This commit is contained in:
rootzoll
2021-09-20 16:40:52 +02:00
11 changed files with 254 additions and 141 deletions

View File

@@ -5,24 +5,26 @@
- New: C-lightning v0.10.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v0.10.1) - New: C-lightning v0.10.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v0.10.1)
- New: C-lightningREST v0.5.1 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.5.1) - New: C-lightningREST v0.5.1 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.5.1)
- New: CLN plugin: Sparko [details](https://github.com/fiatjaf/sparko) - New: CLN plugin: Sparko [details](https://github.com/fiatjaf/sparko)
- New: CLN plugin: CLBOSS The C-Lightning Node Manager [details](https://github.com/ZmnSCPxj/clboss#clboss-the-c-lightning-node-manager)
- New: Suez - channel visualization for LND and CLN [details](https://github.com/prusnak/suez) - New: Suez - channel visualization for LND and CLN [details](https://github.com/prusnak/suez)
- New: LND Static Channel Backup to Nextcloud - New: LND Static Channel Backup to Nextcloud
-
- Update: Bitcoin Core v22.0 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-22.0.md) - Update: Bitcoin Core v22.0 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-22.0.md)
- Update: LND v0.13.1 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.13.1-beta)
- Update: RTL 0.11.2 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.11.2)
- Update: Specter Desktop 1.6.0 [details](https://github.com/cryptoadvance/specter-desktop/blob/master/README.md) - Update: Specter Desktop 1.6.0 [details](https://github.com/cryptoadvance/specter-desktop/blob/master/README.md)
- Update: Lightning Terminal v0.5.0-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.5.0-alpha)
- Update: Pool CLI v0.5.1-alpha [details](https://github.com/lightninglabs/pool/releases/tag/v0.5.1-alpha)
- Update: Balance of Satoshis 10.7.8 (BOS) + keep data on reinstall [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#version-8010)
- Update: Circuitbreaker v0.3.0 [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md)
- Update: JoinMarket v0.9.1 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/#joinmarket-clientserver) - Update: JoinMarket v0.9.1 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/#joinmarket-clientserver)
- Update: JoininBox v0.6.0 [details](https://github.com/openoms/joininbox/tree/master#joininbox) - Update: JoininBox v0.6.0 [details](https://github.com/openoms/joininbox/tree/master#joininbox)
- Update: Electrum Server in Rust (electrs) v0.8.11 [details](https://github.com/romanz/electrs/blob/v0.8.11/RELEASE-NOTES.md#0811-18-aug-2021) - Update: Electrum Server in Rust (electrs) v0.9.0-rc1 [details](https://github.com/romanz/electrs/blob/v0.9.0-rc1/RELEASE-NOTES.md)
- Update: Mempool 2.2.2 [details](https://github.com/mempool/mempool) - Update: Mempool 2.2.2 [details](https://github.com/mempool/mempool)
- Update: BTC-RPC-Explorer v3.2.0 [details](https://github.com/janoside/btc-rpc-explorer/blob/master/CHANGELOG.md#v320) - Update: BTC-RPC-Explorer v3.2.0 [details](https://github.com/janoside/btc-rpc-explorer/blob/master/CHANGELOG.md#v320)
- Update: stacking-sats-kraken 0.4.4 [details](https://github.com/dennisreimann/stacking-sats-kraken/blob/master/README.md) - Update: stacking-sats-kraken 0.4.4 [details](https://github.com/dennisreimann/stacking-sats-kraken/blob/master/README.md)
- Update: BTCPayServer 1.2.3 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.2.3) - Update: BTCPayServer 1.2.3 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.2.3)
- Update: LND v0.13.1 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.13.1-beta)
- Update: RTL 0.11.2 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.11.2)
- Update: Lightning Terminal v0.5.0-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.5.0-alpha)
- Update: Pool CLI v0.5.1-alpha [details](https://github.com/lightninglabs/pool/releases/tag/v0.5.1-alpha)
- Update: Balance of Satoshis 10.7.8 (BOS) + keep data on reinstall [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#version-8010)
- Update: Circuitbreaker v0.3.0 [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md)
## What's new in Version 1.7.0 of RaspiBlitz? ## What's new in Version 1.7.0 of RaspiBlitz?

View File

@@ -104,7 +104,7 @@ while :
# TODO: ALSO SEPARATE GUI/ACTION FOR THE SCANNING / WALLET UNLOCK / ERROR DETECTION # TODO: ALSO SEPARATE GUI/ACTION FOR THE SCANNING / WALLET UNLOCK / ERROR DETECTION
# if lightning is syncing or scanning # if lightning is syncing or scanning
source <(sudo /home/admin/config.scripts/blitz.statusscan.sh $lightning) source <(sudo /home/admin/config.scripts/blitz.statusscan.sh $lightning)
if [ "${walletLocked}" == "1" ]; then if [ "${walletLocked}" == "1" ] || [ "${CLNwalletLocked}" == "1" ]; then
/home/admin/setup.scripts/eventInfoWait.sh "walletlocked" "" lcd /home/admin/setup.scripts/eventInfoWait.sh "walletlocked" "" lcd
sleep 3 sleep 3
continue continue

View File

@@ -141,6 +141,12 @@ do
/home/admin/config.scripts/lnd.unlock.sh /home/admin/config.scripts/lnd.unlock.sh
fi fi
# CLN Wallet Unlock
if [ "${CLNwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then
/home/admin/config.scripts/cln.hsmtool.sh unlock
sleep 5
fi
##################################### #####################################
# SETUP MENU # SETUP MENU
##################################### #####################################

View File

@@ -15,6 +15,9 @@ if [ ${#touchscreen} -eq 0 ]; then touchscreen=0; fi
if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi
if [ ${#zerotier} -eq 0 ]; then zerotier="off"; fi if [ ${#zerotier} -eq 0 ]; then zerotier="off"; fi
if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi
if [ ${#clboss} -eq 0 ]; then clboss="off"; fi
if [ ${#clnEncryptedHSM} -eq 0 ]; then clnEncryptedHSM="off"; fi
if [ ${#clnAutoUnlock} -eq 0 ]; then clnAutoUnlock="off"; fi
echo "# map LND to on/off" echo "# map LND to on/off"
lndNode="off" lndNode="off"
@@ -46,7 +49,7 @@ if [ "${zerotier}" != "off" ]; then zerotierSwitch="on"; fi
echo "# map parallel testnets to on/off" echo "# map parallel testnets to on/off"
parallelTestnets="off" parallelTestnets="off"
if [ "${testnet}" == "on"] || [ "${signet}" == "on" ]; then if [ "${testnet}" == "on" ] || [ "${signet}" == "on" ]; then
parallelTestnets="on" parallelTestnets="on"
fi fi
@@ -85,6 +88,24 @@ if [ ${keysendOn} -eq 0 ]; then
keysend="off" keysend="off"
fi fi
echo "# map clboss to on/off"
clbossMenu='off'
if [ "${clboss}" == "on" ]; then
clbossMenu='on'
fi
echo "# map clnEncryptedHSM to on/off"
clnEncryptedHSMMenu='off'
if [ "${clnEncryptedHSM}" == "on" ]; then
clnEncryptedHSMMenu='on'
fi
echo "# map clnAutoUnlock to on/off"
clnAutoUnlockMenu='off'
if [ "${clnAutoUnlock}" == "on" ]; then
clnAutoUnlockMenu='on'
fi
# show select dialog # show select dialog
echo "run dialog ..." echo "run dialog ..."
@@ -122,6 +143,13 @@ fi
# C-Lightning & options/PlugIns # C-Lightning & options/PlugIns
OPTIONS+=(n 'CLN C-LIGHTNING NODE' ${clnNode}) OPTIONS+=(n 'CLN C-LIGHTNING NODE' ${clnNode})
if [ "${clnNode}" == "on" ]; then
OPTIONS+=(o '-CLN CLBOSS Automatic Node Manager' ${clbossMenu})
OPTIONS+=(h '-CLN Wallet Encryption' ${clnEncryptedHSMMenu})
if [ "${clnEncryptedHSM}" == "on" ]; then
OPTIONS+=(q '-CLN Auto-Unlock' ${clnAutoUnlockMenu})
fi
fi
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1")) CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
HEIGHT=$((CHOICE_HEIGHT+6)) HEIGHT=$((CHOICE_HEIGHT+6))
@@ -428,6 +456,50 @@ else
echo "C-Lightning NODE setting unchanged." echo "C-Lightning NODE setting unchanged."
fi fi
# CLBOSS process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "o")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clboss}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
echo "CLBOSS Setting changed .."
anychange=1
sudo /home/admin/config.scripts/cln-plugin.clboss.sh ${choice}
needsReboot=0
else
echo "CLBOSS Setting unchanged."
fi
# clnEncryptedHSM process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "h")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnEncryptedHSM}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
echo "clnEncryptedHSM Setting changed .."
anychange=1
if [ "${choice}" == "on" ]; then
/home/admin/config.scripts/cln.hsmtool.sh encrypt mainnet
else
/home/admin/config.scripts/cln.hsmtool.sh decrypt mainnet
fi
needsReboot=0
else
echo "clnEncryptedHSM Setting unchanged."
fi
# clnAutoUnlock process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "q")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnAutoUnlock}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
echo "clnAutoUnlock Setting changed .."
anychange=1
if [ "${choice}" == "on" ]; then
/home/admin/config.scripts/cln.hsmtool.sh autounlock-on mainnet
else
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off mainnet
fi
needsReboot=0
else
echo "clnAutoUnlock Setting unchanged."
fi
# parallel testnet process choice # parallel testnet process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "p") choice="off"; check=$(echo "${CHOICES}" | grep -c "p")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi

View File

@@ -209,7 +209,7 @@ The index database needs to be created before Electrum Server can be used.\n
This can take hours/days depending on your RaspiBlitz. Monitor the progress on the LCD.\n This can take hours/days depending on your RaspiBlitz. Monitor the progress on the LCD.\n
When finished use the new 'ELECTRS' entry in Main Menu for more info.\n When finished use the new 'ELECTRS' entry in Main Menu for more info.\n
" 14 50 " 14 50
needsReboot=1 needsReboot=0
else else
l1="!!! FAIL on ElectRS install !!!" l1="!!! FAIL on ElectRS install !!!"
l2="Try manual install on terminal after reboot with:" l2="Try manual install on terminal after reboot with:"

View File

@@ -48,126 +48,126 @@ CHOICE=$(dialog --clear \
case $CHOICE in case $CHOICE in
ENCRYPT) ENCRYPT)
/home/admin/config.scripts/cln.hsmtool.sh encrypt $CHAIN /home/admin/config.scripts/cln.hsmtool.sh encrypt $CHAIN
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
;; ;;
DECRYPT) DECRYPT)
/home/admin/config.scripts/cln.hsmtool.sh decrypt $CHAIN /home/admin/config.scripts/cln.hsmtool.sh decrypt $CHAIN
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
;; ;;
PASSWORD_C) PASSWORD_C)
/home/admin/config.scripts/cln.hsmtool.sh change-password $CHAIN /home/admin/config.scripts/cln.hsmtool.sh change-password $CHAIN
;; ;;
AUTOUNLOCK-ON) AUTOUNLOCK-ON)
/home/admin/config.scripts/cln.hsmtool.sh autounlock-on $CHAIN /home/admin/config.scripts/cln.hsmtool.sh autounlock-on $CHAIN
;; ;;
AUTOUNLOCK-OFF) AUTOUNLOCK-OFF)
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off $CHAIN /home/admin/config.scripts/cln.hsmtool.sh autounlock-off $CHAIN
;; ;;
BACKUP) BACKUP)
## from dialogLightningWallet.sh ## from dialogLightningWallet.sh
# run upload dialog and get result # run upload dialog and get result
_temp="/var/cache/raspiblitz/temp/.temp.tmp" _temp="/var/cache/raspiblitz/temp/.temp.tmp"
clear clear
/home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp /home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
;;
;;
RESET) RESET)
# backup # backup
## from dialogLightningWallet.sh ## from dialogLightningWallet.sh
_temp="/var/cache/raspiblitz/temp/.temp.tmp" _temp="/var/cache/raspiblitz/temp/.temp.tmp"
clear clear
/home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp /home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
echo echo
echo "The rescue file is stored on the SDcard named cln-rescue.*.tar.gz just in case." echo "The rescue file is stored on the SDcard named cln-rescue.*.tar.gz just in case."
echo "The next step will overwrite the old C-lighthning $CHAIN wallet" echo "The next step will overwrite the old C-lighthning $CHAIN wallet"
echo "Press ENTER to continue or CTRL+C to abort" echo "Press ENTER to continue or CTRL+C to abort"
read key read key
# reset # reset
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret sudo rm /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.* sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.*
# make sure the new hsm_secret is treated as unencrypted and clear autounlock # make sure the new hsm_secret is treated as unencrypted and clear autounlock
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \ "s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnEncryptedHSM=off/g" \ "s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnEncryptedHSM=off/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
# new # new
/home/admin/config.scripts/cln.hsmtool.sh new $CHAIN /home/admin/config.scripts/cln.hsmtool.sh new $CHAIN
# set the lightningd service file on each active network # set the lightningd service file on each active network
if [ "${cln}" == "on" ] || [ "${cln}" == "1" ]; then if [ "${cln}" == "on" ] || [ "${cln}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh mainnet /home/admin/config.scripts/cln.install-service.sh mainnet
fi fi
if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh testnet /home/admin/config.scripts/cln.install-service.sh testnet
fi fi
if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh signet /home/admin/config.scripts/cln.install-service.sh signet
fi fi
;; ;;
FILERESTORE) FILERESTORE)
# backup # backup
## from dialogLightningWallet.sh ## from dialogLightningWallet.sh
_temp="/var/cache/raspiblitz/temp/.temp.tmp" _temp="/var/cache/raspiblitz/temp/.temp.tmp"
clear clear
/home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp /home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
echo echo
echo "The rescue file is stored on the SDcard named cln-rescue.*.tar.gz just in case." echo "The rescue file is stored on the SDcard named cln-rescue.*.tar.gz just in case."
echo "The next step will overwrite the old C-lighthning $CHAIN wallet" echo "The next step will overwrite the old C-lighthning $CHAIN wallet"
echo "Press ENTER to continue or CTRL+C to abort" echo "Press ENTER to continue or CTRL+C to abort"
read key read key
# reset # reset
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret sudo rm /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.* sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.*
# import file # import file
_temp="/var/cache/raspiblitz/temp/.temp.tmp" _temp="/var/cache/raspiblitz/temp/.temp.tmp"
clear clear
/home/admin/config.scripts/cln.backup.sh cln-import-gui production $_temp /home/admin/config.scripts/cln.backup.sh cln-import-gui production $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
;; ;;
SEEDRESTORE) SEEDRESTORE)
# backup # backup
## from dialogLightningWallet.sh ## from dialogLightningWallet.sh
_temp="/var/cache/raspiblitz/temp/.temp.tmp" _temp="/var/cache/raspiblitz/temp/.temp.tmp"
clear clear
/home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp /home/admin/config.scripts/cln.backup.sh cln-export-gui production $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
echo echo
echo "The rescue file is stored on the SDcard named cln-rescue.*.tar.gz just in case." echo "The rescue file is stored on the SDcard named cln-rescue.*.tar.gz just in case."
echo "The next step will overwrite the old C-lighthning $CHAIN wallet" echo "The next step will overwrite the old C-lighthning $CHAIN wallet"
echo "Press ENTER to continue or CTRL+C to abort" echo "Press ENTER to continue or CTRL+C to abort"
read key read key
# reset # reset
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret sudo rm /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/config sudo rm /home/bitcoin/.lightning/${CLNETWORK}/config
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.* sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.*
# import seed # import seed
_temp="/var/cache/raspiblitz/.temp.tmp" _temp="/var/cache/raspiblitz/.temp.tmp"
/home/admin/config.scripts/cln.backup.sh seed-import-gui $_temp /home/admin/config.scripts/cln.backup.sh seed-import-gui $_temp
/home/admin/config.scripts/cln.hsmtool.sh seed "$CHAIN" "$(cat $_temp)" /home/admin/config.scripts/cln.hsmtool.sh seed "$CHAIN" "$(cat $_temp)"
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
# regenerate config # regenerate config
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off /home/admin/config.scripts/cln.hsmtool.sh autounlock-off
/home/admin/config.scripts/cln.hsmtool.sh decrypt /home/admin/config.scripts/cln.hsmtool.sh decrypt
/home/admin/config.scripts/cln.install.sh on $CHAIN /home/admin/config.scripts/cln.install.sh on $CHAIN
;; ;;
esac esac

View File

@@ -45,7 +45,10 @@ if [ ${#abcd} -eq 0 ]; then
OPTIONS+=(A "Master Login Password") OPTIONS+=(A "Master Login Password")
OPTIONS+=(B "RPC/App Password") OPTIONS+=(B "RPC/App Password")
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
OPTIONS+=(C "Lightning Wallet Password") OPTIONS+=(C "LND Lightning Wallet Password")
fi
if [ "${cln}" == "on" ] && [ "${clnEncryptedHSM}" == "on" ]; then
OPTIONS+=(CLN "C-Lightning Wallet Password")
fi fi
CHOICE=$(dialog --clear \ CHOICE=$(dialog --clear \
--backtitle "RaspiBlitz" \ --backtitle "RaspiBlitz" \
@@ -68,6 +71,9 @@ if [ ${#abcd} -eq 0 ]; then
D) D)
abcd='d'; abcd='d';
;; ;;
CLN)
abcd='cln';
;;
*) *)
exit 0 exit 0
;; ;;
@@ -435,7 +441,12 @@ elif [ "${abcd}" = "x" ]; then
# store result is file # store result is file
echo "${password1}" > ${resultFile} echo "${password1}" > ${resultFile}
elif [ "${abcd}" = "cln" ]; then
/home/admin/config.scripts/cln.hsmtool.sh change-password mainnet
# do not reboot for cln password
reboot=0
# everything else # everything else
else else
echo "FAIL: there is no password '${abcd}' (reminder: use lower case)" echo "FAIL: there is no password '${abcd}' (reminder: use lower case)"

View File

@@ -279,6 +279,21 @@ fi
# is CLN running # is CLN running
clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running) clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running)
echo "clnActive=${clnRunning}" echo "clnActive=${clnRunning}"
echo "CLNwalletLocked=0"
if [ "${clnRunning}" != "1" ] && [ "${LNTYPE}" == "cln" ]; then
clnInfo=$($lightningcli_alias getinfo 2>&1)
# check if locked
if [ $(echo "${clnInfo}" | grep -c "Connecting to 'lightning-rpc': Connection refused") -gt 0 ];then
echo "# CLN wallet not running yet"
clnError=$(sudo journalctl -n5 -u lightningd)
if [ $(echo "${clnError}" | grep -c 'encrypted-hsm: Could not read pass from stdin.') -gt 0 ]\
|| [ $(echo "${clnError}" | grep -c 'hsm_secret is encrypted, you need to pass the --encrypted-hsm startup option.') -gt 0 ]\
|| [ $(echo "${clnError}" | grep -c 'Wrong password for encrypted hsm_secret.') -gt 0 ]; then
echo "CLNwalletLocked=1"
fi
fi
fi
if [ "${clnRunning}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then if [ "${clnRunning}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then
clnInfo=$($lightningcli_alias getinfo) clnInfo=$($lightningcli_alias getinfo)
clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]') clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]')

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# https://github.com/romanz/electrs/blob/master/doc/usage.md # https://github.com/romanz/electrs/blob/master/doc/usage.md
ELECTRSVERSION=v0.8.11 ELECTRSVERSION="v0.9.0-rc1"
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
@@ -275,22 +275,17 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo apt install -y clang cmake build-essential # for building 'rust-rocksdb' sudo apt install -y clang cmake build-essential # for building 'rust-rocksdb'
echo echo
echo "# Downloading and building electrs $ELECTRSVERSION. This will take ~30 minutes" # ~22 min on an Odroid XU4 echo "# Downloading and building electrs $ELECTRSVERSION. This will take ~40 minutes"
echo echo
sudo -u electrs git clone https://github.com/romanz/electrs sudo -u electrs git clone https://github.com/romanz/electrs
cd /home/electrs/electrs || exit 1 cd /home/electrs/electrs || exit 1
sudo -u electrs git reset --hard $ELECTRSVERSION sudo -u electrs git reset --hard $ELECTRSVERSION
sudo -u electrs cargo build --release || exit 1
sudo -u electrs cargo build --locked --release || exit 1
echo echo
echo "# The electrs database will be built in /mnt/hdd/app-storage/electrs/db. Takes ~18 hours and ~50Gb diskspace" echo "# The electrs database will be built in /mnt/hdd/app-storage/electrs/db. Takes ~18 hours and ~50Gb diskspace"
echo echo
# move old-database if present
if [ -d "/mnt/hdd/electrs/db" ]; then
echo "Moving existing ElectRS index to /mnt/hdd/app-storage/electrs..."
sudo mv -f /mnt/hdd/electrs /mnt/hdd/app-storage/
fi
sudo mkdir /mnt/hdd/app-storage/electrs 2>/dev/null sudo mkdir /mnt/hdd/app-storage/electrs 2>/dev/null
sudo chown -R electrs:electrs /mnt/hdd/app-storage/electrs sudo chown -R electrs:electrs /mnt/hdd/app-storage/electrs
@@ -308,7 +303,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# https://github.com/romanz/electrs/blob/master/doc/usage.md#configuration-files-and-environment-variables # https://github.com/romanz/electrs/blob/master/doc/usage.md#configuration-files-and-environment-variables
sudo -u electrs mkdir /home/electrs/.electrs 2>/dev/null sudo -u electrs mkdir /home/electrs/.electrs 2>/dev/null
echo " echo "
verbose = 4 verbose = 2
timestamp = true timestamp = true
jsonrpc_import = true jsonrpc_import = true
db_dir = \"/mnt/hdd/app-storage/electrs/db\" db_dir = \"/mnt/hdd/app-storage/electrs/db\"
@@ -386,8 +381,6 @@ stream {
fi fi
fi fi
sudo systemctl restart nginx
echo echo
echo "# Open ports 50001 and 5002 on UFW " echo "# Open ports 50001 and 5002 on UFW "
echo echo
@@ -401,7 +394,7 @@ stream {
echo " echo "
[Unit] [Unit]
Description=Electrs Description=Electrs
After=lnd.service After=bitcoind.service
[Service] [Service]
WorkingDirectory=/home/electrs/electrs WorkingDirectory=/home/electrs/electrs
@@ -438,10 +431,24 @@ WantedBy=multi-user.target
/home/admin/config.scripts/internet.hiddenservice.sh electrs 50002 50002 50001 50001 /home/admin/config.scripts/internet.hiddenservice.sh electrs 50002 50002 50001 50001
fi fi
# restart BTC-RPC-Explorer to reconfigure itself to use electrs for address API # whitelist downloading to localhost from bitcoind
if [ "${BTCRPCexplorer}" == "on" ]; then if ! sudo grep -Eq "^whitelist=download@127.0.0.1" /mnt/hdd/bitcoin/bitcoin.conf;then
sudo systemctl restart btc-rpc-explorer echo "whitelist=download@127.0.0.1" | sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
echo "# BTC-RPC-Explorer restarted" bitcoindRestart=yes
fi
source /home/admin/raspiblitz.info
if [ "${state}" == "ready" ]; then
if [ "${bitcoindRestart}" == "yes" ]; then
sudo systemctl restart bitcoind
fi
sudo systemctl restart nginx
sudo systemctl start electrs
# restart BTC-RPC-Explorer to reconfigure itself to use electrs for address API
if [ "${BTCRPCexplorer}" == "on" ]; then
sudo systemctl restart btc-rpc-explorer
echo "# BTC-RPC-Explorer restarted"
fi
fi fi
echo echo
@@ -481,11 +488,11 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo ufw deny 50002 sudo ufw deny 50002
echo "# OK ElectRS removed." echo "# OK ElectRS removed."
# restart BTC-RPC-Explorer to reconfigure itself to use electrs for address API # restart BTC-RPC-Explorer to reconfigure itself to use electrs for address API
if [ "${BTCRPCexplorer}" == "on" ]; then if [ "${BTCRPCexplorer}" == "on" ]; then
sudo systemctl restart btc-rpc-explorer sudo systemctl restart btc-rpc-explorer
echo "# BTC-RPC-Explorer restarted" echo "# BTC-RPC-Explorer restarted"
fi fi
else else
echo "# ElectRS is not installed." echo "# ElectRS is not installed."

View File

@@ -280,7 +280,7 @@ elif [ "$1" = "unlock" ]; then
exit 1 exit 1
fi fi
echo "# Waiting to unlock wallet ... " echo "# Waiting to unlock wallet ... "
sleep 5 sleep 15
attempt=$((attempt+1)) attempt=$((attempt+1))
done done
echo "# Ok the ${netprefix}lightningd wallet is unlocked" echo "# Ok the ${netprefix}lightningd wallet is unlocked"

View File

@@ -65,7 +65,7 @@ do
# setting info string # setting info string
infoStr=" Blockchain Progress : ${syncProgress}\n" infoStr=" Blockchain Progress : ${syncProgress}\n"
if [ "${lightning}" == "lnd" ] || [ "${lightning}" == "cln" ]; then if [ "${lightning}" == "lnd" ] || [ "${lightning}" == "cln" ]; then
infoStr="${infoStr} Lightning Progress : ${scanProgress}\n ${actionString}" infoStr="${infoStr} Lightning Progress : ${scanProgress}\n ${actionString}"
else else
# if lightning is deactivated (leave line clear) # if lightning is deactivated (leave line clear)