diff --git a/.env.example b/.env.example index 6a3710c2..a367bec6 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,9 @@ +#For more information on .env files, their content and format: https://pypi.org/project/python-dotenv/ + HOST=127.0.0.1 PORT=5000 -# uvicorn variable, allow https behind a proxy +# uvicorn variable, uncomment to allow https behind a proxy # FORWARDED_ALLOW_IPS="*" DEBUG=false @@ -54,8 +56,9 @@ LNBITS_SITE_DESCRIPTION="Some description about your service, will display if ti LNBITS_THEME_OPTIONS="classic, bitcoin, flamingo, freedom, mint, autumn, monochrome, salvador" # LNBITS_CUSTOM_LOGO="https://lnbits.com/assets/images/logo/logo.svg" -# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, ClicheWallet, LnTipsWallet -# LndRestWallet, CoreLightningWallet, LNbitsWallet, SparkWallet, FakeWallet, EclairWallet +# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, ClicheWallet, +# LndWallet, LndRestWallet, CoreLightningWallet, EclairWallet, +# LnTipsWallet, LNbitsWallet, SparkWallet, FakeWallet, LNBITS_BACKEND_WALLET_CLASS=VoidWallet # VoidWallet is just a fallback that works without any actual Lightning capabilities, # just so you can see the UI before dealing with this file. @@ -76,6 +79,14 @@ CORELIGHTNING_RPC="/home/bob/.lightning/bitcoin/lightning-rpc" LNBITS_ENDPOINT=https://legend.lnbits.com LNBITS_KEY=LNBITS_ADMIN_KEY +# LndWallet +LND_GRPC_ENDPOINT=127.0.0.1 +LND_GRPC_PORT=10009 +LND_GRPC_CERT="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/tls.cert" +LND_GRPC_MACAROON="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/admin.macaroon or HEXSTRING" +# To use an AES-encrypted macaroon, set +# LND_GRPC_MACAROON="eNcRyPtEdMaCaRoOn" + # LndRestWallet LND_REST_ENDPOINT=https://127.0.0.1:8080/ LND_REST_CERT="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/tls.cert" diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index b6966bfa..18445899 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -24,7 +24,9 @@ jobs: with: poetry-version: ${{ matrix.poetry-version }} - name: Install packages - run: poetry install + run: | + poetry config virtualenvs.create false + poetry install - name: Check black run: make checkblack - name: Check isort diff --git a/.github/workflows/migrations.yml b/.github/workflows/migrations.yml index 11429665..6725d845 100644 --- a/.github/workflows/migrations.yml +++ b/.github/workflows/migrations.yml @@ -36,6 +36,7 @@ jobs: poetry-version: ${{ matrix.poetry-version }} - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install sudo apt install unzip - name: Run migrations diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 6868455e..4c47fafc 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -21,6 +21,7 @@ jobs: poetry-version: ${{ matrix.poetry-version }} - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install - name: Run tests run: poetry run mypy diff --git a/.github/workflows/regtest.yml b/.github/workflows/regtest.yml index 99687032..ecba4090 100644 --- a/.github/workflows/regtest.yml +++ b/.github/workflows/regtest.yml @@ -29,6 +29,7 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install - name: Run tests env: @@ -72,6 +73,7 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install - name: Run tests env: @@ -116,6 +118,7 @@ jobs: sudo chmod -R a+rwx . - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install - name: Run tests env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7409b03e..dbbddf98 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: poetry-version: ${{ matrix.poetry-version }} - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install - name: Run tests run: make test @@ -80,6 +81,7 @@ jobs: poetry-version: ${{ matrix.poetry-version }} - name: Install dependencies run: | + poetry config virtualenvs.create false poetry install - name: Run tests env: diff --git a/.prettierrc b/.prettierrc index 224c6ee0..725c3980 100644 --- a/.prettierrc +++ b/.prettierrc @@ -7,6 +7,6 @@ "singleQuote": true, "trailingComma": "none", "useTabs": false, - "jsxBracketSameLine": false, + "bracketSameLine": false, "bracketSpacing": false } diff --git a/Makefile b/Makefile index ebf2a872..22d79f11 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ check: mypy checkprettier checkisort checkblack prettier: $(shell find lnbits -name "*.js" -o -name ".html") ./node_modules/.bin/prettier --write lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js lnbits/extensions/*/static/components/*/*.js lnbits/extensions/*/static/components/*/*.html +pyright: + ./node_modules/.bin/pyright + black: poetry run black . diff --git a/docs/guide/faq.md b/docs/guide/faq.md new file mode 100644 index 00000000..1ccf3e28 --- /dev/null +++ b/docs/guide/faq.md @@ -0,0 +1,268 @@ +--- +layout: default +title: FAQ +nav_order: 5 +--- + + +# FAQ - Frequently Asked Questions + +## Install options +
LNbits is not a node management software but a ⚡️LN only accounting system on top of a funding source.
+ +If you want to send sats from the same node that is the funding source of your LNbits, you will need to edit the lnd.conf file. The parameters to be included are:
+ +``` +allow-circular-route=1 +allow-self-payment=1 +``` + +If you want your setup to stay behind tor then only apps, pos and wallets that have tor activated can communicate with your wallets. Most likely you will have trouble when people try to redeem your voucher through onion or when importing your lnbits wallets into a wallet-app that doesnt support tor. If you plan to let LNbits wallets interact with plain internet shops and services you should consider setting up hybrid mode for your node.
+This means that you might not have access to some files which would allow certain administrative functions. E.g. on Voltage lnd.conf can not be edited. Payments from your node to LNbits wallets can therefore not be configurated in this case atm so you will need to take an extra wallet to send from funding source->wallet x->LNbits wallet (only) for the initial funding of the wallet.
+Step by step guide how to convert your Tor only node into a clearnet node to make apps like LNbits accessible via https.
+There are several ways to run a LNbits instance funded from different sources. It is importan to choose a source that has a good liquidity and good peers connected. If you use LNbits for public services your users´ payments can then flow happily in both directions. If you would like to fund your LNbits wallet via btc please see section Troubleshooting.
+The LNbits manual shows you which sources can be used and how to configure each: CLN, LND, LNPay, Cliche, OpenNode as well as bots.
+When you run your LNbits in clearnet basically everyone can generate a wallet on it. Since the funds of your node are bound to these wallets you might want to prevent that. There are two ways to do so:
+Please note that all entries in the .env file will not be the taken into account once you activated the admin extension.
+Bad news, this is a routing error that might have quite a lot of reasons. Let´s try a few of the most possible problems and their solutions. First choose your setup
+Always save a copy of your wallet-URL, Export2phone-QR or LNDhub for your own wallets in a safe place. LNbits CANNOT help you to recover them when lost.
+Always save a copy of your wallet-URL, Export2phone-QR or LNDhub for your own wallets in a safe place. + You can find all LNbits users and wallet-IDs in your LNbits user manager extension or in your sqlite database. + To edit or read the LNbits database, go to the LNbits /data folder and look for the file called sqlite.db. + You can open and edit it with excel or with a dedicated SQL-Editor like SQLite browser.
+When you create a LNURL-p, by default the comment box is not filled. That means comments are not allowed to be attached to payments.
+
In order to allow comments, add the characters lenght of the box, from 1 to 250. Once you put a number there, + the comment box will be displayed in the payment process. You can also edit a LNURL-p already created and add that number.
+ + + +There are multiple ways to exchange sats from onchain btc to LN btc (resp. to LNbits).
+If the user do not have full acceess of your LNbits, is just an external user, can use swap services like Boltz, FixedFloat, DiamondHands or ZigZag.
+This is useful if you provide only LNURL/LN invoices from your LNbits instance, but a payer only has onchain sats so + they will have to the swap those sats first on their side.
+The procedure is simple: user sends onchain btc to the swap service and provides the LNURL / LN invoice from LNbits as destination of the swap.
+Keep in mind that this is a separate wallet, not the LN btc one that is represented by LNbits as "your wallet" upon your LN funding source. + This onchain wallet can be used also to swap LN btc to (e.g. your hardwarewallet) by using the LNbits Boltz or Deezy extension. + If you run a webshop that is linked to your LNbits for LN payments, it is very handy to regularily drain all the sats from LN into onchain. + This leads to more space in your LN channels to be able to receive new fresh sats.
+Procedure:
+When you receive a payment in LNbits, the transaction log will display only a resumed type of the transaction. + + + +
In your transaction overview you will find a little green arrow for received and a red arrow for sended funds.
+
If you click on those arrows, a details popup shows attached messages as well as the sender´s name if given.
+In LNbits this is currently not possible to do - but to receive. This is only possible if the sender's LN wallet supports LUD-18 (nameDesc) like e.g. Open Bitcion Wallet - OBW does. You will then see an alias/pseudonym in the details section of your LNbits transactions (click the arrows). Note that you can give any name there and it might not be related to the real sender´s name(!) if your receive such.
+ + +Open your LNbits with the account / wallet you want to use, go to "manage extensions" and activate the LNDHUB extension.
+Then open the LNDHUB extension, choose the wallet you want to use and scan the QR code you want to use: "admin" or "invoice only", depending on the security level you want for that wallet.
+You can use Zeus or Bluewallet as wallet apps for a lndhub account.
+Keep in mind: if your LNbits instance is Tor only, you must use also theose apps behind Tor and open the LNbits page through your Tor .onion address.
+LNbits has all sorts of open APIs and tools to program and connect to a lot of different devices for a gazillion of use-cases. Let us know what you did with it ! Come to the Makerbits Telegram Group if you are interested in building or if you need help with a project - we got you!
+ +This is a do-it-yourself project consisting of a mini-computer (Raspberry Pi Zero), a coin acceptor, a display, a 3D printed case, and a Bitcoin Lightning wallet as a funding source. It exchanges fiat coins for valuable Bitcoin Lightning ⚡ Satoshis. The user can pick up the Satoshis via QR code (LNURL-withdraw) on a mobile phone wallet. It works based on BTCPayer server, LNTXBOT is not longer an option. You can get the components as individual parts and build the case yourself e.g. from Fulmo who also made a guide on it. The shop offers payments in Bitcoin and Lightning ⚡. The code can be found on the ATM github project page>.
+The LNpos is a self-sufficient point of sale terminal which allows offline onchain payments and an offline Lightning ATM for withdrawals. Free and open source software, free from intermediaries, with integrated battery, WLAN, DIY. You can get the 3D print as well as the whole kit from the LNbits shop from 👇 Ressources. It allows +
+
+
The hardwarewallet is a very cheap solution for builders. The projects´ code and installation instructions for the LNbits hardware wallet can be found on github
+
+
+
Candy dispenser, vending machines (online), grabbing machines, jukeboxes, bandits and all sorts of other things have already been build with LNbits´ tools. Further info see 👇 Ressources.
+
+
+
This code works similar to the LNpos. Note that the setup-video for the vending machine misses the new way of installing it via the new LNURLdevices extension. The vending machine project code resides on github.
+
+
+
LNbits is a powerful solution for merchants, due to the easy setup with various extensions, that can be used for many scenarios.
+Here is an overview of the LNbits tools available for a small restaurant as well as a hotel
+LNbits has two swap extensions integrated: Boltz and Deezy.
+For a merchant that uses LNbits to receive BTC payments through LN, this is very handy to move the received sats from LN channels into onchain wallets. It not only helps you HODLing but is also freeing up "space in your channels" so you are ready to receive more sats.
+Boltz has an option to setup an automated swap triggered by a certain amount received.
+Printed voucher links or tippingcards
+To generate voucher you will need LNbits to be available in clearnet. Please consider running your own LNbits instance for this.
+LNURLw are strings that represent a faucet-link to a wallet. By scanning it, everyone will be able to withdraw sats from it. A LNURLw can be either a QR that leads to a static link or to one that responds with new invoices every time it is scanned (click "no assmilking"). You can create these QR by adding the LNURLw extension and generate the vouchertype you need.
+Creating a NFC card for a wallet
+To generate links for your cards you will need LNbits to be available in clearnet. Please consider running your own LNbits instance for this.
++
NON CUSTODIAL atomic swap service
+
+ Link:
+ https://boltz.exchange
+
+
+ README:
+ read more
+
+ Extension created by, + dni +
+
- Submarine and Reverse Submarine Swaps on LNbits via boltz.exchange
- API
-
- Link : - https://boltz.exchange - -
-- More details -
-- Created by, - dni + onchain_amount_received = amount - (amount * boltz_fee / 100) - + lockup_fee - claim_fee
+98.000 = 100.000 - 500 - 500 - 1000
GET
- /boltz/api/v1/swap/reverse
- JSON list of reverse submarine swaps
- curl -X GET {{ root_url }}/boltz/api/v1/swap/reverse -H "X-Api-Key:
- {{ user.wallets[0].adminkey }}"
-
- POST
- /boltz/api/v1/swap/reverse
- {"wallet": <string>, "onchain_address": <string>,
- "amount": <integer>, "instant_settlement":
- <boolean>}
- JSON create a reverse-submarine swaps
- curl -X POST {{ root_url }}/boltz/api/v1/swap/reverse -H "X-Api-Key:
- {{ user.wallets[0].adminkey }}"
-
- + onchain_payment + lockup_fee = amount + (amount * boltz_fee / 100) + + claim_fee + lockup_fee +
+101.000 + lockup_fee = 100.000 + 500 + 500 + lockup_fee
+GET /boltz/api/v1/swap
- JSON list of submarine swaps
- curl -X GET {{ root_url }}/boltz/api/v1/swap -H "X-Api-Key: {{
- user.wallets[0].adminkey }}"
-
- POST /boltz/api/v1/swap
- {"wallet": <string>, "refund_address": <string>,
- "amount": <integer>}
- JSON create a submarine swaps
- curl -X POST {{ root_url }}/boltz/api/v1/swap -H "X-Api-Key: {{
- user.wallets[0].adminkey }}"
-
- POST
- /boltz/api/v1/swap/refund/{swap_id}
- JSON submarine swap
- curl -X GET {{ root_url }}/boltz/api/v1/swap/refund/{swap_id} -H
- "X-Api-Key: {{ user.wallets[0].adminkey }}"
-
- POST
- /boltz/api/v1/swap/status/{swap_id}
- swap status
- curl -X GET {{ root_url }}/boltz/api/v1/swap/status/{swap_id} -H
- "X-Api-Key: {{ user.wallets[0].adminkey }}"
-
- GET
- /boltz/api/v1/swap/check
- JSON pending swaps
- curl -X GET {{ root_url }}/boltz/api/v1/swap/check -H "X-Api-Key: {{
- user.wallets[0].adminkey }}"
-
- GET
- /boltz/api/v1/swap/boltz
- JSON boltz config
- curl -X GET {{ root_url }}/boltz/api/v1/swap/boltz -H "X-Api-Key: {{
- user.wallets[0].inkey }}"
-
- GET
- /boltz/api/v1/swap/mempool
- mempool url
- curl -X GET {{ root_url }}/boltz/api/v1/swap/mempool -H "X-Api-Key:
- {{ user.wallets[0].inkey }}"
-
-
This service is in BETA
- We hold no responsibility for people losing access to funds. Use at
- your own risk!
+ Cashu is still experimental and in active development. There are
+ likely bugs in this implementation so please use this with caution. We
+ hold no responsibility for people losing access to funds. Use at your
+ own risk!