Merge pull request #1132 from eillarra/lnbits

lnbits: update branding and installation script
This commit is contained in:
Christian Rotzoll
2020-04-23 11:16:14 +02:00
committed by GitHub
8 changed files with 66 additions and 71 deletions

2
FAQ.md
View File

@@ -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)

View File

@@ -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

View File

@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 <<EOF
import os
from .wallets import LndWallet
WALLET = LndWallet(endpoint=os.getenv("LND_API_ENDPOINT"),admin_macaroon=os.getenv("LND_ADMIN_MACAROON"),invoice_macaroon=os.getenv("LND_INVOICE_MACAROON"),read_macaroon=os.getenv("LND_READ_MACAROON"))
LNBITS_PATH = os.path.dirname(os.path.realpath(__file__))
LNBITS_DATA_FOLDER = os.getenv("LNBITS_DATA_FOLDER", os.path.join(LNBITS_PATH, "data"))
DEFAULT_USER_WALLET_NAME = os.getenv("DEFAULT_USER_WALLET_NAME", "Bitcoin LN Wallet")
FEE_RESERVE = float(os.getenv("FEE_RESERVE", 0))
EOF
# to the install
cd /home/admin/lnbits
sudo -u admin pipenv install --dev
sudo -u admin pipenv install
sudo -u admin /usr/bin/pipenv run pip install python-dotenv
sudo -u admin /usr/bin/pipenv run pip install gunicorn
# open firewall
echo
@@ -172,17 +165,17 @@ StandardError=journal
WantedBy=multi-user.target
EOF
sudo mv /home/admin/lnbits.service /etc/systemd/system/lnbits.service
sudo mv /home/admin/lnbits.service /etc/systemd/system/lnbits.service
sudo systemctl enable lnbits
echo "# OK - service needs starting: sudo systemctl start lnbits"
else
echo "LNBits already installed."
else
echo "LNbits already installed."
fi
# setting value in raspi blitz config
sudo sed -i "s/^LNBits=.*/LNBits=on/g" /mnt/hdd/raspiblitz.conf
sudo sed -i "s/^LNbits=.*/LNbits=on/g" /mnt/hdd/raspiblitz.conf
# Hidden Service if Tor is active
source /mnt/hdd/raspiblitz.conf
if [ "${runBehindTor}" = "on" ]; then
@@ -195,18 +188,18 @@ fi
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# setting value in raspi blitz config
sudo sed -i "s/^LNBits=.*/LNBits=off/g" /mnt/hdd/raspiblitz.conf
sudo sed -i "s/^LNbits=.*/LNbits=off/g" /mnt/hdd/raspiblitz.conf
isInstalled=$(sudo ls /etc/systemd/system/lnbits.service 2>/dev/null | grep -c 'lnbits.service')
if [ ${isInstalled} -eq 1 ] || [ "${LNBits}" == "on" ]; then
echo "*** REMOVING LNBits ***"
if [ ${isInstalled} -eq 1 ] || [ "${LNbits}" == "on" ]; then
echo "*** REMOVING LNbits ***"
sudo systemctl stop lnbits
sudo systemctl disable lnbits
sudo rm /etc/systemd/system/lnbits.service
sudo rm -r /home/admin/lnbits
echo "OK LNBits removed."
else
echo "LNBits is not installed."
echo "OK LNbits removed."
else
echo "LNbits is not installed."
fi
exit 0
fi

View File

@@ -373,7 +373,7 @@ EOF
if [ "${ElectRS}" = "on" ]; then
/home/admin/config.scripts/internet.hiddenservice.sh electrs 50002 50002 50001 50001
fi
if [ "${LNBits}" = "on" ]; then
if [ "${LNbits}" = "on" ]; then
/home/admin/config.scripts/internet.hiddenservice.sh lnbits 80 5000
fi