#1993 Adding Lightning Terminal Menu integration (#2077)

This commit is contained in:
/rootzoll
2021-03-18 22:46:58 +01:00
committed by GitHub
parent a725aa1524
commit b5b958ebf2
8 changed files with 65 additions and 61 deletions

View File

@@ -2,7 +2,9 @@
## Whats new in Version 1.7.0 of RaspiBlitz? ## Whats new in Version 1.7.0 of RaspiBlitz?
- Update: Raspberry Pi OS Base Image 64-bit (August 2020) - New: Raspberry Pi OS Base Image 64-bit (August 2020)
- New: Build SD card Image with parameters & FatPack [details](https://github.com/rootzoll/raspiblitz/pull/2044)
- New: Lightning Terminal 0.4.1-alpha (Loop, Pool & Faraday UI Bundle) [details](https://github.com/lightninglabs/lightning-terminal#lightning-terminal-lit)
- Update: bitcoin-core version 0.21.0-beta [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md) - Update: bitcoin-core version 0.21.0-beta [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md)
- Update: LND version 0.12.1-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.12.1-beta) - Update: LND version 0.12.1-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.12.1-beta)
- Update: RTL 0.10.1 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.10.1) - Update: RTL 0.10.1 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.10.1)
@@ -14,7 +16,7 @@
- Update: Faraday 0.2.3-alpha [details](https://github.com/lightninglabs/faraday/releases/tag/v0.2.3-alpha) - Update: Faraday 0.2.3-alpha [details](https://github.com/lightninglabs/faraday/releases/tag/v0.2.3-alpha)
- Update: JoinMarket 0.8.2 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.8.2) - Update: JoinMarket 0.8.2 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.8.2)
- Update: JoininBox 0.3.2 [details](https://github.com/openoms/joininbox/releases/tag/v0.3.2) - Update: JoininBox 0.3.2 [details](https://github.com/openoms/joininbox/releases/tag/v0.3.2)
- New: Build SD card Image with parameters & FatPack [details](https://github.com/rootzoll/raspiblitz/pull/2044) - Update: mempool v2.1.2 [detail](https://github.com/mempool/mempool/releases/tag/v2.1.2)
## Whats new in Version 1.6.3 of RaspiBlitz? ## Whats new in Version 1.6.3 of RaspiBlitz?

View File

@@ -68,6 +68,9 @@ fi
if [ "${BTCPayServer}" == "on" ]; then if [ "${BTCPayServer}" == "on" ]; then
OPTIONS+=(BTCPAY "BTCPay Server Info") OPTIONS+=(BTCPAY "BTCPay Server Info")
fi fi
if [ "${lit}" == "on" ]; then
OPTIONS+=(LIT "LIT (loop, pool, faraday)")
fi
if [ "${ElectRS}" == "on" ]; then if [ "${ElectRS}" == "on" ]; then
OPTIONS+=(ELECTRS "Electrum Rust Server") OPTIONS+=(ELECTRS "Electrum Rust Server")
fi fi
@@ -216,6 +219,9 @@ case $CHOICE in
ELECTRS) ELECTRS)
/home/admin/config.scripts/bonus.electrs.sh menu /home/admin/config.scripts/bonus.electrs.sh menu
;; ;;
LIT)
/home/admin/config.scripts/bonus.lit.sh menu
;;
LNBITS) LNBITS)
/home/admin/config.scripts/bonus.lnbits.sh menu /home/admin/config.scripts/bonus.lnbits.sh menu
;; ;;

View File

@@ -6,7 +6,6 @@ source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
echo "services default values" echo "services default values"
if [ ${#loop} -eq 0 ]; then loop="off"; fi
if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi
if [ ${#BTCRPCexplorer} -eq 0 ]; then BTCRPCexplorer="off"; fi if [ ${#BTCRPCexplorer} -eq 0 ]; then BTCRPCexplorer="off"; fi
if [ ${#specter} -eq 0 ]; then specter="off"; fi if [ ${#specter} -eq 0 ]; then specter="off"; fi
@@ -16,12 +15,11 @@ if [ ${#lndmanage} -eq 0 ]; then lndmanage="off"; fi
if [ ${#joinmarket} -eq 0 ]; then joinmarket="off"; fi if [ ${#joinmarket} -eq 0 ]; then joinmarket="off"; fi
if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi
if [ ${#mempoolExplorer} -eq 0 ]; then mempoolExplorer="off"; fi if [ ${#mempoolExplorer} -eq 0 ]; then mempoolExplorer="off"; fi
if [ ${#faraday} -eq 0 ]; then faraday="off"; fi
if [ ${#bos} -eq 0 ]; then bos="off"; fi if [ ${#bos} -eq 0 ]; then bos="off"; fi
if [ ${#pyblock} -eq 0 ]; then pyblock="off"; fi if [ ${#pyblock} -eq 0 ]; then pyblock="off"; fi
if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi
if [ ${#pool} -eq 0 ]; then pool="off"; fi
if [ ${#sphinxrelay} -eq 0 ]; then sphinxrelay="off"; fi if [ ${#sphinxrelay} -eq 0 ]; then sphinxrelay="off"; fi
if [ ${#lit} -eq 0 ]; then lit="off"; fi
# show select dialog # show select dialog
echo "run dialog ..." echo "run dialog ..."
@@ -30,16 +28,14 @@ OPTIONS=()
OPTIONS+=(e 'Electrum Rust Server' ${ElectRS}) OPTIONS+=(e 'Electrum Rust Server' ${ElectRS})
OPTIONS+=(r 'RTL Webinterface' ${rtlWebinterface}) OPTIONS+=(r 'RTL Webinterface' ${rtlWebinterface})
OPTIONS+=(t 'ThunderHub' ${thunderhub}) OPTIONS+=(t 'ThunderHub' ${thunderhub})
OPTIONS+=(l 'LIT (loop, pool, faraday)' ${lit})
OPTIONS+=(p 'BTCPayServer' ${BTCPayServer}) OPTIONS+=(p 'BTCPayServer' ${BTCPayServer})
OPTIONS+=(i 'LNbits' ${LNBits}) OPTIONS+=(i 'LNbits' ${LNBits})
OPTIONS+=(b 'BTC-RPC-Explorer' ${BTCRPCexplorer}) OPTIONS+=(b 'BTC-RPC-Explorer' ${BTCRPCexplorer})
OPTIONS+=(s 'Cryptoadvance Specter' ${specter}) OPTIONS+=(s 'Cryptoadvance Specter' ${specter})
OPTIONS+=(a 'Mempool Space' ${mempoolExplorer}) OPTIONS+=(a 'Mempool Space' ${mempoolExplorer})
OPTIONS+=(j 'JoinMarket' ${joinmarket}) OPTIONS+=(j 'JoinMarket' ${joinmarket})
OPTIONS+=(l 'Lightning Loop' ${loop})
OPTIONS+=(o 'Balance of Satoshis' ${bos}) OPTIONS+=(o 'Balance of Satoshis' ${bos})
OPTIONS+=(f 'Faraday' ${faraday})
OPTIONS+=(c 'Lightning Pool' ${pool})
OPTIONS+=(y 'PyBLOCK' ${pyblock}) OPTIONS+=(y 'PyBLOCK' ${pyblock})
OPTIONS+=(m 'lndmanage' ${lndmanage}) OPTIONS+=(m 'lndmanage' ${lndmanage})
OPTIONS+=(x 'Sphinx-Relay' ${sphinxrelay}) OPTIONS+=(x 'Sphinx-Relay' ${sphinxrelay})
@@ -63,32 +59,6 @@ fi
needsReboot=0 needsReboot=0
anychange=0 anychange=0
# LOOP process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "l")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${loop}" != "${choice}" ]; then
echo "Loop Setting changed .."
anychange=1
needsReboot=1 # always reboot so that RTL gets restarted to show/hide support loop
/home/admin/config.scripts/bonus.loop.sh ${choice}
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
# check macaroons and fix missing
/home/admin/config.scripts/lnd.credential.sh check
sudo systemctl start loopd
/home/admin/config.scripts/bonus.loop.sh menu
else
l1="FAILED to install Lightning LOOP"
l2="Try manual install in the terminal with:"
l3="/home/admin/config.scripts/bonus.loop.sh on"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "Loop Setting unchanged."
fi
# RTL process choice # RTL process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "r") choice="off"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
@@ -266,23 +236,6 @@ else
echo "lndmanage setting unchanged." echo "lndmanage setting unchanged."
fi fi
# FARADAY process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "f")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${faraday}" != "${choice}" ]; then
echo "faraday Setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/bonus.faraday.sh ${choice}
source /mnt/hdd/raspiblitz.conf
if [ "${faraday}" = "on" ]; then
#sudo -u admin /home/admin/config.scripts/bonus.faraday.sh menu
needsReboot=1
fi
else
echo "faraday setting unchanged."
fi
# Balance of Satoshis process choice # Balance of Satoshis process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "o") choice="off"; check=$(echo "${CHOICES}" | grep -c "o")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
@@ -353,19 +306,19 @@ else
echo "LNbits setting unchanged." echo "LNbits setting unchanged."
fi fi
# Lightning Pool # LIT (Lightning Terminal)
choice="off"; check=$(echo "${CHOICES}" | grep -c "c") choice="off"; check=$(echo "${CHOICES}" | grep -c "l")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${pool}" != "${choice}" ]; then if [ "${lit}" != "${choice}" ]; then
echo "Pool Setting changed .." echo "LIT Setting changed .."
anychange=1 anychange=1
sudo -u admin /home/admin/config.scripts/bonus.pool.sh ${choice} sudo -u admin /home/admin/config.scripts/bonus.lit.sh ${choice}
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
sudo systemctl start poold sudo systemctl start lnbits
sudo -u admin /home/admin/config.scripts/bonus.pool.sh menu sudo -u admin /home/admin/config.scripts/bonus.lit.sh menu
fi fi
else else
echo "Pool setting unchanged." echo "LIT setting unchanged."
fi fi
# Sphinx Relay # Sphinx Relay

View File

@@ -195,6 +195,22 @@ function faraday() {
fi fi
} }
# command: lit
# switch to the lit user for the loop, pool & faraday services
function lit() {
if [ $(grep -c "lit=on" < /mnt/hdd/raspiblitz.conf) -eq 1 ]; then
echo "# switching to the lit user with the command: 'sudo su - lit'"
echo "# use command 'exit' and then 'raspiblitz' to return to menu"
echo "# use the commands: 'lncli', 'loop', 'pool' and 'frcli'"
sudo su - lit
echo "# use command 'raspiblitz' to return to menu"
else
echo "LIT is not installed - to install run:"
echo "/home/admin/config.scripts/bonus.lit.sh on"
fi
}
# command: loop # command: loop
# switch to the loop user for the Lightning Loop Service # switch to the loop user for the Lightning Loop Service
function loop() { function loop() {

View File

@@ -1,9 +1,14 @@
#!/bin/bash #!/bin/bash
# !! NOTICE: Faraday is now prt of the 'bonus.lit.sh' bundle
# this single install script will still be available for now
# but main focus for the future development should be on LIT
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "Bonus App: faraday -> https://github.com/lightninglabs/faraday" echo "Bonus App: faraday -> https://github.com/lightninglabs/faraday"
echo "lnd.faraday.sh [status|on|off]" echo "lnd.faraday.sh [status|on|off]"
echo "!! DEPRECATED use instead: bonus.lit.sh"
exit 1 exit 1
fi fi

View File

@@ -70,6 +70,20 @@ sudo systemctl stop litd 2>/dev/null
# switch on # switch on
if [ "$1" = "1" ] || [ "$1" = "on" ]; then if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "# INSTALL LIGHTNING TERMINAL" echo "# INSTALL LIGHTNING TERMINAL"
# switching off single installs of pool, loop or faraday if installed
if [ "${loop}" = "on" ]; then
echo "# Replacing single install of: LOOP"
/home/admin/config.scripts/bonus.loop.sh off
fi
if [ "${pool}" = "on" ]; then
echo "# Replacing single install of: POOL"
/home/admin/config.scripts/bonus.pool.sh off
fi
if [ "${faraday}" = "on" ]; then
echo "# Replacing single install of: FARADAY"
/home/admin/config.scripts/bonus.faraday.sh off
fi
isInstalled=$(sudo ls /etc/systemd/system/litd.service 2>/dev/null | grep -c 'litd.service') isInstalled=$(sudo ls /etc/systemd/system/litd.service 2>/dev/null | grep -c 'litd.service')
if [ ${isInstalled} -eq 0 ]; then if [ ${isInstalled} -eq 0 ]; then

View File

@@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
# !! NOTICE: Faraday is now prt of the 'bonus.lit.sh' bundle
# this single install script will still be available for now
# but main focus for the future development should be on LIT
# https://github.com/lightninglabs/loop/releases- # https://github.com/lightninglabs/loop/releases-
pinnedVersion="v0.11.2-beta" pinnedVersion="v0.11.2-beta"
@@ -7,7 +11,7 @@ pinnedVersion="v0.11.2-beta"
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "config script to switch the Lightning Loop Service on,off or update" echo "config script to switch the Lightning Loop Service on,off or update"
echo "bonus.loop.sh [on|off|menu|update]" echo "bonus.loop.sh [on|off|menu|update]"
echo "Installs Lightning Loop $pinnedVersion by default" echo "!! DEPRECATED use instead: bonus.lit.sh"
exit 1 exit 1
fi fi

View File

@@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
# !! NOTICE: Pool is now prt of the 'bonus.lit.sh' bundle
# this single install script will still be available for now
# but main focus for the future development should be on LIT
# https://github.com/lightninglabs/pool/releases/ # https://github.com/lightninglabs/pool/releases/
pinnedVersion="v0.3.4-alpha" pinnedVersion="v0.3.4-alpha"
@@ -7,7 +11,7 @@ pinnedVersion="v0.3.4-alpha"
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# config script to switch Lightning Pool on, off or update" echo "# config script to switch Lightning Pool on, off or update"
echo "# bonus.pool.sh [on|off|menu|update]" echo "# bonus.pool.sh [on|off|menu|update]"
echo "# installs Pool $pinnedVersion by default" echo "# DEPRECATED use instead: bonus.lit.sh"
exit 1 exit 1
fi fi