rename all cln / CLN to cl / CL except CLNETWORK

This commit is contained in:
openoms 2021-09-26 10:30:09 +01:00
parent f9c095cb5a
commit cac14efc46
No known key found for this signature in database
GPG Key ID: 5BFB77609B081B65
52 changed files with 621 additions and 621 deletions

View File

@ -4,10 +4,10 @@
- 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: CL 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: CL plugin: CLBOSS The C-Lightning Node Manager [details](https://github.com/ZmnSCPxj/clboss#clboss-the-c-lightning-node-manager)
- New: Refactored Setup-Process [details](https://github.com/rootzoll/raspiblitz/issues/1126#issuecomment-829757665) - New: Refactored Setup-Process [details](https://github.com/rootzoll/raspiblitz/issues/1126#issuecomment-829757665)
- New: Suez - channel visualization for LND and CLN [details](https://github.com/prusnak/suez) - New: Suez - channel visualization for LND and CL [details](https://github.com/prusnak/suez)
- New: LND Static Channel Backup to Nextcloud - New: LND Static Channel Backup to Nextcloud
- New: Allow SphinxApp to connect over Tor - New: Allow SphinxApp to connect over Tor
- New: Parallel TESTNET & SIGNET services - New: Parallel TESTNET & SIGNET services

View File

@ -1076,9 +1076,9 @@ PGPpkeys="https://raw.githubusercontent.com/ElementsProject/lightning/master/con
PGPcheck="D9200E6CD1ADB8F1" PGPcheck="D9200E6CD1ADB8F1"
# prepare download dir # prepare download dir
sudo rm -rf /home/admin/download/cln sudo rm -rf /home/admin/download/cl
sudo -u admin mkdir -p /home/admin/download/cln sudo -u admin mkdir -p /home/admin/download/cl
cd /home/admin/download/cln || exit 1 cd /home/admin/download/cl || exit 1
sudo -u admin wget -O "pgp_keys.asc" ${PGPpkeys} sudo -u admin wget -O "pgp_keys.asc" ${PGPpkeys}
gpg --import --import-options show-only ./pgp_keys.asc gpg --import --import-options show-only ./pgp_keys.asc

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet> # 00infoBlitz.sh <cl|lnd> <testnet|mainnet|signet>
# load code software version # load code software version
source /home/admin/_version.info source /home/admin/_version.info
@ -160,7 +160,7 @@ fi
webinterfaceInfo="" webinterfaceInfo=""
runningRTL=$(systemctl status ${netprefix}${typeprefix}RTL.service 2>/dev/null | grep -c active) runningRTL=$(systemctl status ${netprefix}${typeprefix}RTL.service 2>/dev/null | grep -c active)
if [ ${runningRTL} -eq 1 ]; then if [ ${runningRTL} -eq 1 ]; then
if [ "${lightning}" == "cln" ]; then if [ "${lightning}" == "cl" ]; then
RTLHTTP=${portprefix}7000 RTLHTTP=${portprefix}7000
elif [ "${lightning}" == "lnd" ];then elif [ "${lightning}" == "lnd" ];then
RTLHTTP=${portprefix}3000 RTLHTTP=${portprefix}3000
@ -232,12 +232,12 @@ else
fi fi
# LIGHTNING NETWORK # LIGHTNING NETWORK
if [ "${lightning}" == "cln" ]; then if [ "${lightning}" == "cl" ]; then
ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null) ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null)
ln_baseInfo="-" ln_baseInfo="-"
ln_channelInfo="\n" ln_channelInfo="\n"
ln_external="\n" ln_external="\n"
ln_alias="$(sudo cat "${CLNCONF}" | grep "^alias=*" | cut -f2 -d=)" ln_alias="$(sudo cat "${CLCONF}" | grep "^alias=*" | cut -f2 -d=)"
if [ ${#ln_alias} -eq 0 ];then if [ ${#ln_alias} -eq 0 ];then
ln_alias=$(echo "${ln_getInfo}" | grep '"alias":' | cut -d '"' -f4) ln_alias=$(echo "${ln_getInfo}" | grep '"alias":' | cut -d '"' -f4)
fi fi
@ -245,7 +245,7 @@ if [ "${lightning}" == "cln" ]; then
ln_alias=${hostname} ln_alias=${hostname}
fi fi
ln_publicColor="" ln_publicColor=""
ln_port=$(sudo cat "${CLNCONF}" | grep "^bind-addr=*" | cut -f2 -d':') ln_port=$(sudo cat "${CLCONF}" | grep "^bind-addr=*" | cut -f2 -d':')
if [ ${#ln_port} -eq 0 ]; then if [ ${#ln_port} -eq 0 ]; then
ln_port=$(echo "${ln_getInfo}" | grep '"port":' | cut -d: -f2 | tail -1 | bc) ln_port=$(echo "${ln_getInfo}" | grep '"port":' | cut -d: -f2 | tail -1 | bc)
fi fi
@ -288,17 +288,17 @@ if [ "${lightning}" == "cln" ]; then
fi fi
else else
ln_walletbalance=0 ln_walletbalance=0
cln_listfunds=$($lightningcli_alias listfunds 2>/dev/null) cl_listfunds=$($lightningcli_alias listfunds 2>/dev/null)
for i in $(echo "$cln_listfunds" \ for i in $(echo "$cl_listfunds" \
|jq .outputs[]|jq 'select(.status=="confirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do |jq .outputs[]|jq 'select(.status=="confirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
ln_walletbalance=$((ln_walletbalance+i)) ln_walletbalance=$((ln_walletbalance+i))
done done
for i in $(echo "$cln_listfunds" \ for i in $(echo "$cl_listfunds" \
|jq .outputs[]|jq 'select(.status=="unconfirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do |jq .outputs[]|jq 'select(.status=="unconfirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
ln_walletbalance_wait=$((ln_walletbalance_wait+i)) ln_walletbalance_wait=$((ln_walletbalance_wait+i))
done done
# ln_closedchannelbalance: "state": "ONCHAIN" funds in channels # ln_closedchannelbalance: "state": "ONCHAIN" funds in channels
for i in $(echo "$cln_listfunds" \ for i in $(echo "$cl_listfunds" \
|jq .channels[]|jq 'select(.state=="ONCHAIN")'|grep channel_sat|awk '{print $2}'|cut -d, -f1);do |jq .channels[]|jq 'select(.state=="ONCHAIN")'|grep channel_sat|awk '{print $2}'|cut -d, -f1);do
ln_closedchannelbalance=$((ln_closedchannelbalance+i)) ln_closedchannelbalance=$((ln_closedchannelbalance+i))
done done
@ -307,7 +307,7 @@ if [ "${lightning}" == "cln" ]; then
if [ "${ln_pendingonchain}" = "0" ]; then ln_pendingonchain=""; fi if [ "${ln_pendingonchain}" = "0" ]; then ln_pendingonchain=""; fi
if [ ${#ln_pendingonchain} -gt 0 ]; then ln_pendingonchain="(+${ln_pendingonchain})"; fi if [ ${#ln_pendingonchain} -gt 0 ]; then ln_pendingonchain="(+${ln_pendingonchain})"; fi
# ln_channelbalance: "state": "CHANNELD_NORMAL" funds in channels # ln_channelbalance: "state": "CHANNELD_NORMAL" funds in channels
for i in $(echo "$cln_listfunds" \ for i in $(echo "$cl_listfunds" \
|jq .channels[]|jq 'select(.state=="CHANNELD_NORMAL")'|grep channel_sat|awk '{print $2}'|cut -d, -f1);do |jq .channels[]|jq 'select(.state=="CHANNELD_NORMAL")'|grep channel_sat|awk '{print $2}'|cut -d, -f1);do
ln_channelbalance=$((ln_channelbalance+i)) ln_channelbalance=$((ln_channelbalance+i))
done done
@ -315,7 +315,7 @@ if [ "${lightning}" == "cln" ]; then
ln_channelbalance=0 ln_channelbalance=0
fi fi
# ln_channelbalance_all: all funds in channels # ln_channelbalance_all: all funds in channels
for i in $(echo "$cln_listfunds" \ for i in $(echo "$cl_listfunds" \
|jq .channels[]|grep channel_sat|awk '{print $2}'|cut -d, -f1);do |jq .channels[]|grep channel_sat|awk '{print $2}'|cut -d, -f1);do
ln_channelbalance_all=$((ln_channelbalance_all+i)) ln_channelbalance_all=$((ln_channelbalance_all+i))
done done
@ -327,9 +327,9 @@ if [ "${lightning}" == "cln" ]; then
# - **num_active_channels** (u32): The total count of channels in normal state # - **num_active_channels** (u32): The total count of channels in normal state
# - **num_inactive_channels** (u32): The total count of channels waiting for opening or closing # - **num_inactive_channels** (u32): The total count of channels waiting for opening or closing
ln_channels_online="$(echo "${ln_getInfo}" | jq -r '.num_active_channels')" 2>/dev/null ln_channels_online="$(echo "${ln_getInfo}" | jq -r '.num_active_channels')" 2>/dev/null
cln_num_pending_channels="$(echo "${ln_getInfo}" | jq -r '.num_pending_channels')" 2>/dev/null cl_num_pending_channels="$(echo "${ln_getInfo}" | jq -r '.num_pending_channels')" 2>/dev/null
cln_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null cl_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null
ln_channels_total=$((ln_channels_online+cln_num_pending_channels+cln_num_inactive_channels)) ln_channels_total=$((ln_channels_online+cl_num_pending_channels+cl_num_inactive_channels))
ln_baseInfo="${color_gray}Wallet ${ln_walletbalance} ${netprefix}sat ${ln_pendingonchain}" ln_baseInfo="${color_gray}Wallet ${ln_walletbalance} ${netprefix}sat ${ln_pendingonchain}"
ln_peers="$(echo "${ln_getInfo}" | jq -r '.num_peers')" 2>/dev/null ln_peers="$(echo "${ln_getInfo}" | jq -r '.num_peers')" 2>/dev/null
ln_channelInfo="${ln_channels_online}/${ln_channels_total} Channels ${ln_channelbalance} ${netprefix}sat${ln_channelbalance_pending}" ln_channelInfo="${ln_channels_online}/${ln_channels_total} Channels ${ln_channelbalance} ${netprefix}sat${ln_channelbalance_pending}"
@ -430,7 +430,7 @@ ${color_yellow}
${color_yellow}${ln_publicColor}${ln_external}${color_gray}" ${color_yellow}${ln_publicColor}${ln_external}${color_gray}"
fi fi
if [ "${lightning}" == "cln" ];then if [ "${lightning}" == "cl" ];then
LNline="C-LIGHTNING ${color_green}${ln_version}\n ${ln_baseInfo}" LNline="C-LIGHTNING ${color_green}${ln_version}\n ${ln_baseInfo}"
elif [ "${lightning}" == "lnd" ];then elif [ "${lightning}" == "lnd" ];then
LNline="LND ${color_green}${ln_version} ${ln_baseInfo}" LNline="LND ${color_green}${ln_version} ${ln_baseInfo}"

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" ] || [ "${CLNwalletLocked}" == "1" ]; then if [ "${walletLocked}" == "1" ] || [ "${CLwalletLocked}" == "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

@ -148,8 +148,8 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
fi fi
# if C-Lightning is active # if C-Lightning is active
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
OPTIONS+=(CLN "C-lightning Wallet Options") OPTIONS+=(CL "C-lightning Wallet Options")
fi fi
if [ "${testnet}" == "on" ]; then if [ "${testnet}" == "on" ]; then
@ -214,8 +214,8 @@ case $CHOICE in
LND) LND)
/home/admin/99lndMenu.sh /home/admin/99lndMenu.sh
;; ;;
CLN) CL)
/home/admin/99clnMenu.sh ${chain}net /home/admin/99clMenu.sh ${chain}net
;; ;;
CONNECT) CONNECT)
/home/admin/99connectMenu.sh /home/admin/99connectMenu.sh
@ -231,7 +231,7 @@ case $CHOICE in
/home/admin/config.scripts/bonus.rtl.sh menu lnd mainnet /home/admin/config.scripts/bonus.rtl.sh menu lnd mainnet
;; ;;
CRTL) CRTL)
/home/admin/config.scripts/bonus.rtl.sh menu cln mainnet /home/admin/config.scripts/bonus.rtl.sh menu cl mainnet
;; ;;
BTCPAY) BTCPAY)
/home/admin/config.scripts/bonus.btcpayserver.sh menu /home/admin/config.scripts/bonus.btcpayserver.sh menu
@ -246,7 +246,7 @@ case $CHOICE in
/home/admin/config.scripts/bonus.lit.sh menu /home/admin/config.scripts/bonus.lit.sh menu
;; ;;
SPARKO) SPARKO)
/home/admin/config.scripts/cln-plugin.sparko.sh menu mainnet /home/admin/config.scripts/cl-plugin.sparko.sh menu mainnet
;; ;;
LNBITS) LNBITS)
/home/admin/config.scripts/bonus.lnbits.sh menu /home/admin/config.scripts/bonus.lnbits.sh menu

View File

@ -20,7 +20,7 @@ plus=""
if [ "${testnet}" == "on" ]; then if [ "${testnet}" == "on" ]; then
OPTIONS+=(tSYS "TESTNET Monitoring & Configuration") OPTIONS+=(tSYS "TESTNET Monitoring & Configuration")
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(tLND "TESTNET LND Wallet Options"); fi if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(tLND "TESTNET LND Wallet Options"); fi
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then OPTIONS+=(tCLN "TESTNET C-Lightning Wallet Options"); fi if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then OPTIONS+=(tCL "TESTNET C-Lightning Wallet Options"); fi
fi fi
# just an optical splitter - ignored on select # just an optical splitter - ignored on select
@ -28,7 +28,7 @@ OPTIONS+=(--- "----------------------------------")
if [ "${signet}" == "on" ]; then if [ "${signet}" == "on" ]; then
OPTIONS+=(sSYS "SIGNET Monitoring & Configuration") OPTIONS+=(sSYS "SIGNET Monitoring & Configuration")
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then OPTIONS+=(sCLN "SIGNET C-Lightning Wallet Options"); fi if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then OPTIONS+=(sCL "SIGNET C-Lightning Wallet Options"); fi
fi fi
# DONT OFFER SERVICES FOR TESTNET RIGHT NOW # DONT OFFER SERVICES FOR TESTNET RIGHT NOW
@ -63,10 +63,10 @@ case $CHOICE in
sLND) sLND)
/home/admin/99lndMenu.sh signet /home/admin/99lndMenu.sh signet
;; ;;
tCLN) tCL)
/home/admin/99clnMenu.sh testnet /home/admin/99clMenu.sh testnet
;; ;;
sCLN) sCL)
/home/admin/99clnMenu.sh signet /home/admin/99clMenu.sh signet
;; ;;
esac esac

View File

@ -11,7 +11,7 @@ CHAIN=mainnet
echo "services default values" echo "services default values"
if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi
if [ ${#lnd} -eq 0 ]; then lnd="off"; fi if [ ${#lnd} -eq 0 ]; then lnd="off"; fi
if [ ${#cln} -eq 0 ]; then cln="off"; fi if [ ${#cl} -eq 0 ]; then cl="off"; fi
if [ ${#crtlWebinterface} -eq 0 ]; then crtlWebinterface="off"; fi if [ ${#crtlWebinterface} -eq 0 ]; then crtlWebinterface="off"; fi
if [ ${#sparko} -eq 0 ]; then sparko="off"; fi if [ ${#sparko} -eq 0 ]; then sparko="off"; fi
@ -21,9 +21,9 @@ echo "run dialog ..."
OPTIONS=() OPTIONS=()
OPTIONS+=(l "LND on $CHAIN" ${lnd}) OPTIONS+=(l "LND on $CHAIN" ${lnd})
OPTIONS+=(r "RTL for LND $CHAIN" ${rtlWebinterface}) OPTIONS+=(r "RTL for LND $CHAIN" ${rtlWebinterface})
OPTIONS+=(c "C-lightning on $CHAIN" ${cln}) OPTIONS+=(c "C-lightning on $CHAIN" ${cl})
OPTIONS+=(t "RTL for CLN on $CHAIN" ${crtlWebinterface}) OPTIONS+=(t "RTL for CL on $CHAIN" ${crtlWebinterface})
OPTIONS+=(s "Sparko for CLN on $CHAIN" ${sparko}) OPTIONS+=(s "Sparko for CL on $CHAIN" ${sparko})
CHOICES=$(dialog --title ' Additional Services ' \ CHOICES=$(dialog --title ' Additional Services ' \
--checklist ' use spacebar to activate/de-activate ' \ --checklist ' use spacebar to activate/de-activate ' \
@ -68,26 +68,26 @@ else
echo "# LND on $CHAIN Setting unchanged." echo "# LND on $CHAIN Setting unchanged."
fi fi
# cln process choice # cl process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "c") choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${cln}" != "${choice}" ]; then if [ "${cl}" != "${choice}" ]; then
echo "# CLN on $CHAIN Setting changed .." echo "# CL on $CHAIN Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/cln.install.sh ${choice} $CHAIN /home/admin/config.scripts/cl.install.sh ${choice} $CHAIN
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
echo "# Successfully installed CLN on $CHAIN" echo "# Successfully installed CL on $CHAIN"
else else
l1="# !!! FAIL on CLN on $CHAIN install !!!" l1="# !!! FAIL on CL on $CHAIN install !!!"
l2="# Try manual install on terminal after reboot with:" l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cln.install.sh on $CHAIN" l3="/home/admin/config.scripts/cl.install.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi
else else
echo "# CLN on $CHAIN Setting unchanged." echo "# CL on $CHAIN Setting unchanged."
fi fi
# RTL process choice # RTL process choice
@ -119,25 +119,25 @@ fi
choice="off"; check=$(echo "${CHOICES}" | grep -c "t") choice="off"; check=$(echo "${CHOICES}" | grep -c "t")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${crtlWebinterface}" != "${choice}" ]; then if [ "${crtlWebinterface}" != "${choice}" ]; then
echo "RTL for CLN $CHAIN Setting changed .." echo "RTL for CL $CHAIN Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/bonus.rtl.sh ${choice} cln $CHAIN /home/admin/config.scripts/bonus.rtl.sh ${choice} cl $CHAIN
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start cRTL sudo systemctl start cRTL
echo "waiting 10 secs .." echo "waiting 10 secs .."
sleep 10 sleep 10
/home/admin/config.scripts/bonus.rtl.sh menu cln $CHAIN /home/admin/config.scripts/bonus.rtl.sh menu cl $CHAIN
else else
l1="!!! FAIL on RTL for CLN $CHAIN install !!!" l1="!!! FAIL on RTL for CL $CHAIN install !!!"
l2="Try manual install on terminal after reboot with:" l2="Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/bonus.rtl.sh on cln $CHAIN" l3="/home/admin/config.scripts/bonus.rtl.sh on cl $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi
else else
echo "RTL for CLN $CHAIN Setting unchanged." echo "RTL for CL $CHAIN Setting unchanged."
fi fi
# sparko process choice # sparko process choice
@ -146,15 +146,15 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${sparko}" != "${choice}" ]; then if [ "${sparko}" != "${choice}" ]; then
echo "# Sparko on $CHAIN Setting changed .." echo "# Sparko on $CHAIN Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/cln-plugin.sparko.sh ${choice} $CHAIN /home/admin/config.scripts/cl-plugin.sparko.sh ${choice} $CHAIN
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cln-plugin.sparko.sh menu $CHAIN /home/admin/config.scripts/cl-plugin.sparko.sh menu $CHAIN
else else
l1="# !!! FAIL on Sparko on $CHAIN install !!!" l1="# !!! FAIL on Sparko on $CHAIN install !!!"
l2="# Try manual install on terminal after reboot with:" l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cln-plugin.sparko.sh on $CHAIN" l3="/home/admin/config.scripts/cl-plugin.sparko.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi

View File

@ -12,7 +12,7 @@ echo "services default values"
if [ ${#trtlWebinterface} -eq 0 ]; then trtlWebinterface="off"; fi if [ ${#trtlWebinterface} -eq 0 ]; then trtlWebinterface="off"; fi
if [ ${#tlnd} -eq 0 ]; then tlnd="off"; fi if [ ${#tlnd} -eq 0 ]; then tlnd="off"; fi
if [ ${#tcrtlWebinterface} -eq 0 ]; then tcrtlWebinterface="off"; fi if [ ${#tcrtlWebinterface} -eq 0 ]; then tcrtlWebinterface="off"; fi
if [ ${#tcln} -eq 0 ]; then tcln="off"; fi if [ ${#tcl} -eq 0 ]; then tcl="off"; fi
if [ ${#tsparko} -eq 0 ]; then tsparko="off"; fi if [ ${#tsparko} -eq 0 ]; then tsparko="off"; fi
# show select dialog # show select dialog
@ -21,9 +21,9 @@ echo "run dialog ..."
OPTIONS=() OPTIONS=()
OPTIONS+=(l "LND on $CHAIN" ${tlnd}) OPTIONS+=(l "LND on $CHAIN" ${tlnd})
OPTIONS+=(r "RTL for LND $CHAIN" ${trtlWebinterface}) OPTIONS+=(r "RTL for LND $CHAIN" ${trtlWebinterface})
OPTIONS+=(c "C-lightning on $CHAIN" ${tcln}) OPTIONS+=(c "C-lightning on $CHAIN" ${tcl})
OPTIONS+=(t "RTL for CLN on $CHAIN" ${tcrtlWebinterface}) OPTIONS+=(t "RTL for CL on $CHAIN" ${tcrtlWebinterface})
OPTIONS+=(s "Sparko for CLN on $CHAIN" ${tsparko}) OPTIONS+=(s "Sparko for CL on $CHAIN" ${tsparko})
CHOICES=$(dialog --title ' Additional Services ' \ CHOICES=$(dialog --title ' Additional Services ' \
--checklist ' use spacebar to activate/de-activate ' \ --checklist ' use spacebar to activate/de-activate ' \
@ -68,26 +68,26 @@ else
echo "# LND on $CHAIN Setting unchanged." echo "# LND on $CHAIN Setting unchanged."
fi fi
# tcln process choice # tcl process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "c") choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${tcln}" != "${choice}" ]; then if [ "${tcl}" != "${choice}" ]; then
echo "# CLN on $CHAIN Setting changed .." echo "# CL on $CHAIN Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/cln.install.sh ${choice} $CHAIN /home/admin/config.scripts/cl.install.sh ${choice} $CHAIN
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
echo "# Successfully installed CLN on $CHAIN" echo "# Successfully installed CL on $CHAIN"
else else
l1="# !!! FAIL on CLN on $CHAIN install !!!" l1="# !!! FAIL on CL on $CHAIN install !!!"
l2="# Try manual install on terminal after reboot with:" l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cln.install.sh on $CHAIN" l3="/home/admin/config.scripts/cl.install.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi
else else
echo "# CLN on $CHAIN Setting unchanged." echo "# CL on $CHAIN Setting unchanged."
fi fi
# tRTL process choice # tRTL process choice
@ -119,25 +119,25 @@ fi
choice="off"; check=$(echo "${CHOICES}" | grep -c "t") choice="off"; check=$(echo "${CHOICES}" | grep -c "t")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${tcrtlWebinterface}" != "${choice}" ]; then if [ "${tcrtlWebinterface}" != "${choice}" ]; then
echo "RTL for CLN $CHAIN Setting changed .." echo "RTL for CL $CHAIN Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/bonus.rtl.sh ${choice} cln $CHAIN /home/admin/config.scripts/bonus.rtl.sh ${choice} cl $CHAIN
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start tcRTL sudo systemctl start tcRTL
echo "waiting 10 secs .." echo "waiting 10 secs .."
sleep 10 sleep 10
/home/admin/config.scripts/bonus.rtl.sh menu cln $CHAIN /home/admin/config.scripts/bonus.rtl.sh menu cl $CHAIN
else else
l1="!!! FAIL on RTL for CLN $CHAIN install !!!" l1="!!! FAIL on RTL for CL $CHAIN install !!!"
l2="Try manual install on terminal after reboot with:" l2="Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/bonus.rtl.sh on cln $CHAIN" l3="/home/admin/config.scripts/bonus.rtl.sh on cl $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi
else else
echo "RTL for CLN $CHAIN Setting unchanged." echo "RTL for CL $CHAIN Setting unchanged."
fi fi
# tsparko process choice # tsparko process choice
@ -146,15 +146,15 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${tsparko}" != "${choice}" ]; then if [ "${tsparko}" != "${choice}" ]; then
echo "# Sparko on $CHAIN Setting changed .." echo "# Sparko on $CHAIN Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/cln-plugin.sparko.sh ${choice} $CHAIN /home/admin/config.scripts/cl-plugin.sparko.sh ${choice} $CHAIN
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cln-plugin.sparko.sh menu $CHAIN /home/admin/config.scripts/cl-plugin.sparko.sh menu $CHAIN
else else
l1="# !!! FAIL on Sparko on $CHAIN install !!!" l1="# !!! FAIL on Sparko on $CHAIN install !!!"
l2="# Try manual install on terminal after reboot with:" l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cln-plugin.sparko.sh on $CHAIN" l3="/home/admin/config.scripts/cl-plugin.sparko.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi

View File

@ -141,9 +141,9 @@ do
/home/admin/config.scripts/lnd.unlock.sh /home/admin/config.scripts/lnd.unlock.sh
fi fi
# CLN Wallet Unlock # CL Wallet Unlock
if [ "${CLNwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then if [ "${CLwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then
/home/admin/config.scripts/cln.hsmtool.sh unlock /home/admin/config.scripts/cl.hsmtool.sh unlock
sleep 5 sleep 5
fi fi
@ -306,7 +306,7 @@ if [ "${setupPhase}" == "done" ]; then
if [ "${lightning}" == "lnd" ]; then if [ "${lightning}" == "lnd" ]; then
echo "LND command line options: lncli -h" echo "LND command line options: lncli -h"
fi fi
if [ "${lightning}" == "cln" ]; then if [ "${lightning}" == "cl" ]; then
echo "C-Lightning command line options: lightning-cli help" echo "C-Lightning command line options: lightning-cli help"
fi fi
else else

View File

@ -16,8 +16,8 @@ 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 [ ${#clboss} -eq 0 ]; then clboss="off"; fi
if [ ${#clnEncryptedHSM} -eq 0 ]; then clnEncryptedHSM="off"; fi if [ ${#clEncryptedHSM} -eq 0 ]; then clEncryptedHSM="off"; fi
if [ ${#clnAutoUnlock} -eq 0 ]; then clnAutoUnlock="off"; fi if [ ${#clAutoUnlock} -eq 0 ]; then clAutoUnlock="off"; fi
echo "# map LND to on/off" echo "# map LND to on/off"
lndNode="off" lndNode="off"
@ -25,10 +25,10 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
lndNode="on" lndNode="on"
fi fi
echo "# map CLN to on/off" echo "# map CL to on/off"
clnNode="off" clNode="off"
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
clnNode="on" clNode="on"
fi fi
echo "map nextcloudbackup to on/off" echo "map nextcloudbackup to on/off"
@ -90,16 +90,16 @@ if [ "${clboss}" == "on" ]; then
clbossMenu='on' clbossMenu='on'
fi fi
echo "# map clnEncryptedHSM to on/off" echo "# map clEncryptedHSM to on/off"
clnEncryptedHSMMenu='off' clEncryptedHSMMenu='off'
if [ "${clnEncryptedHSM}" == "on" ]; then if [ "${clEncryptedHSM}" == "on" ]; then
clnEncryptedHSMMenu='on' clEncryptedHSMMenu='on'
fi fi
echo "# map clnAutoUnlock to on/off" echo "# map clAutoUnlock to on/off"
clnAutoUnlockMenu='off' clAutoUnlockMenu='off'
if [ "${clnAutoUnlock}" == "on" ]; then if [ "${clAutoUnlock}" == "on" ]; then
clnAutoUnlockMenu='on' clAutoUnlockMenu='on'
fi fi
# show select dialog # show select dialog
@ -137,12 +137,12 @@ if [ "${lndNode}" == "on" ]; then
fi fi
# C-Lightning & options/PlugIns # C-Lightning & options/PlugIns
OPTIONS+=(n 'CLN C-LIGHTNING NODE' ${clnNode}) OPTIONS+=(n 'CL C-LIGHTNING NODE' ${clNode})
if [ "${clnNode}" == "on" ]; then if [ "${clNode}" == "on" ]; then
OPTIONS+=(o '-CLN CLBOSS Automatic Node Manager' ${clbossMenu}) OPTIONS+=(o '-CL CLBOSS Automatic Node Manager' ${clbossMenu})
OPTIONS+=(h '-CLN Wallet Encryption' ${clnEncryptedHSMMenu}) OPTIONS+=(h '-CL Wallet Encryption' ${clEncryptedHSMMenu})
if [ "${clnEncryptedHSM}" == "on" ]; then if [ "${clEncryptedHSM}" == "on" ]; then
OPTIONS+=(q '-CLN Auto-Unlock' ${clnAutoUnlockMenu}) OPTIONS+=(q '-CL Auto-Unlock' ${clAutoUnlockMenu})
fi fi
fi fi
@ -409,27 +409,27 @@ else
echo "LND NODE setting unchanged." echo "LND NODE setting unchanged."
fi fi
# CLN choice # CL choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "n") choice="off"; check=$(echo "${CHOICES}" | grep -c "n")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnNode}" != "${choice}" ]; then if [ "${clNode}" != "${choice}" ]; then
anychange=1 anychange=1
echo "# C-Lightning NODE Setting changed .." echo "# C-Lightning NODE Setting changed .."
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
echo "# turning ON" echo "# turning ON"
/home/admin/config.scripts/cln.install.sh on mainnet /home/admin/config.scripts/cl.install.sh on mainnet
sudo /home/admin/config.scripts/cln.install.sh display-seed mainnet sudo /home/admin/config.scripts/cl.install.sh display-seed mainnet
if [ "${testnet}" == "on" ]; then if [ "${testnet}" == "on" ]; then
/home/admin/config.scripts/cln.install.sh on testnet /home/admin/config.scripts/cl.install.sh on testnet
fi fi
if [ "${signet}" == "on" ]; then if [ "${signet}" == "on" ]; then
/home/admin/config.scripts/cln.install.sh on signet /home/admin/config.scripts/cl.install.sh on signet
fi fi
else else
echo "# turning OFF" echo "# turning OFF"
/home/admin/config.scripts/cln.install.sh off mainnet /home/admin/config.scripts/cl.install.sh off mainnet
/home/admin/config.scripts/cln.install.sh off testnet /home/admin/config.scripts/cl.install.sh off testnet
/home/admin/config.scripts/cln.install.sh off signet /home/admin/config.scripts/cl.install.sh off signet
fi fi
else else
echo "C-Lightning NODE setting unchanged." echo "C-Lightning NODE setting unchanged."
@ -438,45 +438,45 @@ fi
# CLBOSS process choice # CLBOSS 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
if [ "${clboss}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then if [ "${clboss}" != "${choice}" ] && [ "${clNode}" == "on" ]; then
echo "CLBOSS Setting changed .." echo "CLBOSS Setting changed .."
anychange=1 anychange=1
sudo /home/admin/config.scripts/cln-plugin.clboss.sh ${choice} sudo /home/admin/config.scripts/cl-plugin.clboss.sh ${choice}
needsReboot=0 needsReboot=0
else else
echo "CLBOSS Setting unchanged." echo "CLBOSS Setting unchanged."
fi fi
# clnEncryptedHSM process choice # clEncryptedHSM process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "h") choice="off"; check=$(echo "${CHOICES}" | grep -c "h")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnEncryptedHSM}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then if [ "${clEncryptedHSM}" != "${choice}" ] && [ "${clNode}" == "on" ]; then
echo "clnEncryptedHSM Setting changed .." echo "clEncryptedHSM Setting changed .."
anychange=1 anychange=1
if [ "${choice}" == "on" ]; then if [ "${choice}" == "on" ]; then
/home/admin/config.scripts/cln.hsmtool.sh encrypt mainnet /home/admin/config.scripts/cl.hsmtool.sh encrypt mainnet
else else
/home/admin/config.scripts/cln.hsmtool.sh decrypt mainnet /home/admin/config.scripts/cl.hsmtool.sh decrypt mainnet
fi fi
needsReboot=0 needsReboot=0
else else
echo "clnEncryptedHSM Setting unchanged." echo "clEncryptedHSM Setting unchanged."
fi fi
# clnAutoUnlock process choice # clAutoUnlock process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "q") choice="off"; check=$(echo "${CHOICES}" | grep -c "q")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${clnAutoUnlock}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then if [ "${clAutoUnlock}" != "${choice}" ] && [ "${clNode}" == "on" ]; then
echo "clnAutoUnlock Setting changed .." echo "clAutoUnlock Setting changed .."
anychange=1 anychange=1
if [ "${choice}" == "on" ]; then if [ "${choice}" == "on" ]; then
/home/admin/config.scripts/cln.hsmtool.sh autounlock-on mainnet /home/admin/config.scripts/cl.hsmtool.sh autounlock-on mainnet
else else
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off mainnet /home/admin/config.scripts/cl.hsmtool.sh autounlock-off mainnet
fi fi
needsReboot=0 needsReboot=0
else else
echo "clnAutoUnlock Setting unchanged." echo "clAutoUnlock Setting unchanged."
fi fi
# parallel testnet process choice # parallel testnet process choice
@ -492,16 +492,16 @@ if [ "${testnet}" != "${choice}" ]; then
/home/admin/config.scripts/lnd.install.sh on testnet initwallet /home/admin/config.scripts/lnd.install.sh on testnet initwallet
/home/admin/config.scripts/lnd.install.sh on signet initwallet /home/admin/config.scripts/lnd.install.sh on signet initwallet
fi fi
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
/home/admin/config.scripts/cln.install.sh on testnet /home/admin/config.scripts/cl.install.sh on testnet
/home/admin/config.scripts/cln.install.sh on signet /home/admin/config.scripts/cl.install.sh on signet
fi fi
else else
# just turn al lightning testnets off (even if not on before) # just turn al lightning testnets off (even if not on before)
/home/admin/config.scripts/lnd.install.sh off testnet /home/admin/config.scripts/lnd.install.sh off testnet
/home/admin/config.scripts/lnd.install.sh off signet /home/admin/config.scripts/lnd.install.sh off signet
/home/admin/config.scripts/cln.install.sh off testnet /home/admin/config.scripts/cl.install.sh off testnet
/home/admin/config.scripts/cln.install.sh off signet /home/admin/config.scripts/cl.install.sh off signet
/home/admin/config.scripts/bitcoin.install.sh off testnet /home/admin/config.scripts/bitcoin.install.sh off testnet
/home/admin/config.scripts/bitcoin.install.sh off signet /home/admin/config.scripts/bitcoin.install.sh off signet
fi fi

View File

@ -54,8 +54,8 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
OPTIONS+=(x 'LND Sphinx-Relay' ${sphinxrelay}) OPTIONS+=(x 'LND Sphinx-Relay' ${sphinxrelay})
fi fi
# just available for CLN # just available for CL
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
OPTIONS+=(c 'C-Lightning RTL Webinterface' ${crtlWebinterface}) OPTIONS+=(c 'C-Lightning RTL Webinterface' ${crtlWebinterface})
OPTIONS+=(k 'C-Lightning Sparko WebWallet' ${sparko}) OPTIONS+=(k 'C-Lightning Sparko WebWallet' ${sparko})
fi fi
@ -111,25 +111,25 @@ fi
choice="off"; check=$(echo "${CHOICES}" | grep -c "c") choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${crtlWebinterface}" != "${choice}" ]; then if [ "${crtlWebinterface}" != "${choice}" ]; then
echo "RTL-cln Webinterface Setting changed .." echo "RTL-cl Webinterface Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/bonus.rtl.sh ${choice} cln mainnet /home/admin/config.scripts/bonus.rtl.sh ${choice} cl mainnet
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start RTL sudo systemctl start RTL
echo "waiting 10 secs .." echo "waiting 10 secs .."
sleep 10 sleep 10
/home/admin/config.scripts/bonus.rtl.sh menu cln mainnet /home/admin/config.scripts/bonus.rtl.sh menu cl mainnet
else else
l1="!!! FAIL on RTL C-Lightning install !!!" l1="!!! FAIL on RTL C-Lightning install !!!"
l2="Try manual install on terminal after reboot with:" l2="Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/bonus.rtl.sh on cln mainnet" l3="/home/admin/config.scripts/bonus.rtl.sh on cl mainnet"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi
else else
echo "RTL-cln Webinterface Setting unchanged." echo "RTL-cl Webinterface Setting unchanged."
fi fi
# BTC-RPC-Explorer process choice # BTC-RPC-Explorer process choice
@ -480,15 +480,15 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${sparko}" != "${choice}" ]; then if [ "${sparko}" != "${choice}" ]; then
echo "# Sparko on mainnet Setting changed .." echo "# Sparko on mainnet Setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/cln-plugin.sparko.sh ${choice} mainnet /home/admin/config.scripts/cl-plugin.sparko.sh ${choice} mainnet
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cln-plugin.sparko.sh menu mainnet /home/admin/config.scripts/cl-plugin.sparko.sh menu mainnet
else else
l1="# !!! FAIL on Sparko on mainnet install !!!" l1="# !!! FAIL on Sparko on mainnet install !!!"
l2="# Try manual install on terminal after reboot with:" l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cln-plugin.sparko.sh on mainnet" l3="/home/admin/config.scripts/cl-plugin.sparko.sh on mainnet"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi fi
fi fi

View File

@ -6,7 +6,7 @@ source /mnt/hdd/raspiblitz.conf
if [ "$1" = "-h" ] || [ "$1" = "-help" ];then if [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo "Usage:" echo "Usage:"
echo "97addMobileWallet.sh <lnd|cln> <mainnet|testnet|signet>" echo "97addMobileWallet.sh <lnd|cl> <mainnet|testnet|signet>"
echo "defaults from the configs are:" echo "defaults from the configs are:"
echo "ligthning=${lightning}" echo "ligthning=${lightning}"
echo "chain=${chain}" echo "chain=${chain}"
@ -153,9 +153,9 @@ if [ $lightning = "lnd" ]; then
# add SEND MANY APP # add SEND MANY APP
OPTIONS+=(SENDMANY_ANDROID "SendMany (Android)") OPTIONS+=(SENDMANY_ANDROID "SendMany (Android)")
elif [ $lightning = "cln" ]; then elif [ $lightning = "cl" ]; then
OPTIONS=(ZEUS_CLNREST "Zeus to C-lightningREST (Android or iOS)" \ OPTIONS=(ZEUS_CLREST "Zeus to C-lightningREST (Android or iOS)" \
ZEUS_SPARK "Zeus to Sparko (Android or iOS)" \ ZEUS_SPARK "Zeus to Sparko (Android or iOS)" \
SPARK "Spark Wallet to Sparko (Android - EXPERIMENTAL)" SPARK "Spark Wallet to Sparko (Android - EXPERIMENTAL)"
) )
@ -332,7 +332,7 @@ Or scan the qr code on the LCD with your mobile phone.
exit 0; exit 0;
;; ;;
ZEUS_CLNREST) ZEUS_CLREST)
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zeus.png /home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zeus.png
whiptail --title "Install Zeus on your Android or iOS Phone" \ whiptail --title "Install Zeus on your Android or iOS Phone" \
--yes-button "Continue" \ --yes-button "Continue" \
@ -342,7 +342,7 @@ ZEUS_CLNREST)
exit 0 exit 0
fi fi
/home/admin/config.scripts/blitz.display.sh hide /home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/cln.rest.sh connect /home/admin/config.scripts/cl.rest.sh connect
exit 0; exit 0;
;; ;;
ZEUS_SPARK) ZEUS_SPARK)
@ -355,7 +355,7 @@ ZEUS_SPARK)
exit 0 exit 0
fi fi
/home/admin/config.scripts/blitz.display.sh hide /home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/cln-plugin.sparko.sh connect /home/admin/config.scripts/cl-plugin.sparko.sh connect
exit 0; exit 0;
;; ;;
SPARK) SPARK)
@ -374,7 +374,7 @@ Or scan the QR code on the LCD with your mobile phone.
" 11 70 " 11 70
fi fi
/home/admin/config.scripts/blitz.display.sh hide /home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/cln-plugin.sparko.sh connect /home/admin/config.scripts/cl-plugin.sparko.sh connect
exit 0; exit 0;
;; ;;

View File

@ -53,8 +53,8 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
OPTIONS+=(BACKUP-LND "Backup your LND data (Rescue-File)") OPTIONS+=(BACKUP-LND "Backup your LND data (Rescue-File)")
OPTIONS+=(RESET-LND "Delete LND & start new node/wallet") OPTIONS+=(RESET-LND "Delete LND & start new node/wallet")
fi fi
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
OPTIONS+=(REPAIR-CLN "Repair/Backup C-Lightning") OPTIONS+=(REPAIR-CL "Repair/Backup C-Lightning")
fi fi
OPTIONS+=(MIGRATION "Migrate Blitz Data to new Hardware") OPTIONS+=(MIGRATION "Migrate Blitz Data to new Hardware")
OPTIONS+=(COPY-SOURCE "Copy Blockchain Source Modus") OPTIONS+=(COPY-SOURCE "Copy Blockchain Source Modus")
@ -82,8 +82,8 @@ case $CHOICE in
read key read key
/home/admin/config.scripts/blitz.shutdown.sh /home/admin/config.scripts/blitz.shutdown.sh
;; ;;
REPAIR-CLN) REPAIR-CL)
sudo /home/admin/99clnRepairMenu.sh sudo /home/admin/99clRepairMenu.sh
echo echo
echo "Press ENTER to return to main menu." echo "Press ENTER to return to main menu."
read key read key

View File

@ -5,7 +5,7 @@ echo "# get raspiblitz config"
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
# get the local network IP to be displayed on the LCD # get the local network IP to be displayed on the LCD
source <(/home/admin/config.scripts/internet.sh status local) source <(/home/admin/config.scripts/internet.sh status local)
@ -25,16 +25,16 @@ OPTIONS=()
OPTIONS+=(NAME "Change the name / alias of the node") OPTIONS+=(NAME "Change the name / alias of the node")
ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null) ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null)
ln_channels_online="$(echo "${ln_getInfo}" | jq -r '.num_active_channels')" 2>/dev/null ln_channels_online="$(echo "${ln_getInfo}" | jq -r '.num_active_channels')" 2>/dev/null
cln_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null cl_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null
openChannels=$((ln_channels_online+cln_num_inactive_channels)) openChannels=$((ln_channels_online+cl_num_inactive_channels))
if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
OPTIONS+=(SUEZ "Visualize channels") OPTIONS+=(SUEZ "Visualize channels")
OPTIONS+=(CLOSEALL "Close all open channels on $CHAIN") OPTIONS+=(CLOSEALL "Close all open channels on $CHAIN")
fi fi
OPTIONS+=(CASHOUT "Withdraw all funds onchain ($CHAIN)") OPTIONS+=(CASHOUT "Withdraw all funds onchain ($CHAIN)")
OPTIONS+=(SEED "Show Wallet Seed Words") OPTIONS+=(SEED "Show Wallet Seed Words")
OPTIONS+=(CLNREPAIR "Repair options for C-lightning") OPTIONS+=(CLREPAIR "Repair options for C-lightning")
if [ "${lightning}" != "cln" ] && [ "${CHAIN}" == "mainnet" ]; then if [ "${lightning}" != "cl" ] && [ "${CHAIN}" == "mainnet" ]; then
OPTIONS+=(SWITCHLN "Use C-lightning as default") OPTIONS+=(SWITCHLN "Use C-lightning as default")
fi fi
@ -53,33 +53,33 @@ CHOICE=$(dialog --clear \
case $CHOICE in case $CHOICE in
SUMMARY) SUMMARY)
clear clear
/home/admin/config.scripts/cln-plugin.summary.sh $CHAIN /home/admin/config.scripts/cl-plugin.summary.sh $CHAIN
echo "Press ENTER to return to main menu." echo "Press ENTER to return to main menu."
read key read key
;; ;;
PEERING) PEERING)
/home/admin/BBconnectPeer.sh cln $CHAIN /home/admin/BBconnectPeer.sh cl $CHAIN
;; ;;
FUNDING) FUNDING)
/home/admin/BBfundWallet.sh cln $CHAIN /home/admin/BBfundWallet.sh cl $CHAIN
;; ;;
CASHOUT) CASHOUT)
/home/admin/BBcashoutWallet.sh cln $CHAIN /home/admin/BBcashoutWallet.sh cl $CHAIN
;; ;;
CHANNEL) CHANNEL)
/home/admin/BBopenChannel.sh cln $CHAIN /home/admin/BBopenChannel.sh cl $CHAIN
;; ;;
SEND) SEND)
/home/admin/BBpayInvoice.sh cln $CHAIN /home/admin/BBpayInvoice.sh cl $CHAIN
;; ;;
RECEIVE) RECEIVE)
/home/admin/BBcreateInvoice.sh cln $CHAIN /home/admin/BBcreateInvoice.sh cl $CHAIN
;; ;;
SEED) SEED)
sudo /home/admin/config.scripts/cln.install.sh display-seed $CHAIN sudo /home/admin/config.scripts/cl.install.sh display-seed $CHAIN
;; ;;
NAME) NAME)
sudo /home/admin/config.scripts/cln.setname.sh $CHAIN sudo /home/admin/config.scripts/cl.setname.sh $CHAIN
;; ;;
SUEZ) SUEZ)
clear clear
@ -87,7 +87,7 @@ case $CHOICE in
/home/admin/config.scripts/bonus.suez.sh on /home/admin/config.scripts/bonus.suez.sh on
fi fi
cd /home/bitcoin/suez || exit 0 cd /home/bitcoin/suez || exit 0
command="sudo -u bitcoin /home/bitcoin/.local/bin/poetry run ./suez --client=c-lightning --client-args=--conf=${CLNCONF}" command="sudo -u bitcoin /home/bitcoin/.local/bin/poetry run ./suez --client=c-lightning --client-args=--conf=${CLCONF}"
echo "# Running the command:" echo "# Running the command:"
echo "${command}" echo "${command}"
echo echo
@ -97,19 +97,19 @@ case $CHOICE in
read key read key
;; ;;
CLOSEALL) CLOSEALL)
/home/admin/BBcloseAllChannels.sh cln $CHAIN /home/admin/BBcloseAllChannels.sh cl $CHAIN
echo "Press ENTER to return to main menu." echo "Press ENTER to return to main menu."
read key read key
;; ;;
CLNREPAIR) CLREPAIR)
/home/admin/99clnRepairMenu.sh $CHAIN /home/admin/99clRepairMenu.sh $CHAIN
;; ;;
SWITCHLN) SWITCHLN)
clear clear
echo echo
# setting value in the raspiblitz.conf # setting value in the raspiblitz.conf
sudo sed -i "s/^lightning=.*/lightning=cln/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^lightning=.*/lightning=cl/g" /mnt/hdd/raspiblitz.conf
echo "# OK - lightning=cln is set in /mnt/hdd/raspiblitz.conf" echo "# OK - lightning=cl is set in /mnt/hdd/raspiblitz.conf"
echo echo
echo "Press ENTER to return to main menu." echo "Press ENTER to return to main menu."
read key read key

View File

@ -5,11 +5,11 @@ echo "# get raspiblitz config"
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
# get the local network IP to be displayed on the LCD # get the local network IP to be displayed on the LCD
source <(/home/admin/config.scripts/internet.sh status local) source <(/home/admin/config.scripts/internet.sh status local)
NETclnEncryptedHSM="${netprefix}clnEncryptedHSM" NETclEncryptedHSM="${netprefix}clEncryptedHSM"
# BASIC MENU INFO # BASIC MENU INFO
WIDTH=64 WIDTH=64
@ -18,12 +18,12 @@ TITLE="C-lightning repair options for $CHAIN"
MENU="" MENU=""
OPTIONS=() OPTIONS=()
if [ "$(eval echo \$${netprefix}clnEncryptedHSM)" = "off" ];then if [ "$(eval echo \$${netprefix}clEncryptedHSM)" = "off" ];then
OPTIONS+=(ENCRYPT "Encrypt the hsm_secret") OPTIONS+=(ENCRYPT "Encrypt the hsm_secret")
elif [ "$(eval echo \$${netprefix}clnEncryptedHSM)" = "on" ];then elif [ "$(eval echo \$${netprefix}clEncryptedHSM)" = "on" ];then
OPTIONS+=(PASSWORD_C "Change the hsm_secret encryption password") OPTIONS+=(PASSWORD_C "Change the hsm_secret encryption password")
OPTIONS+=(DECRYPT "Decrypt the hsm_secret") OPTIONS+=(DECRYPT "Decrypt the hsm_secret")
if [ ! -f "/root/.${netprefix}cln.pw" ]; then if [ ! -f "/root/.${netprefix}cl.pw" ]; then
OPTIONS+=(AUTOUNLOCK-ON "Auto-decrypt the hsm_secret after boot") OPTIONS+=(AUTOUNLOCK-ON "Auto-decrypt the hsm_secret after boot")
else else
OPTIONS+=(AUTOUNLOCK-OFF "Do not auto-decrypt the hsm_secret after boot") OPTIONS+=(AUTOUNLOCK-OFF "Do not auto-decrypt the hsm_secret after boot")
@ -48,25 +48,25 @@ CHOICE=$(dialog --clear \
case $CHOICE in case $CHOICE in
ENCRYPT) ENCRYPT)
/home/admin/config.scripts/cln.hsmtool.sh encrypt $CHAIN /home/admin/config.scripts/cl.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/cl.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/cl.hsmtool.sh change-password $CHAIN
;; ;;
AUTOUNLOCK-ON) AUTOUNLOCK-ON)
/home/admin/config.scripts/cln.hsmtool.sh autounlock-on $CHAIN /home/admin/config.scripts/cl.hsmtool.sh autounlock-on $CHAIN
;; ;;
AUTOUNLOCK-OFF) AUTOUNLOCK-OFF)
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off $CHAIN /home/admin/config.scripts/cl.hsmtool.sh autounlock-off $CHAIN
;; ;;
BACKUP) BACKUP)
@ -74,7 +74,7 @@ case $CHOICE in
# 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/cl.backup.sh cl-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
;; ;;
@ -84,11 +84,11 @@ case $CHOICE in
## 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/cl.backup.sh cl-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 cl-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
@ -97,22 +97,22 @@ case $CHOICE in
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}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=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}clAutoUnlock=.*/${netprefix}clEncryptedHSM=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/cl.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 [ "${cl}" == "on" ] || [ "${cl}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh mainnet /home/admin/config.scripts/cl.install-service.sh mainnet
fi fi
if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then if [ "${tcl}" == "on" ] || [ "${tcl}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh testnet /home/admin/config.scripts/cl.install-service.sh testnet
fi fi
if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then if [ "${scl}" == "on" ] || [ "${scl}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh signet /home/admin/config.scripts/cl.install-service.sh signet
fi fi
;; ;;
@ -121,11 +121,11 @@ case $CHOICE in
## 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/cl.backup.sh cl-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 cl-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
@ -135,7 +135,7 @@ case $CHOICE in
# 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/cl.backup.sh cl-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
;; ;;
@ -145,11 +145,11 @@ case $CHOICE in
## 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/cl.backup.sh cl-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 cl-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
@ -159,14 +159,14 @@ case $CHOICE in
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/cl.backup.sh seed-import-gui $_temp
/home/admin/config.scripts/cln.hsmtool.sh seed "$CHAIN" "$(cat $_temp)" /home/admin/config.scripts/cl.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/cl.hsmtool.sh autounlock-off
/home/admin/config.scripts/cln.hsmtool.sh decrypt /home/admin/config.scripts/cl.hsmtool.sh decrypt
/home/admin/config.scripts/cln.install.sh on $CHAIN /home/admin/config.scripts/cl.install.sh on $CHAIN
;; ;;
esac esac

View File

@ -5,8 +5,8 @@ echo "get raspiblitz config"
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cln> <mainnet|testnet|signet>) # source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cl> <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
# BASIC MENU INFO # BASIC MENU INFO
WIDTH=64 WIDTH=64
@ -23,9 +23,9 @@ if grep "^${netprefix}lnd=on" /mnt/hdd/raspiblitz.conf;then
OPTIONS+=(LNDCONF "Edit the lnd.conf for ${CHAIN}") OPTIONS+=(LNDCONF "Edit the lnd.conf for ${CHAIN}")
fi fi
if grep "^${netprefix}cln=on" /mnt/hdd/raspiblitz.conf;then if grep "^${netprefix}cl=on" /mnt/hdd/raspiblitz.conf;then
OPTIONS+=(CLNLOG "Monitor the CLN log for ${CHAIN}") OPTIONS+=(CLLOG "Monitor the CL log for ${CHAIN}")
OPTIONS+=(CLNCONF "Edit the CLN config for ${CHAIN}") OPTIONS+=(CLCONF "Edit the CL config for ${CHAIN}")
fi fi
if [ "${runBehindTor}" == "on" ] && [ "${netprefix}" == "" ]; then if [ "${runBehindTor}" == "on" ] && [ "${netprefix}" == "" ]; then
@ -110,7 +110,7 @@ case $CHOICE in
else else
echo "# No change made" echo "# No change made"
fi;; fi;;
CLNLOG) CLLOG)
clear clear
echo echo
echo "Will follow the /home/bitcoin/.lightning/${CLNETWORK}/cl.log" echo "Will follow the /home/bitcoin/.lightning/${CLNETWORK}/cl.log"
@ -121,8 +121,8 @@ case $CHOICE in
echo "###############################################################################" echo "###############################################################################"
read key read key
sudo tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log;; sudo tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log;;
CLNCONF) CLCONF)
if /home/admin/config.scripts/blitz.setconf.sh "${CLNCONF}" "root" if /home/admin/config.scripts/blitz.setconf.sh "${CLCONF}" "root"
then then
whiptail \ whiptail \
--title "Restart" --yes-button "Restart" --no-button "Not now" \ --title "Restart" --yes-button "Restart" --no-button "Not now" \

View File

@ -42,8 +42,8 @@ Do you want to download Lightning Data Backup now?
sleep 2 sleep 2
if [ "${lightning}" == "lnd" ]; then if [ "${lightning}" == "lnd" ]; then
/home/admin/config.scripts/lnd.backup.sh lnd-export-gui /home/admin/config.scripts/lnd.backup.sh lnd-export-gui
elif [ "${lightning}" == "cln" ]; then elif [ "${lightning}" == "cl" ]; then
/home/admin/config.scripts/cln.backup.sh cln-export-gui /home/admin/config.scripts/cl.backup.sh cl-export-gui
else else
echo "TODO: Implement Data Backup for '${lightning}'" echo "TODO: Implement Data Backup for '${lightning}'"
fi fi
@ -59,8 +59,8 @@ Do you want to download Lightning Data Backup now?
sleep 2 sleep 2
if [ "${lightning}" == "lnd" ]; then if [ "${lightning}" == "lnd" ]; then
/home/admin/config.scripts/lnd.backup.sh lnd-export /home/admin/config.scripts/lnd.backup.sh lnd-export
elif [ "${lightning}" == "cln" ]; then elif [ "${lightning}" == "cl" ]; then
/home/admin/config.scripts/cln.backup.sh cln-export /home/admin/config.scripts/cl.backup.sh cl-export
else else
echo "TODO: Implement Data Backup for '${lightning}'" echo "TODO: Implement Data Backup for '${lightning}'"
sleep 3 sleep 3

View File

@ -18,11 +18,11 @@ fi
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2) source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
# check if user has money in lightning channels - info about close all # check if user has money in lightning channels - info about close all
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null) ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null)
ln_channels_online="$(echo "${ln_getInfo}" | jq -r '.num_active_channels')" 2>/dev/null ln_channels_online="$(echo "${ln_getInfo}" | jq -r '.num_active_channels')" 2>/dev/null
cln_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null cl_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null
openChannels=$((ln_channels_online+cln_num_inactive_channels)) openChannels=$((ln_channels_online+cl_num_inactive_channels))
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
openChannels=$($lncli_alias listchannels 2>/dev/null | jq '.[] | length') openChannels=$($lncli_alias listchannels 2>/dev/null | jq '.[] | length')
fi fi
@ -47,10 +47,10 @@ if [ ${openChannels} -gt 0 ]; then
fi fi
# check if money is waiting to get confirmed # check if money is waiting to get confirmed
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
ln_walletbalance_wait=0 ln_walletbalance_wait=0
cln_listfunds=$($lightningcli_alias listfunds 2>/dev/null) cl_listfunds=$($lightningcli_alias listfunds 2>/dev/null)
for i in $(echo "$cln_listfunds" \ for i in $(echo "$cl_listfunds" \
|jq .outputs[]|jq 'select(.status=="unconfirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do |jq .outputs[]|jq 'select(.status=="unconfirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
ln_walletbalance_wait=$((ln_walletbalance_wait+i)) ln_walletbalance_wait=$((ln_walletbalance_wait+i))
done done
@ -91,7 +91,7 @@ echo "Sweep all possible Funds"
echo "******************************" echo "******************************"
# execute command # execute command
if [ ${LNTYPE} = "cln" ];then if [ ${LNTYPE} = "cl" ];then
# withdraw destination satoshi [feerate] [minconf] [utxos] # withdraw destination satoshi [feerate] [minconf] [utxos]
command="$lightningcli_alias withdraw ${address} all slow" command="$lightningcli_alias withdraw ${address} all slow"
elif [ ${LNTYPE} = "lnd" ];then elif [ ${LNTYPE} = "lnd" ];then

View File

@ -11,19 +11,19 @@ fi
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2) source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
# https://lightning.readthedocs.io/lightning-close.7.html # https://lightning.readthedocs.io/lightning-close.7.html
peerlist=$($lightningcli_alias listpeers|grep '"id":'|awk '{print $2}'|cut -d, -f1) peerlist=$($lightningcli_alias listpeers|grep '"id":'|awk '{print $2}'|cut -d, -f1)
# to display # to display
function cln_closeall_command { function cl_closeall_command {
for i in $peerlist; do for i in $peerlist; do
# close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*] # close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*]
echo "$lightningcli_alias close $i 30;" echo "$lightningcli_alias close $i 30;"
done done
} }
command=$(cln_closeall_command) command=$(cl_closeall_command)
# to run # to run
function cln_closeall { function cl_closeall {
for i in $peerlist; do for i in $peerlist; do
# close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*] # close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*]
echo "# Attempting a mutual close one-by-one with a 30 seconds timeout" echo "# Attempting a mutual close one-by-one with a 30 seconds timeout"
@ -42,7 +42,7 @@ fi
clear clear
echo echo
echo "# Precheck" # PRECHECK) check if chain is in sync echo "# Precheck" # PRECHECK) check if chain is in sync
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1) BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight) CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
@ -54,7 +54,7 @@ elif [ $LNTYPE = lnd ];then
chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c) chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c)
fi fi
if [ ${chainOutSync} -eq 1 ]; then if [ ${chainOutSync} -eq 1 ]; then
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
echo "# FAIL PRECHECK - '${netprefix}lightning-cli getinfo' blockheight is different from '${netprefix}bitcoind getblockchaininfo' - wait until chain is sync " echo "# FAIL PRECHECK - '${netprefix}lightning-cli getinfo' blockheight is different from '${netprefix}bitcoind getblockchaininfo' - wait until chain is sync "
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
echo "# FAIL PRECHECK - ${netprefix}lncli getinfo shows 'synced_to_chain': false - wait until chain is sync " echo "# FAIL PRECHECK - ${netprefix}lncli getinfo shows 'synced_to_chain': false - wait until chain is sync "
@ -78,8 +78,8 @@ echo "# RESULT:"
# execute command # execute command
if [ ${#command} -gt 0 ]; then if [ ${#command} -gt 0 ]; then
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
cln_closeall cl_closeall
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
${command} ${command}
fi fi

View File

@ -41,7 +41,7 @@ pubkey=$(echo "${_input}"|cut -d@ -f1)
# address=$(echo "${_input}"|cut -d@ -f2|cut -d: -f1) # address=$(echo "${_input}"|cut -d@ -f2|cut -d: -f1)
# port=$(echo "${_input}"|cut -d: -f2) # port=$(echo "${_input}"|cut -d: -f2)
# build command # build command
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
# connect id [host port] # connect id [host port]
command="$lightningcli_alias connect ${_input}" command="$lightningcli_alias connect ${_input}"
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
@ -104,7 +104,7 @@ else
echo "$result" echo "$result"
# check if the node is now in peer list # check if the node is now in peer list
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
isPeer=$($lightningcli_alias listpeers 2>/dev/null| grep "${pubkey}" -c) isPeer=$($lightningcli_alias listpeers 2>/dev/null| grep "${pubkey}" -c)
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
isPeer=$($lncli_alias listpeers 2>/dev/null| grep "${pubkey}" -c) isPeer=$($lncli_alias listpeers 2>/dev/null| grep "${pubkey}" -c)

View File

@ -21,7 +21,7 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net) source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net)
# check if chain is in sync # check if chain is in sync
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
lncommand="${netprefix}lightning-cli" lncommand="${netprefix}lightning-cli"
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1) BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight) CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
@ -49,7 +49,7 @@ done
# check number of connected peers # check number of connected peers
echo "check for open channels" echo "check for open channels"
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
openChannels=$($lightningcli_alias listpeers | grep -c "CHANNELD_NORMAL") openChannels=$($lightningcli_alias listpeers | grep -c "CHANNELD_NORMAL")
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
openChannels=$($lncli_alias listchannels 2>/dev/null | grep chan_id -c) openChannels=$($lncli_alias listchannels 2>/dev/null | grep chan_id -c)
@ -81,7 +81,7 @@ fi
# TODO let user enter a description # TODO let user enter a description
# build command # build command
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
label=$(date +%s) # seconds since 1970-01-01 00:00:00 UTC label=$(date +%s) # seconds since 1970-01-01 00:00:00 UTC
# invoice msatoshi label description [expiry] [fallbacks] [preimage] [exposeprivatechannels] [cltv] # invoice msatoshi label description [expiry] [fallbacks] [preimage] [exposeprivatechannels] [cltv]
command="$lightningcli_alias invoice ${amount}sat $label ''" command="$lightningcli_alias invoice ${amount}sat $label ''"
@ -115,7 +115,7 @@ if [ ${#error} -gt 0 ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "${error}" echo "${error}"
else else
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
payReq=$(echo "$result" | grep bolt11 | cut -d '"' -f4) payReq=$(echo "$result" | grep bolt11 | cut -d '"' -f4)
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
rhash=$(echo "$result" | grep r_hash | cut -d '"' -f4) rhash=$(echo "$result" | grep r_hash | cut -d '"' -f4)
@ -139,7 +139,7 @@ else
echo "${payReq}" echo "${payReq}"
echo echo
echo "Monitoring the Incoming Payment with:" echo "Monitoring the Incoming Payment with:"
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
echo "$lightningcli_alias waitinvoice $label" echo "$lightningcli_alias waitinvoice $label"
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
echo "$lncli_alias lookupinvoice ${rhash}" echo "$lncli_alias lookupinvoice ${rhash}"
@ -148,7 +148,7 @@ else
while : while :
do do
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
result=$($lightningcli_alias waitinvoice $label) result=$($lightningcli_alias waitinvoice $label)
wasPayed=$(echo $result | grep -c 'paid') wasPayed=$(echo $result | grep -c 'paid')
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then

View File

@ -14,7 +14,7 @@ fi
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2) source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
# PRECHECK) check if chain is in sync # PRECHECK) check if chain is in sync
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1) BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight) CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
@ -26,7 +26,7 @@ elif [ $LNTYPE = lnd ];then
chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c) chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c)
fi fi
if [ ${chainOutSync} -eq 1 ]; then if [ ${chainOutSync} -eq 1 ]; then
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
echo "# FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync " echo "# FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync "
else else
echo "# FAIL PRECHECK - 'lightning-cli getinfo' blockheight is different from 'bitcoind getblockchaininfo' - wait until chain is sync " echo "# FAIL PRECHECK - 'lightning-cli getinfo' blockheight is different from 'bitcoind getblockchaininfo' - wait until chain is sync "
@ -40,7 +40,7 @@ else
fi fi
# execute command # execute command
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
command="$lightningcli_alias newaddr bech32" command="$lightningcli_alias newaddr bech32"
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
command="$lncli_alias newaddress p2wkh" command="$lncli_alias newaddress p2wkh"
@ -61,7 +61,7 @@ if [ ${#result} -eq 0 ]; then
fi fi
# parse address from result # parse address from result
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
address=$( echo "$result" | grep "bech32" | cut -d '"' -f4) address=$( echo "$result" | grep "bech32" | cut -d '"' -f4)
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
address=$( echo "$result" | grep "address" | cut -d '"' -f4) address=$( echo "$result" | grep "address" | cut -d '"' -f4)
@ -100,10 +100,10 @@ fi
/home/admin/config.scripts/blitz.display.sh hide /home/admin/config.scripts/blitz.display.sh hide
# follow up info # follow up info
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
string="Wait for confirmations." string="Wait for confirmations."
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
string="Wait for confirmations. \n\nYou can use info on LCD to check if funds have arrived. \n\nIf you want your lighting node to open channels automatically, activate the 'Autopilot' under 'Activate/Deactivate Services'" string="Wait for confirmations. \n\nYou can use info on LCD to check if funds have arrived. \n\nIf you want your lightning node to open channels automatically, activate the 'Autopilot' under 'Activate/Deactivate Services'"
fi fi
whiptail --backtitle "Fund your onchain wallet" \ whiptail --backtitle "Fund your onchain wallet" \
--title "What's next?" \ --title "What's next?" \

View File

@ -18,7 +18,7 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
echo echo
echo "# Precheck" # PRECHECK) check if chain is in sync echo "# Precheck" # PRECHECK) check if chain is in sync
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1) BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight) CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
@ -30,7 +30,7 @@ elif [ $LNTYPE = lnd ];then
chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c) chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c)
fi fi
if [ ${chainOutSync} -eq 1 ]; then if [ ${chainOutSync} -eq 1 ]; then
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
echo "# FAIL PRECHECK - 'lightning-cli getinfo' blockheight is different from 'bitcoind getblockchaininfo' - wait until chain is sync " echo "# FAIL PRECHECK - 'lightning-cli getinfo' blockheight is different from 'bitcoind getblockchaininfo' - wait until chain is sync "
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
echo "# FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync " echo "# FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync "
@ -44,7 +44,7 @@ else
fi fi
# check available funding # check available funding
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
for i in $($lightningcli_alias \ for i in $($lightningcli_alias \
listfunds|jq .outputs[]|jq 'select(.status=="confirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do listfunds|jq .outputs[]|jq 'select(.status=="confirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
confirmedBalance=$((confirmedBalance+i)) confirmedBalance=$((confirmedBalance+i))
@ -63,7 +63,7 @@ if [ ${confirmedBalance} -eq 0 ]; then
fi fi
# check number of connected peers # check number of connected peers
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
numConnectedPeers=$($lightningcli_alias listpeers | grep -c '"id":') numConnectedPeers=$($lightningcli_alias listpeers | grep -c '"id":')
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
numConnectedPeers=$($lncli_alias listpeers | grep pub_key -c) numConnectedPeers=$($lncli_alias listpeers | grep pub_key -c)
@ -81,7 +81,7 @@ fi
# let user pick a peer to open a channels with # let user pick a peer to open a channels with
OPTIONS=() OPTIONS=()
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
while IFS= read -r grepLine while IFS= read -r grepLine
do do
pubKey=$(echo ${grepLine} | cut -d '"' -f4) pubKey=$(echo ${grepLine} | cut -d '"' -f4)
@ -160,7 +160,7 @@ if [ ${#conf_target} -eq 0 ]; then
fi fi
# build command # build command
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
# fundchannel id amount [feerate] [announce] [minconf] [utxos] [push_msat] [close_to] # fundchannel id amount [feerate] [announce] [minconf] [utxos] [push_msat] [close_to]
feerate=$($bitcoincli_alias estimatesmartfee $conf_target |grep feerate|awk '{print $2}'|cut -c 5-7|bc) feerate=$($bitcoincli_alias estimatesmartfee $conf_target |grep feerate|awk '{print $2}'|cut -c 5-7|bc)
command="$lightningcli_alias fundchannel ${pubKey} ${amount} $feerate" command="$lightningcli_alias fundchannel ${pubKey} ${amount} $feerate"
@ -197,7 +197,7 @@ else
echo "${result}" echo "${result}"
echo echo
echo "What's next? --> You need to wait 3 confirmations for the channel to be ready." echo "What's next? --> You need to wait 3 confirmations for the channel to be ready."
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
fundingTX=$(echo "${result}" | grep 'txid' | cut -d '"' -f4) fundingTX=$(echo "${result}" | grep 'txid' | cut -d '"' -f4)
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
fundingTX=$(echo "${result}" | grep 'funding_txid' | cut -d '"' -f4) fundingTX=$(echo "${result}" | grep 'funding_txid' | cut -d '"' -f4)

View File

@ -21,7 +21,7 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net) source <(/home/admin/config.scripts/network.aliases.sh getvars $LNTYPE ${chain}net)
# check if chain is in sync # check if chain is in sync
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
lncommand="${netprefix}lightning-cli" lncommand="${netprefix}lightning-cli"
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1) BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight) CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
@ -49,7 +49,7 @@ done
# check number of connected peers # check number of connected peers
echo "check for open channels" echo "check for open channels"
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
openChannels=$($lightningcli_alias listpeers | grep -c "CHANNELD_NORMAL") openChannels=$($lightningcli_alias listpeers | grep -c "CHANNELD_NORMAL")
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
openChannels=$($lncli_alias listchannels 2>/dev/null | grep chan_id -c) openChannels=$($lncli_alias listchannels 2>/dev/null | grep chan_id -c)
@ -105,7 +105,7 @@ fi
# TODO: maybe try/show the decoded info first by using https://api.lightning.community/#decodepayreq # TODO: maybe try/show the decoded info first by using https://api.lightning.community/#decodepayreq
# build command # build command
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
# pay bolt11 [msatoshi] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] # pay bolt11 [msatoshi] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee]
command="$lightningcli_alias pay ${invoice}" command="$lightningcli_alias pay ${invoice}"
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
@ -132,7 +132,7 @@ error=$(cat ${_error})
#echo "result(${result})" #echo "result(${result})"
#echo "error(${error})" #echo "error(${error})"
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
resultIsError=$(echo "${result}" | grep -c '"code":') resultIsError=$(echo "${result}" | grep -c '"code":')
elif [ $LNTYPE = lnd ];then elif [ $LNTYPE = lnd ];then
resultIsError=$(echo "${result}" | grep -c "payment_error") resultIsError=$(echo "${result}" | grep -c "payment_error")

View File

@ -175,7 +175,7 @@ function status() {
while : while :
do do
# show the same info as on LCD screen # show the same info as on LCD screen
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet> # 00infoBlitz.sh <cl|lnd> <testnet|mainnet|signet>
/home/admin/00infoBlitz.sh $1 $2 /home/admin/00infoBlitz.sh $1 $2
# wait 6 seconds for user exiting loop # wait 6 seconds for user exiting loop
#echo #echo

View File

@ -349,26 +349,26 @@ if [ "${lightning}" == "lnd" ]; then
fi fi
if [ "${lightning}" == "cln" ]; then if [ "${lightning}" == "cl" ]; then
################################### ###################################
# c-lightning # c-lightning
echo "############## c-lightning" >> ${logFile} echo "############## c-lightning" >> ${logFile}
sudo sed -i "s/^message=.*/message='C-Lightning Install'/g" ${infoFile} sudo sed -i "s/^message=.*/message='C-Lightning Install'/g" ${infoFile}
sudo /home/admin/config.scripts/cln.install.sh on mainnet >> ${logFile} sudo /home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile}
sudo sed -i "s/^message=.*/message='C-Lightning Setup'/g" ${infoFile} sudo sed -i "s/^message=.*/message='C-Lightning Setup'/g" ${infoFile}
# OLD WALLET FROM CLIGHTNING RESCUE # OLD WALLET FROM CLIGHTNING RESCUE
if [ "${clnrescue}" != "" ]; then if [ "${clrescue}" != "" ]; then
echo "Restore CLN data from uploaded rescue file ${clnrescue} ..." >> ${logFile} echo "Restore CL data from uploaded rescue file ${clrescue} ..." >> ${logFile}
source <(sudo /home/admin/config.scripts/cln.backup.sh cln-import ${clnrescue}) source <(sudo /home/admin/config.scripts/cl.backup.sh cl-import ${clrescue})
if [ "${error}" != "" ]; then if [ "${error}" != "" ]; then
sed -i "s/^state=.*/state=error/g" ${infoFile} sed -i "s/^state=.*/state=error/g" ${infoFile}
sed -i "s/^message=.*/message='setup: cln import backup failed'/g" ${infoFile} sed -i "s/^message=.*/message='setup: cl import backup failed'/g" ${infoFile}
echo "FAIL see ${logFile}" echo "FAIL see ${logFile}"
echo "FAIL: setup: cln import backup failed" >> ${logFile} echo "FAIL: setup: cl import backup failed" >> ${logFile}
echo "${error}" >> ${logFile} echo "${error}" >> ${logFile}
exit 16 exit 16
fi fi
@ -376,31 +376,31 @@ if [ "${lightning}" == "cln" ]; then
# OLD WALLET FROM SEEDWORDS # OLD WALLET FROM SEEDWORDS
elif [ "${seedWords}" != "" ]; then elif [ "${seedWords}" != "" ]; then
echo "Restore CLN wallet from seedWords ..." >> ${logFile} echo "Restore CL wallet from seedWords ..." >> ${logFile}
source <(sudo /home/admin/config.scripts/cln.hsmtool.sh seed-force mainnet "${seedWords}" "${seedPassword}") source <(sudo /home/admin/config.scripts/cl.hsmtool.sh seed-force mainnet "${seedWords}" "${seedPassword}")
# check if wallet really got created # check if wallet really got created
walletExistsNow=$(sudo ls /home/bitcoin/.lightning/bitcoin/hsm_secret 2>/dev/null | grep -c "hsm_secret") walletExistsNow=$(sudo ls /home/bitcoin/.lightning/bitcoin/hsm_secret 2>/dev/null | grep -c "hsm_secret")
if [ $walletExistsNow -eq 0 ]; then if [ $walletExistsNow -eq 0 ]; then
sed -i "s/^state=.*/state=error/g" ${infoFile} sed -i "s/^state=.*/state=error/g" ${infoFile}
sed -i "s/^message=.*/message='setup: seed maybe wrong'/g" ${infoFile} sed -i "s/^message=.*/message='setup: seed maybe wrong'/g" ${infoFile}
echo "FAIL: setup: no cln wallet created - seed maybe wrong" >> ${logFile} echo "FAIL: setup: no cl wallet created - seed maybe wrong" >> ${logFile}
exit 17 exit 17
fi fi
# NEW WALLET # NEW WALLET
else else
echo "Generate new CLN wallet ..." >> ${logFile} echo "Generate new CL wallet ..." >> ${logFile}
# generate new wallet # generate new wallet
source <(sudo /home/admin/config.scripts/cln.hsmtool.sh new-force mainnet) source <(sudo /home/admin/config.scripts/cl.hsmtool.sh new-force mainnet)
# check if got new seedwords # check if got new seedwords
if [ "${seedwords}" == "" ] || [ "${seedwords6x4}" == "" ]; then if [ "${seedwords}" == "" ] || [ "${seedwords6x4}" == "" ]; then
sed -i "s/^state=.*/state=error/g" ${infoFile} sed -i "s/^state=.*/state=error/g" ${infoFile}
sed -i "s/^message=.*/message='setup: no cln seedwords'/g" ${infoFile} sed -i "s/^message=.*/message='setup: no cl seedwords'/g" ${infoFile}
echo "FAIL: setup: no cln seedwords" >> ${logFile} echo "FAIL: setup: no cl seedwords" >> ${logFile}
exit 18 exit 18
fi fi
@ -408,8 +408,8 @@ if [ "${lightning}" == "cln" ]; then
walletExistsNow=$(sudo ls /home/bitcoin/.lightning/bitcoin/hsm_secret 2>/dev/null | grep -c "hsm_secret") walletExistsNow=$(sudo ls /home/bitcoin/.lightning/bitcoin/hsm_secret 2>/dev/null | grep -c "hsm_secret")
if [ $walletExistsNow -eq 0 ]; then if [ $walletExistsNow -eq 0 ]; then
sed -i "s/^state=.*/state=error/g" ${infoFile} sed -i "s/^state=.*/state=error/g" ${infoFile}
sed -i "s/^message=.*/message='setup: no cln wallet created'/g" ${infoFile} sed -i "s/^message=.*/message='setup: no cl wallet created'/g" ${infoFile}
echo "FAIL: setup: no cln wallet created" >> ${logFile} echo "FAIL: setup: no cl wallet created" >> ${logFile}
exit 19 exit 19
fi fi

View File

@ -248,16 +248,16 @@ if [ "${lightning}" == "lnd" ]; then
sudo systemctl start lnd >> ${logFile} sudo systemctl start lnd >> ${logFile}
elif [ "${lightning}" == "cln" ]; then elif [ "${lightning}" == "cl" ]; then
echo "Install C-lightning on update" >> ${logFile} echo "Install C-lightning on update" >> ${logFile}
sudo sed -i "s/^message=.*/message='C-Lightning Install'/g" ${infoFile} sudo sed -i "s/^message=.*/message='C-Lightning Install'/g" ${infoFile}
sudo /home/admin/config.scripts/cln.install.sh on mainnet >> ${logFile} sudo /home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile}
sudo sed -i "s/^message=.*/message='C-Lightning Setup'/g" ${infoFile} sudo sed -i "s/^message=.*/message='C-Lightning Setup'/g" ${infoFile}
elif [ "${lightning}" == "none" ]; then elif [ "${lightning}" == "none" ]; then
echo "No Lightnig" >> ${logFile} echo "No Lightning" >> ${logFile}
else else

View File

@ -332,37 +332,37 @@ if [ "${tlnd}" == "on" ]; then
sudo systemctl start tlnd >> ${logFile} 2>&1 sudo systemctl start tlnd >> ${logFile} 2>&1
else else
echo "Provisioning LND Testnet - not active" >> ${logFile} echo "Provisioning LND Testnet - not active" >> ${logFile}
fi fiCL
# LND Signet # LND SignetCL
if [ "${slnd}" == "on" ]; then if [ "${slnd}" == "on" ]; then
echo "Provisioning LND Signet - run config script" >> ${logFile} echo "Provisioning LND Signet - run config script" >> ${logFile}
sudo /home/admin/config.scripts/lnd.install.sh on signet >> ${logFile} 2>&1 sudo /home/admin/coCLg.scripts/lnd.install.sh on signet >> ${logFile} 2>&1
sudo systemctl start slnd >> ${logFile} 2>&1 sudo systemctl start slnd >> ${logFile} 2>&1
else else
echo "Provisioning LND Signet - not active" >> ${logFile} CLcho "Provisioning LND Signet - not active" >> ${logFile}
fi fi
CL
# CLN Mainnet (when not main instance) # CLN Mainnet (when not main instance)
if [ "${cln}" == "on" ] && [ "${lightning}" != "cln" ]; then if [ "${cl}" == "on" ] && [ "${lightning}" != "cl" ]; then
echo "Provisioning CLN Mainnet - run config script" >> ${logFile} echo "Provisioning CL Mainnet - run config script" >> ${logFile}
sudo /home/admin/config.scripts/cln.install.sh on mainnet >> ${logFile} 2>&1 sudo /home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile} 2>&1
else else
echo "Provisioning CLN Mainnet - not active as secondary option" >> ${logFile} CLcho "Provisioning CLN Mainnet - not active as secondary option" >> ${logFile}
fi fi
CL
# CLN Testnet # CLN Testnet
if [ "${tcln}" == "on" ]; then if [ "${tcl}" == "on" ]; then
echo "Provisioning CLN Testnet - run config script" >> ${logFile} echo "Provisioning CL Testnet - run config script" >> ${logFile}
sudo /home/admin/config.scripts/cln.install.sh on testnet >> ${logFile} 2>&1 sudo /home/admin/config.scripts/cl.install.sh on testnet >> ${logFile} 2>&1
else else
echo "Provisioning CLN Testnet - not active" >> ${logFile} echo "Provisioning CLN Testnet - not active" >> ${logFile}
fi fi
# CLN Signet # CLN Signet
if [ "${scln}" == "on" ]; then if [ "${scl}" == "on" ]; then
echo "Provisioning CLN Signet - run config script" >> ${logFile} echo "Provisioning CLN Signet - run config script" >> ${logFile}
sudo /home/admin/config.scripts/cln.install.sh on signet >> ${logFile} 2>&1 sudo /home/admin/config.scripts/cl.install.sh on signet >> ${logFile} 2>&1
else else
echo "Provisioning CLN Signet - not active" >> ${logFile} echo "Provisioning CLN Signet - not active" >> ${logFile}
fi fi
@ -410,13 +410,13 @@ if [ "${#dynDomain}" -gt 0 ]; then
sudo /home/admin/config.scripts/internet.dyndomain.sh on ${dynDomain} ${dynUpdateUrl} >> ${logFile} 2>&1 sudo /home/admin/config.scripts/internet.dyndomain.sh on ${dynDomain} ${dynUpdateUrl} >> ${logFile} 2>&1
else else
echo "Provisioning DYNAMIC DOMAIN - keep default" >> ${logFile} echo "Provisioning DYNAMIC DOMAIN - keep default" >> ${logFile}
fi fiCL
# RTL (LND) # RTL (LND)CL
if [ "${rtlWebinterface}" = "on" ]; then if [ "${rtlWebinterface}" = "on" ]; then
echo "Provisioning RTL LND - run config script" >> ${logFile} echo "Provisioning RTL LND - run config script" >> ${logFile}
sudo sed -i "s/^message=.*/message='Setup RTL (takes time)'/g" ${infoFile} sudo sed -i "s/^message=.*/message='Setup RTL (takes time)'/g" ${infoFile}
sudo -u admin /home/admin/config.scripts/bonus.rtl.sh on lnd mainnet >> ${logFile} 2>&1 sudo -u admin /home/admCLconfig.scripts/bonus.rtl.sh on lnd mainnet >> ${logFile} 2>&1
else else
echo "Provisioning RTL LND - keep default" >> ${logFile} echo "Provisioning RTL LND - keep default" >> ${logFile}
fi fi
@ -425,7 +425,7 @@ fi
if [ "${crtlWebinterface}" = "on" ]; then if [ "${crtlWebinterface}" = "on" ]; then
echo "Provisioning RTL CLN - run config script" >> ${logFile} echo "Provisioning RTL CLN - run config script" >> ${logFile}
sudo sed -i "s/^message=.*/message='Setup RTL (takes time)'/g" ${infoFile} sudo sed -i "s/^message=.*/message='Setup RTL (takes time)'/g" ${infoFile}
sudo -u admin /home/admin/config.scripts/bonus.rtl.sh on cln mainnet >> ${logFile} 2>&1 sudo -u admin /home/admCLconfig.scripts/bonus.rtl.sh on cl mainnet >> ${logFile} 2>&1
else else
echo "Provisioning RTL CLN - keep default" >> ${logFile} echo "Provisioning RTL CLN - keep default" >> ${logFile}
fi fi
@ -434,7 +434,7 @@ fi
if [ "${sparko}" = "on" ]; then if [ "${sparko}" = "on" ]; then
echo "Provisioning Sparko - run config script" >> ${logFile} echo "Provisioning Sparko - run config script" >> ${logFile}
sudo sed -i "s/^message=.*/message='Setup SPARKO (takes time)'/g" ${infoFile} sudo sed -i "s/^message=.*/message='Setup SPARKO (takes time)'/g" ${infoFile}
sudo -u admin /home/admin/config.scripts/cln-plugin.sparko.sh on mainnet >> ${logFile} 2>&1 sudo -u admin /home/admin/config.scripts/cl-plugin.sparko.sh on mainnet >> ${logFile} 2>&1
else else
echo "Provisioning RTL CLN - keep default" >> ${logFile} echo "Provisioning RTL CLN - keep default" >> ${logFile}
fi fi
@ -802,7 +802,7 @@ if [ "${lightning}" == "lnd" ];then
else else
echo "No /mnt/hdd/passwordc.flag" >> ${logFile} echo "No /mnt/hdd/passwordc.flag" >> ${logFile}
fi fi
elif [ "${lightning}" == "cln" ];then elif [ "${lightning}" == "cl" ];then
sudo systemctl start lightningd sudo systemctl start lightningd
fi fi

View File

@ -83,7 +83,7 @@ fi
echo echo
echo "*** C-LIGHTNING (MAINNET) SYSTEMD STATUS ***" echo "*** C-LIGHTNING (MAINNET) SYSTEMD STATUS ***"
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ] || [ "${cln}" == "1" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ] || [ "${cl}" == "1" ]; then
sudo systemctl status lightningd -n2 --no-pager sudo systemctl status lightningd -n2 --no-pager
echo echo
echo "*** LAST 30 C-LIGHTNING (MAINNET) INFO LOGS ***" echo "*** LAST 30 C-LIGHTNING (MAINNET) INFO LOGS ***"
@ -127,7 +127,7 @@ fi
echo echo
echo "*** C-LIGHTNING (TESTNET) SYSTEMD STATUS ***" echo "*** C-LIGHTNING (TESTNET) SYSTEMD STATUS ***"
if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then if [ "${tcl}" == "on" ] || [ "${tcl}" == "1" ]; then
sudo systemctl status tlightningd -n2 --no-pager sudo systemctl status tlightningd -n2 --no-pager
echo echo
echo "*** LAST 30 C-LIGHTNING (TESTNET) INFO LOGS ***" echo "*** LAST 30 C-LIGHTNING (TESTNET) INFO LOGS ***"
@ -171,7 +171,7 @@ fi
echo echo
echo "*** C-LIGHTNING (SIGNET) SYSTEMD STATUS ***" echo "*** C-LIGHTNING (SIGNET) SYSTEMD STATUS ***"
if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then if [ "${scl}" == "on" ] || [ "${scl}" == "1" ]; then
sudo systemctl status slightningd -n2 --no-pager sudo systemctl status slightningd -n2 --no-pager
echo echo
echo "*** LAST 30 C-LIGHTNING (SIGNET) INFO LOGS ***" echo "*** LAST 30 C-LIGHTNING (SIGNET) INFO LOGS ***"
@ -236,11 +236,11 @@ fi
if [ "${crtlWebinterface}" == "on" ]; then if [ "${crtlWebinterface}" == "on" ]; then
echo echo
echo "*** CLN-RTL ***" echo "*** CL-RTL ***"
sudo systemctl status cRTL -n10 --no-pager sudo systemctl status cRTL -n10 --no-pager
echo echo
else else
echo "- CLN-RTL is OFF by config" echo "- CL-RTL is OFF by config"
fi fi
if [ "${ElectRS}" == "on" ]; then if [ "${ElectRS}" == "on" ]; then

View File

@ -47,8 +47,8 @@ if [ ${#abcd} -eq 0 ]; then
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
OPTIONS+=(C "LND Lightning Wallet Password") OPTIONS+=(C "LND Lightning Wallet Password")
fi fi
if [ "${cln}" == "on" ] && [ "${clnEncryptedHSM}" == "on" ]; then if [ "${cl}" == "on" ] && [ "${clEncryptedHSM}" == "on" ]; then
OPTIONS+=(CLN "C-Lightning Wallet Password") OPTIONS+=(CL "C-Lightning Wallet Password")
fi fi
CHOICE=$(dialog --clear \ CHOICE=$(dialog --clear \
--backtitle "RaspiBlitz" \ --backtitle "RaspiBlitz" \
@ -71,8 +71,8 @@ if [ ${#abcd} -eq 0 ]; then
D) D)
abcd='d'; abcd='d';
;; ;;
CLN) CL)
abcd='cln'; abcd='cl';
;; ;;
*) *)
exit 0 exit 0
@ -442,9 +442,9 @@ elif [ "${abcd}" = "x" ]; then
# store result is file # store result is file
echo "${password1}" > ${resultFile} echo "${password1}" > ${resultFile}
elif [ "${abcd}" = "cln" ]; then elif [ "${abcd}" = "cl" ]; then
/home/admin/config.scripts/cln.hsmtool.sh change-password mainnet /home/admin/config.scripts/cl.hsmtool.sh change-password mainnet
# do not reboot for cln password # do not reboot for cl password
reboot=0 reboot=0
# everything else # everything else

View File

@ -3,7 +3,7 @@
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf 2>/dev/null source /mnt/hdd/raspiblitz.conf 2>/dev/null
# LNTYPE is lnd | cln # LNTYPE is lnd | cl
if [ $# -gt 0 ];then if [ $# -gt 0 ];then
LNTYPE=$1 LNTYPE=$1
else else
@ -276,26 +276,26 @@ if [ ${lndRunning} -eq 1 ] && [ "${LNTYPE}" == "lnd" ]; then
fi fi
# is CLN running # is CL running
clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running) clRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running)
echo "clnActive=${clnRunning}" echo "clActive=${clRunning}"
echo "CLNwalletLocked=0" echo "CLwalletLocked=0"
if [ "${clnRunning}" != "1" ] && [ "${LNTYPE}" == "cln" ]; then if [ "${clRunning}" != "1" ] && [ "${LNTYPE}" == "cl" ]; then
# check if locked # check if locked
if [ "$(sudo journalctl -n5 -u ${netprefix}lightningd | \ if [ "$(sudo journalctl -n5 -u ${netprefix}lightningd | \
grep -cE 'Could not read pass from stdin|pass the --encrypted-hsm|Wrong password')" -gt 0 ];then grep -cE 'Could not read pass from stdin|pass the --encrypted-hsm|Wrong password')" -gt 0 ];then
echo "CLNwalletLocked=1" echo "CLwalletLocked=1"
fi fi
fi fi
if [ "${clnRunning}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then if [ "${clRunning}" == "1" ] && [ "${LNTYPE}" == "cl" ]; then
clnInfo=$($lightningcli_alias getinfo 2>&1) clInfo=$($lightningcli_alias getinfo 2>&1)
clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]') clBlockHeight=$(echo "${clInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]')
scanProgress=$(echo "scale=2; $clnBlockHeight*100/$total" | bc) scanProgress=$(echo "scale=2; $clBlockHeight*100/$total" | bc)
echo "scanProgress=${scanProgress}" echo "scanProgress=${scanProgress}"
clnBlockHeightPlusOne=$(expr $clnBlockHeight + 1) clBlockHeightPlusOne=$(expr $clBlockHeight + 1)
if [ "${total}" == "${clnBlockHeight}" ] || [ "${total}" == "${clnBlockHeightPlusOne}" ]; then if [ "${total}" == "${clBlockHeight}" ] || [ "${total}" == "${clBlockHeightPlusOne}" ]; then
echo "syncedToChain=1" echo "syncedToChain=1"
else else
echo "syncedToChain=0" echo "syncedToChain=0"

View File

@ -137,14 +137,14 @@ if [ "$1" = "update-config" ]; then
sed -i "s/^lnd_macaroon=.*/lnd_macaroon=${adminMacaroon}/g" ./.env sed -i "s/^lnd_macaroon=.*/lnd_macaroon=${adminMacaroon}/g" ./.env
sed -i "s/^lnd_cert=.*/lnd_cert=${tlsCert}/g" ./.env sed -i "s/^lnd_cert=.*/lnd_cert=${tlsCert}/g" ./.env
# configure CLN # configure CL
elif [ "${lightning}" == "cln" ]; then elif [ "${lightning}" == "cl" ]; then
echo "# CONFIG Web API Lightning --> CLN" echo "# CONFIG Web API Lightning --> CL"
sed -i "s/^ln_node=.*/ln_node=cln/g" ./.env sed -i "s/^ln_node=.*/ln_node=cl/g" ./.env
# TODO: ADD C-Lightning config as soon as available # TODO: ADD C-Lightning config as soon as available
echo "# MISSING CLN CONFIG YET" echo "# MISSING CL CONFIG YET"
else else
echo "# CONFIG Web API Lightning --> OFF" echo "# CONFIG Web API Lightning --> OFF"

View File

@ -315,8 +315,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
[Unit] [Unit]
Description=lnbits Description=lnbits
Wants=lnd.service Wants=bitcoind.service
After=lnd.service After=bitcoind.service
[Service] [Service]
WorkingDirectory=/home/lnbits/lnbits WorkingDirectory=/home/lnbits/lnbits

View File

@ -10,11 +10,11 @@ source /mnt/hdd/raspiblitz.conf
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# config script for RideTheLightning $RTLVERSION WebInterface" echo "# config script for RideTheLightning $RTLVERSION WebInterface"
echo "# able to run intances for lnd and cln parallel" echo "# able to run intances for lnd and cl parallel"
echo "# mainnet and testnet instances can run parallel" echo "# mainnet and testnet instances can run parallel"
echo "# bonus.rtl.sh [on|off|menu] <lnd|cln> <mainnet|testnet|signet>" echo "# bonus.rtl.sh [on|off|menu] <lnd|cl> <mainnet|testnet|signet>"
echo "# bonus.rtl.sh connect-services" echo "# bonus.rtl.sh connect-services"
echo "# bonus.rtl.sh prestart <lnd|cln> <mainnet|testnet|signet>" echo "# bonus.rtl.sh prestart <lnd|cl> <mainnet|testnet|signet>"
exit 1 exit 1
fi fi
@ -22,7 +22,7 @@ echo "# Running: 'bonus.rtl.sh $*'"
source <(/home/admin/config.scripts/network.aliases.sh getvars $2 $3) source <(/home/admin/config.scripts/network.aliases.sh getvars $2 $3)
# LNTYPE is lnd | cln # LNTYPE is lnd | cl
echo "# LNTYPE(${LNTYPE})" echo "# LNTYPE(${LNTYPE})"
# CHAIN is signet | testnet | mainnet # CHAIN is signet | testnet | mainnet
echo "# CHAIN(${CHAIN})" echo "# CHAIN(${CHAIN})"
@ -32,7 +32,7 @@ echo "# portprefix(${portprefix})"
echo "# typeprefix(${typeprefix})" echo "# typeprefix(${typeprefix})"
# prefix for parallel lightning impl # prefix for parallel lightning impl
if [ "${LNTYPE}" == "cln" ]; then if [ "${LNTYPE}" == "cl" ]; then
RTLHTTP=${portprefix}7000 RTLHTTP=${portprefix}7000
elif [ "${LNTYPE}" == "lnd" ]; then elif [ "${LNTYPE}" == "lnd" ]; then
RTLHTTP=${portprefix}3000 RTLHTTP=${portprefix}3000
@ -216,15 +216,15 @@ WantedBy=multi-user.target
sudo sed -i "s/^Wants=.*/Wants=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service sudo sed -i "s/^Wants=.*/Wants=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service
sudo sed -i "s/^After=.*/After=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service sudo sed -i "s/^After=.*/After=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service
fi fi
CL
# adapt systemd service template for CLN # adapt systemd service template for CLN
if [ "${LNTYPE}" == "cln" ]; then if [ "${LNTYPE}" == "cl" ]; thenCL
echo "# modifying ${systemdService}.service for CLN" echo "# modifying ${systemdService}.service for CLN"
sudo sed -i "s/^Wants=.*/Wants=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service sudo sed -i "s/^Wants=.*/Wants=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service
sudo sed -i "s/^After=.*/After=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service sudo sed -i "s/^After=.*/After=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service
# set up C-LightningREST # set up C-LightningREST
/home/admin/config.scripts/cln.rest.sh on ${CHAIN} /home/admin/config.scripts/cl.rest.sh on ${CHAIN}
fi fi
# Note about RTL config file # Note about RTL config file
@ -383,14 +383,14 @@ if [ "$1" = "prestart" ]; then
# C-Lightning changes of config # C-Lightning changes of config
# https://github.com/Ride-The-Lightning/RTL/blob/master/docs/C-Lightning-setup.md # https://github.com/Ride-The-Lightning/RTL/blob/master/docs/C-Lightning-setup.md
if [ "${LNTYPE}" == "cln" ]; then if [ "${LNCLE}" == "cl" ]; then
echo "# CLN Config" echo "# CLN Config"
cat /home/rtl/${systemdService}/RTL-Config.json | \ cat /home/rtl/${systemdService}/RTL-Config.json | \
jq ".port = \"${RTLHTTP}\"" | \ jq ".port = \"${RTLHTTP}\"" | \
jq ".multiPass = \"${RPCPASSWORD}\"" | \ jq ".multiPass = \"${RPCPASSWORD}\"" | \
jq ".nodes[0].lnNode = \"${hostname}\"" | \ jq ".nodes[0].lnNode = \"${hostname}\"" | \
jq ".nodes[0].lnImplementation = \"CLT\"" | \ jq ".nodes[0].lnImplementation = \"CLT\"" | \
jq ".nodes[0].Authentication.macaroonPath = \"/home/bitcoin/c-lightning-REST/certs\"" | \ jq ".nodes[0].Authentication.macaroonPath = \"CLme/bitcoin/c-lightning-REST/certs\"" | \
jq ".nodes[0].Authentication.configPath = \"${CLNCONF}\"" | \ jq ".nodes[0].Authentication.configPath = \"${CLNCONF}\"" | \
jq ".nodes[0].Authentication.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" | \ jq ".nodes[0].Authentication.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" | \
jq ".nodes[0].Authentication.boltzMacaroonPath = \"/home/rtl/.boltz-lnd/macaroons/\"" | \ jq ".nodes[0].Authentication.boltzMacaroonPath = \"/home/rtl/.boltz-lnd/macaroons/\"" | \
@ -452,8 +452,8 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
echo "# Removing the binaries" echo "# Removing the binaries"
echo "# Delete user and home directory" echo "# Delete user and home directory"
sudo userdel -rf rtl sudo userdel -rf rtl
if [ $LNTYPE = cln ];then if [ $LNTYPE = cl ];then
/home/admin/config.scripts/cln.rest.sh off ${CHAIN} /home/admin/config.scripts/cl.rest.sh off ${CHAIN}
fi fi
fi fi

View File

@ -6,9 +6,9 @@ function help(){
echo "Replicates the lightningd.sqlite3 database on the SDcard" echo "Replicates the lightningd.sqlite3 database on the SDcard"
echo echo
echo "Usage:" echo "Usage:"
echo "cln-plugin.backup.sh [on|off] [testnet|mainnet|signet]" echo "cl-plugin.backup.sh [on|off] [testnet|mainnet|signet]"
echo "cln-plugin.backup.sh [restore] [testnet|mainnet|signet] [force]" echo "cl-plugin.backup.sh [restore] [testnet|mainnet|signet] [force]"
echo "cln-plugin.backup.sh [backup-compact] [testnet|mainnet|signet]" echo "cl-plugin.backup.sh [backup-compact] [testnet|mainnet|signet]"
echo echo
echo "https://github.com/lightningd/plugins/tree/master/backup" echo "https://github.com/lightningd/plugins/tree/master/backup"
echo echo
@ -20,14 +20,14 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
help help
fi fi
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
plugin="backup" plugin="backup"
plugindir="/home/bitcoin/cln-plugins-available/plugins" plugindir="/home/bitcoin/cl-plugins-available/plugins"
function install() { function install() {
if [ ! -f "${plugindir}/${plugin}/${plugin}.py" ]; then if [ ! -f "${plugindir}/${plugin}/${plugin}.py" ]; then
cd /home/bitcoin/cln-plugins-available || exit 1 cd /home/bitcoin/cl-plugins-available || exit 1
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
fi fi
@ -40,9 +40,9 @@ function install() {
fi fi
sudo chmod +x ${plugindir}/${plugin}/${plugin}.py sudo chmod +x ${plugindir}/${plugin}/${plugin}.py
# symlink to the default plugin dir # symlink to the default plugin dir
if [ ! -L /home/bitcoin/${netprefix}cln-plugins-enabled/backup.py ];then if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/backup.py ];then
sudo ln -s ${plugindir}/backup/backup.py \ sudo ln -s ${plugindir}/backup/backup.py \
/home/bitcoin/${netprefix}cln-plugins-enabled/ /home/bitcoin/${netprefix}cl-plugins-enabled/
fi fi
else else
echo "# The ${plugin} plugin is already loaded" echo "# The ${plugin} plugin is already loaded"
@ -83,7 +83,7 @@ if [ $1 = on ];then
elif [ $1 = off ];then elif [ $1 = off ];then
echo "# Removing the backup plugin" echo "# Removing the backup plugin"
sudo rm -f /home/bitcoin/${netprefix}cln-plugins-enabled/backup.py sudo rm -f /home/bitcoin/${netprefix}cl-plugins-enabled/backup.py
echo "# Backup the existing old backup on the SDcard" echo "# Backup the existing old backup on the SDcard"
now=$(date +"%Y_%m_%d_%H%M%S") now=$(date +"%Y_%m_%d_%H%M%S")
sudo mv /home/bitcoin/${netprefix}lightningd.sqlite3.backup \ sudo mv /home/bitcoin/${netprefix}lightningd.sqlite3.backup \
@ -137,7 +137,7 @@ elif [ $1 = backup-compact ];then
else else
echo "# No /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3 is present" echo "# No /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3 is present"
echo "# Run 'config.scripts/cln-plugin.backup.sh on ${CLNETWORK}' first" echo "# Run 'config.scripts/cl-plugin.backup.sh on ${CLNETWORK}' first"
fi fi
else else

View File

@ -10,13 +10,13 @@ if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo "Install or remove the CLBOSS C-lightning plugin" echo "Install or remove the CLBOSS C-lightning plugin"
echo "version: v${CLBOSSVERSION}" echo "version: v${CLBOSSVERSION}"
echo "Usage:" echo "Usage:"
echo "cln-plugin.clboss.sh [on|off] [testnet|mainnet|signet]" echo "cl-plugin.clboss.sh [on|off] [testnet|mainnet|signet]"
echo echo
exit 1 exit 1
fi fi
# source <(/home/admin/config.scripts/network.aliases.sh getvars cln <mainnet|testnet|signet>) # source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
# add default value to raspi config if needed # add default value to raspi config if needed
configEntry="${netprefix}clboss" configEntry="${netprefix}clboss"
@ -30,21 +30,21 @@ fi
if [ $1 = on ];then if [ $1 = on ];then
if [ ! -f /home/bitcoin/cln-plugins-available/clboss-${CLBOSSVERSION}.tar.gz ];then if [ ! -f /home/bitcoin/cl-plugins-available/clboss-${CLBOSSVERSION}.tar.gz ];then
# download tarball # download tarball
sudo -u bitcoin wget \ sudo -u bitcoin wget \
https://github.com/ZmnSCPxj/clboss/releases/download/v${CLBOSSVERSION}/clboss-${CLBOSSVERSION}.tar.gz \ https://github.com/ZmnSCPxj/clboss/releases/download/v${CLBOSSVERSION}/clboss-${CLBOSSVERSION}.tar.gz \
-O /home/bitcoin/cln-plugins-available/clboss-${CLBOSSVERSION}.tar.gz || exit 1 -O /home/bitcoin/cl-plugins-available/clboss-${CLBOSSVERSION}.tar.gz || exit 1
fi fi
if [ ! -f /home/bitcoin/cln-plugins-available/clboss-${CLBOSSVERSION}/clboss ];then if [ ! -f /home/bitcoin/cl-plugins-available/clboss-${CLBOSSVERSION}/clboss ];then
# dependencies # dependencies
sudo apt install -y build-essential pkg-config libev-dev \ sudo apt install -y build-essential pkg-config libev-dev \
libcurl4-gnutls-dev libsqlite3-dev dnsutils libcurl4-gnutls-dev libsqlite3-dev dnsutils
# install # install
cd /home/bitcoin/cln-plugins-available/ || exit 1 cd /home/bitcoin/cl-plugins-available/ || exit 1
sudo -u bitcoin tar -xvf clboss-${CLBOSSVERSION}.tar.gz sudo -u bitcoin tar -xvf clboss-${CLBOSSVERSION}.tar.gz
cd clboss-${CLBOSSVERSION} || exit 1 cd clboss-${CLBOSSVERSION} || exit 1
sudo -u bitcoin ./configure && sudo -u bitcoin make sudo -u bitcoin ./configure && sudo -u bitcoin make
@ -52,9 +52,9 @@ if [ $1 = on ];then
fi fi
# symlink to enable # symlink to enable
if [ ! -L /home/bitcoin/${netprefix}cln-plugins-enabled/clboss ];then if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ];then
sudo ln -s /home/bitcoin/cln-plugins-available/clboss-${CLBOSSVERSION}/clboss \ sudo ln -s /home/bitcoin/cl-plugins-available/clboss-${CLBOSSVERSION}/clboss \
/home/bitcoin/${netprefix}cln-plugins-enabled /home/bitcoin/${netprefix}cl-plugins-enabled
fi fi
# setting value in raspiblitz.conf # setting value in raspiblitz.conf
@ -69,14 +69,14 @@ if [ $1 = on ];then
echo "# clboss was installed for $CHAIN" echo "# clboss was installed for $CHAIN"
echo "# Monitor with:" echo "# Monitor with:"
echo "sudo tail -n 100 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log | grep clboss" echo "sudo tail -n 100 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log | grep clboss"
echo "${netprefix}cln clboss-status" echo "${netprefix}cl clboss-status"
echo "https://github.com/ZmnSCPxj/clboss#operating" echo "https://github.com/ZmnSCPxj/clboss#operating"
fi fi
if [ $1 = off ];then if [ $1 = off ];then
# delete symlink # delete symlink
sudo rm -rf /home/bitcoin/${netprefix}cln-plugins-enabled/clboss sudo rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss
echo "# Restart the ${netprefix}lightningd.service to deactivate clboss" echo "# Restart the ${netprefix}lightningd.service to deactivate clboss"
sudo systemctl restart ${netprefix}lightningd sudo systemctl restart ${netprefix}lightningd
@ -84,7 +84,7 @@ if [ $1 = off ];then
# purge # purge
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
echo "# Delete plugin" echo "# Delete plugin"
sudo rm -rf /home/bitcoin/cln-plugins-available/clboss* sudo rm -rf /home/bitcoin/cl-plugins-available/clboss*
sudo rm -f /usr/local/bin/clboss sudo rm -f /usr/local/bin/clboss
fi fi

View File

@ -2,7 +2,7 @@
# explanation on paths https://github.com/ElementsProject/lightning/issues/4223 # explanation on paths https://github.com/ElementsProject/lightning/issues/4223
# built-in path dir: /usr/local/libexec/c-lightning/plugins/ # built-in path dir: /usr/local/libexec/c-lightning/plugins/
# added --plugin-dir=/home/bitcoin/${netprefix}cln-plugins-enabled # added --plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled
SPARKOVERSION="v2.7" SPARKOVERSION="v2.7"
@ -12,13 +12,13 @@ if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo "Install, remove, connect or get info about the Sparko plugin for C-lightning" echo "Install, remove, connect or get info about the Sparko plugin for C-lightning"
echo "version: $SPARKOVERSION" echo "version: $SPARKOVERSION"
echo "Usage:" echo "Usage:"
echo "cln-plugin.sparko.sh [on|off|menu|connect] [testnet|mainnet|signet]" echo "cl-plugin.sparko.sh [on|off|menu|connect] [testnet|mainnet|signet]"
echo echo
exit 1 exit 1
fi fi
# source <(/home/admin/config.scripts/network.aliases.sh getvars cln <mainnet|testnet|signet>) # source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
# show info menu # show info menu
if [ "$1" = "menu" ]; then if [ "$1" = "menu" ]; then
@ -63,7 +63,7 @@ fi
if [ $1 = connect ];then if [ $1 = connect ];then
localip=$(ip addr | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep 'eth0\|wlan0\|enp0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') localip=$(ip addr | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep 'eth0\|wlan0\|enp0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}sparko/hostname) toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}sparko/hostname)
accesskey=$(sudo cat ${CLNCONF} | grep "^sparko-keys=" | cut -d= -f2 | cut -d';' -f1) accesskey=$(sudo cat ${CLCONF} | grep "^sparko-keys=" | cut -d= -f2 | cut -d';' -f1)
url="https://${localip}:${portprefix}9000/" url="https://${localip}:${portprefix}9000/"
#string="${url}?access-key=${accesskey}" #string="${url}?access-key=${accesskey}"
#/home/admin/config.scripts/blitz.display.sh qr "$string" #/home/admin/config.scripts/blitz.display.sh qr "$string"
@ -118,18 +118,18 @@ if [ $1 = on ];then
DISTRO="linux_amd64" DISTRO="linux_amd64"
fi fi
if [ ! -f /home/bitcoin/cln-plugins-available/sparko ];then if [ ! -f /home/bitcoin/cl-plugins-available/sparko ];then
sudo -u bitcoin mkdir /home/bitcoin/cln-plugins-available sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available
# download binary # download binary
sudo -u bitcoin wget https://github.com/fiatjaf/sparko/releases/download/${SPARKOVERSION}/sparko_${DISTRO}\ sudo -u bitcoin wget https://github.com/fiatjaf/sparko/releases/download/${SPARKOVERSION}/sparko_${DISTRO}\
-O /home/bitcoin/cln-plugins-available/sparko || exit 1 -O /home/bitcoin/cl-plugins-available/sparko || exit 1
# make executable # make executable
sudo chmod +x /home/bitcoin/cln-plugins-available/sparko sudo chmod +x /home/bitcoin/cl-plugins-available/sparko
fi fi
if [ ! -L /home/bitcoin/${netprefix}cln-plugins-enabled/sparko ];then if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then
sudo ln -s /home/bitcoin/cln-plugins-available/sparko \ sudo ln -s /home/bitcoin/cl-plugins-available/sparko \
/home/bitcoin/${netprefix}cln-plugins-enabled /home/bitcoin/${netprefix}cl-plugins-enabled
fi fi
if [ ! -f /home/bitcoin/.lightning/sparko-tls/key.pem ];then if [ ! -f /home/bitcoin/.lightning/sparko-tls/key.pem ];then
@ -146,8 +146,8 @@ if [ $1 = on ];then
########## ##########
# Config # # Config #
########## ##########
if ! grep -Eq "^sparko" ${CLNCONF};then if ! grep -Eq "^sparko" ${CLCONF};then
echo "# Editing ${CLNCONF}" echo "# Editing ${CLCONF}"
echo "# See: https://github.com/fiatjaf/sparko#how-to-use" echo "# See: https://github.com/fiatjaf/sparko#how-to-use"
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
# Spark wallet only allows alphanumeric characters # Spark wallet only allows alphanumeric characters
@ -161,9 +161,9 @@ sparko-port=${portprefix}9000
sparko-tls-path=/home/bitcoin/.lightning/sparko-tls sparko-tls-path=/home/bitcoin/.lightning/sparko-tls
sparko-login=blitz:$PASSWORD_B sparko-login=blitz:$PASSWORD_B
sparko-keys=${masterkeythatcandoeverything}; ${secretaccesskeythatcanreadstuff}: getinfo, listchannels, listnodes; ${verysecretkeythatcanpayinvoices}: pay; ${keythatcanlistentoallevents}: stream sparko-keys=${masterkeythatcandoeverything}; ${secretaccesskeythatcanreadstuff}: getinfo, listchannels, listnodes; ${verysecretkeythatcanpayinvoices}: pay; ${keythatcanlistentoallevents}: stream
" | sudo tee -a ${CLNCONF} " | sudo tee -a ${CLCONF}
else else
echo "# Sparko is already configured in ${CLNCONF}" echo "# Sparko is already configured in ${CLCONF}"
fi fi
echo "# Allowing port ${portprefix}9000 through the firewall" echo "# Allowing port ${portprefix}9000 through the firewall"
@ -190,10 +190,10 @@ fi
if [ $1 = off ];then if [ $1 = off ];then
# delete symlink # delete symlink
sudo rm -rf /home/bitcoin/${netprefix}cln-plugins-enabled/sparko sudo rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko
echo "# Editing ${CLNCONF}" echo "# Editing ${CLCONF}"
sudo sed -i "/^sparko/d" ${CLNCONF} sudo sed -i "/^sparko/d" ${CLCONF}
echo "# Restart the ${netprefix}lightningd.service to deactivate Sparko" echo "# Restart the ${netprefix}lightningd.service to deactivate Sparko"
sudo systemctl restart ${netprefix}lightningd sudo systemctl restart ${netprefix}lightningd
@ -206,7 +206,7 @@ if [ $1 = off ];then
# purge # purge
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
echo "# Delete plugin" echo "# Delete plugin"
sudo rm -rf /home/bitcoin/cln-plugins-available/sparko sudo rm -rf /home/bitcoin/cl-plugins-available/sparko
fi fi
# setting value in raspi blitz config # setting value in raspi blitz config
sudo sed -i "s/^${netprefix}sparko=.*/${netprefix}sparko=off/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^${netprefix}sparko=.*/${netprefix}sparko=off/g" /mnt/hdd/raspiblitz.conf

View File

@ -5,7 +5,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo echo
echo "Install and show the output of the chosen plugin for C-lightning" echo "Install and show the output of the chosen plugin for C-lightning"
echo "Usage:" echo "Usage:"
echo "cln-plugin.standard-python.sh on [plugin-name] [testnet|mainnet|signet] [runonce]" echo "cl-plugin.standard-python.sh on [plugin-name] [testnet|mainnet|signet] [runonce]"
echo echo
echo "tested plugins:" echo "tested plugins:"
echo "summary | helpme | feeadjuster" echo "summary | helpme | feeadjuster"
@ -18,19 +18,19 @@ fi
if [ $1 = on ];then if [ $1 = on ];then
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
plugin=$2 plugin=$2
if [ ! -f "/home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py" ]; then if [ ! -f "/home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py" ]; then
cd /home/bitcoin/cln-plugins-available || exit 1 cd /home/bitcoin/cl-plugins-available || exit 1
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
fi fi
if [ $($lightningcli_alias | grep -c "${plugin}") -eq 0 ];then if [ $($lightningcli_alias | grep -c "${plugin}") -eq 0 ];then
echo "# Starting the ${plugin} plugin" echo "# Starting the ${plugin} plugin"
sudo -u bitcoin pip install -r /home/bitcoin/cln-plugins-available/plugins/${plugin}/requirements.txt sudo -u bitcoin pip install -r /home/bitcoin/cl-plugins-available/plugins/${plugin}/requirements.txt
$lightningcli_alias plugin start /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py $lightningcli_alias plugin start /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py
fi fi
echo echo
@ -48,7 +48,7 @@ if [ $1 = on ];then
echo echo
if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then
$lightningcli_alias plugin stop /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py $lightningcli_alias plugin stop /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py
fi fi
fi fi

View File

@ -5,16 +5,16 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo echo
echo "Install and show the output if the summary plugin for C-lightning" echo "Install and show the output if the summary plugin for C-lightning"
echo "Usage:" echo "Usage:"
echo "cln-plugin.summary.sh [testnet|mainnet|signet] [runonce]" echo "cl-plugin.summary.sh [testnet|mainnet|signet] [runonce]"
echo echo
exit 1 exit 1
fi fi
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
if [ ! -f "/home/bitcoin/cln-plugins-available/plugins/summary/summary.py" ]; then if [ ! -f "/home/bitcoin/cl-plugins-available/plugins/summary/summary.py" ]; then
sudo -u bitcoin mkdir /home/bitcoin/cln-plugins-available sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available
cd /home/bitcoin/cln-plugins-available || exit 1 cd /home/bitcoin/cl-plugins-available || exit 1
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
fi fi
if [ $($lightningcli_alias | grep -c "summary") -eq 0 ];then if [ $($lightningcli_alias | grep -c "summary") -eq 0 ];then
@ -22,8 +22,8 @@ if [ $($lightningcli_alias | grep -c "summary") -eq 0 ];then
# https://github.com/ElementsProject/lightning/tree/master/contrib/pylightning # https://github.com/ElementsProject/lightning/tree/master/contrib/pylightning
sudo -u bitcoin pip install pylightning 1>/dev/null sudo -u bitcoin pip install pylightning 1>/dev/null
# https://github.com/lightningd/plugins#dynamic-plugin-initialization # https://github.com/lightningd/plugins#dynamic-plugin-initialization
sudo -u bitcoin pip install -r /home/bitcoin/cln-plugins-available/plugins/summary/requirements.txt 1>/dev/null sudo -u bitcoin pip install -r /home/bitcoin/cl-plugins-available/plugins/summary/requirements.txt 1>/dev/null
$lightningcli_alias plugin start -H /home/bitcoin/cln-plugins-available/plugins/summary/summary.py 1>/dev/null $lightningcli_alias plugin start -H /home/bitcoin/cl-plugins-available/plugins/summary/summary.py 1>/dev/null
fi fi
echo echo
@ -41,5 +41,5 @@ $lightningcli_alias -H summary
echo echo
if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then
$lightningcli_alias plugin stop -H /home/bitcoin/cln-plugins-available/plugins/summary/summary.py $lightningcli_alias plugin stop -H /home/bitcoin/cl-plugins-available/plugins/summary/summary.py
fi fi

View File

@ -4,17 +4,17 @@
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo echo
echo "---------------------------------------------------" echo "---------------------------------------------------"
echo "CLN RESCUE FILE (tar.gz of complete cln directory)" echo "CL RESCUE FILE (tar.gz of complete cl directory)"
echo "---------------------------------------------------" echo "---------------------------------------------------"
echo "cln.backup.sh cln-export" echo "cl.backup.sh cl-export"
echo "cln.backup.sh cln-export-gui" echo "cl.backup.sh cl-export-gui"
echo "cln.backup.sh cln-import [file]" echo "cl.backup.sh cl-import [file]"
echo "cln.backup.sh cln-import-gui [setup|production] [?resultfile]" echo "cl.backup.sh cl-import-gui [setup|production] [?resultfile]"
echo "---------------------------------------------------" echo "---------------------------------------------------"
echo "SEED WORDS" echo "SEED WORDS"
echo "---------------------------------------------------" echo "---------------------------------------------------"
echo "cln.backup.sh seed-export-gui [lndseeddata]" echo "cl.backup.sh seed-export-gui [lndseeddata]"
echo "cln.backup.sh seed-import-gui [resultfile]" echo "cl.backup.sh seed-import-gui [resultfile]"
echo echo
exit 1 exit 1
fi fi
@ -23,48 +23,48 @@ fi
mode="$1" mode="$1"
################################ ################################
# CLN RESCUE FILE - EXPORT # CL RESCUE FILE - EXPORT
################################ ################################
if [ ${mode} = "cln-export" ]; then if [ ${mode} = "cl-export" ]; then
echo "# *** CLN.RESCUE --> BACKUP" echo "# *** CL.RESCUE --> BACKUP"
downloadPath="/home/admin" downloadPath="/home/admin"
fileowner="admin" fileowner="admin"
# stop # stop
echo "# Stopping cln..." echo "# Stopping cl..."
sudo systemctl stop lightningd 1>/dev/null sudo systemctl stop lightningd 1>/dev/null
if grep -Eq "^tcln=on" /mnt/hdd/raspiblitz.conf; then if grep -Eq "^tcl=on" /mnt/hdd/raspiblitz.conf; then
echo "# stopping tcln..." echo "# stopping tcl..."
sudo systemctl stop tlightningd 1>/dev/null sudo systemctl stop tlightningd 1>/dev/null
fi fi
if grep -Eq "^scln=on" /mnt/hdd/raspiblitz.conf; then if grep -Eq "^scl=on" /mnt/hdd/raspiblitz.conf; then
echo "# stopping scln..." echo "# stopping scl..."
sudo systemctl stop slightningd 1>/dev/null sudo systemctl stop slightningd 1>/dev/null
fi fi
sleep 5 sleep 5
echo "# OK" echo "# OK"
echo echo
# add cln version info into lnd dir (to detect needed updates later) # add cl version info into lnd dir (to detect needed updates later)
clnVersion=$(sudo -u bitcoin lightning-cli --version | cut -d '-' -f1 | cut -d 'v' -f2) clVersion=$(sudo -u bitcoin lightning-cli --version | cut -d '-' -f1 | cut -d 'v' -f2)
sudo rm /mnt/hdd/app-data/.lightning/version.info 2>/dev/null sudo rm /mnt/hdd/app-data/.lightning/version.info 2>/dev/null
echo "${clnVersion}" > /home/admin/cln.version.info echo "${clVersion}" > /home/admin/cl.version.info
sudo mv /home/admin/cln.version.info /mnt/hdd/app-data/.lightning/version.info sudo mv /home/admin/cl.version.info /mnt/hdd/app-data/.lightning/version.info
sudo chown bitcoin:bitcoin /mnt/hdd/app-data/.lightning/version.info sudo chown bitcoin:bitcoin /mnt/hdd/app-data/.lightning/version.info
# zip it # zip it
sudo tar -zcvf ${downloadPath}/cln-rescue.tar.gz /mnt/hdd/app-data/.lightning 1>&2 sudo tar -zcvf ${downloadPath}/cl-rescue.tar.gz /mnt/hdd/app-data/.lightning 1>&2
sudo chown ${fileowner}:${fileowner} ${downloadPath}/cln-rescue.tar.gz 1>&2 sudo chown ${fileowner}:${fileowner} ${downloadPath}/cl-rescue.tar.gz 1>&2
# delete old backups # delete old backups
rm ${downloadPath}/cln-rescue-*.tar.gz 2>/dev/null 1>/dev/null rm ${downloadPath}/cl-rescue-*.tar.gz 2>/dev/null 1>/dev/null
# name with md5 checksum # name with md5 checksum
md5checksum=$(md5sum ${downloadPath}/cln-rescue.tar.gz | head -n1 | cut -d " " -f1) md5checksum=$(md5sum ${downloadPath}/cl-rescue.tar.gz | head -n1 | cut -d " " -f1)
mv ${downloadPath}/cln-rescue.tar.gz ${downloadPath}/cln-rescue-${md5checksum}.tar.gz 1>&2 mv ${downloadPath}/cl-rescue.tar.gz ${downloadPath}/cl-rescue-${md5checksum}.tar.gz 1>&2
byteSize=$(ls -l ${downloadPath}/cln-rescue-${md5checksum}.tar.gz | awk '{print $5}') byteSize=$(ls -l ${downloadPath}/cl-rescue-${md5checksum}.tar.gz | awk '{print $5}')
# check file size # check file size
if [ ${byteSize} -lt 100 ]; then if [ ${byteSize} -lt 100 ]; then
@ -73,17 +73,17 @@ if [ ${mode} = "cln-export" ]; then
fi fi
# output result data # output result data
echo "# cln service is stopped for security" echo "# cl service is stopped for security"
echo "filename='${downloadPath}/cln-rescue-${md5checksum}.tar.gz'" echo "filename='${downloadPath}/cl-rescue-${md5checksum}.tar.gz'"
echo "fileowner='${fileowner}'" echo "fileowner='${fileowner}'"
echo "size=${byteSize}" echo "size=${byteSize}"
exit 0 exit 0
fi fi
if [ ${mode} = "cln-export-gui" ]; then if [ ${mode} = "cl-export-gui" ]; then
# create lnd rescue file # create lnd rescue file
source <(/home/admin/config.scripts/cln.backup.sh cln-export) source <(/home/admin/config.scripts/cl.backup.sh cl-export)
if [ "${error}" != "" ]; then if [ "${error}" != "" ]; then
echo "error='${error}'" echo "error='${error}'"
exit 1 exit 1
@ -115,10 +115,10 @@ if [ ${mode} = "cln-export-gui" ]; then
fi fi
################################ ################################
# CLN RESCUE FILE - IMPORT # CL RESCUE FILE - IMPORT
################################ ################################
if [ ${mode} = "cln-import" ]; then if [ ${mode} = "cl-import" ]; then
# 2nd PARAMETER: file to import (expect that the file was valid checked from calling script) # 2nd PARAMETER: file to import (expect that the file was valid checked from calling script)
filename=$2 filename=$2
@ -133,24 +133,24 @@ if [ ${mode} = "cln-import" ]; then
fi fi
# stop # stop
echo "# stopping cln..." echo "# stopping cl..."
sudo systemctl stop lightningd 1>/dev/null sudo systemctl stop lightningd 1>/dev/null
if grep -Eq "^tcln=on" /mnt/hdd/raspiblitz.conf; then if grep -Eq "^tcl=on" /mnt/hdd/raspiblitz.conf; then
echo "# stopping tcln..." echo "# stopping tcl..."
sudo systemctl stop tlightningd 1>/dev/null sudo systemctl stop tlightningd 1>/dev/null
fi fi
if grep -Eq "^scln=on" /mnt/hdd/raspiblitz.conf; then if grep -Eq "^scl=on" /mnt/hdd/raspiblitz.conf; then
echo "# stopping scln..." echo "# stopping scl..."
sudo systemctl stop slightningd 1>/dev/null sudo systemctl stop slightningd 1>/dev/null
fi fi
sleep 5 sleep 5
# clean DIR # clean DIR
echo "# cleaning old CLN data ..." echo "# cleaning old CL data ..."
sudo rm -r /mnt/hdd/app-data/.lightning/* 1>/dev/null 2>/dev/null sudo rm -r /mnt/hdd/app-data/.lightning/* 1>/dev/null 2>/dev/null
# unpack zip # unpack zip
echo "# restoring CLN data from ${filename} ..." echo "# restoring CL data from ${filename} ..."
sudo tar -xf ${filename} -C / 1>/dev/null sudo tar -xf ${filename} -C / 1>/dev/null
sudo chown -R bitcoin:bitcoin /mnt/hdd/app-data/.lightning 1>/dev/null sudo chown -R bitcoin:bitcoin /mnt/hdd/app-data/.lightning 1>/dev/null
@ -160,7 +160,7 @@ if [ ${mode} = "cln-import" ]; then
fi fi
if [ ${mode} = "cln-import-gui" ]; then if [ ${mode} = "cl-import-gui" ]; then
# get by second parameter if this call if happening during setup or production # get by second parameter if this call if happening during setup or production
scenario=$2 scenario=$2
@ -195,22 +195,22 @@ if [ ${mode} = "cln-import-gui" ]; then
echo "**************************" echo "**************************"
echo "* UPLOAD THE RESCUE FILE *" echo "* UPLOAD THE RESCUE FILE *"
echo "**************************" echo "**************************"
echo "If you have a cln-rescue backup file on your laptop you can now" echo "If you have a cl-rescue backup file on your laptop you can now"
echo "upload it and restore your latest C-Lightning state." echo "upload it and restore your latest C-Lightning state."
echo echo
echo "CAUTION: Dont restore outdated states - risk of loosing funds!" echo "CAUTION: Dont restore outdated states - risk of loosing funds!"
echo echo
echo "To make upload open a new terminal on your laptop," echo "To make upload open a new terminal on your laptop,"
echo "change into the directory where your cln-rescue file is and" echo "change into the directory where your cl-rescue file is and"
echo "COPY, PASTE AND EXECUTE THE FOLLOWING COMMAND:" echo "COPY, PASTE AND EXECUTE THE FOLLOWING COMMAND:"
echo "scp -r ./cln-rescue-*.tar.gz ${defaultUploadUser}@${localip}:${defaultUploadPath}/" echo "scp -r ./cl-rescue-*.tar.gz ${defaultUploadUser}@${localip}:${defaultUploadPath}/"
echo "" echo ""
echo "Use ${passwordInfo} to authenticate file transfer." echo "Use ${passwordInfo} to authenticate file transfer."
echo "PRESS ENTER when upload is done" echo "PRESS ENTER when upload is done"
read key read key
# check upload (will return filename or error) # check upload (will return filename or error)
source <(sudo /home/admin/config.scripts/blitz.upload.sh check-upload cln-rescue) source <(sudo /home/admin/config.scripts/blitz.upload.sh check-upload cl-rescue)
if [ "${filename}" != "" ]; then if [ "${filename}" != "" ]; then
echo "OK - File found: ${filename}" echo "OK - File found: ${filename}"
echo "PRESS ENTER to continue." echo "PRESS ENTER to continue."
@ -222,7 +222,7 @@ if [ ${mode} = "cln-import-gui" ]; then
read keyRetry read keyRetry
elif [ "${error}" == "multiple" ]; then elif [ "${error}" == "multiple" ]; then
echo "!! WARNING !!" echo "!! WARNING !!"
echo "There are multiple cln-rescue files in directory ${defaultUploadPath}" echo "There are multiple cl-rescue files in directory ${defaultUploadPath}"
echo "Make sure you upload only one tar.gz-file and start again." echo "Make sure you upload only one tar.gz-file and start again."
echo "PRESS ENTER to continue & retry ... or 'x'+ ENTER to cancel" echo "PRESS ENTER to continue & retry ... or 'x'+ ENTER to cancel"
read keyRetry read keyRetry
@ -247,9 +247,9 @@ if [ ${mode} = "cln-import-gui" ]; then
# in setup scenario the final import is happening during provison # in setup scenario the final import is happening during provison
if [ "${scenario}" == "setup" ]; then if [ "${scenario}" == "setup" ]; then
# just add clnrescue filename to give file # just add clrescue filename to give file
echo "# result in: ${RESULTFILE} (remember to make clean delete once processed)" echo "# result in: ${RESULTFILE} (remember to make clean delete once processed)"
echo "clnrescue='${filename}'" >> $RESULTFILE echo "clrescue='${filename}'" >> $RESULTFILE
exit 0 exit 0
fi fi
@ -269,17 +269,17 @@ if [ ${mode} = "cln-import-gui" ]; then
echo echo
# run import process # run import process
echo "OK deleting old CLN data & restoring imported rescue file ..." echo "OK deleting old CL data & restoring imported rescue file ..."
source <(sudo /home/admin/config.scripts/cln.backup.sh cln-import ${filename}) source <(sudo /home/admin/config.scripts/cl.backup.sh cl-import ${filename})
# TODO: check if update of CLN is needed (see detailes in cln-import) for edge case # TODO: check if update of CL is needed (see detailes in cl-import) for edge case
# turn off auto-unlock if activated because password c might now change # turn off auto-unlock if activated because password c might now change
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off /home/admin/config.scripts/cl.hsmtool.sh autounlock-off
# detect if the imported hsm_secret is encrypted # detect if the imported hsm_secret is encrypted
# use the variables for the default network # use the variables for the default network
source <(/home/admin/config.scripts/network.aliases.sh getvars cln) source <(/home/admin/config.scripts/network.aliases.sh getvars cl)
hsmSecretPath="/home/bitcoin/.lightning/${CLNETWORK}/hsm_secret" hsmSecretPath="/home/bitcoin/.lightning/${CLNETWORK}/hsm_secret"
# check if encrypted # check if encrypted
trap 'rm -f "$output"' EXIT trap 'rm -f "$output"' EXIT
@ -290,33 +290,33 @@ if [ ${mode} = "cln-import-gui" ]; then
echo "# The hsm_secret is not encrypted" echo "# The hsm_secret is not encrypted"
echo "# Record in raspiblitz.conf" echo "# Record in raspiblitz.conf"
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \ "s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=off/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
else else
cat $output cat $output
echo "# Starting cln.hsmtool.sh unlock" echo "# Starting cl.hsmtool.sh unlock"
/home/admin/config.scripts/cln.hsmtool.sh unlock # there are mutiple wallets possible, need to check for non-default ones too /home/admin/config.scripts/cl.hsmtool.sh unlock # there are mutiple wallets possible, need to check for non-default ones too
fi fi
# set the lightningd service file on each active network # set the lightningd service file on each active network
# init backup plugin, restart cln # init backup plugin, restart cl
if [ "${cln}" == "on" ] || [ "${cln}" == "1" ]; then if [ "${cl}" == "on" ] || [ "${cl}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh mainnet /home/admin/config.scripts/cl.install-service.sh mainnet
/home/admin/config.scripts/cln-plugin.backup.sh on mainnet /home/admin/config.scripts/cl-plugin.backup.sh on mainnet
fi fi
if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then if [ "${tcl}" == "on" ] || [ "${tcl}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh testnet /home/admin/config.scripts/cl.install-service.sh testnet
/home/admin/config.scripts/cln-plugin.backup.sh on testnet /home/admin/config.scripts/cl-plugin.backup.sh on testnet
fi fi
if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then if [ "${scl}" == "on" ] || [ "${scl}" == "1" ]; then
/home/admin/config.scripts/cln.install-service.sh signet /home/admin/config.scripts/cl.install-service.sh signet
/home/admin/config.scripts/cln-plugin.backup.sh on signet /home/admin/config.scripts/cl-plugin.backup.sh on signet
fi fi
# give final info # give final info
echo echo
echo "# DONE - lightningd is now starting" echo "# DONE - lightningd is now starting"
echo "# Check that CLN is starting up correctly and your old channels & funds are restored." echo "# Check that CL is starting up correctly and your old channels & funds are restored."
echo "# Take into account that some channels might have been force closed in the meanwhile." echo "# Take into account that some channels might have been force closed in the meanwhile."
echo echo
exit 0 exit 0
@ -432,7 +432,7 @@ wordone wordtweo wordthree ...
fi fi
done done
# dont ask for password D (seed password) because raspiblitz never had that option for cln # dont ask for password D (seed password) because raspiblitz never had that option for cl
passwordD="" passwordD=""
# writing result file data # writing result file data

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# keeps the password in memory between restarts: /dev/shm/.${netprefix}cln.pw # keeps the password in memory between restarts: /dev/shm/.${netprefix}cl.pw
# see the reasoning: https://github.com/ElementsProject/lightning#hd-wallet-encryption # see the reasoning: https://github.com/ElementsProject/lightning#hd-wallet-encryption
# does not store the password on disk unless auto-unlock is enabled # does not store the password on disk unless auto-unlock is enabled
# autounlock password is in /root/.${netprefix}cln.pw # autounlock password is in /root/.${netprefix}cl.pw
# command info # command info
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]||\ if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]||\
@ -14,44 +14,44 @@ if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]||\
echo echo
echo "Usage:" echo "Usage:"
echo "Create new wallet:" echo "Create new wallet:"
echo "cln.hsmtool.sh [new] [mainnet|testnet|signet] [?seedPassword]" echo "cl.hsmtool.sh [new] [mainnet|testnet|signet] [?seedPassword]"
echo "cln.hsmtool.sh [new-force] [mainnet|testnet|signet] [?seedPassword]" echo "cl.hsmtool.sh [new-force] [mainnet|testnet|signet] [?seedPassword]"
echo "There will be no seedPassword(passphrase) used by default" echo "There will be no seedPassword(passphrase) used by default"
echo "new-force will delete any old wallet and will work without dialog" echo "new-force will delete any old wallet and will work without dialog"
echo echo
echo "cln.hsmtool.sh [seed] [mainnet|testnet|signet] [\"space-separated-seed-words\"] [?seedPassword]" echo "cl.hsmtool.sh [seed] [mainnet|testnet|signet] [\"space-separated-seed-words\"] [?seedPassword]"
echo "cln.hsmtool.sh [seed-force] [mainnet|testnet|signet] [\"space-separated-seed-words\"] [?seedPassword]" echo "cl.hsmtool.sh [seed-force] [mainnet|testnet|signet] [\"space-separated-seed-words\"] [?seedPassword]"
echo "The new hsm_secret will be not encrypted if no NewPassword is given" echo "The new hsm_secret will be not encrypted if no NewPassword is given"
echo "seed-force will delete any old wallet and will work without dialog" echo "seed-force will delete any old wallet and will work without dialog"
echo echo
echo "cln.hsmtool.sh [unlock|lock] <mainnet|testnet|signet>" echo "cl.hsmtool.sh [unlock|lock] <mainnet|testnet|signet>"
echo "cln.hsmtool.sh [encrypt|decrypt] <mainnet|testnet|signet>" echo "cl.hsmtool.sh [encrypt|decrypt] <mainnet|testnet|signet>"
echo "cln.hsmtool.sh [autounlock-on|autounlock-off] <mainnet|testnet|signet>" echo "cl.hsmtool.sh [autounlock-on|autounlock-off] <mainnet|testnet|signet>"
echo echo
echo "cln.hsmtool.sh [change-password] <mainnet|testnet|signet> <NewPassword>" echo "cl.hsmtool.sh [change-password] <mainnet|testnet|signet> <NewPassword>"
echo echo
exit 1 exit 1
fi fi
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
hsmSecretPath="/home/bitcoin/.lightning/${CLNETWORK}/hsm_secret" hsmSecretPath="/home/bitcoin/.lightning/${CLNETWORK}/hsm_secret"
# password file is on the disk if encrypted and auto-unlock is enabled # password file is on the disk if encrypted and auto-unlock is enabled
passwordFile=/dev/shm/.${netprefix}cln.pw passwordFile=/dev/shm/.${netprefix}cl.pw
if grep -Eq "${netprefix}clnEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then if grep -Eq "${netprefix}clEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
if grep -Eq "${netprefix}clnAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then if grep -Eq "${netprefix}clAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then
passwordFile=/root/${netprefix}cln.pw passwordFile=/root/${netprefix}cl.pw
fi fi
fi fi
# add default value to raspi config if needed # add default value to raspi config if needed
if ! grep -Eq "^${netprefix}clnEncryptedHSM=" /mnt/hdd/raspiblitz.conf; then if ! grep -Eq "^${netprefix}clEncryptedHSM=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}clnEncryptedHSM=off" >> /mnt/hdd/raspiblitz.conf echo "${netprefix}clEncryptedHSM=off" >> /mnt/hdd/raspiblitz.conf
fi fi
# add default value to raspi config if needed # add default value to raspi config if needed
if ! grep -Eq "^${netprefix}clnAutoUnlock=" /mnt/hdd/raspiblitz.conf; then if ! grep -Eq "^${netprefix}clAutoUnlock=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}clnAutoUnlock=off" >> /mnt/hdd/raspiblitz.conf echo "${netprefix}clAutoUnlock=off" >> /mnt/hdd/raspiblitz.conf
fi fi
############# #############
@ -100,11 +100,11 @@ function shredPasswordFile() {
echo echo
echo "# Shredding the passwordFile" echo "# Shredding the passwordFile"
echo echo
if [ -f /dev/shm/.${netprefix}cln.pw ];then if [ -f /dev/shm/.${netprefix}cl.pw ];then
sudo shred -uvz /dev/shm/.${netprefix}cln.pw sudo shred -uvz /dev/shm/.${netprefix}cl.pw
fi fi
if [ -f /root/${netprefix}cln.pw ];then if [ -f /root/${netprefix}cl.pw ];then
sudo shred -uvz /root/${netprefix}cln.pw sudo shred -uvz /root/${netprefix}cl.pw
fi fi
} }
@ -123,7 +123,7 @@ function encryptHSMsecret() {
sudo -u bitcoin lightning-hsmtool encrypt $hsmSecretPath || exit 1 sudo -u bitcoin lightning-hsmtool encrypt $hsmSecretPath || exit 1
# setting value in raspiblitz.conf # setting value in raspiblitz.conf
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=on/g" \ "s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=on/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
echo "# Encrypted the hsm_secret for C-lightning $CHAIN" echo "# Encrypted the hsm_secret for C-lightning $CHAIN"
} }
@ -142,7 +142,7 @@ function decryptHSMsecret() {
else else
# setting value in raspiblitz.conf # setting value in raspiblitz.conf
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=on/g" \ "s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=on/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
if [ -f $passwordFile ];then if [ -f $passwordFile ];then
echo "# Getting the password from $passwordFile" echo "# Getting the password from $passwordFile"
@ -154,7 +154,7 @@ function decryptHSMsecret() {
echo "# Decrypted successfully" echo "# Decrypted successfully"
else else
# unlock manually # unlock manually
/home/admin/config.scripts/cln.hsmtool.sh unlock /home/admin/config.scripts/cl.hsmtool.sh unlock
# attempt to decrypt again # attempt to decrypt again
sudo cat $passwordFile | sudo -u bitcoin lightning-hsmtool decrypt \ sudo cat $passwordFile | sudo -u bitcoin lightning-hsmtool decrypt \
"$hsmSecretPath" || echo "# Couldn't decrypt"; exit 1 "$hsmSecretPath" || echo "# Couldn't decrypt"; exit 1
@ -163,7 +163,7 @@ function decryptHSMsecret() {
shredPasswordFile shredPasswordFile
# setting value in raspiblitz config # setting value in raspiblitz config
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \ "s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=off/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
echo "# Decrypted the hsm_secret for C-lightning $CHAIN" echo "# Decrypted the hsm_secret for C-lightning $CHAIN"
} }
@ -198,15 +198,15 @@ if [ "$1" = "new" ] || [ "$1" = "new-force" ] || [ "$1" = "seed" ] || [ "$1" = "
seedPassword="$3" seedPassword="$3"
# get 24 words # get 24 words
source <(python /home/admin/config.scripts/blitz.mnemonic.py generate) source <(python /home/admin/config.scripts/blitz.mnemonic.py generate)
#TODO seedwords to cln.backup.sh seed-export-gui #TODO seedwords to cl.backup.sh seed-export-gui
/home/admin/config.scripts/cln.backup.sh seed-export-gui "${seedwords6x4}" /home/admin/config.scripts/cl.backup.sh seed-export-gui "${seedwords6x4}"
elif [ "$1" = "new-force" ]; then elif [ "$1" = "new-force" ]; then
# get 24 words # get 24 words
source <(python /home/admin/config.scripts/blitz.mnemonic.py generate) source <(python /home/admin/config.scripts/blitz.mnemonic.py generate)
echo "seedwords='${seedwords}'" echo "seedwords='${seedwords}'"
echo "seedwords6x4='${seedwords6x4}'" echo "seedwords6x4='${seedwords6x4}'"
elif [ "$1" = "seed" ] || [ "$1" = "seed-force" ]; then elif [ "$1" = "seed" ] || [ "$1" = "seed-force" ]; then
#TODO get seedwords from cln.backup.sh seed-import-gui [$RESULTFILE] #TODO get seedwords from cl.backup.sh seed-import-gui [$RESULTFILE]
seedwords="$3" seedwords="$3"
seedpassword="$4" seedpassword="$4"
fi fi
@ -216,7 +216,7 @@ if [ "$1" = "new" ] || [ "$1" = "new-force" ] || [ "$1" = "seed" ] || [ "$1" = "
sudo chown bitcoin:bitcoin /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info sudo chown bitcoin:bitcoin /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info
sudo chmod 600 /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info sudo chmod 600 /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info
echo " echo "
# This file was placed by cln.hsmtool.sh . # This file was placed by cl.hsmtool.sh .
# Contains the seed words from which the hsm_secret in the same directory was generated # Contains the seed words from which the hsm_secret in the same directory was generated
seedwords='${seedwords}' seedwords='${seedwords}'
seedwords6x4='${seedwords6x4}' seedwords6x4='${seedwords6x4}'
@ -234,7 +234,7 @@ seedwords6x4='${seedwords6x4}'
fi fi
echo "# Re-init the backup plugin with the new wallet" echo "# Re-init the backup plugin with the new wallet"
/home/admin/config.scripts/cln-plugin.backup.sh on $CHAIN /home/admin/config.scripts/cl-plugin.backup.sh on $CHAIN
exit 0 exit 0
@ -243,10 +243,10 @@ elif [ "$1" = "unlock" ]; then
attempt=0 attempt=0
justUnlocked=0 justUnlocked=0
while [ $($lightningcli_alias getinfo 2>&1 | grep -c '"id":') -eq 0 ];do while [ $($lightningcli_alias getinfo 2>&1 | grep -c '"id":') -eq 0 ];do
clnError=$(sudo journalctl -n5 -u ${netprefix}lightningd) clError=$(sudo journalctl -n5 -u ${netprefix}lightningd)
# getpassword # getpassword
if [ $(echo "${clnError}" | \ if [ $(echo "${clError}" | \
grep -c 'encrypted-hsm: Could not read pass from stdin.') -gt 0 ];then grep -c 'encrypted-hsm: Could not read pass from stdin.') -gt 0 ];then
if [ ${justUnlocked} -eq 0 ];then if [ ${justUnlocked} -eq 0 ];then
if [ -f $passwordFile ];then if [ -f $passwordFile ];then
@ -263,19 +263,19 @@ elif [ "$1" = "unlock" ]; then
fi fi
# configure --encrypted-hsm # configure --encrypted-hsm
elif [ $(echo "${clnError}" | \ elif [ $(echo "${clError}" | \
grep -c 'hsm_secret is encrypted, you need to pass the --encrypted-hsm startup option.') -gt 0 ];then grep -c 'hsm_secret is encrypted, you need to pass the --encrypted-hsm startup option.') -gt 0 ];then
echo "# The hsm_secret is encrypted, but unlock is not configured" echo "# The hsm_secret is encrypted, but unlock is not configured"
passwordToFile passwordToFile
# setting value in raspiblitz config # setting value in raspiblitz config
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=on/g" \ "s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=on/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
/home/admin/config.scripts/cln.install-service.sh $CHAIN /home/admin/config.scripts/cl.install-service.sh $CHAIN
# get new password # get new password
elif [ $(echo "${clnError}" | \ elif [ $(echo "${clError}" | \
grep -c 'Wrong password for encrypted hsm_secret.') -gt 0 ];then grep -c 'Wrong password for encrypted hsm_secret.') -gt 0 ];then
echo "# Wrong password" echo "# Wrong password"
sudo rm -f $passwordFile sudo rm -f $passwordFile
@ -322,7 +322,7 @@ elif [ "$1" = "encrypt" ]; then
sudo -u bitcoin shred /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info sudo -u bitcoin shred /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info
fi fi
echo " echo "
# This file is placed by cln.hsmtool.sh . # This file is placed by cl.hsmtool.sh .
# The seed words from which the hsm_secret in the same directory was generated # The seed words from which the hsm_secret in the same directory was generated
# were $deletedWhen. # were $deletedWhen.
# The words cannot be generated from the hsm_secret (one way function). # The words cannot be generated from the hsm_secret (one way function).
@ -337,29 +337,29 @@ elif [ "$1" = "decrypt" ]; then
decryptHSMsecret decryptHSMsecret
elif [ "$1" = "autounlock-on" ]; then elif [ "$1" = "autounlock-on" ]; then
if grep -Eq "${netprefix}clnEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then if grep -Eq "${netprefix}clEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
echo "# Moving the password from $passwordFile to /root/.${netprefix}cln.pw" echo "# Moving the password from $passwordFile to /root/.${netprefix}cl.pw"
sudo -u bitcoin mv /dev/shm/.${netprefix}cln.pw /root/.${netprefix}cln.pw sudo -u bitcoin mv /dev/shm/.${netprefix}cl.pw /root/.${netprefix}cl.pw
else else
passwordFile=/root/.${netprefix}cln.pw passwordFile=/root/.${netprefix}cl.pw
passwordToFile passwordToFile
fi fi
# setting value in raspiblitz config # setting value in raspiblitz config
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnAutoUnlock=on/g" \ "s/^${netprefix}clAutoUnlock=.*/${netprefix}clAutoUnlock=on/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
echo "# Autounlock is on for C-lightning $CHAIN" echo "# Autounlock is on for C-lightning $CHAIN"
elif [ "$1" = "autounlock-off" ]; then elif [ "$1" = "autounlock-off" ]; then
if [ -f /root/${netprefix}cln.pw ];then if [ -f /root/${netprefix}cl.pw ];then
sudo cp /root/.${netprefix}cln.pw /dev/shm/.${netprefix}cln.pw sudo cp /root/.${netprefix}cl.pw /dev/shm/.${netprefix}cl.pw
sudo shred -uzv /root/.${netprefix}cln.pw sudo shred -uzv /root/.${netprefix}cl.pw
sudo chmod 600 /dev/shm/.${netprefix}cln.pw sudo chmod 600 /dev/shm/.${netprefix}cl.pw
sudo chown bitcoin:bitcoin /dev/shm/.${netprefix}cln.pw sudo chown bitcoin:bitcoin /dev/shm/.${netprefix}cl.pw
fi fi
# setting value in raspiblitz config # setting value in raspiblitz config
sudo sed -i \ sudo sed -i \
"s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnAutoUnlock=off/g" \ "s/^${netprefix}clAutoUnlock=.*/${netprefix}clAutoUnlock=off/g" \
/mnt/hdd/raspiblitz.conf /mnt/hdd/raspiblitz.conf
echo "# Autounlock is off for C-lightning $CHAIN" echo "# Autounlock is off for C-lightning $CHAIN"
@ -369,7 +369,7 @@ elif [ "$1" = "change-password" ]; then
if ! encryptHSMsecret "$walletPassword"; then if ! encryptHSMsecret "$walletPassword"; then
echo "# Warning: the hsm_secret is left unencrypted." echo "# Warning: the hsm_secret is left unencrypted."
echo "# To fix run:" echo "# To fix run:"
echo "/home/admin/config.scripts/cln.hsmtool encrypt $2" echo "/home/admin/config.scripts/cl.hsmtool encrypt $2"
exit 1 exit 1
fi fi
exit 0 exit 0
@ -389,4 +389,4 @@ else
fi fi
# set the lightningd service file after all choices unless exited before # set the lightningd service file after all choices unless exited before
/home/admin/config.scripts/cln.install-service.sh $CHAIN /home/admin/config.scripts/cl.install-service.sh $CHAIN

View File

@ -5,26 +5,26 @@ if [ "$1" = "-h" ]||[ "$1" = "--help" ];then
echo echo
echo "Script to set up or update the C-lightning systemd service" echo "Script to set up or update the C-lightning systemd service"
echo "Usage:" echo "Usage:"
echo "/home/admin/config.scripts/cln.install-service.sh <mainnet|testnet|signet>" echo "/home/admin/config.scripts/cl.install-service.sh <mainnet|testnet|signet>"
echo echo
exit 1 exit 1
fi fi
# source <(/home/admin/config.scripts/network.aliases.sh getvars cln <mainnet|testnet|signet>) # source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
if [ $(sudo -u bitcoin cat ${CLNCONF} | grep -c "^sparko") -gt 0 ];then if [ $(sudo -u bitcoin cat ${CLCONF} | grep -c "^sparko") -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cln-plugins-enabled/sparko ];then if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then
echo "# The Sparko plugin is not present but in config" echo "# The Sparko plugin is not present but in config"
/home/admin/config.scripts/cln-plugin.sparko.sh on $CHAIN /home/admin/config.scripts/cl-plugin.sparko.sh on $CHAIN
fi fi
fi fi
if grep -Eq "${netprefix}clnEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then if grep -Eq "${netprefix}clEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
if grep -Eq "${netprefix}clnAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then if grep -Eq "${netprefix}clAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then
passwordFile=/root/.${netprefix}cln.pw passwordFile=/root/.${netprefix}cl.pw
else else
passwordFile=/dev/shm/.${netprefix}cln.pw passwordFile=/dev/shm/.${netprefix}cl.pw
fi fi
passwordInput="(cat $passwordFile;echo;cat $passwordFile) | " passwordInput="(cat $passwordFile;echo;cat $passwordFile) | "
encryptedHSMoption="--encrypted-hsm" encryptedHSMoption="--encrypted-hsm"
@ -45,7 +45,7 @@ User=bitcoin
Group=bitcoin Group=bitcoin
Type=simple Type=simple
ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd\ ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd\
--conf=${CLNCONF} ${encryptedHSMoption}' --conf=${CLCONF} ${encryptedHSMoption}'
Restart=always Restart=always
TimeoutSec=120 TimeoutSec=120
RestartSec=30 RestartSec=30

View File

@ -21,10 +21,10 @@ if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then
echo "mainnet / testnet / signet instances can run parallel" echo "mainnet / testnet / signet instances can run parallel"
echo echo
echo "Usage:" echo "Usage:"
echo "cln.install.sh on <mainnet|testnet|signet>" echo "cl.install.sh on <mainnet|testnet|signet>"
echo "cln.install.sh off <mainnet|testnet|signet> <purge>" echo "cl.install.sh off <mainnet|testnet|signet> <purge>"
echo "cln.install.sh [update <version>|testPR <PRnumber>]" echo "cl.install.sh [update <version>|testPR <PRnumber>]"
echo "cln.install.sh display-seed <mainnet|testnet|signet>" echo "cl.install.sh display-seed <mainnet|testnet|signet>"
echo echo
exit 1 exit 1
fi fi
@ -32,31 +32,31 @@ fi
# Tor # Tor
TORGROUP="debian-tor" TORGROUP="debian-tor"
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
echo "# Running: 'cln.install.sh $*'" echo "# Running: 'cl.install.sh $*'"
echo "# Using the settings for: ${network} ${CHAIN}" echo "# Using the settings for: ${network} ${CHAIN}"
# add default value to raspi config if needed # add default value to raspi config if needed
if ! grep -Eq "^lightning=" /mnt/hdd/raspiblitz.conf; then if ! grep -Eq "^lightning=" /mnt/hdd/raspiblitz.conf; then
echo "lightning=cln" | sudo tee -a /mnt/hdd/raspiblitz.conf echo "lightning=cl" | sudo tee -a /mnt/hdd/raspiblitz.conf
fi fi
# add default value to raspi config if needed # add default value to raspi config if needed
if ! grep -Eq "^${netprefix}cln=" /mnt/hdd/raspiblitz.conf; then if ! grep -Eq "^${netprefix}cl=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}cln=off" | sudo tee -a /mnt/hdd/raspiblitz.conf echo "${netprefix}cl=off" | sudo tee -a /mnt/hdd/raspiblitz.conf
fi fi
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];then if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];then
if [ "${CHAIN}" == "testnet" ] && [ "${testnet}" != "on" ]; then if [ "${CHAIN}" == "testnet" ] && [ "${testnet}" != "on" ]; then
echo "# before activating testnet on cln, first activate testnet on bitcoind" echo "# before activating testnet on cl, first activate testnet on bitcoind"
echo "err='missing bitcoin testnet'" echo "err='missing bitcoin testnet'"
exit 1 exit 1
fi fi
if [ "${CHAIN}" == "signet" ] && [ "${signet}" != "on" ]; then if [ "${CHAIN}" == "signet" ] && [ "${signet}" != "on" ]; then
echo "# before activating signet on cln, first activate signet on bitcoind" echo "# before activating signet on cl, first activate signet on bitcoind"
echo "err='missing bitcoin signet'" echo "err='missing bitcoin signet'"
exit 1 exit 1
fi fi
@ -146,11 +146,11 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];
echo "# Make sure bitcoin is in the ${TORGROUP} group" echo "# Make sure bitcoin is in the ${TORGROUP} group"
sudo usermod -a -G ${TORGROUP} bitcoin sudo usermod -a -G ${TORGROUP} bitcoin
echo "# Add plugin-dir: /home/bitcoin/${netprefix}cln-plugins-enabled" echo "# Add plugin-dir: /home/bitcoin/${netprefix}cl-plugins-enabled"
echo "# Add plugin-dir: /home/bitcoin/cln-plugins-available" echo "# Add plugin-dir: /home/bitcoin/cl-plugins-available"
# note that the disk is mounted with noexec # note that the disk is mounted with noexec
sudo -u bitcoin mkdir /home/bitcoin/${netprefix}cln-plugins-enabled 2>/dev/null sudo -u bitcoin mkdir /home/bitcoin/${netprefix}cl-plugins-enabled 2>/dev/null
sudo -u bitcoin mkdir /home/bitcoin/cln-plugins-available 2>/dev/null sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available 2>/dev/null
echo "# Store the lightning data in /mnt/hdd/app-data/.lightning" echo "# Store the lightning data in /mnt/hdd/app-data/.lightning"
echo "# Symlink to /home/bitcoin/" echo "# Symlink to /home/bitcoin/"
@ -162,24 +162,24 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];
sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK} sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK}
fi fi
if ! sudo ls ${CLNCONF};then if ! sudo ls ${CLCONF};then
echo "# Create ${CLNCONF}" echo "# Create ${CLCONF}"
echo "# lightningd configuration for ${network} ${CHAIN} echo "# lightningd configuration for ${network} ${CHAIN}
network=${CLNETWORK} network=${CLNETWORK}
announce-addr=127.0.0.1:${portprefix}9736 announce-addr=127.0.0.1:${portprefix}9736
log-file=cl.log log-file=cl.log
log-level=info log-level=info
plugin-dir=/home/bitcoin/${netprefix}cln-plugins-enabled plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled
# Tor settings # Tor settings
proxy=127.0.0.1:9050 proxy=127.0.0.1:9050
bind-addr=127.0.0.1:${portprefix}9736 bind-addr=127.0.0.1:${portprefix}9736
addr=statictor:127.0.0.1:9051/torport=${portprefix}9736 addr=statictor:127.0.0.1:9051/torport=${portprefix}9736
always-use-proxy=true always-use-proxy=true
" | sudo tee ${CLNCONF} " | sudo tee ${CLCONF}
else else
echo "# The file ${CLNCONF} is already present" echo "# The file ${CLCONF} is already present"
fi fi
sudo chown -R bitcoin:bitcoin /mnt/hdd/app-data/.lightning sudo chown -R bitcoin:bitcoin /mnt/hdd/app-data/.lightning
sudo chown -R bitcoin:bitcoin /home/bitcoin/ sudo chown -R bitcoin:bitcoin /home/bitcoin/
@ -187,24 +187,24 @@ always-use-proxy=true
################# #################
# Backup plugin # # Backup plugin #
################# #################
/home/admin/config.scripts/cln-plugin.backup.sh on $CHAIN /home/admin/config.scripts/cl-plugin.backup.sh on $CHAIN
################### ###################
# Systemd service # # Systemd service #
################### ###################
/home/admin/config.scripts/cln.install-service.sh $CHAIN /home/admin/config.scripts/cl.install-service.sh $CHAIN
echo echo
echo "# Adding aliases" echo "# Adding aliases"
echo "\ echo "\
alias ${netprefix}lightning-cli=\"sudo -u bitcoin /usr/local/bin/lightning-cli\ alias ${netprefix}lightning-cli=\"sudo -u bitcoin /usr/local/bin/lightning-cli\
--conf=${CLNCONF}\" --conf=${CLCONF}\"
alias ${netprefix}cln=\"sudo -u bitcoin /usr/local/bin/lightning-cli\ alias ${netprefix}cl=\"sudo -u bitcoin /usr/local/bin/lightning-cli\
--conf=${CLNCONF}\" --conf=${CLCONF}\"
alias ${netprefix}clnlog=\"sudo\ alias ${netprefix}cllog=\"sudo\
tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log\" tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log\"
alias ${netprefix}clnconf=\"sudo\ alias ${netprefix}clconf=\"sudo\
nano ${CLNCONF}\" nano ${CLCONF}\"
" | sudo tee -a /home/admin/_aliases " | sudo tee -a /home/admin/_aliases
sudo chown admin:admin /home/admin/_aliases sudo chown admin:admin /home/admin/_aliases
@ -222,12 +222,12 @@ alias ${netprefix}clnconf=\"sudo\
echo echo
# setting value in the raspiblitz.conf # setting value in the raspiblitz.conf
sudo sed -i "s/^${netprefix}cln=.*/${netprefix}cln=on/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^${netprefix}cl=.*/${netprefix}cl=on/g" /mnt/hdd/raspiblitz.conf
# if this is the first lightning mainnet turned on - make default # if this is the first lightning mainnet turned on - make default
if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "" ]; then if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "" ]; then
echo "# CLN is now the default lightning implementation" echo "# CL is now the default lightning implementation"
sudo sed -i "s/^lightning=.*/lightning=cln/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^lightning=.*/lightning=cl/g" /mnt/hdd/raspiblitz.conf
fi fi
exit 0 exit 0
@ -246,7 +246,7 @@ if [ "$1" = "display-seed" ]; then
if [ "${displayNetwork}" == "" ]; then if [ "${displayNetwork}" == "" ]; then
displayNetwork="mainnet" displayNetwork="mainnet"
fi fi
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $displayNetwork) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $displayNetwork)
# check if seedword file exists # check if seedword file exists
seedwordFile="/home/bitcoin/.lightning/${CLNETWORK}/seedwords.info" seedwordFile="/home/bitcoin/.lightning/${CLNETWORK}/seedwords.info"
@ -288,11 +288,11 @@ if [ "$1" = "off" ];then
sudo rm -f /usr/local/bin/lightning-cli sudo rm -f /usr/local/bin/lightning-cli
fi fi
# setting value in the raspiblitz.conf # setting value in the raspiblitz.conf
sudo sed -i "s/^${netprefix}cln=.*/${netprefix}cln=off/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^${netprefix}cl=.*/${netprefix}cl=off/g" /mnt/hdd/raspiblitz.conf
# if cln mainnet was default - remove # if cl mainnet was default - remove
if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "cln" ]; then if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "cl" ]; then
echo "# CLN is REMOVED as the default lightning implementation" echo "# CL is REMOVED as the default lightning implementation"
sudo sed -i "s/^lightning=.*/lightning=/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^lightning=.*/lightning=/g" /mnt/hdd/raspiblitz.conf
if [ "${lnd}" == "on" ]; then if [ "${lnd}" == "on" ]; then
echo "# LND is now the new default lightning implementation" echo "# LND is now the new default lightning implementation"

View File

@ -12,23 +12,23 @@ if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then
echo "The same macaroon and certs will be used for the parallel networks" echo "The same macaroon and certs will be used for the parallel networks"
echo echo
echo "Usage:" echo "Usage:"
echo "cln.rest.sh [on|off|connect] <mainnet|testnet|signet>" echo "cl.rest.sh [on|off|connect] <mainnet|testnet|signet>"
echo echo
exit 1 exit 1
fi fi
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
echo "# Running 'cln.rest.sh $*'" echo "# Running 'cl.rest.sh $*'"
if [ $1 = connect ];then if [ $1 = connect ];then
echo "# Allowing port ${portprefix}6100 through the firewall" echo "# Allowing port ${portprefix}6100 through the firewall"
sudo ufw allow "${portprefix}6100" comment "${netprefix}clnrest" sudo ufw allow "${portprefix}6100" comment "${netprefix}clrest"
localip=$(ip addr | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep 'eth0\|wlan0\|enp0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') localip=$(ip addr | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep 'eth0\|wlan0\|enp0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
# hidden service to https://xx.onion # hidden service to https://xx.onion
/home/admin/config.scripts/internet.hiddenservice.sh ${netprefix}clnrest 443 ${portprefix}6100 /home/admin/config.scripts/internet.hiddenservice.sh ${netprefix}clrest 443 ${portprefix}6100
toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}clnrest/hostname) toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}clrest/hostname)
hex_macaroon=$(xxd -plain /home/bitcoin/c-lightning-REST/certs/access.macaroon | tr -d '\n') hex_macaroon=$(xxd -plain /home/bitcoin/c-lightning-REST/certs/access.macaroon | tr -d '\n')
url="https://${localip}:${portprefix}6100/" url="https://${localip}:${portprefix}6100/"
#string="${url}?${hex_macaroon}" #string="${url}?${hex_macaroon}"
@ -75,8 +75,8 @@ fi
if [ $1 = on ];then if [ $1 = on ];then
echo "# Setting up c-lightning-REST for $CHAIN" echo "# Setting up c-lightning-REST for $CHAIN"
sudo systemctl stop ${netprefix}clnrest sudo systemctl stop ${netprefix}clrest
sudo systemctl disable ${netprefix}clnrest sudo systemctl disable ${netprefix}clrest
if [ ! -f /home/bitcoin/c-lightning-REST/cl-rest.js ];then if [ ! -f /home/bitcoin/c-lightning-REST/cl-rest.js ];then
cd /home/bitcoin || exit 1 cd /home/bitcoin || exit 1
@ -101,7 +101,7 @@ if [ $1 = on ];then
echo " echo "
# systemd unit for c-lightning-REST for ${CHAIN} # systemd unit for c-lightning-REST for ${CHAIN}
# /etc/systemd/system/${netprefix}clnrest.service # /etc/systemd/system/${netprefix}clrest.service
[Unit] [Unit]
Description=c-lightning-REST daemon for ${CHAIN} Description=c-lightning-REST daemon for ${CHAIN}
Wants=${netprefix}lightningd.service Wants=${netprefix}lightningd.service
@ -123,30 +123,30 @@ PrivateDevices=true
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
" | sudo tee /etc/systemd/system/${netprefix}clnrest.service " | sudo tee /etc/systemd/system/${netprefix}clrest.service
sudo systemctl enable ${netprefix}clnrest sudo systemctl enable ${netprefix}clrest
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
if [ "${state}" == "ready" ]; then if [ "${state}" == "ready" ]; then
echo "# OK - the clnrest.service is enabled, system is ready so starting service" echo "# OK - the clrest.service is enabled, system is ready so starting service"
sudo systemctl start ${netprefix}clnrest sudo systemctl start ${netprefix}clrest
else else
echo "# OK - the clnrest.service is enabled, to start manually use: 'sudo systemctl start clnrest'" echo "# OK - the clrest.service is enabled, to start manually use: 'sudo systemctl start clrest'"
fi fi
echo echo
echo "# Monitor with:" echo "# Monitor with:"
echo "sudo journalctl -f -u clnrest" echo "sudo journalctl -f -u clrest"
echo echo
fi fi
if [ $1 = off ];then if [ $1 = off ];then
echo "# Removing c-lightning-REST for ${CHAIN}" echo "# Removing c-lightning-REST for ${CHAIN}"
sudo systemctl stop ${netprefix}clnrest sudo systemctl stop ${netprefix}clrest
sudo systemctl disable ${netprefix}clnrest sudo systemctl disable ${netprefix}clrest
sudo rm -rf /home/bitcoin/c-lightning-REST/${CLNETWORK} sudo rm -rf /home/bitcoin/c-lightning-REST/${CLNETWORK}
echo "# Deny port ${portprefix}6100 through the firewall" echo "# Deny port ${portprefix}6100 through the firewall"
sudo ufw deny "${portprefix}6100" sudo ufw deny "${portprefix}6100"
/home/admin/config.scripts/internet.hiddenservice.sh off ${netprefix}clnrest /home/admin/config.scripts/internet.hiddenservice.sh off ${netprefix}clrest
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
echo "# Removing the source code and binaries" echo "# Removing the source code and binaries"
sudo rm -rf /home/bitcoin/c-lightning-REST sudo rm -rf /home/bitcoin/c-lightning-REST

View File

@ -4,7 +4,7 @@
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo echo
echo "Config script to set the alias of the C-lightning node" echo "Config script to set the alias of the C-lightning node"
echo "cln.setname.sh [mainnet|testnet|signet] [?newName]" echo "cl.setname.sh [mainnet|testnet|signet] [?newName]"
echo echo
exit 1 exit 1
fi fi
@ -13,13 +13,13 @@ fi
newName=$2 newName=$2
# use default values from the raspiblitz.conf # use default values from the raspiblitz.conf
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
# run interactive if 'turn on' && no further parameters # run interactive if 'turn on' && no further parameters
if [ ${#newName} -eq 0 ]; then if [ ${#newName} -eq 0 ]; then
sudo rm ./.tmp sudo rm ./.tmp
dialog --backtitle "Set CLN Name/Alias" --inputbox "ENTER the new Name/Alias for the C-lightning node: dialog --backtitle "Set CL Name/Alias" --inputbox "ENTER the new Name/Alias for the C-lightning node:
(free to choose, one word up to 32 basic characters) (free to choose, one word up to 32 basic characters)
" 8 56 2>./.tmp " 8 56 2>./.tmp
newName=$( cat ./.tmp | tr -dc '[:alnum:]\n\r' ) newName=$( cat ./.tmp | tr -dc '[:alnum:]\n\r' )
@ -32,8 +32,8 @@ fi
# config file # config file
blitzConfig="/mnt/hdd/raspiblitz.conf" blitzConfig="/mnt/hdd/raspiblitz.conf"
# cln conf file # cl conf file
clnConfig="${CLNCONF}" clConfig="${CLCONF}"
# check if raspiblitz config file exists # check if raspiblitz config file exists
if [ ! -f ${blitzConfig} ]; then if [ ! -f ${blitzConfig} ]; then
@ -41,16 +41,16 @@ if [ ! -f ${blitzConfig} ]; then
exit 1 exit 1
fi fi
# check if cln config file exists # check if cl config file exists
if sudo ls ${clnConfig}; then if sudo ls ${clConfig}; then
echo "FAIL - missing ${clnConfig}" echo "FAIL - missing ${clConfig}"
exit 1 exit 1
fi fi
# make sure entry line for 'alias' exists # make sure entry line for 'alias' exists
entryExists=$(cat ${clnConfig} | grep -c "alias=") entryExists=$(cat ${clConfig} | grep -c "alias=")
if [ ${entryExists} -eq 0 ]; then if [ ${entryExists} -eq 0 ]; then
echo "alias=" >> ${clnConfig} echo "alias=" >> ${clConfig}
fi fi
# stop services # stop services
@ -58,7 +58,7 @@ echo "making sure services are not running"
sudo systemctl stop ${netprefix}lightningd 2>/dev/null sudo systemctl stop ${netprefix}lightningd 2>/dev/null
# config: change name # config: change name
sudo sed -i "s/^alias=.*/alias=${newName}/g" ${clnConfig} sudo sed -i "s/^alias=.*/alias=${newName}/g" ${clConfig}
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
if [ "${state}" == "ready" ]; then if [ "${state}" == "ready" ]; then

View File

@ -216,7 +216,7 @@ alias ${netprefix}lncli=\"sudo -u bitcoin /usr/local/bin/lncli\
# setting value in raspi blitz config # setting value in raspi blitz config
sudo sed -i "s/^${netprefix}lnd=.*/${netprefix}lnd=on/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^${netprefix}lnd=.*/${netprefix}lnd=on/g" /mnt/hdd/raspiblitz.conf
# if this is the first lighting mainnet turned on - make default # if this is the first lightning mainnet turned on - make default
if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "" ]; then if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "" ]; then
echo "# LND is now default lighthning implementation" echo "# LND is now default lighthning implementation"
sudo sed -i "s/^lightning=.*/lightning=lnd/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^lightning=.*/lightning=lnd/g" /mnt/hdd/raspiblitz.conf
@ -289,9 +289,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "lnd" ]; then if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "lnd" ]; then
echo "# LND is REMOVED as default lightning implementation" echo "# LND is REMOVED as default lightning implementation"
sudo sed -i "s/^lightning=.*/lightning=/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^lightning=.*/lightning=/g" /mnt/hdd/raspiblitz.conf
if [ "${cln}" == "on" ]; then if [ "${cl}" == "on" ]; then
echo "# CLN is now new default lightning implementation" echo "# CL is now the new default lightning implementation"
sudo sed -i "s/^lightning=.*/lightning=cln/g" /mnt/hdd/raspiblitz.conf sudo sed -i "s/^lightning=.*/lightning=cl/g" /mnt/hdd/raspiblitz.conf
fi fi
fi fi

View File

@ -3,12 +3,12 @@
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo "# Usage:" echo "# Usage:"
echo "# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cln> <mainnet|testnet|signet>)" echo "# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cl> <mainnet|testnet|signet>)"
echo "# if no values given uses the default values from the raspiblitz.conf" echo "# if no values given uses the default values from the raspiblitz.conf"
echo echo
echo "# chain is: main | test ; from raspiblitz.conf or raspiblitz.info or defaults to main" echo "# chain is: main | test ; from raspiblitz.conf or raspiblitz.info or defaults to main"
echo echo
echo "# LNTYPE is: lnd | cln ; default: lnd" echo "# LNTYPE is: lnd | cl ; default: lnd"
echo "# typeprefix is: "" | c" echo "# typeprefix is: "" | c"
echo echo
echo "# CHAIN is: mainnet | testnet | signet" echo "# CHAIN is: mainnet | testnet | signet"
@ -23,7 +23,7 @@ source /mnt/hdd/raspiblitz.conf 2>/dev/null
if [ $1 = getvars ];then if [ $1 = getvars ];then
# LNTYPE is: lnd | cln # LNTYPE is: lnd | cl
if [ $# -gt 1 ];then if [ $# -gt 1 ];then
LNTYPE=$2 LNTYPE=$2
else else
@ -72,7 +72,7 @@ if [ $1 = getvars ];then
echo "portprefix=${portprefix}" echo "portprefix=${portprefix}"
echo "L2rpcportmod=${L2rpcportmod}" echo "L2rpcportmod=${L2rpcportmod}"
if [ "${LNTYPE}" == "cln" ];then if [ "${LNTYPE}" == "cl" ];then
# CLNETWORK is: bitcoin / signet / testnet # CLNETWORK is: bitcoin / signet / testnet
if [ "${chain}" == "main" ];then if [ "${chain}" == "main" ];then
CLNETWORK=${network} CLNETWORK=${network}
@ -81,13 +81,13 @@ if [ $1 = getvars ];then
fi fi
echo "CLNETWORK=${CLNETWORK}" echo "CLNETWORK=${CLNETWORK}"
# CLNCONF is the path to the config # CLCONF is the path to the config
if [ "${CLNETWORK}" == "bitcoin" ]; then if [ "${CLNETWORK}" == "bitcoin" ]; then
CLNCONF="/home/bitcoin/.lightning/config" CLCONF="/home/bitcoin/.lightning/config"
else else
CLNCONF="/home/bitcoin/.lightning/${CLNETWORK}/config" CLCONF="/home/bitcoin/.lightning/${CLNETWORK}/config"
fi fi
echo "CLNCONF=${CLNCONF}" echo "CLCONF=${CLCONF}"
typeprefix=c typeprefix=c
fi fi
@ -102,7 +102,7 @@ if [ $1 = getvars ];then
echo "lncli_alias=\"sudo -u bitcoin /usr/local/bin/lncli -n=${chain}net --rpcserver localhost:1${L2rpcportmod}009\"" echo "lncli_alias=\"sudo -u bitcoin /usr/local/bin/lncli -n=${chain}net --rpcserver localhost:1${L2rpcportmod}009\""
# sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} # sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network}
echo "bitcoincli_alias=\"/usr/local/bin/${network}-cli -datadir=/home/bitcoin/.${network} -rpcport=${L1rpcportmod}8332\"" echo "bitcoincli_alias=\"/usr/local/bin/${network}-cli -datadir=/home/bitcoin/.${network} -rpcport=${L1rpcportmod}8332\""
echo "lightningcli_alias=\"sudo -u bitcoin /usr/local/bin/lightning-cli --conf=${CLNCONF}\"" echo "lightningcli_alias=\"sudo -u bitcoin /usr/local/bin/lightning-cli --conf=${CLCONF}\""
fi fi

View File

@ -13,7 +13,7 @@ source ${SETUPFILE}
# SHOW SEED WORDS AFTER SETUP # SHOW SEED WORDS AFTER SETUP
if [ "${lightning}" == "lnd" ]; then if [ "${lightning}" == "lnd" ]; then
walletName="LND" walletName="LND"
elif [ "${lightning}" == "cln" ]; then elif [ "${lightning}" == "cl" ]; then
walletName="C-lightning" walletName="C-lightning"
fi fi
if [ "${setupPhase}" == "setup" ] && [ "${seedwords6x4NEW}" != "" ]; then if [ "${setupPhase}" == "setup" ] && [ "${seedwords6x4NEW}" != "" ]; then

View File

@ -262,10 +262,10 @@ if [ "${setupPhase}" == "setup" ]; then
/home/admin/setup.scripts/dialogLightningWallet-lnd.sh /home/admin/setup.scripts/dialogLightningWallet-lnd.sh
dialogResult=$? dialogResult=$?
elif [ "${lightning}" == "cln" ]; then elif [ "${lightning}" == "cl" ]; then
echo "# Starting lightning wallet dialog for C-LIGHTNING ..." echo "# Starting lightning wallet dialog for C-LIGHTNING ..."
/home/admin/setup.scripts/dialogLightningWallet-cln.sh /home/admin/setup.scripts/dialogLightningWallet-cl.sh
dialogResult=$? dialogResult=$?
else else

View File

@ -55,7 +55,7 @@ if [ "${network}" == "bitcoin" ]; then
# choose lightning client # choose lightning client
OPTIONS=() OPTIONS=()
OPTIONS+=(LND "LND - Lightning Network Daemon (DEFAULT)") OPTIONS+=(LND "LND - Lightning Network Daemon (DEFAULT)")
OPTIONS+=(CLN "C-lightning by Blockstream (fewer apps)") OPTIONS+=(CL "C-lightning by Blockstream (fewer apps)")
OPTIONS+=(NONE "Run without Lightning") OPTIONS+=(NONE "Run without Lightning")
CHOICE=$(dialog --clear \ CHOICE=$(dialog --clear \
--backtitle "RaspiBlitz ${codeVersion} - Setup" \ --backtitle "RaspiBlitz ${codeVersion} - Setup" \
@ -69,8 +69,8 @@ if [ "${network}" == "bitcoin" ]; then
LND) LND)
lightning="lnd" lightning="lnd"
;; ;;
CLN) CL)
lightning="cln" lightning="cl"
;; ;;
NONE) NONE)
lightning="none" lightning="none"

View File

@ -23,7 +23,7 @@ if [ "${CHOICE}" == "NEW" ]; then
sudo sed -i '/^setPasswordB=/d' $SETUPFILE sudo sed -i '/^setPasswordB=/d' $SETUPFILE
sudo sed -i '/^setPasswordC=/d' $SETUPFILE sudo sed -i '/^setPasswordC=/d' $SETUPFILE
# mark all passwords to be set - passwordc wallet encryption not for cln # mark all passwords to be set - passwordc wallet encryption not for cl
echo "setPasswordA=1" >> $SETUPFILE echo "setPasswordA=1" >> $SETUPFILE
echo "setPasswordB=1" >> $SETUPFILE echo "setPasswordB=1" >> $SETUPFILE
echo "setPasswordC=0" >> $SETUPFILE echo "setPasswordC=0" >> $SETUPFILE
@ -36,11 +36,11 @@ elif [ "${CHOICE}" == "OLD" ]; then
# get more details what kind of old lightning wallet user has # get more details what kind of old lightning wallet user has
OPTIONS=() OPTIONS=()
OPTIONS+=(CLNRESCUE "CLN tar.gz-Backupfile (BEST)") OPTIONS+=(CLRESCUE "CL tar.gz-Backupfile (BEST)")
OPTIONS+=(ONLYSEED "Only Seed Word List (FALLBACK)") OPTIONS+=(ONLYSEED "Only Seed Word List (FALLBACK)")
CHOICESUB=$(dialog --backtitle "RaspiBlitz" --clear --title "RECOVER CLN DATA & WALLET" --menu "Data you have to recover from?" 11 60 6 "${OPTIONS[@]}" 2>&1 >/dev/tty) CHOICESUB=$(dialog --backtitle "RaspiBlitz" --clear --title "RECOVER CL DATA & WALLET" --menu "Data you have to recover from?" 11 60 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
if [ "${CHOICESUB}" == "CLNRESCUE" ]; then if [ "${CHOICESUB}" == "CLRESCUE" ]; then
# just activate LND rescue upload # just activate LND rescue upload
uploadRESCUE=1 uploadRESCUE=1
@ -94,27 +94,27 @@ else
exit 1 exit 1
fi fi
# UPLOAD CLN RESCUE FILE dialog (if activated by dialogs above) # UPLOAD CL RESCUE FILE dialog (if activated by dialogs above)
if [ ${uploadRESCUE} -eq 1 ]; then if [ ${uploadRESCUE} -eq 1 ]; then
# 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-import-gui setup $_temp /home/admin/config.scripts/cl.backup.sh cl-import-gui setup $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null
# if user canceled upload # if user canceled upload
if [ "${clnrescue}" == "" ]; then if [ "${clrescue}" == "" ]; then
# signal cancel to the calling script by exit code (3 = exit on clnrescue) # signal cancel to the calling script by exit code (3 = exit on clrescue)
exit 3 exit 3
fi fi
# clear setup state from all fomer possible choices (previous loop) # clear setup state from all fomer possible choices (previous loop)
sudo sed -i '/^clnrescue=/d' $SETUPFILE sudo sed -i '/^clrescue=/d' $SETUPFILE
# store result in setup state # store result in setup state
echo "clnrescue='${clnrescue}'" >> $SETUPFILE echo "clrescue='${clrescue}'" >> $SETUPFILE
fi fi
# INPUT LIGHTNING SEED dialog (if activated by dialogs above) # INPUT LIGHTNING SEED dialog (if activated by dialogs above)
@ -122,7 +122,7 @@ if [ ${enterSEED} -eq 1 ]; then
# start seed input and get results # start seed input and get results
_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/cl.backup.sh seed-import-gui $_temp
source $_temp 2>/dev/null source $_temp 2>/dev/null
sudo rm $_temp 2>/dev/null sudo rm $_temp 2>/dev/null

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}" == "cl" ]; 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)