diff --git a/FAQ.md b/FAQ.md index a67ab2f0c..3c7965b49 100644 --- a/FAQ.md +++ b/FAQ.md @@ -39,7 +39,7 @@ Beside many small improvements and changes, these are most important changes: - New: LNDmanage (Advanced Channel Management CLI) [details](https://github.com/bitromortac/lndmanage) - New: BTC-RPC-Explorer (Bitcoin Blockchain Explorer) [details](https://github.com/janoside/btc-rpc-explorer) - New: Loop (Submarine Swaps Service) [details](https://github.com/lightninglabs/loop) -- New: LNBits (Lightning wallet/accounts System) [details](https://github.com/arcbtc/lnbits) +- New: LNbits (Lightning wallet/accounts System) [details](https://github.com/arcbtc/lnbits) - New: Fully Noded (iOS) [details](https://apps.apple.com/us/app/fully-noded/id1436425586) - New: TOR Support to connect mobile Apps - New: Migration Export/Import (e.g. HDD -> SSD) [details](README.md#import-a-migration-file) diff --git a/README.md b/README.md index c65288a40..d8b1e753a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **The RaspiBlitz is a do-it-yourself Lightning Node based on LND running together with a Bitcoin-Fullnode on a RaspberryPi 3/4 - with a HDD/SSD and an nice display for easy setup & monitoring.** -RaspiBlitz is mainly targeted for learning how to run your own node decentralized from home - because: Not you Node, Not your Rules. Discover & develop the growing ecosystem of the Lightning Network by becoming a full part of it. Build it as part of a [workshop](WORKSHOP.md) or as a weekend project yourself. +RaspiBlitz is mainly targeted for learning how to run your own node decentralized from home - because: Not your Node, Not your Rules. Discover & develop the growing ecosystem of the Lightning Network by becoming a full part of it. Build it as part of a [workshop](WORKSHOP.md) or as a weekend project yourself. ## Feature Overview @@ -26,7 +26,7 @@ There are further Services that can be switched on: * **ElectRS** (Electrum Server in Rust) [details](https://github.com/romanz/electrs) * **BTCPayServer** (Cryptocurrency Payment Processor) [details](https://btcpayserver.org) * **BTC-RPC-Explorer** (Bitcoin Blockchain Explorer) [details](https://github.com/janoside/btc-rpc-explorer) -* **LNBits** (Lightning wallet/accounts System) [details](https://github.com/arcbtc/lnbits) +* **LNbits** (Lightning wallet/accounts System) [details](https://github.com/arcbtc/lnbits) * **SpecterDesktop** (Multisig Trezor, Ledger, COLDCARDwallet & Specter-DIY) [details](https://twitter.com/CryptoAdvance/status/1233833767283941376?s=20) * **LNDmanage** (Advanced Channel Management CLI) [details](https://github.com/bitromortac/lndmanage) * **Loop** (Submarine Swaps Service) [details](https://github.com/lightninglabs/loop) @@ -70,12 +70,13 @@ The cheapest way is to buy and assemble the single parts yourself. The new shopp *The "Standard Package" is most tested and recommended if you can effort it. It aims to give you the best economic value to run all the RaspiBlitz features at a good performance and even allows you to self-validate your blockchain in under 3 days.* -* RaspBerry Pi 4 2GB + Power: [amazon](https://geni.us/raspiblitz-2gb-power) -* Heatsink-Case RP4: [amazon](https://geni.us/heatsink-raspi4) +* RaspBerry Pi 4 2GB [amazon](https://geni.us/raspiblitz-4-2gb) +* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps) * 500GB SSD: [amazon](https://geni.us/raspiblitz-500gb-ssd) * SSD-Case: [amazon](https://geni.us/raspiblitz-ssd-case) * Micro SD-Card 32GB: [amazon](https://geni.us/raspiblitz-sc-card) * LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen) +* RaspberryPi Heatsink Case: [amazon](https://geni.us/heatsink-raspi4) #### Package: Minimal (around 180 USD) @@ -92,19 +93,21 @@ If you have already a used RaspberryPi 3 B+ you can reuse with the following par * Power >=3A: [amazon](https://geni.us/raspiblitz-3A-power) Or if you order new go with the RaspberryPi 4 2GB and the following parts: -* RaspBerry Pi 4 2GB + Power: [amazon](https://geni.us/raspiblitz-2gb-power) -* Heatsink-Case RP4: [amazon](https://geni.us/heatsink-raspi4) +* RaspBerry Pi 4 2GB [amazon](https://geni.us/raspiblitz-4-2gb) +* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps) +* RaspberryPi Heatsink Case: [amazon](https://geni.us/heatsink-raspi4) #### Package: Maximal *The maximal package is still in the works ... if you want to prepare for it, take the standard package as a base and choose the RaspberryPi4 with 4GB and a high quality 1TB SSD instead of 500GB.* -* RaspBerry Pi 4 4GB: [amazon](https://geni.us/raspiblitz-4-4gb-power) -* Heatsink-Case RP4: [amazon](https://geni.us/heatsink-raspi4) -* LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen) -* Micro SD-Card 32GB: [amazon](https://geni.us/raspiblitz-sc-card) -* 1000GB SSD: [amazon](https://geni.us/raspiblitz-1000gb-san) +* 1TB SSD: [amazon](https://geni.us/raspiblitz-1000gb-san) +* RaspBerry Pi 4 4GB: [amazon](https://geni.us/raspiblitz-4-4gb) +* RaspBerry Power Supply [amazon](https://geni.us/raspiblitz-ps) * SSD-Case: [amazon](https://geni.us/raspiblitz-ssd-case) +* Micro SD-Card 32GB: [amazon](https://geni.us/raspiblitz-sc-card) +* LCD-Display: [amazon](https://geni.us/raspiblitz-touchscreen) +* RaspberryPi Heatsink Case: [amazon](https://geni.us/heatsink-raspi4) *You can even pay your RaspiBlitz Amazon Shopping with Bitcoin & Lightning through [Bitrefill](https://blog.bitrefill.com/its-here-buy-amazon-vouchers-with-bitcoin-on-bitrefill-bb2a4449724a).* @@ -651,7 +654,7 @@ To run it change to the RaspiBlitz terminal and type 'manage'. This starts the L [Details on Service](https://github.com/bitromortac/lndmanage/blob/master/README.md) -##### LNBits +##### LNbits LNbits is a very simple server that sits on top of your Lightning Wallet diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 34c211276..df6237cde 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -48,8 +48,8 @@ fi if [ "${BTCRPCexplorer}" == "on" ]; then OPTIONS+=(EXPLORE "BTC RPC Explorer") fi -if [ "${LNBits}" == "on" ]; then - OPTIONS+=(LNBITS "LNBits Server") +if [ "${LNbits}" == "on" ]; then + OPTIONS+=(LNBITS "LNbits Server") fi if [ "${lndmanage}" == "on" ]; then OPTIONS+=(LNDMANAGE "LND Manage Script") diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index a085c5395..28ed74563 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -21,7 +21,6 @@ if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi if [ ${#BTCPayServer} -eq 0 ]; then BTCPayServer="off"; fi if [ ${#ElectRS} -eq 0 ]; then ElectRS="off"; fi if [ ${#lndmanage} -eq 0 ]; then lndmanage="off"; fi -if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi if [ ${#joinmarket} -eq 0 ]; then joinmarket="off"; fi echo "map dropboxbackup to on/off" @@ -87,7 +86,7 @@ r 'LCD Rotate' ${lcdrotateMenu} \ e 'Electrum Rust Server' ${ElectRS} \ p 'BTCPayServer' ${BTCPayServer} \ m 'lndmanage' ${lndmanage} \ -i 'LNBits' ${LNBits} \ +i 'LNbits' ${LNbits} \ d 'StaticChannelBackup on DropBox' ${DropboxBackup} \ j 'JoinMarket' ${joinmarket} \ 2>&1 >/dev/tty) @@ -110,7 +109,7 @@ r 'LCD Rotate' ${lcdrotateMenu} \ e 'Electrum Rust Server' ${ElectRS} \ p 'BTCPayServer' ${BTCPayServer} \ m 'lndmanage' ${lndmanage} \ -i 'LNBits' ${LNBits} \ +i 'LNbits' ${LNbits} \ d 'StaticChannelBackup on DropBox' ${DropboxBackup} \ j 'JoinMarket' ${joinmarket} \ 2>&1 >/dev/tty) @@ -552,11 +551,11 @@ else echo "lndmanage setting unchanged." fi -# LNBits process choice +# LNbits process choice choice="off"; check=$(echo "${CHOICES}" | grep -c "i") if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${LNBits}" != "${choice}" ]; then - echo "LNBits Setting changed .." +if [ "${LNbits}" != "${choice}" ]; then + echo "LNbits Setting changed .." anychange=1 sudo -u admin /home/admin/config.scripts/bonus.lnbits.sh ${choice} if [ "${choice}" = "on" ]; then diff --git a/home.admin/XXdebugLogs.sh b/home.admin/XXdebugLogs.sh index 304adda24..f12769810 100644 --- a/home.admin/XXdebugLogs.sh +++ b/home.admin/XXdebugLogs.sh @@ -124,13 +124,13 @@ else echo "" fi -if [ "${LNBits}" = "on" ]; then - echo "*** LAST 20 LNBits LOGS ***" +if [ "${LNbits}" = "on" ]; then + echo "*** LAST 20 LNbits LOGS ***" echo "sudo journalctl -u lnbits -b --no-pager -n20" sudo journalctl -u lnbits -b --no-pager -n20 echo "" else - echo "- LNBits is OFF by config" + echo "- LNbits is OFF by config" echo "" fi diff --git a/home.admin/_bootstrap.provision.sh b/home.admin/_bootstrap.provision.sh index 44dd1704b..661780d68 100644 --- a/home.admin/_bootstrap.provision.sh +++ b/home.admin/_bootstrap.provision.sh @@ -350,13 +350,13 @@ else echo "Provisioning UPS - not active" >> ${logFile} fi -# LNBits -if [ "${LNBits}" = "on" ]; then - echo "Provisioning LNBits - run config script" >> ${logFile} - sudo sed -i "s/^message=.*/message='Setup LNBits '/g" ${infoFile} +# LNbits +if [ "${LNbits}" = "on" ]; then + echo "Provisioning LNbits - run config script" >> ${logFile} + sudo sed -i "s/^message=.*/message='Setup LNbits '/g" ${infoFile} sudo -u admin /home/admin/config.scripts/bonus.lnbits.sh on >> ${logFile} 2>&1 else - echo "Provisioning LNBits - keep default" >> ${logFile} + echo "Provisioning LNbits - keep default" >> ${logFile} fi # JoinMarket diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index 1be0f63fc..b607eb9d8 100644 --- a/home.admin/config.scripts/bonus.lnbits.sh +++ b/home.admin/config.scripts/bonus.lnbits.sh @@ -4,9 +4,9 @@ # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "small config script to switch LNBits on or off" - echo "bonus.lnbits.sh [on|off|status|menu|write-macaroons]" - exit 1 + echo "small config script to switch LNbits on or off" + echo "bonus.lnbits.sh [on|off|status|menu|write-macaroons]" + exit 1 fi source /mnt/hdd/raspiblitz.conf @@ -26,7 +26,7 @@ if [ "$1" = "menu" ]; then # TOR /home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}" - whiptail --title " LNBits " --msgbox "Open the following URL in your local web browser: + whiptail --title " LNbits " --msgbox "Open the following URL in your local web browser: http://${localip}:5000\n Hidden Service address for TOR Browser (QR see LCD): ${toraddress} @@ -35,7 +35,7 @@ ${toraddress} else # IP + Domain - whiptail --title " LNBits " --msgbox "Open the following URL in your local web browser: + whiptail --title " LNbits " --msgbox "Open the following URL in your local web browser: http://${localip}:5000\n Activate TOR to access from outside your local network. " 12 54 @@ -46,14 +46,14 @@ Activate TOR to access from outside your local network. fi # add default value to raspi config if needed -if ! grep -Eq "^LNBits=" /mnt/hdd/raspiblitz.conf; then - echo "LNBits=off" >> /mnt/hdd/raspiblitz.conf +if ! grep -Eq "^LNbits=" /mnt/hdd/raspiblitz.conf; then + echo "LNbits=off" >> /mnt/hdd/raspiblitz.conf fi # status if [ "$1" = "status" ]; then - if [ "${LNBits}" = "on" ]; then + if [ "${LNbits}" = "on" ]; then echo "installed=1" # check for error @@ -71,7 +71,7 @@ fi # status if [ "$1" = "write-macaroons" ]; then - + # make sure its run as user admin adminUserId=$(id -u admin) if [ "${EUID}" != "${adminUserId}" ]; then @@ -83,7 +83,7 @@ if [ "$1" = "write-macaroons" ]; then macaroonAdminHex=$(sudo xxd -ps -u -c 1000 /mnt/hdd/lnd/data/chain/${network}/${chain}net/admin.macaroon) macaroonInvoiceHex=$(sudo xxd -ps -u -c 1000 /mnt/hdd/lnd/data/chain/${network}/${chain}net/invoice.macaroon) macaroonReadHex=$(sudo xxd -ps -u -c 1000 /mnt/hdd/lnd/data/chain/${network}/${chain}net/readonly.macaroon) - sudo sed -i "s/^LND_API_ENDPOINT=.*/LND_API_ENDPOINT=https:\/\/127.0.0.1:8080/g" /home/admin/lnbits/.env + sudo sed -i "s/^LND_CERT=.*/LND_CERT=_____TO-DO_____/g" /home/admin/lnbits/.env sudo sed -i "s/^LND_ADMIN_MACAROON=.*/LND_ADMIN_MACAROON=${macaroonAdminHex}/g" /home/admin/lnbits/.env sudo sed -i "s/^LND_INVOICE_MACAROON=.*/LND_INVOICE_MACAROON=${macaroonInvoiceHex}/g" /home/admin/lnbits/.env sudo sed -i "s/^LND_READ_MACAROON=.*/LND_READ_MACAROON=${macaroonReadHex}/g" /home/admin/lnbits/.env @@ -97,7 +97,7 @@ sudo systemctl stop lnbits 2>/dev/null # switch on if [ "$1" = "1" ] || [ "$1" = "on" ]; then - echo "*** INSTALL LNBits ***" + echo "*** INSTALL LNbits ***" isInstalled=$(sudo ls /etc/systemd/system/lnbits.service 2>/dev/null | grep -c 'lnbits.service') if [ ${isInstalled} -eq 0 ]; then @@ -106,40 +106,33 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "# installing needed packages" sudo apt-get install -y pipenv 2>/dev/null - # prepare .env file + # install from GitHub echo "# get the github code" sudo rm -r /home/admin/lnbits 2>/dev/null cd /home/admin sudo -u admin git clone https://github.com/arcbtc/lnbits.git - #sudo -u admin git reset --hard e3fd6b4ff1f19b750b852a0bb0814cd259db948c - - # write macarroons to .env file + cd /home/admin/lnbits + sudo -u admin git checkout tags/0.1.0 + + # prepare .env file echo "# preparing env file" - sudo rm /home/admin/lnbits/.env 2>/dev/null - sudo -u admin mv /home/admin/lnbits/.env.example /home/admin/lnbits/.env + sudo rm /home/admin/lnbits/.env 2>/dev/null + echo "FLASK_APP=lnbits" >> /home/admin/lnbits/.env + echo "FLASK_ENV=production" >> /home/admin/lnbits/.env + echo "LNBITS_BACKEND_WALLET_CLASS=LndWallet" >> /home/admin/lnbits/.env + echo "LND_GRPC_ENDPOINT=127.0.0.1" >> /home/admin/lnbits/.env + echo "LND_GRPC_PORT=10009" >> /home/admin/lnbits/.env sudo -u admin /home/admin/config.scripts/bonus.lnbits.sh write-macaroons # set database path to HDD data so that its survives updates and migrations sudo mkdir /mnt/hdd/app-data/LNBits 2>/dev/null sudo chown admin:admin -R /mnt/hdd/app-data/LNBits echo "LNBITS_DATA_FOLDER=/mnt/hdd/app-data/LNBits" >> /home/admin/lnbits/.env - - # make sure in settings file LND is set as funding source - cat > /home/admin/lnbits/lnbits/settings.py <