mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-23 22:47:03 +01:00
Merge pull request #2575 from openoms/CLNtoCL
change CLN / cln variables and filenames to CL / cl
This commit is contained in:
commit
841f8afb9a
52 changed files with 621 additions and 621 deletions
|
@ -4,10 +4,10 @@
|
|||
|
||||
- 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: CLN plugin: Sparko [details](https://github.com/fiatjaf/sparko)
|
||||
- New: CLN plugin: CLBOSS The C-Lightning Node Manager [details](https://github.com/ZmnSCPxj/clboss#clboss-the-c-lightning-node-manager)
|
||||
- New: CL plugin: Sparko [details](https://github.com/fiatjaf/sparko)
|
||||
- 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: 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: Allow SphinxApp to connect over Tor
|
||||
- New: Parallel TESTNET & SIGNET services
|
||||
|
|
|
@ -1076,9 +1076,9 @@ PGPpkeys="https://raw.githubusercontent.com/ElementsProject/lightning/master/con
|
|||
PGPcheck="D9200E6CD1ADB8F1"
|
||||
|
||||
# prepare download dir
|
||||
sudo rm -rf /home/admin/download/cln
|
||||
sudo -u admin mkdir -p /home/admin/download/cln
|
||||
cd /home/admin/download/cln || exit 1
|
||||
sudo rm -rf /home/admin/download/cl
|
||||
sudo -u admin mkdir -p /home/admin/download/cl
|
||||
cd /home/admin/download/cl || exit 1
|
||||
|
||||
sudo -u admin wget -O "pgp_keys.asc" ${PGPpkeys}
|
||||
gpg --import --import-options show-only ./pgp_keys.asc
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet>
|
||||
# 00infoBlitz.sh <cl|lnd> <testnet|mainnet|signet>
|
||||
|
||||
# load code software version
|
||||
source /home/admin/_version.info
|
||||
|
@ -160,7 +160,7 @@ fi
|
|||
webinterfaceInfo=""
|
||||
runningRTL=$(systemctl status ${netprefix}${typeprefix}RTL.service 2>/dev/null | grep -c active)
|
||||
if [ ${runningRTL} -eq 1 ]; then
|
||||
if [ "${lightning}" == "cln" ]; then
|
||||
if [ "${lightning}" == "cl" ]; then
|
||||
RTLHTTP=${portprefix}7000
|
||||
elif [ "${lightning}" == "lnd" ];then
|
||||
RTLHTTP=${portprefix}3000
|
||||
|
@ -232,12 +232,12 @@ else
|
|||
fi
|
||||
|
||||
# LIGHTNING NETWORK
|
||||
if [ "${lightning}" == "cln" ]; then
|
||||
if [ "${lightning}" == "cl" ]; then
|
||||
ln_getInfo=$($lightningcli_alias getinfo 2>/dev/null)
|
||||
ln_baseInfo="-"
|
||||
ln_channelInfo="\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
|
||||
ln_alias=$(echo "${ln_getInfo}" | grep '"alias":' | cut -d '"' -f4)
|
||||
fi
|
||||
|
@ -245,7 +245,7 @@ if [ "${lightning}" == "cln" ]; then
|
|||
ln_alias=${hostname}
|
||||
fi
|
||||
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
|
||||
ln_port=$(echo "${ln_getInfo}" | grep '"port":' | cut -d: -f2 | tail -1 | bc)
|
||||
fi
|
||||
|
@ -288,17 +288,17 @@ if [ "${lightning}" == "cln" ]; then
|
|||
fi
|
||||
else
|
||||
ln_walletbalance=0
|
||||
cln_listfunds=$($lightningcli_alias listfunds 2>/dev/null)
|
||||
for i in $(echo "$cln_listfunds" \
|
||||
cl_listfunds=$($lightningcli_alias listfunds 2>/dev/null)
|
||||
for i in $(echo "$cl_listfunds" \
|
||||
|jq .outputs[]|jq 'select(.status=="confirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
|
||||
ln_walletbalance=$((ln_walletbalance+i))
|
||||
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
|
||||
ln_walletbalance_wait=$((ln_walletbalance_wait+i))
|
||||
done
|
||||
# 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
|
||||
ln_closedchannelbalance=$((ln_closedchannelbalance+i))
|
||||
done
|
||||
|
@ -307,7 +307,7 @@ if [ "${lightning}" == "cln" ]; then
|
|||
if [ "${ln_pendingonchain}" = "0" ]; then ln_pendingonchain=""; fi
|
||||
if [ ${#ln_pendingonchain} -gt 0 ]; then ln_pendingonchain="(+${ln_pendingonchain})"; fi
|
||||
# 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
|
||||
ln_channelbalance=$((ln_channelbalance+i))
|
||||
done
|
||||
|
@ -315,7 +315,7 @@ if [ "${lightning}" == "cln" ]; then
|
|||
ln_channelbalance=0
|
||||
fi
|
||||
# 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
|
||||
ln_channelbalance_all=$((ln_channelbalance_all+i))
|
||||
done
|
||||
|
@ -327,9 +327,9 @@ if [ "${lightning}" == "cln" ]; then
|
|||
# - **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
|
||||
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
|
||||
cln_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))
|
||||
cl_num_pending_channels="$(echo "${ln_getInfo}" | jq -r '.num_pending_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+cl_num_pending_channels+cl_num_inactive_channels))
|
||||
ln_baseInfo="${color_gray}Wallet ${ln_walletbalance} ${netprefix}sat ${ln_pendingonchain}"
|
||||
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}"
|
||||
|
@ -430,7 +430,7 @@ ${color_yellow}
|
|||
${color_yellow}${ln_publicColor}${ln_external}${color_gray}"
|
||||
fi
|
||||
|
||||
if [ "${lightning}" == "cln" ];then
|
||||
if [ "${lightning}" == "cl" ];then
|
||||
LNline="C-LIGHTNING ${color_green}${ln_version}\n ${ln_baseInfo}"
|
||||
elif [ "${lightning}" == "lnd" ];then
|
||||
LNline="LND ${color_green}${ln_version} ${ln_baseInfo}"
|
||||
|
|
|
@ -104,7 +104,7 @@ while :
|
|||
# TODO: ALSO SEPARATE GUI/ACTION FOR THE SCANNING / WALLET UNLOCK / ERROR DETECTION
|
||||
# if lightning is syncing or scanning
|
||||
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
|
||||
sleep 3
|
||||
continue
|
||||
|
|
|
@ -148,8 +148,8 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
|||
fi
|
||||
|
||||
# if C-Lightning is active
|
||||
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
|
||||
OPTIONS+=(CLN "C-lightning Wallet Options")
|
||||
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
||||
OPTIONS+=(CL "C-lightning Wallet Options")
|
||||
fi
|
||||
|
||||
if [ "${testnet}" == "on" ]; then
|
||||
|
@ -214,8 +214,8 @@ case $CHOICE in
|
|||
LND)
|
||||
/home/admin/99lndMenu.sh
|
||||
;;
|
||||
CLN)
|
||||
/home/admin/99clnMenu.sh ${chain}net
|
||||
CL)
|
||||
/home/admin/99clMenu.sh ${chain}net
|
||||
;;
|
||||
CONNECT)
|
||||
/home/admin/99connectMenu.sh
|
||||
|
@ -231,7 +231,7 @@ case $CHOICE in
|
|||
/home/admin/config.scripts/bonus.rtl.sh menu lnd mainnet
|
||||
;;
|
||||
CRTL)
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cln mainnet
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cl mainnet
|
||||
;;
|
||||
BTCPAY)
|
||||
/home/admin/config.scripts/bonus.btcpayserver.sh menu
|
||||
|
@ -246,7 +246,7 @@ case $CHOICE in
|
|||
/home/admin/config.scripts/bonus.lit.sh menu
|
||||
;;
|
||||
SPARKO)
|
||||
/home/admin/config.scripts/cln-plugin.sparko.sh menu mainnet
|
||||
/home/admin/config.scripts/cl-plugin.sparko.sh menu mainnet
|
||||
;;
|
||||
LNBITS)
|
||||
/home/admin/config.scripts/bonus.lnbits.sh menu
|
||||
|
|
|
@ -20,7 +20,7 @@ plus=""
|
|||
if [ "${testnet}" == "on" ]; then
|
||||
OPTIONS+=(tSYS "TESTNET Monitoring & Configuration")
|
||||
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
|
||||
|
||||
# just an optical splitter - ignored on select
|
||||
|
@ -28,7 +28,7 @@ OPTIONS+=(--- "----------------------------------")
|
|||
|
||||
if [ "${signet}" == "on" ]; then
|
||||
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
|
||||
|
||||
# DONT OFFER SERVICES FOR TESTNET RIGHT NOW
|
||||
|
@ -63,10 +63,10 @@ case $CHOICE in
|
|||
sLND)
|
||||
/home/admin/99lndMenu.sh signet
|
||||
;;
|
||||
tCLN)
|
||||
/home/admin/99clnMenu.sh testnet
|
||||
tCL)
|
||||
/home/admin/99clMenu.sh testnet
|
||||
;;
|
||||
sCLN)
|
||||
/home/admin/99clnMenu.sh signet
|
||||
sCL)
|
||||
/home/admin/99clMenu.sh signet
|
||||
;;
|
||||
esac
|
|
@ -11,7 +11,7 @@ CHAIN=mainnet
|
|||
echo "services default values"
|
||||
if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="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 [ ${#sparko} -eq 0 ]; then sparko="off"; fi
|
||||
|
||||
|
@ -21,9 +21,9 @@ echo "run dialog ..."
|
|||
OPTIONS=()
|
||||
OPTIONS+=(l "LND on $CHAIN" ${lnd})
|
||||
OPTIONS+=(r "RTL for LND $CHAIN" ${rtlWebinterface})
|
||||
OPTIONS+=(c "C-lightning on $CHAIN" ${cln})
|
||||
OPTIONS+=(t "RTL for CLN on $CHAIN" ${crtlWebinterface})
|
||||
OPTIONS+=(s "Sparko for CLN on $CHAIN" ${sparko})
|
||||
OPTIONS+=(c "C-lightning on $CHAIN" ${cl})
|
||||
OPTIONS+=(t "RTL for CL on $CHAIN" ${crtlWebinterface})
|
||||
OPTIONS+=(s "Sparko for CL on $CHAIN" ${sparko})
|
||||
|
||||
CHOICES=$(dialog --title ' Additional Services ' \
|
||||
--checklist ' use spacebar to activate/de-activate ' \
|
||||
|
@ -68,26 +68,26 @@ else
|
|||
echo "# LND on $CHAIN Setting unchanged."
|
||||
fi
|
||||
|
||||
# cln process choice
|
||||
# cl process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${cln}" != "${choice}" ]; then
|
||||
echo "# CLN on $CHAIN Setting changed .."
|
||||
if [ "${cl}" != "${choice}" ]; then
|
||||
echo "# CL on $CHAIN Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/cln.install.sh ${choice} $CHAIN
|
||||
/home/admin/config.scripts/cl.install.sh ${choice} $CHAIN
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; then
|
||||
if [ ${errorOnInstall} -eq 0 ]; then
|
||||
echo "# Successfully installed CLN on $CHAIN"
|
||||
echo "# Successfully installed CL on $CHAIN"
|
||||
else
|
||||
l1="# !!! FAIL on CLN on $CHAIN install !!!"
|
||||
l1="# !!! FAIL on CL on $CHAIN install !!!"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "# CLN on $CHAIN Setting unchanged."
|
||||
echo "# CL on $CHAIN Setting unchanged."
|
||||
fi
|
||||
|
||||
# RTL process choice
|
||||
|
@ -119,25 +119,25 @@ fi
|
|||
choice="off"; check=$(echo "${CHOICES}" | grep -c "t")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${crtlWebinterface}" != "${choice}" ]; then
|
||||
echo "RTL for CLN $CHAIN Setting changed .."
|
||||
echo "RTL for CL $CHAIN Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/bonus.rtl.sh ${choice} cln $CHAIN
|
||||
/home/admin/config.scripts/bonus.rtl.sh ${choice} cl $CHAIN
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; then
|
||||
if [ ${errorOnInstall} -eq 0 ]; then
|
||||
sudo systemctl start cRTL
|
||||
echo "waiting 10 secs .."
|
||||
sleep 10
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cln $CHAIN
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cl $CHAIN
|
||||
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:"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "RTL for CLN $CHAIN Setting unchanged."
|
||||
echo "RTL for CL $CHAIN Setting unchanged."
|
||||
fi
|
||||
|
||||
# sparko process choice
|
||||
|
@ -146,15 +146,15 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
|
|||
if [ "${sparko}" != "${choice}" ]; then
|
||||
echo "# Sparko on $CHAIN Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/cln-plugin.sparko.sh ${choice} $CHAIN
|
||||
/home/admin/config.scripts/cl-plugin.sparko.sh ${choice} $CHAIN
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; 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
|
||||
l1="# !!! FAIL on Sparko on $CHAIN install !!!"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ echo "services default values"
|
|||
if [ ${#trtlWebinterface} -eq 0 ]; then trtlWebinterface="off"; fi
|
||||
if [ ${#tlnd} -eq 0 ]; then tlnd="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
|
||||
|
||||
# show select dialog
|
||||
|
@ -21,9 +21,9 @@ echo "run dialog ..."
|
|||
OPTIONS=()
|
||||
OPTIONS+=(l "LND on $CHAIN" ${tlnd})
|
||||
OPTIONS+=(r "RTL for LND $CHAIN" ${trtlWebinterface})
|
||||
OPTIONS+=(c "C-lightning on $CHAIN" ${tcln})
|
||||
OPTIONS+=(t "RTL for CLN on $CHAIN" ${tcrtlWebinterface})
|
||||
OPTIONS+=(s "Sparko for CLN on $CHAIN" ${tsparko})
|
||||
OPTIONS+=(c "C-lightning on $CHAIN" ${tcl})
|
||||
OPTIONS+=(t "RTL for CL on $CHAIN" ${tcrtlWebinterface})
|
||||
OPTIONS+=(s "Sparko for CL on $CHAIN" ${tsparko})
|
||||
|
||||
CHOICES=$(dialog --title ' Additional Services ' \
|
||||
--checklist ' use spacebar to activate/de-activate ' \
|
||||
|
@ -68,26 +68,26 @@ else
|
|||
echo "# LND on $CHAIN Setting unchanged."
|
||||
fi
|
||||
|
||||
# tcln process choice
|
||||
# tcl process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${tcln}" != "${choice}" ]; then
|
||||
echo "# CLN on $CHAIN Setting changed .."
|
||||
if [ "${tcl}" != "${choice}" ]; then
|
||||
echo "# CL on $CHAIN Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/cln.install.sh ${choice} $CHAIN
|
||||
/home/admin/config.scripts/cl.install.sh ${choice} $CHAIN
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; then
|
||||
if [ ${errorOnInstall} -eq 0 ]; then
|
||||
echo "# Successfully installed CLN on $CHAIN"
|
||||
echo "# Successfully installed CL on $CHAIN"
|
||||
else
|
||||
l1="# !!! FAIL on CLN on $CHAIN install !!!"
|
||||
l1="# !!! FAIL on CL on $CHAIN install !!!"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "# CLN on $CHAIN Setting unchanged."
|
||||
echo "# CL on $CHAIN Setting unchanged."
|
||||
fi
|
||||
|
||||
# tRTL process choice
|
||||
|
@ -119,25 +119,25 @@ fi
|
|||
choice="off"; check=$(echo "${CHOICES}" | grep -c "t")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${tcrtlWebinterface}" != "${choice}" ]; then
|
||||
echo "RTL for CLN $CHAIN Setting changed .."
|
||||
echo "RTL for CL $CHAIN Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/bonus.rtl.sh ${choice} cln $CHAIN
|
||||
/home/admin/config.scripts/bonus.rtl.sh ${choice} cl $CHAIN
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; then
|
||||
if [ ${errorOnInstall} -eq 0 ]; then
|
||||
sudo systemctl start tcRTL
|
||||
echo "waiting 10 secs .."
|
||||
sleep 10
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cln $CHAIN
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cl $CHAIN
|
||||
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:"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "RTL for CLN $CHAIN Setting unchanged."
|
||||
echo "RTL for CL $CHAIN Setting unchanged."
|
||||
fi
|
||||
|
||||
# tsparko process choice
|
||||
|
@ -146,15 +146,15 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
|
|||
if [ "${tsparko}" != "${choice}" ]; then
|
||||
echo "# Sparko on $CHAIN Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/cln-plugin.sparko.sh ${choice} $CHAIN
|
||||
/home/admin/config.scripts/cl-plugin.sparko.sh ${choice} $CHAIN
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; 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
|
||||
l1="# !!! FAIL on Sparko on $CHAIN install !!!"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -141,9 +141,9 @@ do
|
|||
/home/admin/config.scripts/lnd.unlock.sh
|
||||
fi
|
||||
|
||||
# CLN Wallet Unlock
|
||||
if [ "${CLNwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then
|
||||
/home/admin/config.scripts/cln.hsmtool.sh unlock
|
||||
# CL Wallet Unlock
|
||||
if [ "${CLwalletLocked}" == "1" ] && [ "${state}" == "ready" ] && [ "${setupPhase}" == "done" ]; then
|
||||
/home/admin/config.scripts/cl.hsmtool.sh unlock
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
|
@ -306,7 +306,7 @@ if [ "${setupPhase}" == "done" ]; then
|
|||
if [ "${lightning}" == "lnd" ]; then
|
||||
echo "LND command line options: lncli -h"
|
||||
fi
|
||||
if [ "${lightning}" == "cln" ]; then
|
||||
if [ "${lightning}" == "cl" ]; then
|
||||
echo "C-Lightning command line options: lightning-cli help"
|
||||
fi
|
||||
else
|
||||
|
|
|
@ -16,8 +16,8 @@ if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi
|
|||
if [ ${#zerotier} -eq 0 ]; then zerotier="off"; fi
|
||||
if [ ${#circuitbreaker} -eq 0 ]; then circuitbreaker="off"; fi
|
||||
if [ ${#clboss} -eq 0 ]; then clboss="off"; fi
|
||||
if [ ${#clnEncryptedHSM} -eq 0 ]; then clnEncryptedHSM="off"; fi
|
||||
if [ ${#clnAutoUnlock} -eq 0 ]; then clnAutoUnlock="off"; fi
|
||||
if [ ${#clEncryptedHSM} -eq 0 ]; then clEncryptedHSM="off"; fi
|
||||
if [ ${#clAutoUnlock} -eq 0 ]; then clAutoUnlock="off"; fi
|
||||
|
||||
echo "# map LND to on/off"
|
||||
lndNode="off"
|
||||
|
@ -25,10 +25,10 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
|||
lndNode="on"
|
||||
fi
|
||||
|
||||
echo "# map CLN to on/off"
|
||||
clnNode="off"
|
||||
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
|
||||
clnNode="on"
|
||||
echo "# map CL to on/off"
|
||||
clNode="off"
|
||||
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
||||
clNode="on"
|
||||
fi
|
||||
|
||||
echo "map nextcloudbackup to on/off"
|
||||
|
@ -90,16 +90,16 @@ if [ "${clboss}" == "on" ]; then
|
|||
clbossMenu='on'
|
||||
fi
|
||||
|
||||
echo "# map clnEncryptedHSM to on/off"
|
||||
clnEncryptedHSMMenu='off'
|
||||
if [ "${clnEncryptedHSM}" == "on" ]; then
|
||||
clnEncryptedHSMMenu='on'
|
||||
echo "# map clEncryptedHSM to on/off"
|
||||
clEncryptedHSMMenu='off'
|
||||
if [ "${clEncryptedHSM}" == "on" ]; then
|
||||
clEncryptedHSMMenu='on'
|
||||
fi
|
||||
|
||||
echo "# map clnAutoUnlock to on/off"
|
||||
clnAutoUnlockMenu='off'
|
||||
if [ "${clnAutoUnlock}" == "on" ]; then
|
||||
clnAutoUnlockMenu='on'
|
||||
echo "# map clAutoUnlock to on/off"
|
||||
clAutoUnlockMenu='off'
|
||||
if [ "${clAutoUnlock}" == "on" ]; then
|
||||
clAutoUnlockMenu='on'
|
||||
fi
|
||||
|
||||
# show select dialog
|
||||
|
@ -137,12 +137,12 @@ if [ "${lndNode}" == "on" ]; then
|
|||
fi
|
||||
|
||||
# C-Lightning & options/PlugIns
|
||||
OPTIONS+=(n 'CLN C-LIGHTNING NODE' ${clnNode})
|
||||
if [ "${clnNode}" == "on" ]; then
|
||||
OPTIONS+=(o '-CLN CLBOSS Automatic Node Manager' ${clbossMenu})
|
||||
OPTIONS+=(h '-CLN Wallet Encryption' ${clnEncryptedHSMMenu})
|
||||
if [ "${clnEncryptedHSM}" == "on" ]; then
|
||||
OPTIONS+=(q '-CLN Auto-Unlock' ${clnAutoUnlockMenu})
|
||||
OPTIONS+=(n 'CL C-LIGHTNING NODE' ${clNode})
|
||||
if [ "${clNode}" == "on" ]; then
|
||||
OPTIONS+=(o '-CL CLBOSS Automatic Node Manager' ${clbossMenu})
|
||||
OPTIONS+=(h '-CL Wallet Encryption' ${clEncryptedHSMMenu})
|
||||
if [ "${clEncryptedHSM}" == "on" ]; then
|
||||
OPTIONS+=(q '-CL Auto-Unlock' ${clAutoUnlockMenu})
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -409,27 +409,27 @@ else
|
|||
echo "LND NODE setting unchanged."
|
||||
fi
|
||||
|
||||
# CLN choice
|
||||
# CL choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "n")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${clnNode}" != "${choice}" ]; then
|
||||
if [ "${clNode}" != "${choice}" ]; then
|
||||
anychange=1
|
||||
echo "# C-Lightning NODE Setting changed .."
|
||||
if [ "${choice}" = "on" ]; then
|
||||
echo "# turning ON"
|
||||
/home/admin/config.scripts/cln.install.sh on mainnet
|
||||
sudo /home/admin/config.scripts/cln.install.sh display-seed mainnet
|
||||
/home/admin/config.scripts/cl.install.sh on mainnet
|
||||
sudo /home/admin/config.scripts/cl.install.sh display-seed mainnet
|
||||
if [ "${testnet}" == "on" ]; then
|
||||
/home/admin/config.scripts/cln.install.sh on testnet
|
||||
/home/admin/config.scripts/cl.install.sh on testnet
|
||||
fi
|
||||
if [ "${signet}" == "on" ]; then
|
||||
/home/admin/config.scripts/cln.install.sh on signet
|
||||
/home/admin/config.scripts/cl.install.sh on signet
|
||||
fi
|
||||
else
|
||||
echo "# turning OFF"
|
||||
/home/admin/config.scripts/cln.install.sh off mainnet
|
||||
/home/admin/config.scripts/cln.install.sh off testnet
|
||||
/home/admin/config.scripts/cln.install.sh off signet
|
||||
/home/admin/config.scripts/cl.install.sh off mainnet
|
||||
/home/admin/config.scripts/cl.install.sh off testnet
|
||||
/home/admin/config.scripts/cl.install.sh off signet
|
||||
fi
|
||||
else
|
||||
echo "C-Lightning NODE setting unchanged."
|
||||
|
@ -438,45 +438,45 @@ fi
|
|||
# CLBOSS process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "o")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${clboss}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
|
||||
if [ "${clboss}" != "${choice}" ] && [ "${clNode}" == "on" ]; then
|
||||
echo "CLBOSS Setting changed .."
|
||||
anychange=1
|
||||
sudo /home/admin/config.scripts/cln-plugin.clboss.sh ${choice}
|
||||
sudo /home/admin/config.scripts/cl-plugin.clboss.sh ${choice}
|
||||
needsReboot=0
|
||||
else
|
||||
echo "CLBOSS Setting unchanged."
|
||||
fi
|
||||
|
||||
# clnEncryptedHSM process choice
|
||||
# clEncryptedHSM process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "h")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${clnEncryptedHSM}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
|
||||
echo "clnEncryptedHSM Setting changed .."
|
||||
if [ "${clEncryptedHSM}" != "${choice}" ] && [ "${clNode}" == "on" ]; then
|
||||
echo "clEncryptedHSM Setting changed .."
|
||||
anychange=1
|
||||
if [ "${choice}" == "on" ]; then
|
||||
/home/admin/config.scripts/cln.hsmtool.sh encrypt mainnet
|
||||
/home/admin/config.scripts/cl.hsmtool.sh encrypt mainnet
|
||||
else
|
||||
/home/admin/config.scripts/cln.hsmtool.sh decrypt mainnet
|
||||
/home/admin/config.scripts/cl.hsmtool.sh decrypt mainnet
|
||||
fi
|
||||
needsReboot=0
|
||||
else
|
||||
echo "clnEncryptedHSM Setting unchanged."
|
||||
echo "clEncryptedHSM Setting unchanged."
|
||||
fi
|
||||
|
||||
# clnAutoUnlock process choice
|
||||
# clAutoUnlock process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "q")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${clnAutoUnlock}" != "${choice}" ] && [ "${clnNode}" == "on" ]; then
|
||||
echo "clnAutoUnlock Setting changed .."
|
||||
if [ "${clAutoUnlock}" != "${choice}" ] && [ "${clNode}" == "on" ]; then
|
||||
echo "clAutoUnlock Setting changed .."
|
||||
anychange=1
|
||||
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
|
||||
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off mainnet
|
||||
/home/admin/config.scripts/cl.hsmtool.sh autounlock-off mainnet
|
||||
fi
|
||||
needsReboot=0
|
||||
else
|
||||
echo "clnAutoUnlock Setting unchanged."
|
||||
echo "clAutoUnlock Setting unchanged."
|
||||
fi
|
||||
|
||||
# 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 signet initwallet
|
||||
fi
|
||||
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
|
||||
/home/admin/config.scripts/cln.install.sh on testnet
|
||||
/home/admin/config.scripts/cln.install.sh on signet
|
||||
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
||||
/home/admin/config.scripts/cl.install.sh on testnet
|
||||
/home/admin/config.scripts/cl.install.sh on signet
|
||||
fi
|
||||
else
|
||||
# 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 signet
|
||||
/home/admin/config.scripts/cln.install.sh off testnet
|
||||
/home/admin/config.scripts/cln.install.sh off signet
|
||||
/home/admin/config.scripts/cl.install.sh off testnet
|
||||
/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 signet
|
||||
fi
|
||||
|
|
|
@ -54,8 +54,8 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
|||
OPTIONS+=(x 'LND Sphinx-Relay' ${sphinxrelay})
|
||||
fi
|
||||
|
||||
# just available for CLN
|
||||
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
|
||||
# just available for CL
|
||||
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
||||
OPTIONS+=(c 'C-Lightning RTL Webinterface' ${crtlWebinterface})
|
||||
OPTIONS+=(k 'C-Lightning Sparko WebWallet' ${sparko})
|
||||
fi
|
||||
|
@ -111,25 +111,25 @@ fi
|
|||
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${crtlWebinterface}" != "${choice}" ]; then
|
||||
echo "RTL-cln Webinterface Setting changed .."
|
||||
echo "RTL-cl Webinterface Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/bonus.rtl.sh ${choice} cln mainnet
|
||||
/home/admin/config.scripts/bonus.rtl.sh ${choice} cl mainnet
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; then
|
||||
if [ ${errorOnInstall} -eq 0 ]; then
|
||||
sudo systemctl start RTL
|
||||
echo "waiting 10 secs .."
|
||||
sleep 10
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cln mainnet
|
||||
/home/admin/config.scripts/bonus.rtl.sh menu cl mainnet
|
||||
else
|
||||
l1="!!! FAIL on RTL C-Lightning install !!!"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "RTL-cln Webinterface Setting unchanged."
|
||||
echo "RTL-cl Webinterface Setting unchanged."
|
||||
fi
|
||||
|
||||
# BTC-RPC-Explorer process choice
|
||||
|
@ -480,15 +480,15 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
|
|||
if [ "${sparko}" != "${choice}" ]; then
|
||||
echo "# Sparko on mainnet Setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/cln-plugin.sparko.sh ${choice} mainnet
|
||||
/home/admin/config.scripts/cl-plugin.sparko.sh ${choice} mainnet
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; 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
|
||||
l1="# !!! FAIL on Sparko on mainnet install !!!"
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -6,7 +6,7 @@ source /mnt/hdd/raspiblitz.conf
|
|||
|
||||
if [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
||||
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 "ligthning=${lightning}"
|
||||
echo "chain=${chain}"
|
||||
|
@ -153,9 +153,9 @@ if [ $lightning = "lnd" ]; then
|
|||
# add SEND MANY APP
|
||||
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)" \
|
||||
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;
|
||||
;;
|
||||
|
||||
ZEUS_CLNREST)
|
||||
ZEUS_CLREST)
|
||||
/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" \
|
||||
--yes-button "Continue" \
|
||||
|
@ -342,7 +342,7 @@ ZEUS_CLNREST)
|
|||
exit 0
|
||||
fi
|
||||
/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;
|
||||
;;
|
||||
ZEUS_SPARK)
|
||||
|
@ -355,7 +355,7 @@ ZEUS_SPARK)
|
|||
exit 0
|
||||
fi
|
||||
/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;
|
||||
;;
|
||||
SPARK)
|
||||
|
@ -374,7 +374,7 @@ Or scan the QR code on the LCD with your mobile phone.
|
|||
" 11 70
|
||||
fi
|
||||
/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;
|
||||
;;
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
|||
OPTIONS+=(BACKUP-LND "Backup your LND data (Rescue-File)")
|
||||
OPTIONS+=(RESET-LND "Delete LND & start new node/wallet")
|
||||
fi
|
||||
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then
|
||||
OPTIONS+=(REPAIR-CLN "Repair/Backup C-Lightning")
|
||||
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
||||
OPTIONS+=(REPAIR-CL "Repair/Backup C-Lightning")
|
||||
fi
|
||||
OPTIONS+=(MIGRATION "Migrate Blitz Data to new Hardware")
|
||||
OPTIONS+=(COPY-SOURCE "Copy Blockchain Source Modus")
|
||||
|
@ -82,8 +82,8 @@ case $CHOICE in
|
|||
read key
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
;;
|
||||
REPAIR-CLN)
|
||||
sudo /home/admin/99clnRepairMenu.sh
|
||||
REPAIR-CL)
|
||||
sudo /home/admin/99clRepairMenu.sh
|
||||
echo
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
|
|
|
@ -5,7 +5,7 @@ echo "# get raspiblitz config"
|
|||
source /home/admin/raspiblitz.info
|
||||
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
|
||||
source <(/home/admin/config.scripts/internet.sh status local)
|
||||
|
@ -25,16 +25,16 @@ OPTIONS=()
|
|||
OPTIONS+=(NAME "Change the name / alias of the node")
|
||||
ln_getInfo=$($lightningcli_alias getinfo 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
|
||||
openChannels=$((ln_channels_online+cln_num_inactive_channels))
|
||||
cl_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null
|
||||
openChannels=$((ln_channels_online+cl_num_inactive_channels))
|
||||
if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
|
||||
OPTIONS+=(SUEZ "Visualize channels")
|
||||
OPTIONS+=(CLOSEALL "Close all open channels on $CHAIN")
|
||||
fi
|
||||
OPTIONS+=(CASHOUT "Withdraw all funds onchain ($CHAIN)")
|
||||
OPTIONS+=(SEED "Show Wallet Seed Words")
|
||||
OPTIONS+=(CLNREPAIR "Repair options for C-lightning")
|
||||
if [ "${lightning}" != "cln" ] && [ "${CHAIN}" == "mainnet" ]; then
|
||||
OPTIONS+=(CLREPAIR "Repair options for C-lightning")
|
||||
if [ "${lightning}" != "cl" ] && [ "${CHAIN}" == "mainnet" ]; then
|
||||
OPTIONS+=(SWITCHLN "Use C-lightning as default")
|
||||
fi
|
||||
|
||||
|
@ -53,33 +53,33 @@ CHOICE=$(dialog --clear \
|
|||
case $CHOICE in
|
||||
SUMMARY)
|
||||
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."
|
||||
read key
|
||||
;;
|
||||
PEERING)
|
||||
/home/admin/BBconnectPeer.sh cln $CHAIN
|
||||
/home/admin/BBconnectPeer.sh cl $CHAIN
|
||||
;;
|
||||
FUNDING)
|
||||
/home/admin/BBfundWallet.sh cln $CHAIN
|
||||
/home/admin/BBfundWallet.sh cl $CHAIN
|
||||
;;
|
||||
CASHOUT)
|
||||
/home/admin/BBcashoutWallet.sh cln $CHAIN
|
||||
/home/admin/BBcashoutWallet.sh cl $CHAIN
|
||||
;;
|
||||
CHANNEL)
|
||||
/home/admin/BBopenChannel.sh cln $CHAIN
|
||||
/home/admin/BBopenChannel.sh cl $CHAIN
|
||||
;;
|
||||
SEND)
|
||||
/home/admin/BBpayInvoice.sh cln $CHAIN
|
||||
/home/admin/BBpayInvoice.sh cl $CHAIN
|
||||
;;
|
||||
RECEIVE)
|
||||
/home/admin/BBcreateInvoice.sh cln $CHAIN
|
||||
/home/admin/BBcreateInvoice.sh cl $CHAIN
|
||||
;;
|
||||
SEED)
|
||||
sudo /home/admin/config.scripts/cln.install.sh display-seed $CHAIN
|
||||
sudo /home/admin/config.scripts/cl.install.sh display-seed $CHAIN
|
||||
;;
|
||||
NAME)
|
||||
sudo /home/admin/config.scripts/cln.setname.sh $CHAIN
|
||||
sudo /home/admin/config.scripts/cl.setname.sh $CHAIN
|
||||
;;
|
||||
SUEZ)
|
||||
clear
|
||||
|
@ -87,7 +87,7 @@ case $CHOICE in
|
|||
/home/admin/config.scripts/bonus.suez.sh on
|
||||
fi
|
||||
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 "${command}"
|
||||
echo
|
||||
|
@ -97,19 +97,19 @@ case $CHOICE in
|
|||
read key
|
||||
;;
|
||||
CLOSEALL)
|
||||
/home/admin/BBcloseAllChannels.sh cln $CHAIN
|
||||
/home/admin/BBcloseAllChannels.sh cl $CHAIN
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
;;
|
||||
CLNREPAIR)
|
||||
/home/admin/99clnRepairMenu.sh $CHAIN
|
||||
CLREPAIR)
|
||||
/home/admin/99clRepairMenu.sh $CHAIN
|
||||
;;
|
||||
SWITCHLN)
|
||||
clear
|
||||
echo
|
||||
# setting value in the raspiblitz.conf
|
||||
sudo sed -i "s/^lightning=.*/lightning=cln/g" /mnt/hdd/raspiblitz.conf
|
||||
echo "# OK - lightning=cln is set in /mnt/hdd/raspiblitz.conf"
|
||||
sudo sed -i "s/^lightning=.*/lightning=cl/g" /mnt/hdd/raspiblitz.conf
|
||||
echo "# OK - lightning=cl is set in /mnt/hdd/raspiblitz.conf"
|
||||
echo
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
|
@ -5,11 +5,11 @@ echo "# get raspiblitz config"
|
|||
source /home/admin/raspiblitz.info
|
||||
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
|
||||
source <(/home/admin/config.scripts/internet.sh status local)
|
||||
NETclnEncryptedHSM="${netprefix}clnEncryptedHSM"
|
||||
NETclEncryptedHSM="${netprefix}clEncryptedHSM"
|
||||
|
||||
# BASIC MENU INFO
|
||||
WIDTH=64
|
||||
|
@ -18,12 +18,12 @@ TITLE="C-lightning repair options for $CHAIN"
|
|||
MENU=""
|
||||
OPTIONS=()
|
||||
|
||||
if [ "$(eval echo \$${netprefix}clnEncryptedHSM)" = "off" ];then
|
||||
if [ "$(eval echo \$${netprefix}clEncryptedHSM)" = "off" ];then
|
||||
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+=(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")
|
||||
else
|
||||
OPTIONS+=(AUTOUNLOCK-OFF "Do not auto-decrypt the hsm_secret after boot")
|
||||
|
@ -48,25 +48,25 @@ CHOICE=$(dialog --clear \
|
|||
|
||||
case $CHOICE in
|
||||
ENCRYPT)
|
||||
/home/admin/config.scripts/cln.hsmtool.sh encrypt $CHAIN
|
||||
/home/admin/config.scripts/cl.hsmtool.sh encrypt $CHAIN
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
;;
|
||||
|
||||
DECRYPT)
|
||||
/home/admin/config.scripts/cln.hsmtool.sh decrypt $CHAIN
|
||||
/home/admin/config.scripts/cl.hsmtool.sh decrypt $CHAIN
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
;;
|
||||
|
||||
PASSWORD_C)
|
||||
/home/admin/config.scripts/cln.hsmtool.sh change-password $CHAIN
|
||||
/home/admin/config.scripts/cl.hsmtool.sh change-password $CHAIN
|
||||
;;
|
||||
|
||||
AUTOUNLOCK-ON)
|
||||
/home/admin/config.scripts/cln.hsmtool.sh autounlock-on $CHAIN
|
||||
/home/admin/config.scripts/cl.hsmtool.sh autounlock-on $CHAIN
|
||||
;;
|
||||
|
||||
AUTOUNLOCK-OFF)
|
||||
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off $CHAIN
|
||||
/home/admin/config.scripts/cl.hsmtool.sh autounlock-off $CHAIN
|
||||
;;
|
||||
|
||||
BACKUP)
|
||||
|
@ -74,7 +74,7 @@ case $CHOICE in
|
|||
# run upload dialog and get result
|
||||
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
|
||||
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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
;;
|
||||
|
@ -84,11 +84,11 @@ case $CHOICE in
|
|||
## from dialogLightningWallet.sh
|
||||
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
|
||||
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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
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 "Press ENTER to continue or CTRL+C to abort"
|
||||
read key
|
||||
|
@ -97,22 +97,22 @@ case $CHOICE in
|
|||
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.*
|
||||
# make sure the new hsm_secret is treated as unencrypted and clear autounlock
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \
|
||||
"s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=off/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnEncryptedHSM=off/g" \
|
||||
"s/^${netprefix}clAutoUnlock=.*/${netprefix}clEncryptedHSM=off/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
# 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
|
||||
if [ "${cln}" == "on" ] || [ "${cln}" == "1" ]; then
|
||||
/home/admin/config.scripts/cln.install-service.sh mainnet
|
||||
if [ "${cl}" == "on" ] || [ "${cl}" == "1" ]; then
|
||||
/home/admin/config.scripts/cl.install-service.sh mainnet
|
||||
fi
|
||||
if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then
|
||||
/home/admin/config.scripts/cln.install-service.sh testnet
|
||||
if [ "${tcl}" == "on" ] || [ "${tcl}" == "1" ]; then
|
||||
/home/admin/config.scripts/cl.install-service.sh testnet
|
||||
fi
|
||||
if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then
|
||||
/home/admin/config.scripts/cln.install-service.sh signet
|
||||
if [ "${scl}" == "on" ] || [ "${scl}" == "1" ]; then
|
||||
/home/admin/config.scripts/cl.install-service.sh signet
|
||||
fi
|
||||
;;
|
||||
|
||||
|
@ -121,11 +121,11 @@ case $CHOICE in
|
|||
## from dialogLightningWallet.sh
|
||||
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
|
||||
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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
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 "Press ENTER to continue or CTRL+C to abort"
|
||||
read key
|
||||
|
@ -135,7 +135,7 @@ case $CHOICE in
|
|||
# import file
|
||||
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
|
||||
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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
;;
|
||||
|
@ -145,11 +145,11 @@ case $CHOICE in
|
|||
## from dialogLightningWallet.sh
|
||||
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
|
||||
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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
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 "Press ENTER to continue or CTRL+C to abort"
|
||||
read key
|
||||
|
@ -159,14 +159,14 @@ case $CHOICE in
|
|||
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/*.*
|
||||
# import seed
|
||||
_temp="/var/cache/raspiblitz/.temp.tmp"
|
||||
/home/admin/config.scripts/cln.backup.sh seed-import-gui $_temp
|
||||
/home/admin/config.scripts/cln.hsmtool.sh seed "$CHAIN" "$(cat $_temp)"
|
||||
/home/admin/config.scripts/cl.backup.sh seed-import-gui $_temp
|
||||
/home/admin/config.scripts/cl.hsmtool.sh seed "$CHAIN" "$(cat $_temp)"
|
||||
source $_temp 2>/dev/null
|
||||
sudo rm $_temp 2>/dev/null
|
||||
# regenerate config
|
||||
/home/admin/config.scripts/cln.hsmtool.sh autounlock-off
|
||||
/home/admin/config.scripts/cln.hsmtool.sh decrypt
|
||||
/home/admin/config.scripts/cln.install.sh on $CHAIN
|
||||
/home/admin/config.scripts/cl.hsmtool.sh autounlock-off
|
||||
/home/admin/config.scripts/cl.hsmtool.sh decrypt
|
||||
/home/admin/config.scripts/cl.install.sh on $CHAIN
|
||||
;;
|
||||
|
||||
esac
|
|
@ -5,8 +5,8 @@ echo "get raspiblitz config"
|
|||
source /home/admin/raspiblitz.info
|
||||
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 cln $1)
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cl> <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
|
||||
|
||||
# BASIC MENU INFO
|
||||
WIDTH=64
|
||||
|
@ -23,9 +23,9 @@ if grep "^${netprefix}lnd=on" /mnt/hdd/raspiblitz.conf;then
|
|||
OPTIONS+=(LNDCONF "Edit the lnd.conf for ${CHAIN}")
|
||||
fi
|
||||
|
||||
if grep "^${netprefix}cln=on" /mnt/hdd/raspiblitz.conf;then
|
||||
OPTIONS+=(CLNLOG "Monitor the CLN log for ${CHAIN}")
|
||||
OPTIONS+=(CLNCONF "Edit the CLN config for ${CHAIN}")
|
||||
if grep "^${netprefix}cl=on" /mnt/hdd/raspiblitz.conf;then
|
||||
OPTIONS+=(CLLOG "Monitor the CL log for ${CHAIN}")
|
||||
OPTIONS+=(CLCONF "Edit the CL config for ${CHAIN}")
|
||||
fi
|
||||
|
||||
if [ "${runBehindTor}" == "on" ] && [ "${netprefix}" == "" ]; then
|
||||
|
@ -110,7 +110,7 @@ case $CHOICE in
|
|||
else
|
||||
echo "# No change made"
|
||||
fi;;
|
||||
CLNLOG)
|
||||
CLLOG)
|
||||
clear
|
||||
echo
|
||||
echo "Will follow the /home/bitcoin/.lightning/${CLNETWORK}/cl.log"
|
||||
|
@ -121,8 +121,8 @@ case $CHOICE in
|
|||
echo "###############################################################################"
|
||||
read key
|
||||
sudo tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log;;
|
||||
CLNCONF)
|
||||
if /home/admin/config.scripts/blitz.setconf.sh "${CLNCONF}" "root"
|
||||
CLCONF)
|
||||
if /home/admin/config.scripts/blitz.setconf.sh "${CLCONF}" "root"
|
||||
then
|
||||
whiptail \
|
||||
--title "Restart" --yes-button "Restart" --no-button "Not now" \
|
||||
|
|
|
@ -42,8 +42,8 @@ Do you want to download Lightning Data Backup now?
|
|||
sleep 2
|
||||
if [ "${lightning}" == "lnd" ]; then
|
||||
/home/admin/config.scripts/lnd.backup.sh lnd-export-gui
|
||||
elif [ "${lightning}" == "cln" ]; then
|
||||
/home/admin/config.scripts/cln.backup.sh cln-export-gui
|
||||
elif [ "${lightning}" == "cl" ]; then
|
||||
/home/admin/config.scripts/cl.backup.sh cl-export-gui
|
||||
else
|
||||
echo "TODO: Implement Data Backup for '${lightning}'"
|
||||
fi
|
||||
|
@ -59,8 +59,8 @@ Do you want to download Lightning Data Backup now?
|
|||
sleep 2
|
||||
if [ "${lightning}" == "lnd" ]; then
|
||||
/home/admin/config.scripts/lnd.backup.sh lnd-export
|
||||
elif [ "${lightning}" == "cln" ]; then
|
||||
/home/admin/config.scripts/cln.backup.sh cln-export
|
||||
elif [ "${lightning}" == "cl" ]; then
|
||||
/home/admin/config.scripts/cl.backup.sh cl-export
|
||||
else
|
||||
echo "TODO: Implement Data Backup for '${lightning}'"
|
||||
sleep 3
|
||||
|
|
|
@ -18,11 +18,11 @@ fi
|
|||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||
|
||||
# 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_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
|
||||
openChannels=$((ln_channels_online+cln_num_inactive_channels))
|
||||
cl_num_inactive_channels="$(echo "${ln_getInfo}" | jq -r '.num_inactive_channels')" 2>/dev/null
|
||||
openChannels=$((ln_channels_online+cl_num_inactive_channels))
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
openChannels=$($lncli_alias listchannels 2>/dev/null | jq '.[] | length')
|
||||
fi
|
||||
|
@ -47,10 +47,10 @@ if [ ${openChannels} -gt 0 ]; then
|
|||
fi
|
||||
|
||||
# check if money is waiting to get confirmed
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
ln_walletbalance_wait=0
|
||||
cln_listfunds=$($lightningcli_alias listfunds 2>/dev/null)
|
||||
for i in $(echo "$cln_listfunds" \
|
||||
cl_listfunds=$($lightningcli_alias listfunds 2>/dev/null)
|
||||
for i in $(echo "$cl_listfunds" \
|
||||
|jq .outputs[]|jq 'select(.status=="unconfirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
|
||||
ln_walletbalance_wait=$((ln_walletbalance_wait+i))
|
||||
done
|
||||
|
@ -91,7 +91,7 @@ echo "Sweep all possible Funds"
|
|||
echo "******************************"
|
||||
|
||||
# execute command
|
||||
if [ ${LNTYPE} = "cln" ];then
|
||||
if [ ${LNTYPE} = "cl" ];then
|
||||
# withdraw destination satoshi [feerate] [minconf] [utxos]
|
||||
command="$lightningcli_alias withdraw ${address} all slow"
|
||||
elif [ ${LNTYPE} = "lnd" ];then
|
||||
|
|
|
@ -11,19 +11,19 @@ fi
|
|||
|
||||
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
|
||||
peerlist=$($lightningcli_alias listpeers|grep '"id":'|awk '{print $2}'|cut -d, -f1)
|
||||
# to display
|
||||
function cln_closeall_command {
|
||||
function cl_closeall_command {
|
||||
for i in $peerlist; do
|
||||
# close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*]
|
||||
echo "$lightningcli_alias close $i 30;"
|
||||
done
|
||||
}
|
||||
command=$(cln_closeall_command)
|
||||
command=$(cl_closeall_command)
|
||||
# to run
|
||||
function cln_closeall {
|
||||
function cl_closeall {
|
||||
for i in $peerlist; do
|
||||
# close id [unilateraltimeout] [destination] [fee_negotiation_step] [*wrong_funding*]
|
||||
echo "# Attempting a mutual close one-by-one with a 30 seconds timeout"
|
||||
|
@ -42,7 +42,7 @@ fi
|
|||
clear
|
||||
echo
|
||||
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)
|
||||
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
||||
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
|
||||
|
@ -54,7 +54,7 @@ elif [ $LNTYPE = lnd ];then
|
|||
chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c)
|
||||
fi
|
||||
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 "
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
echo "# FAIL PRECHECK - ${netprefix}lncli getinfo shows 'synced_to_chain': false - wait until chain is sync "
|
||||
|
@ -78,8 +78,8 @@ echo "# RESULT:"
|
|||
|
||||
# execute command
|
||||
if [ ${#command} -gt 0 ]; then
|
||||
if [ $LNTYPE = cln ];then
|
||||
cln_closeall
|
||||
if [ $LNTYPE = cl ];then
|
||||
cl_closeall
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
${command}
|
||||
fi
|
||||
|
|
|
@ -41,7 +41,7 @@ pubkey=$(echo "${_input}"|cut -d@ -f1)
|
|||
# address=$(echo "${_input}"|cut -d@ -f2|cut -d: -f1)
|
||||
# port=$(echo "${_input}"|cut -d: -f2)
|
||||
# build command
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
# connect id [host port]
|
||||
command="$lightningcli_alias connect ${_input}"
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
|
@ -104,7 +104,7 @@ else
|
|||
echo "$result"
|
||||
|
||||
# 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)
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
isPeer=$($lncli_alias listpeers 2>/dev/null| grep "${pubkey}" -c)
|
||||
|
|
|
@ -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)
|
||||
|
||||
# check if chain is in sync
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
lncommand="${netprefix}lightning-cli"
|
||||
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
|
||||
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
||||
|
@ -49,7 +49,7 @@ done
|
|||
|
||||
# check number of connected peers
|
||||
echo "check for open channels"
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
openChannels=$($lightningcli_alias listpeers | grep -c "CHANNELD_NORMAL")
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
openChannels=$($lncli_alias listchannels 2>/dev/null | grep chan_id -c)
|
||||
|
@ -81,7 +81,7 @@ fi
|
|||
# TODO let user enter a description
|
||||
|
||||
# build command
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
label=$(date +%s) # seconds since 1970-01-01 00:00:00 UTC
|
||||
# invoice msatoshi label description [expiry] [fallbacks] [preimage] [exposeprivatechannels] [cltv]
|
||||
command="$lightningcli_alias invoice ${amount}sat $label ''"
|
||||
|
@ -115,7 +115,7 @@ if [ ${#error} -gt 0 ]; then
|
|||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "${error}"
|
||||
else
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
payReq=$(echo "$result" | grep bolt11 | cut -d '"' -f4)
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
rhash=$(echo "$result" | grep r_hash | cut -d '"' -f4)
|
||||
|
@ -139,7 +139,7 @@ else
|
|||
echo "${payReq}"
|
||||
echo
|
||||
echo "Monitoring the Incoming Payment with:"
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
echo "$lightningcli_alias waitinvoice $label"
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
echo "$lncli_alias lookupinvoice ${rhash}"
|
||||
|
@ -148,7 +148,7 @@ else
|
|||
|
||||
while :
|
||||
do
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
result=$($lightningcli_alias waitinvoice $label)
|
||||
wasPayed=$(echo $result | grep -c 'paid')
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
|
|
|
@ -14,7 +14,7 @@ fi
|
|||
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
||||
|
||||
# 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)
|
||||
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
||||
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
|
||||
|
@ -26,7 +26,7 @@ elif [ $LNTYPE = lnd ];then
|
|||
chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c)
|
||||
fi
|
||||
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 "
|
||||
else
|
||||
echo "# FAIL PRECHECK - 'lightning-cli getinfo' blockheight is different from 'bitcoind getblockchaininfo' - wait until chain is sync "
|
||||
|
@ -40,7 +40,7 @@ else
|
|||
fi
|
||||
|
||||
# execute command
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
command="$lightningcli_alias newaddr bech32"
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
command="$lncli_alias newaddress p2wkh"
|
||||
|
@ -61,7 +61,7 @@ if [ ${#result} -eq 0 ]; then
|
|||
fi
|
||||
|
||||
# parse address from result
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
address=$( echo "$result" | grep "bech32" | cut -d '"' -f4)
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
address=$( echo "$result" | grep "address" | cut -d '"' -f4)
|
||||
|
@ -100,10 +100,10 @@ fi
|
|||
/home/admin/config.scripts/blitz.display.sh hide
|
||||
|
||||
# follow up info
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
string="Wait for confirmations."
|
||||
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
|
||||
whiptail --backtitle "Fund your onchain wallet" \
|
||||
--title "What's next?" \
|
||||
|
|
|
@ -18,7 +18,7 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
|
|||
|
||||
echo
|
||||
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)
|
||||
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
||||
if [ $BLOCKHEIGHT -eq $CLHEIGHT ];then
|
||||
|
@ -30,7 +30,7 @@ elif [ $LNTYPE = lnd ];then
|
|||
chainOutSync=$($lncli_alias getinfo | grep '"synced_to_chain": false' -c)
|
||||
fi
|
||||
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 "
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
echo "# FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync "
|
||||
|
@ -44,7 +44,7 @@ else
|
|||
fi
|
||||
|
||||
# check available funding
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
for i in $($lightningcli_alias \
|
||||
listfunds|jq .outputs[]|jq 'select(.status=="confirmed")'|grep value|awk '{print $2}'|cut -d, -f1);do
|
||||
confirmedBalance=$((confirmedBalance+i))
|
||||
|
@ -63,7 +63,7 @@ if [ ${confirmedBalance} -eq 0 ]; then
|
|||
fi
|
||||
|
||||
# check number of connected peers
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
numConnectedPeers=$($lightningcli_alias listpeers | grep -c '"id":')
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
numConnectedPeers=$($lncli_alias listpeers | grep pub_key -c)
|
||||
|
@ -81,7 +81,7 @@ fi
|
|||
|
||||
# let user pick a peer to open a channels with
|
||||
OPTIONS=()
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
while IFS= read -r grepLine
|
||||
do
|
||||
pubKey=$(echo ${grepLine} | cut -d '"' -f4)
|
||||
|
@ -160,7 +160,7 @@ if [ ${#conf_target} -eq 0 ]; then
|
|||
fi
|
||||
|
||||
# build command
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
# 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)
|
||||
command="$lightningcli_alias fundchannel ${pubKey} ${amount} $feerate"
|
||||
|
@ -197,7 +197,7 @@ else
|
|||
echo "${result}"
|
||||
echo
|
||||
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)
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
fundingTX=$(echo "${result}" | grep 'funding_txid' | cut -d '"' -f4)
|
||||
|
|
|
@ -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)
|
||||
|
||||
# check if chain is in sync
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
lncommand="${netprefix}lightning-cli"
|
||||
BLOCKHEIGHT=$($bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1)
|
||||
CLHEIGHT=$($lightningcli_alias getinfo | jq .blockheight)
|
||||
|
@ -49,7 +49,7 @@ done
|
|||
|
||||
# check number of connected peers
|
||||
echo "check for open channels"
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
openChannels=$($lightningcli_alias listpeers | grep -c "CHANNELD_NORMAL")
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
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
|
||||
|
||||
# build command
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
# pay bolt11 [msatoshi] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee]
|
||||
command="$lightningcli_alias pay ${invoice}"
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
|
@ -132,7 +132,7 @@ error=$(cat ${_error})
|
|||
#echo "result(${result})"
|
||||
#echo "error(${error})"
|
||||
|
||||
if [ $LNTYPE = cln ];then
|
||||
if [ $LNTYPE = cl ];then
|
||||
resultIsError=$(echo "${result}" | grep -c '"code":')
|
||||
elif [ $LNTYPE = lnd ];then
|
||||
resultIsError=$(echo "${result}" | grep -c "payment_error")
|
||||
|
|
|
@ -175,7 +175,7 @@ function status() {
|
|||
while :
|
||||
do
|
||||
# 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
|
||||
# wait 6 seconds for user exiting loop
|
||||
#echo
|
||||
|
|
|
@ -349,26 +349,26 @@ if [ "${lightning}" == "lnd" ]; then
|
|||
|
||||
fi
|
||||
|
||||
if [ "${lightning}" == "cln" ]; then
|
||||
if [ "${lightning}" == "cl" ]; then
|
||||
|
||||
###################################
|
||||
# c-lightning
|
||||
echo "############## c-lightning" >> ${logFile}
|
||||
|
||||
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}
|
||||
|
||||
# OLD WALLET FROM CLIGHTNING RESCUE
|
||||
if [ "${clnrescue}" != "" ]; then
|
||||
if [ "${clrescue}" != "" ]; then
|
||||
|
||||
echo "Restore CLN data from uploaded rescue file ${clnrescue} ..." >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/cln.backup.sh cln-import ${clnrescue})
|
||||
echo "Restore CL data from uploaded rescue file ${clrescue} ..." >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/cl.backup.sh cl-import ${clrescue})
|
||||
if [ "${error}" != "" ]; then
|
||||
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: setup: cln import backup failed" >> ${logFile}
|
||||
echo "FAIL: setup: cl import backup failed" >> ${logFile}
|
||||
echo "${error}" >> ${logFile}
|
||||
exit 16
|
||||
fi
|
||||
|
@ -376,31 +376,31 @@ if [ "${lightning}" == "cln" ]; then
|
|||
# OLD WALLET FROM SEEDWORDS
|
||||
elif [ "${seedWords}" != "" ]; then
|
||||
|
||||
echo "Restore CLN wallet from seedWords ..." >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/cln.hsmtool.sh seed-force mainnet "${seedWords}" "${seedPassword}")
|
||||
echo "Restore CL wallet from seedWords ..." >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/cl.hsmtool.sh seed-force mainnet "${seedWords}" "${seedPassword}")
|
||||
|
||||
# check if wallet really got created
|
||||
walletExistsNow=$(sudo ls /home/bitcoin/.lightning/bitcoin/hsm_secret 2>/dev/null | grep -c "hsm_secret")
|
||||
if [ $walletExistsNow -eq 0 ]; then
|
||||
sed -i "s/^state=.*/state=error/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
|
||||
fi
|
||||
|
||||
# NEW WALLET
|
||||
else
|
||||
|
||||
echo "Generate new CLN wallet ..." >> ${logFile}
|
||||
echo "Generate new CL wallet ..." >> ${logFile}
|
||||
|
||||
# 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
|
||||
if [ "${seedwords}" == "" ] || [ "${seedwords6x4}" == "" ]; then
|
||||
sed -i "s/^state=.*/state=error/g" ${infoFile}
|
||||
sed -i "s/^message=.*/message='setup: no cln seedwords'/g" ${infoFile}
|
||||
echo "FAIL: setup: no cln seedwords" >> ${logFile}
|
||||
sed -i "s/^message=.*/message='setup: no cl seedwords'/g" ${infoFile}
|
||||
echo "FAIL: setup: no cl seedwords" >> ${logFile}
|
||||
exit 18
|
||||
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")
|
||||
if [ $walletExistsNow -eq 0 ]; then
|
||||
sed -i "s/^state=.*/state=error/g" ${infoFile}
|
||||
sed -i "s/^message=.*/message='setup: no cln wallet created'/g" ${infoFile}
|
||||
echo "FAIL: setup: no cln wallet created" >> ${logFile}
|
||||
sed -i "s/^message=.*/message='setup: no cl wallet created'/g" ${infoFile}
|
||||
echo "FAIL: setup: no cl wallet created" >> ${logFile}
|
||||
exit 19
|
||||
fi
|
||||
|
||||
|
|
|
@ -248,16 +248,16 @@ if [ "${lightning}" == "lnd" ]; then
|
|||
sudo systemctl start lnd >> ${logFile}
|
||||
|
||||
|
||||
elif [ "${lightning}" == "cln" ]; then
|
||||
elif [ "${lightning}" == "cl" ]; then
|
||||
|
||||
echo "Install C-lightning on update" >> ${logFile}
|
||||
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}
|
||||
|
||||
elif [ "${lightning}" == "none" ]; then
|
||||
|
||||
echo "No Lightnig" >> ${logFile}
|
||||
echo "No Lightning" >> ${logFile}
|
||||
|
||||
else
|
||||
|
||||
|
|
|
@ -332,37 +332,37 @@ if [ "${tlnd}" == "on" ]; then
|
|||
sudo systemctl start tlnd >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning LND Testnet - not active" >> ${logFile}
|
||||
fi
|
||||
fiCL
|
||||
|
||||
# LND Signet
|
||||
# LND SignetCL
|
||||
if [ "${slnd}" == "on" ]; then
|
||||
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
|
||||
else
|
||||
echo "Provisioning LND Signet - not active" >> ${logFile}
|
||||
CLcho "Provisioning LND Signet - not active" >> ${logFile}
|
||||
fi
|
||||
|
||||
CL
|
||||
# CLN Mainnet (when not main instance)
|
||||
if [ "${cln}" == "on" ] && [ "${lightning}" != "cln" ]; then
|
||||
echo "Provisioning CLN Mainnet - run config script" >> ${logFile}
|
||||
sudo /home/admin/config.scripts/cln.install.sh on mainnet >> ${logFile} 2>&1
|
||||
if [ "${cl}" == "on" ] && [ "${lightning}" != "cl" ]; then
|
||||
echo "Provisioning CL Mainnet - run config script" >> ${logFile}
|
||||
sudo /home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning CLN Mainnet - not active as secondary option" >> ${logFile}
|
||||
CLcho "Provisioning CLN Mainnet - not active as secondary option" >> ${logFile}
|
||||
fi
|
||||
|
||||
CL
|
||||
# CLN Testnet
|
||||
if [ "${tcln}" == "on" ]; then
|
||||
echo "Provisioning CLN Testnet - run config script" >> ${logFile}
|
||||
sudo /home/admin/config.scripts/cln.install.sh on testnet >> ${logFile} 2>&1
|
||||
if [ "${tcl}" == "on" ]; then
|
||||
echo "Provisioning CL Testnet - run config script" >> ${logFile}
|
||||
sudo /home/admin/config.scripts/cl.install.sh on testnet >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning CLN Testnet - not active" >> ${logFile}
|
||||
fi
|
||||
|
||||
# CLN Signet
|
||||
if [ "${scln}" == "on" ]; then
|
||||
if [ "${scl}" == "on" ]; then
|
||||
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
|
||||
echo "Provisioning CLN Signet - not active" >> ${logFile}
|
||||
fi
|
||||
|
@ -410,13 +410,13 @@ if [ "${#dynDomain}" -gt 0 ]; then
|
|||
sudo /home/admin/config.scripts/internet.dyndomain.sh on ${dynDomain} ${dynUpdateUrl} >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning DYNAMIC DOMAIN - keep default" >> ${logFile}
|
||||
fi
|
||||
fiCL
|
||||
|
||||
# RTL (LND)
|
||||
# RTL (LND)CL
|
||||
if [ "${rtlWebinterface}" = "on" ]; then
|
||||
echo "Provisioning RTL LND - run config script" >> ${logFile}
|
||||
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
|
||||
echo "Provisioning RTL LND - keep default" >> ${logFile}
|
||||
fi
|
||||
|
@ -425,7 +425,7 @@ fi
|
|||
if [ "${crtlWebinterface}" = "on" ]; then
|
||||
echo "Provisioning RTL CLN - run config script" >> ${logFile}
|
||||
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
|
||||
echo "Provisioning RTL CLN - keep default" >> ${logFile}
|
||||
fi
|
||||
|
@ -434,7 +434,7 @@ fi
|
|||
if [ "${sparko}" = "on" ]; then
|
||||
echo "Provisioning Sparko - run config script" >> ${logFile}
|
||||
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
|
||||
echo "Provisioning RTL CLN - keep default" >> ${logFile}
|
||||
fi
|
||||
|
@ -802,7 +802,7 @@ if [ "${lightning}" == "lnd" ];then
|
|||
else
|
||||
echo "No /mnt/hdd/passwordc.flag" >> ${logFile}
|
||||
fi
|
||||
elif [ "${lightning}" == "cln" ];then
|
||||
elif [ "${lightning}" == "cl" ];then
|
||||
sudo systemctl start lightningd
|
||||
fi
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ fi
|
|||
echo
|
||||
|
||||
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
|
||||
echo
|
||||
echo "*** LAST 30 C-LIGHTNING (MAINNET) INFO LOGS ***"
|
||||
|
@ -127,7 +127,7 @@ fi
|
|||
echo
|
||||
|
||||
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
|
||||
echo
|
||||
echo "*** LAST 30 C-LIGHTNING (TESTNET) INFO LOGS ***"
|
||||
|
@ -171,7 +171,7 @@ fi
|
|||
echo
|
||||
|
||||
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
|
||||
echo
|
||||
echo "*** LAST 30 C-LIGHTNING (SIGNET) INFO LOGS ***"
|
||||
|
@ -236,11 +236,11 @@ fi
|
|||
|
||||
if [ "${crtlWebinterface}" == "on" ]; then
|
||||
echo
|
||||
echo "*** CLN-RTL ***"
|
||||
echo "*** CL-RTL ***"
|
||||
sudo systemctl status cRTL -n10 --no-pager
|
||||
echo
|
||||
else
|
||||
echo "- CLN-RTL is OFF by config"
|
||||
echo "- CL-RTL is OFF by config"
|
||||
fi
|
||||
|
||||
if [ "${ElectRS}" == "on" ]; then
|
||||
|
|
|
@ -47,8 +47,8 @@ if [ ${#abcd} -eq 0 ]; then
|
|||
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
||||
OPTIONS+=(C "LND Lightning Wallet Password")
|
||||
fi
|
||||
if [ "${cln}" == "on" ] && [ "${clnEncryptedHSM}" == "on" ]; then
|
||||
OPTIONS+=(CLN "C-Lightning Wallet Password")
|
||||
if [ "${cl}" == "on" ] && [ "${clEncryptedHSM}" == "on" ]; then
|
||||
OPTIONS+=(CL "C-Lightning Wallet Password")
|
||||
fi
|
||||
CHOICE=$(dialog --clear \
|
||||
--backtitle "RaspiBlitz" \
|
||||
|
@ -71,8 +71,8 @@ if [ ${#abcd} -eq 0 ]; then
|
|||
D)
|
||||
abcd='d';
|
||||
;;
|
||||
CLN)
|
||||
abcd='cln';
|
||||
CL)
|
||||
abcd='cl';
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
|
@ -442,9 +442,9 @@ elif [ "${abcd}" = "x" ]; then
|
|||
# store result is file
|
||||
echo "${password1}" > ${resultFile}
|
||||
|
||||
elif [ "${abcd}" = "cln" ]; then
|
||||
/home/admin/config.scripts/cln.hsmtool.sh change-password mainnet
|
||||
# do not reboot for cln password
|
||||
elif [ "${abcd}" = "cl" ]; then
|
||||
/home/admin/config.scripts/cl.hsmtool.sh change-password mainnet
|
||||
# do not reboot for cl password
|
||||
reboot=0
|
||||
|
||||
# everything else
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
source /home/admin/raspiblitz.info
|
||||
source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||
|
||||
# LNTYPE is lnd | cln
|
||||
# LNTYPE is lnd | cl
|
||||
if [ $# -gt 0 ];then
|
||||
LNTYPE=$1
|
||||
else
|
||||
|
@ -276,26 +276,26 @@ if [ ${lndRunning} -eq 1 ] && [ "${LNTYPE}" == "lnd" ]; then
|
|||
|
||||
fi
|
||||
|
||||
# is CLN running
|
||||
clnRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running)
|
||||
echo "clnActive=${clnRunning}"
|
||||
echo "CLNwalletLocked=0"
|
||||
# is CL running
|
||||
clRunning=$(systemctl status ${netprefix}lightningd.service 2>/dev/null | grep -c running)
|
||||
echo "clActive=${clRunning}"
|
||||
echo "CLwalletLocked=0"
|
||||
|
||||
if [ "${clnRunning}" != "1" ] && [ "${LNTYPE}" == "cln" ]; then
|
||||
if [ "${clRunning}" != "1" ] && [ "${LNTYPE}" == "cl" ]; then
|
||||
# check if locked
|
||||
if [ "$(sudo journalctl -n5 -u ${netprefix}lightningd | \
|
||||
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
|
||||
|
||||
if [ "${clnRunning}" == "1" ] && [ "${LNTYPE}" == "cln" ]; then
|
||||
clnInfo=$($lightningcli_alias getinfo 2>&1)
|
||||
clnBlockHeight=$(echo "${clnInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]')
|
||||
scanProgress=$(echo "scale=2; $clnBlockHeight*100/$total" | bc)
|
||||
if [ "${clRunning}" == "1" ] && [ "${LNTYPE}" == "cl" ]; then
|
||||
clInfo=$($lightningcli_alias getinfo 2>&1)
|
||||
clBlockHeight=$(echo "${clInfo}" | jq -r '.blockheight' | tr -cd '[[:digit:]]')
|
||||
scanProgress=$(echo "scale=2; $clBlockHeight*100/$total" | bc)
|
||||
echo "scanProgress=${scanProgress}"
|
||||
clnBlockHeightPlusOne=$(expr $clnBlockHeight + 1)
|
||||
if [ "${total}" == "${clnBlockHeight}" ] || [ "${total}" == "${clnBlockHeightPlusOne}" ]; then
|
||||
clBlockHeightPlusOne=$(expr $clBlockHeight + 1)
|
||||
if [ "${total}" == "${clBlockHeight}" ] || [ "${total}" == "${clBlockHeightPlusOne}" ]; then
|
||||
echo "syncedToChain=1"
|
||||
else
|
||||
echo "syncedToChain=0"
|
||||
|
|
|
@ -137,14 +137,14 @@ if [ "$1" = "update-config" ]; then
|
|||
sed -i "s/^lnd_macaroon=.*/lnd_macaroon=${adminMacaroon}/g" ./.env
|
||||
sed -i "s/^lnd_cert=.*/lnd_cert=${tlsCert}/g" ./.env
|
||||
|
||||
# configure CLN
|
||||
elif [ "${lightning}" == "cln" ]; then
|
||||
# configure CL
|
||||
elif [ "${lightning}" == "cl" ]; then
|
||||
|
||||
echo "# CONFIG Web API Lightning --> CLN"
|
||||
sed -i "s/^ln_node=.*/ln_node=cln/g" ./.env
|
||||
echo "# CONFIG Web API Lightning --> CL"
|
||||
sed -i "s/^ln_node=.*/ln_node=cl/g" ./.env
|
||||
|
||||
# TODO: ADD C-Lightning config as soon as available
|
||||
echo "# MISSING CLN CONFIG YET"
|
||||
echo "# MISSING CL CONFIG YET"
|
||||
|
||||
else
|
||||
echo "# CONFIG Web API Lightning --> OFF"
|
||||
|
|
|
@ -315,8 +315,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
|
||||
[Unit]
|
||||
Description=lnbits
|
||||
Wants=lnd.service
|
||||
After=lnd.service
|
||||
Wants=bitcoind.service
|
||||
After=bitcoind.service
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/home/lnbits/lnbits
|
||||
|
|
|
@ -10,11 +10,11 @@ source /mnt/hdd/raspiblitz.conf
|
|||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
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 "# 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 prestart <lnd|cln> <mainnet|testnet|signet>"
|
||||
echo "# bonus.rtl.sh prestart <lnd|cl> <mainnet|testnet|signet>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -22,7 +22,7 @@ echo "# Running: 'bonus.rtl.sh $*'"
|
|||
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars $2 $3)
|
||||
|
||||
# LNTYPE is lnd | cln
|
||||
# LNTYPE is lnd | cl
|
||||
echo "# LNTYPE(${LNTYPE})"
|
||||
# CHAIN is signet | testnet | mainnet
|
||||
echo "# CHAIN(${CHAIN})"
|
||||
|
@ -32,7 +32,7 @@ echo "# portprefix(${portprefix})"
|
|||
echo "# typeprefix(${typeprefix})"
|
||||
|
||||
# prefix for parallel lightning impl
|
||||
if [ "${LNTYPE}" == "cln" ]; then
|
||||
if [ "${LNTYPE}" == "cl" ]; then
|
||||
RTLHTTP=${portprefix}7000
|
||||
elif [ "${LNTYPE}" == "lnd" ]; then
|
||||
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/^After=.*/After=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service
|
||||
fi
|
||||
|
||||
CL
|
||||
# adapt systemd service template for CLN
|
||||
if [ "${LNTYPE}" == "cln" ]; then
|
||||
if [ "${LNTYPE}" == "cl" ]; thenCL
|
||||
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/^After=.*/After=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service
|
||||
|
||||
# set up C-LightningREST
|
||||
/home/admin/config.scripts/cln.rest.sh on ${CHAIN}
|
||||
/home/admin/config.scripts/cl.rest.sh on ${CHAIN}
|
||||
fi
|
||||
|
||||
# Note about RTL config file
|
||||
|
@ -383,14 +383,14 @@ if [ "$1" = "prestart" ]; then
|
|||
|
||||
# C-Lightning changes of config
|
||||
# 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"
|
||||
cat /home/rtl/${systemdService}/RTL-Config.json | \
|
||||
jq ".port = \"${RTLHTTP}\"" | \
|
||||
jq ".multiPass = \"${RPCPASSWORD}\"" | \
|
||||
jq ".nodes[0].lnNode = \"${hostname}\"" | \
|
||||
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.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" | \
|
||||
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 "# Delete user and home directory"
|
||||
sudo userdel -rf rtl
|
||||
if [ $LNTYPE = cln ];then
|
||||
/home/admin/config.scripts/cln.rest.sh off ${CHAIN}
|
||||
if [ $LNTYPE = cl ];then
|
||||
/home/admin/config.scripts/cl.rest.sh off ${CHAIN}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ function help(){
|
|||
echo "Replicates the lightningd.sqlite3 database on the SDcard"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo "cln-plugin.backup.sh [on|off] [testnet|mainnet|signet]"
|
||||
echo "cln-plugin.backup.sh [restore] [testnet|mainnet|signet] [force]"
|
||||
echo "cln-plugin.backup.sh [backup-compact] [testnet|mainnet|signet]"
|
||||
echo "cl-plugin.backup.sh [on|off] [testnet|mainnet|signet]"
|
||||
echo "cl-plugin.backup.sh [restore] [testnet|mainnet|signet] [force]"
|
||||
echo "cl-plugin.backup.sh [backup-compact] [testnet|mainnet|signet]"
|
||||
echo
|
||||
echo "https://github.com/lightningd/plugins/tree/master/backup"
|
||||
echo
|
||||
|
@ -20,14 +20,14 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
|||
help
|
||||
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"
|
||||
plugindir="/home/bitcoin/cln-plugins-available/plugins"
|
||||
plugindir="/home/bitcoin/cl-plugins-available/plugins"
|
||||
|
||||
function install() {
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -40,9 +40,9 @@ function install() {
|
|||
fi
|
||||
sudo chmod +x ${plugindir}/${plugin}/${plugin}.py
|
||||
# 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 \
|
||||
/home/bitcoin/${netprefix}cln-plugins-enabled/
|
||||
/home/bitcoin/${netprefix}cl-plugins-enabled/
|
||||
fi
|
||||
else
|
||||
echo "# The ${plugin} plugin is already loaded"
|
||||
|
@ -83,7 +83,7 @@ if [ $1 = on ];then
|
|||
|
||||
elif [ $1 = off ];then
|
||||
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"
|
||||
now=$(date +"%Y_%m_%d_%H%M%S")
|
||||
sudo mv /home/bitcoin/${netprefix}lightningd.sqlite3.backup \
|
||||
|
@ -137,7 +137,7 @@ elif [ $1 = backup-compact ];then
|
|||
|
||||
else
|
||||
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
|
||||
|
||||
else
|
|
@ -10,13 +10,13 @@ if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
|||
echo "Install or remove the CLBOSS C-lightning plugin"
|
||||
echo "version: v${CLBOSSVERSION}"
|
||||
echo "Usage:"
|
||||
echo "cln-plugin.clboss.sh [on|off] [testnet|mainnet|signet]"
|
||||
echo "cl-plugin.clboss.sh [on|off] [testnet|mainnet|signet]"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars cln <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2)
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
|
||||
|
||||
# add default value to raspi config if needed
|
||||
configEntry="${netprefix}clboss"
|
||||
|
@ -30,21 +30,21 @@ fi
|
|||
|
||||
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
|
||||
sudo -u bitcoin wget \
|
||||
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
|
||||
|
||||
if [ ! -f /home/bitcoin/cln-plugins-available/clboss-${CLBOSSVERSION}/clboss ];then
|
||||
if [ ! -f /home/bitcoin/cl-plugins-available/clboss-${CLBOSSVERSION}/clboss ];then
|
||||
# dependencies
|
||||
sudo apt install -y build-essential pkg-config libev-dev \
|
||||
libcurl4-gnutls-dev libsqlite3-dev dnsutils
|
||||
|
||||
# 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
|
||||
cd clboss-${CLBOSSVERSION} || exit 1
|
||||
sudo -u bitcoin ./configure && sudo -u bitcoin make
|
||||
|
@ -52,9 +52,9 @@ if [ $1 = on ];then
|
|||
fi
|
||||
|
||||
# symlink to enable
|
||||
if [ ! -L /home/bitcoin/${netprefix}cln-plugins-enabled/clboss ];then
|
||||
sudo ln -s /home/bitcoin/cln-plugins-available/clboss-${CLBOSSVERSION}/clboss \
|
||||
/home/bitcoin/${netprefix}cln-plugins-enabled
|
||||
if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ];then
|
||||
sudo ln -s /home/bitcoin/cl-plugins-available/clboss-${CLBOSSVERSION}/clboss \
|
||||
/home/bitcoin/${netprefix}cl-plugins-enabled
|
||||
fi
|
||||
|
||||
# setting value in raspiblitz.conf
|
||||
|
@ -69,14 +69,14 @@ if [ $1 = on ];then
|
|||
echo "# clboss was installed for $CHAIN"
|
||||
echo "# Monitor with:"
|
||||
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"
|
||||
|
||||
fi
|
||||
|
||||
if [ $1 = off ];then
|
||||
# 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"
|
||||
sudo systemctl restart ${netprefix}lightningd
|
||||
|
@ -84,7 +84,7 @@ if [ $1 = off ];then
|
|||
# purge
|
||||
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
|
||||
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
|
||||
fi
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# explanation on paths https://github.com/ElementsProject/lightning/issues/4223
|
||||
# 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"
|
||||
|
||||
|
@ -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 "version: $SPARKOVERSION"
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars cln <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2)
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
|
||||
|
||||
# show info menu
|
||||
if [ "$1" = "menu" ]; then
|
||||
|
@ -63,7 +63,7 @@ fi
|
|||
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'/')
|
||||
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/"
|
||||
#string="${url}?access-key=${accesskey}"
|
||||
#/home/admin/config.scripts/blitz.display.sh qr "$string"
|
||||
|
@ -118,18 +118,18 @@ if [ $1 = on ];then
|
|||
DISTRO="linux_amd64"
|
||||
fi
|
||||
|
||||
if [ ! -f /home/bitcoin/cln-plugins-available/sparko ];then
|
||||
sudo -u bitcoin mkdir /home/bitcoin/cln-plugins-available
|
||||
if [ ! -f /home/bitcoin/cl-plugins-available/sparko ];then
|
||||
sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available
|
||||
# download binary
|
||||
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
|
||||
sudo chmod +x /home/bitcoin/cln-plugins-available/sparko
|
||||
sudo chmod +x /home/bitcoin/cl-plugins-available/sparko
|
||||
fi
|
||||
|
||||
if [ ! -L /home/bitcoin/${netprefix}cln-plugins-enabled/sparko ];then
|
||||
sudo ln -s /home/bitcoin/cln-plugins-available/sparko \
|
||||
/home/bitcoin/${netprefix}cln-plugins-enabled
|
||||
if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then
|
||||
sudo ln -s /home/bitcoin/cl-plugins-available/sparko \
|
||||
/home/bitcoin/${netprefix}cl-plugins-enabled
|
||||
fi
|
||||
|
||||
if [ ! -f /home/bitcoin/.lightning/sparko-tls/key.pem ];then
|
||||
|
@ -146,8 +146,8 @@ if [ $1 = on ];then
|
|||
##########
|
||||
# Config #
|
||||
##########
|
||||
if ! grep -Eq "^sparko" ${CLNCONF};then
|
||||
echo "# Editing ${CLNCONF}"
|
||||
if ! grep -Eq "^sparko" ${CLCONF};then
|
||||
echo "# Editing ${CLCONF}"
|
||||
echo "# See: https://github.com/fiatjaf/sparko#how-to-use"
|
||||
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
|
||||
# Spark wallet only allows alphanumeric characters
|
||||
|
@ -161,9 +161,9 @@ sparko-port=${portprefix}9000
|
|||
sparko-tls-path=/home/bitcoin/.lightning/sparko-tls
|
||||
sparko-login=blitz:$PASSWORD_B
|
||||
sparko-keys=${masterkeythatcandoeverything}; ${secretaccesskeythatcanreadstuff}: getinfo, listchannels, listnodes; ${verysecretkeythatcanpayinvoices}: pay; ${keythatcanlistentoallevents}: stream
|
||||
" | sudo tee -a ${CLNCONF}
|
||||
" | sudo tee -a ${CLCONF}
|
||||
else
|
||||
echo "# Sparko is already configured in ${CLNCONF}"
|
||||
echo "# Sparko is already configured in ${CLCONF}"
|
||||
fi
|
||||
|
||||
echo "# Allowing port ${portprefix}9000 through the firewall"
|
||||
|
@ -190,10 +190,10 @@ fi
|
|||
|
||||
if [ $1 = off ];then
|
||||
# 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}"
|
||||
sudo sed -i "/^sparko/d" ${CLNCONF}
|
||||
echo "# Editing ${CLCONF}"
|
||||
sudo sed -i "/^sparko/d" ${CLCONF}
|
||||
|
||||
echo "# Restart the ${netprefix}lightningd.service to deactivate Sparko"
|
||||
sudo systemctl restart ${netprefix}lightningd
|
||||
|
@ -206,7 +206,7 @@ if [ $1 = off ];then
|
|||
# purge
|
||||
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
|
||||
echo "# Delete plugin"
|
||||
sudo rm -rf /home/bitcoin/cln-plugins-available/sparko
|
||||
sudo rm -rf /home/bitcoin/cl-plugins-available/sparko
|
||||
fi
|
||||
# setting value in raspi blitz config
|
||||
sudo sed -i "s/^${netprefix}sparko=.*/${netprefix}sparko=off/g" /mnt/hdd/raspiblitz.conf
|
|
@ -5,7 +5,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
|||
echo
|
||||
echo "Install and show the output of the chosen plugin for C-lightning"
|
||||
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 "tested plugins:"
|
||||
echo "summary | helpme | feeadjuster"
|
||||
|
@ -18,19 +18,19 @@ fi
|
|||
|
||||
if [ $1 = on ];then
|
||||
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $3)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $3)
|
||||
|
||||
plugin=$2
|
||||
|
||||
if [ ! -f "/home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py" ]; then
|
||||
cd /home/bitcoin/cln-plugins-available || exit 1
|
||||
if [ ! -f "/home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py" ]; then
|
||||
cd /home/bitcoin/cl-plugins-available || exit 1
|
||||
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
|
||||
fi
|
||||
|
||||
if [ $($lightningcli_alias | grep -c "${plugin}") -eq 0 ];then
|
||||
echo "# Starting the ${plugin} plugin"
|
||||
sudo -u bitcoin pip install -r /home/bitcoin/cln-plugins-available/plugins/${plugin}/requirements.txt
|
||||
$lightningcli_alias plugin start /home/bitcoin/cln-plugins-available/plugins/${plugin}/${plugin}.py
|
||||
sudo -u bitcoin pip install -r /home/bitcoin/cl-plugins-available/plugins/${plugin}/requirements.txt
|
||||
$lightningcli_alias plugin start /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py
|
||||
fi
|
||||
|
||||
echo
|
||||
|
@ -48,7 +48,7 @@ if [ $1 = on ];then
|
|||
echo
|
||||
|
||||
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
|
|
@ -5,16 +5,16 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
|||
echo
|
||||
echo "Install and show the output if the summary plugin for C-lightning"
|
||||
echo "Usage:"
|
||||
echo "cln-plugin.summary.sh [testnet|mainnet|signet] [runonce]"
|
||||
echo "cl-plugin.summary.sh [testnet|mainnet|signet] [runonce]"
|
||||
echo
|
||||
exit 1
|
||||
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
|
||||
sudo -u bitcoin mkdir /home/bitcoin/cln-plugins-available
|
||||
cd /home/bitcoin/cln-plugins-available || exit 1
|
||||
if [ ! -f "/home/bitcoin/cl-plugins-available/plugins/summary/summary.py" ]; then
|
||||
sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available
|
||||
cd /home/bitcoin/cl-plugins-available || exit 1
|
||||
sudo -u bitcoin git clone https://github.com/lightningd/plugins.git
|
||||
fi
|
||||
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
|
||||
sudo -u bitcoin pip install pylightning 1>/dev/null
|
||||
# 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
|
||||
$lightningcli_alias plugin start -H /home/bitcoin/cln-plugins-available/plugins/summary/summary.py 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/cl-plugins-available/plugins/summary/summary.py 1>/dev/null
|
||||
fi
|
||||
|
||||
echo
|
||||
|
@ -41,5 +41,5 @@ $lightningcli_alias -H summary
|
|||
echo
|
||||
|
||||
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
|
132
home.admin/config.scripts/cln.backup.sh → home.admin/config.scripts/cl.backup.sh
Executable file → Normal file
132
home.admin/config.scripts/cln.backup.sh → home.admin/config.scripts/cl.backup.sh
Executable file → Normal file
|
@ -4,17 +4,17 @@
|
|||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo
|
||||
echo "---------------------------------------------------"
|
||||
echo "CLN RESCUE FILE (tar.gz of complete cln directory)"
|
||||
echo "CL RESCUE FILE (tar.gz of complete cl directory)"
|
||||
echo "---------------------------------------------------"
|
||||
echo "cln.backup.sh cln-export"
|
||||
echo "cln.backup.sh cln-export-gui"
|
||||
echo "cln.backup.sh cln-import [file]"
|
||||
echo "cln.backup.sh cln-import-gui [setup|production] [?resultfile]"
|
||||
echo "cl.backup.sh cl-export"
|
||||
echo "cl.backup.sh cl-export-gui"
|
||||
echo "cl.backup.sh cl-import [file]"
|
||||
echo "cl.backup.sh cl-import-gui [setup|production] [?resultfile]"
|
||||
echo "---------------------------------------------------"
|
||||
echo "SEED WORDS"
|
||||
echo "---------------------------------------------------"
|
||||
echo "cln.backup.sh seed-export-gui [lndseeddata]"
|
||||
echo "cln.backup.sh seed-import-gui [resultfile]"
|
||||
echo "cl.backup.sh seed-export-gui [lndseeddata]"
|
||||
echo "cl.backup.sh seed-import-gui [resultfile]"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
@ -23,48 +23,48 @@ fi
|
|||
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"
|
||||
fileowner="admin"
|
||||
|
||||
# stop
|
||||
echo "# Stopping cln..."
|
||||
echo "# Stopping cl..."
|
||||
sudo systemctl stop lightningd 1>/dev/null
|
||||
if grep -Eq "^tcln=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping tcln..."
|
||||
if grep -Eq "^tcl=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping tcl..."
|
||||
sudo systemctl stop tlightningd 1>/dev/null
|
||||
fi
|
||||
if grep -Eq "^scln=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping scln..."
|
||||
if grep -Eq "^scl=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping scl..."
|
||||
sudo systemctl stop slightningd 1>/dev/null
|
||||
fi
|
||||
sleep 5
|
||||
echo "# OK"
|
||||
echo
|
||||
|
||||
# add cln version info into lnd dir (to detect needed updates later)
|
||||
clnVersion=$(sudo -u bitcoin lightning-cli --version | cut -d '-' -f1 | cut -d 'v' -f2)
|
||||
# add cl version info into lnd dir (to detect needed updates later)
|
||||
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
|
||||
echo "${clnVersion}" > /home/admin/cln.version.info
|
||||
sudo mv /home/admin/cln.version.info /mnt/hdd/app-data/.lightning/version.info
|
||||
echo "${clVersion}" > /home/admin/cl.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
|
||||
|
||||
# zip it
|
||||
sudo tar -zcvf ${downloadPath}/cln-rescue.tar.gz /mnt/hdd/app-data/.lightning 1>&2
|
||||
sudo chown ${fileowner}:${fileowner} ${downloadPath}/cln-rescue.tar.gz 1>&2
|
||||
sudo tar -zcvf ${downloadPath}/cl-rescue.tar.gz /mnt/hdd/app-data/.lightning 1>&2
|
||||
sudo chown ${fileowner}:${fileowner} ${downloadPath}/cl-rescue.tar.gz 1>&2
|
||||
|
||||
# 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
|
||||
md5checksum=$(md5sum ${downloadPath}/cln-rescue.tar.gz | head -n1 | cut -d " " -f1)
|
||||
mv ${downloadPath}/cln-rescue.tar.gz ${downloadPath}/cln-rescue-${md5checksum}.tar.gz 1>&2
|
||||
byteSize=$(ls -l ${downloadPath}/cln-rescue-${md5checksum}.tar.gz | awk '{print $5}')
|
||||
md5checksum=$(md5sum ${downloadPath}/cl-rescue.tar.gz | head -n1 | cut -d " " -f1)
|
||||
mv ${downloadPath}/cl-rescue.tar.gz ${downloadPath}/cl-rescue-${md5checksum}.tar.gz 1>&2
|
||||
byteSize=$(ls -l ${downloadPath}/cl-rescue-${md5checksum}.tar.gz | awk '{print $5}')
|
||||
|
||||
# check file size
|
||||
if [ ${byteSize} -lt 100 ]; then
|
||||
|
@ -73,17 +73,17 @@ if [ ${mode} = "cln-export" ]; then
|
|||
fi
|
||||
|
||||
# output result data
|
||||
echo "# cln service is stopped for security"
|
||||
echo "filename='${downloadPath}/cln-rescue-${md5checksum}.tar.gz'"
|
||||
echo "# cl service is stopped for security"
|
||||
echo "filename='${downloadPath}/cl-rescue-${md5checksum}.tar.gz'"
|
||||
echo "fileowner='${fileowner}'"
|
||||
echo "size=${byteSize}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ${mode} = "cln-export-gui" ]; then
|
||||
if [ ${mode} = "cl-export-gui" ]; then
|
||||
|
||||
# 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
|
||||
echo "error='${error}'"
|
||||
exit 1
|
||||
|
@ -115,10 +115,10 @@ if [ ${mode} = "cln-export-gui" ]; then
|
|||
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)
|
||||
filename=$2
|
||||
|
@ -133,24 +133,24 @@ if [ ${mode} = "cln-import" ]; then
|
|||
fi
|
||||
|
||||
# stop
|
||||
echo "# stopping cln..."
|
||||
echo "# stopping cl..."
|
||||
sudo systemctl stop lightningd 1>/dev/null
|
||||
if grep -Eq "^tcln=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping tcln..."
|
||||
if grep -Eq "^tcl=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping tcl..."
|
||||
sudo systemctl stop tlightningd 1>/dev/null
|
||||
fi
|
||||
if grep -Eq "^scln=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping scln..."
|
||||
if grep -Eq "^scl=on" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "# stopping scl..."
|
||||
sudo systemctl stop slightningd 1>/dev/null
|
||||
fi
|
||||
sleep 5
|
||||
|
||||
# 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
|
||||
|
||||
# unpack zip
|
||||
echo "# restoring CLN data from ${filename} ..."
|
||||
echo "# restoring CL data from ${filename} ..."
|
||||
sudo tar -xf ${filename} -C / 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
|
||||
|
||||
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
|
||||
scenario=$2
|
||||
|
@ -195,22 +195,22 @@ if [ ${mode} = "cln-import-gui" ]; then
|
|||
echo "**************************"
|
||||
echo "* UPLOAD THE RESCUE FILE *"
|
||||
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
|
||||
echo "CAUTION: Dont restore outdated states - risk of loosing funds!"
|
||||
echo
|
||||
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 "scp -r ./cln-rescue-*.tar.gz ${defaultUploadUser}@${localip}:${defaultUploadPath}/"
|
||||
echo "scp -r ./cl-rescue-*.tar.gz ${defaultUploadUser}@${localip}:${defaultUploadPath}/"
|
||||
echo ""
|
||||
echo "Use ${passwordInfo} to authenticate file transfer."
|
||||
echo "PRESS ENTER when upload is done"
|
||||
read key
|
||||
|
||||
# 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
|
||||
echo "OK - File found: ${filename}"
|
||||
echo "PRESS ENTER to continue."
|
||||
|
@ -222,7 +222,7 @@ if [ ${mode} = "cln-import-gui" ]; then
|
|||
read keyRetry
|
||||
elif [ "${error}" == "multiple" ]; then
|
||||
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 "PRESS ENTER to continue & retry ... or 'x'+ ENTER to cancel"
|
||||
read keyRetry
|
||||
|
@ -247,9 +247,9 @@ if [ ${mode} = "cln-import-gui" ]; then
|
|||
|
||||
# in setup scenario the final import is happening during provison
|
||||
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 "clnrescue='${filename}'" >> $RESULTFILE
|
||||
echo "clrescue='${filename}'" >> $RESULTFILE
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -269,17 +269,17 @@ if [ ${mode} = "cln-import-gui" ]; then
|
|||
echo
|
||||
|
||||
# run import process
|
||||
echo "OK deleting old CLN data & restoring imported rescue file ..."
|
||||
source <(sudo /home/admin/config.scripts/cln.backup.sh cln-import ${filename})
|
||||
echo "OK deleting old CL data & restoring imported rescue file ..."
|
||||
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
|
||||
/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
|
||||
# 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"
|
||||
# check if encrypted
|
||||
trap 'rm -f "$output"' EXIT
|
||||
|
@ -290,33 +290,33 @@ if [ ${mode} = "cln-import-gui" ]; then
|
|||
echo "# The hsm_secret is not encrypted"
|
||||
echo "# Record in raspiblitz.conf"
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \
|
||||
"s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=off/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
else
|
||||
cat $output
|
||||
echo "# Starting cln.hsmtool.sh unlock"
|
||||
/home/admin/config.scripts/cln.hsmtool.sh unlock # there are mutiple wallets possible, need to check for non-default ones too
|
||||
echo "# Starting cl.hsmtool.sh unlock"
|
||||
/home/admin/config.scripts/cl.hsmtool.sh unlock # there are mutiple wallets possible, need to check for non-default ones too
|
||||
fi
|
||||
|
||||
# set the lightningd service file on each active network
|
||||
# init backup plugin, restart cln
|
||||
if [ "${cln}" == "on" ] || [ "${cln}" == "1" ]; then
|
||||
/home/admin/config.scripts/cln.install-service.sh mainnet
|
||||
/home/admin/config.scripts/cln-plugin.backup.sh on mainnet
|
||||
# init backup plugin, restart cl
|
||||
if [ "${cl}" == "on" ] || [ "${cl}" == "1" ]; then
|
||||
/home/admin/config.scripts/cl.install-service.sh mainnet
|
||||
/home/admin/config.scripts/cl-plugin.backup.sh on mainnet
|
||||
fi
|
||||
if [ "${tcln}" == "on" ] || [ "${tcln}" == "1" ]; then
|
||||
/home/admin/config.scripts/cln.install-service.sh testnet
|
||||
/home/admin/config.scripts/cln-plugin.backup.sh on testnet
|
||||
if [ "${tcl}" == "on" ] || [ "${tcl}" == "1" ]; then
|
||||
/home/admin/config.scripts/cl.install-service.sh testnet
|
||||
/home/admin/config.scripts/cl-plugin.backup.sh on testnet
|
||||
fi
|
||||
if [ "${scln}" == "on" ] || [ "${scln}" == "1" ]; then
|
||||
/home/admin/config.scripts/cln.install-service.sh signet
|
||||
/home/admin/config.scripts/cln-plugin.backup.sh on signet
|
||||
if [ "${scl}" == "on" ] || [ "${scl}" == "1" ]; then
|
||||
/home/admin/config.scripts/cl.install-service.sh signet
|
||||
/home/admin/config.scripts/cl-plugin.backup.sh on signet
|
||||
fi
|
||||
|
||||
# give final info
|
||||
echo
|
||||
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
|
||||
exit 0
|
||||
|
@ -432,7 +432,7 @@ wordone wordtweo wordthree ...
|
|||
fi
|
||||
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=""
|
||||
|
||||
# writing result file data
|
|
@ -1,9 +1,9 @@
|
|||
#!/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
|
||||
# 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
|
||||
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]||\
|
||||
|
@ -14,44 +14,44 @@ if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]||\
|
|||
echo
|
||||
echo "Usage:"
|
||||
echo "Create new wallet:"
|
||||
echo "cln.hsmtool.sh [new] [mainnet|testnet|signet] [?seedPassword]"
|
||||
echo "cln.hsmtool.sh [new-force] [mainnet|testnet|signet] [?seedPassword]"
|
||||
echo "cl.hsmtool.sh [new] [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 "new-force will delete any old wallet and will work without dialog"
|
||||
echo
|
||||
echo "cln.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] [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 "seed-force will delete any old wallet and will work without dialog"
|
||||
echo
|
||||
echo "cln.hsmtool.sh [unlock|lock] <mainnet|testnet|signet>"
|
||||
echo "cln.hsmtool.sh [encrypt|decrypt] <mainnet|testnet|signet>"
|
||||
echo "cln.hsmtool.sh [autounlock-on|autounlock-off] <mainnet|testnet|signet>"
|
||||
echo "cl.hsmtool.sh [unlock|lock] <mainnet|testnet|signet>"
|
||||
echo "cl.hsmtool.sh [encrypt|decrypt] <mainnet|testnet|signet>"
|
||||
echo "cl.hsmtool.sh [autounlock-on|autounlock-off] <mainnet|testnet|signet>"
|
||||
echo
|
||||
echo "cln.hsmtool.sh [change-password] <mainnet|testnet|signet> <NewPassword>"
|
||||
echo "cl.hsmtool.sh [change-password] <mainnet|testnet|signet> <NewPassword>"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
# password file is on the disk if encrypted and auto-unlock is enabled
|
||||
passwordFile=/dev/shm/.${netprefix}cln.pw
|
||||
if grep -Eq "${netprefix}clnEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
|
||||
if grep -Eq "${netprefix}clnAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then
|
||||
passwordFile=/root/${netprefix}cln.pw
|
||||
passwordFile=/dev/shm/.${netprefix}cl.pw
|
||||
if grep -Eq "${netprefix}clEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
|
||||
if grep -Eq "${netprefix}clAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then
|
||||
passwordFile=/root/${netprefix}cl.pw
|
||||
fi
|
||||
fi
|
||||
|
||||
# add default value to raspi config if needed
|
||||
if ! grep -Eq "^${netprefix}clnEncryptedHSM=" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "${netprefix}clnEncryptedHSM=off" >> /mnt/hdd/raspiblitz.conf
|
||||
if ! grep -Eq "^${netprefix}clEncryptedHSM=" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "${netprefix}clEncryptedHSM=off" >> /mnt/hdd/raspiblitz.conf
|
||||
fi
|
||||
# add default value to raspi config if needed
|
||||
if ! grep -Eq "^${netprefix}clnAutoUnlock=" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "${netprefix}clnAutoUnlock=off" >> /mnt/hdd/raspiblitz.conf
|
||||
if ! grep -Eq "^${netprefix}clAutoUnlock=" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "${netprefix}clAutoUnlock=off" >> /mnt/hdd/raspiblitz.conf
|
||||
fi
|
||||
|
||||
#############
|
||||
|
@ -100,11 +100,11 @@ function shredPasswordFile() {
|
|||
echo
|
||||
echo "# Shredding the passwordFile"
|
||||
echo
|
||||
if [ -f /dev/shm/.${netprefix}cln.pw ];then
|
||||
sudo shred -uvz /dev/shm/.${netprefix}cln.pw
|
||||
if [ -f /dev/shm/.${netprefix}cl.pw ];then
|
||||
sudo shred -uvz /dev/shm/.${netprefix}cl.pw
|
||||
fi
|
||||
if [ -f /root/${netprefix}cln.pw ];then
|
||||
sudo shred -uvz /root/${netprefix}cln.pw
|
||||
if [ -f /root/${netprefix}cl.pw ];then
|
||||
sudo shred -uvz /root/${netprefix}cl.pw
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ function encryptHSMsecret() {
|
|||
sudo -u bitcoin lightning-hsmtool encrypt $hsmSecretPath || exit 1
|
||||
# setting value in raspiblitz.conf
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=on/g" \
|
||||
"s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=on/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
echo "# Encrypted the hsm_secret for C-lightning $CHAIN"
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ function decryptHSMsecret() {
|
|||
else
|
||||
# setting value in raspiblitz.conf
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=on/g" \
|
||||
"s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=on/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
if [ -f $passwordFile ];then
|
||||
echo "# Getting the password from $passwordFile"
|
||||
|
@ -154,7 +154,7 @@ function decryptHSMsecret() {
|
|||
echo "# Decrypted successfully"
|
||||
else
|
||||
# unlock manually
|
||||
/home/admin/config.scripts/cln.hsmtool.sh unlock
|
||||
/home/admin/config.scripts/cl.hsmtool.sh unlock
|
||||
# attempt to decrypt again
|
||||
sudo cat $passwordFile | sudo -u bitcoin lightning-hsmtool decrypt \
|
||||
"$hsmSecretPath" || echo "# Couldn't decrypt"; exit 1
|
||||
|
@ -163,7 +163,7 @@ function decryptHSMsecret() {
|
|||
shredPasswordFile
|
||||
# setting value in raspiblitz config
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=off/g" \
|
||||
"s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=off/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
echo "# Decrypted the hsm_secret for C-lightning $CHAIN"
|
||||
}
|
||||
|
@ -198,15 +198,15 @@ if [ "$1" = "new" ] || [ "$1" = "new-force" ] || [ "$1" = "seed" ] || [ "$1" = "
|
|||
seedPassword="$3"
|
||||
# get 24 words
|
||||
source <(python /home/admin/config.scripts/blitz.mnemonic.py generate)
|
||||
#TODO seedwords to cln.backup.sh seed-export-gui
|
||||
/home/admin/config.scripts/cln.backup.sh seed-export-gui "${seedwords6x4}"
|
||||
#TODO seedwords to cl.backup.sh seed-export-gui
|
||||
/home/admin/config.scripts/cl.backup.sh seed-export-gui "${seedwords6x4}"
|
||||
elif [ "$1" = "new-force" ]; then
|
||||
# get 24 words
|
||||
source <(python /home/admin/config.scripts/blitz.mnemonic.py generate)
|
||||
echo "seedwords='${seedwords}'"
|
||||
echo "seedwords6x4='${seedwords6x4}'"
|
||||
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"
|
||||
seedpassword="$4"
|
||||
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 chmod 600 /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info
|
||||
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
|
||||
seedwords='${seedwords}'
|
||||
seedwords6x4='${seedwords6x4}'
|
||||
|
@ -234,7 +234,7 @@ seedwords6x4='${seedwords6x4}'
|
|||
fi
|
||||
|
||||
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
|
||||
|
||||
|
@ -243,10 +243,10 @@ elif [ "$1" = "unlock" ]; then
|
|||
attempt=0
|
||||
justUnlocked=0
|
||||
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
|
||||
if [ $(echo "${clnError}" | \
|
||||
if [ $(echo "${clError}" | \
|
||||
grep -c 'encrypted-hsm: Could not read pass from stdin.') -gt 0 ];then
|
||||
if [ ${justUnlocked} -eq 0 ];then
|
||||
if [ -f $passwordFile ];then
|
||||
|
@ -263,19 +263,19 @@ elif [ "$1" = "unlock" ]; then
|
|||
fi
|
||||
|
||||
# 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
|
||||
|
||||
echo "# The hsm_secret is encrypted, but unlock is not configured"
|
||||
passwordToFile
|
||||
# setting value in raspiblitz config
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnEncryptedHSM=.*/${netprefix}clnEncryptedHSM=on/g" \
|
||||
"s/^${netprefix}clEncryptedHSM=.*/${netprefix}clEncryptedHSM=on/g" \
|
||||
/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
|
||||
elif [ $(echo "${clnError}" | \
|
||||
elif [ $(echo "${clError}" | \
|
||||
grep -c 'Wrong password for encrypted hsm_secret.') -gt 0 ];then
|
||||
echo "# Wrong password"
|
||||
sudo rm -f $passwordFile
|
||||
|
@ -322,7 +322,7 @@ elif [ "$1" = "encrypt" ]; then
|
|||
sudo -u bitcoin shred /home/bitcoin/.lightning/${CLNETWORK}/seedwords.info
|
||||
fi
|
||||
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
|
||||
# were $deletedWhen.
|
||||
# The words cannot be generated from the hsm_secret (one way function).
|
||||
|
@ -337,29 +337,29 @@ elif [ "$1" = "decrypt" ]; then
|
|||
decryptHSMsecret
|
||||
|
||||
elif [ "$1" = "autounlock-on" ]; then
|
||||
if grep -Eq "${netprefix}clnEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
|
||||
echo "# Moving the password from $passwordFile to /root/.${netprefix}cln.pw"
|
||||
sudo -u bitcoin mv /dev/shm/.${netprefix}cln.pw /root/.${netprefix}cln.pw
|
||||
if grep -Eq "${netprefix}clEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
|
||||
echo "# Moving the password from $passwordFile to /root/.${netprefix}cl.pw"
|
||||
sudo -u bitcoin mv /dev/shm/.${netprefix}cl.pw /root/.${netprefix}cl.pw
|
||||
else
|
||||
passwordFile=/root/.${netprefix}cln.pw
|
||||
passwordFile=/root/.${netprefix}cl.pw
|
||||
passwordToFile
|
||||
fi
|
||||
# setting value in raspiblitz config
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnAutoUnlock=on/g" \
|
||||
"s/^${netprefix}clAutoUnlock=.*/${netprefix}clAutoUnlock=on/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
echo "# Autounlock is on for C-lightning $CHAIN"
|
||||
|
||||
elif [ "$1" = "autounlock-off" ]; then
|
||||
if [ -f /root/${netprefix}cln.pw ];then
|
||||
sudo cp /root/.${netprefix}cln.pw /dev/shm/.${netprefix}cln.pw
|
||||
sudo shred -uzv /root/.${netprefix}cln.pw
|
||||
sudo chmod 600 /dev/shm/.${netprefix}cln.pw
|
||||
sudo chown bitcoin:bitcoin /dev/shm/.${netprefix}cln.pw
|
||||
if [ -f /root/${netprefix}cl.pw ];then
|
||||
sudo cp /root/.${netprefix}cl.pw /dev/shm/.${netprefix}cl.pw
|
||||
sudo shred -uzv /root/.${netprefix}cl.pw
|
||||
sudo chmod 600 /dev/shm/.${netprefix}cl.pw
|
||||
sudo chown bitcoin:bitcoin /dev/shm/.${netprefix}cl.pw
|
||||
fi
|
||||
# setting value in raspiblitz config
|
||||
sudo sed -i \
|
||||
"s/^${netprefix}clnAutoUnlock=.*/${netprefix}clnAutoUnlock=off/g" \
|
||||
"s/^${netprefix}clAutoUnlock=.*/${netprefix}clAutoUnlock=off/g" \
|
||||
/mnt/hdd/raspiblitz.conf
|
||||
echo "# Autounlock is off for C-lightning $CHAIN"
|
||||
|
||||
|
@ -369,7 +369,7 @@ elif [ "$1" = "change-password" ]; then
|
|||
if ! encryptHSMsecret "$walletPassword"; then
|
||||
echo "# Warning: the hsm_secret is left unencrypted."
|
||||
echo "# To fix run:"
|
||||
echo "/home/admin/config.scripts/cln.hsmtool encrypt $2"
|
||||
echo "/home/admin/config.scripts/cl.hsmtool encrypt $2"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
@ -389,4 +389,4 @@ else
|
|||
fi
|
||||
|
||||
# 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
|
|
@ -5,26 +5,26 @@ if [ "$1" = "-h" ]||[ "$1" = "--help" ];then
|
|||
echo
|
||||
echo "Script to set up or update the C-lightning systemd service"
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars cln <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1)
|
||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
|
||||
|
||||
if [ $(sudo -u bitcoin cat ${CLNCONF} | grep -c "^sparko") -gt 0 ];then
|
||||
if [ ! -f /home/bitcoin/${netprefix}cln-plugins-enabled/sparko ];then
|
||||
if [ $(sudo -u bitcoin cat ${CLCONF} | grep -c "^sparko") -gt 0 ];then
|
||||
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then
|
||||
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
|
||||
|
||||
if grep -Eq "${netprefix}clnEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
|
||||
if grep -Eq "${netprefix}clnAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then
|
||||
passwordFile=/root/.${netprefix}cln.pw
|
||||
if grep -Eq "${netprefix}clEncryptedHSM=on" /mnt/hdd/raspiblitz.conf;then
|
||||
if grep -Eq "${netprefix}clAutoUnlock=on" /mnt/hdd/raspiblitz.conf;then
|
||||
passwordFile=/root/.${netprefix}cl.pw
|
||||
else
|
||||
passwordFile=/dev/shm/.${netprefix}cln.pw
|
||||
passwordFile=/dev/shm/.${netprefix}cl.pw
|
||||
fi
|
||||
passwordInput="(cat $passwordFile;echo;cat $passwordFile) | "
|
||||
encryptedHSMoption="--encrypted-hsm"
|
||||
|
@ -45,7 +45,7 @@ User=bitcoin
|
|||
Group=bitcoin
|
||||
Type=simple
|
||||
ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd\
|
||||
--conf=${CLNCONF} ${encryptedHSMoption}'
|
||||
--conf=${CLCONF} ${encryptedHSMoption}'
|
||||
Restart=always
|
||||
TimeoutSec=120
|
||||
RestartSec=30
|
|
@ -21,10 +21,10 @@ if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then
|
|||
echo "mainnet / testnet / signet instances can run parallel"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo "cln.install.sh on <mainnet|testnet|signet>"
|
||||
echo "cln.install.sh off <mainnet|testnet|signet> <purge>"
|
||||
echo "cln.install.sh [update <version>|testPR <PRnumber>]"
|
||||
echo "cln.install.sh display-seed <mainnet|testnet|signet>"
|
||||
echo "cl.install.sh on <mainnet|testnet|signet>"
|
||||
echo "cl.install.sh off <mainnet|testnet|signet> <purge>"
|
||||
echo "cl.install.sh [update <version>|testPR <PRnumber>]"
|
||||
echo "cl.install.sh display-seed <mainnet|testnet|signet>"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
@ -32,31 +32,31 @@ fi
|
|||
# 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}"
|
||||
|
||||
# add default value to raspi config if needed
|
||||
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
|
||||
# add default value to raspi config if needed
|
||||
if ! grep -Eq "^${netprefix}cln=" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "${netprefix}cln=off" | sudo tee -a /mnt/hdd/raspiblitz.conf
|
||||
if ! grep -Eq "^${netprefix}cl=" /mnt/hdd/raspiblitz.conf; then
|
||||
echo "${netprefix}cl=off" | sudo tee -a /mnt/hdd/raspiblitz.conf
|
||||
fi
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
|
||||
if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];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'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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'"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -146,11 +146,11 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];
|
|||
echo "# Make sure bitcoin is in the ${TORGROUP} group"
|
||||
sudo usermod -a -G ${TORGROUP} bitcoin
|
||||
|
||||
echo "# Add plugin-dir: /home/bitcoin/${netprefix}cln-plugins-enabled"
|
||||
echo "# Add plugin-dir: /home/bitcoin/cln-plugins-available"
|
||||
echo "# Add plugin-dir: /home/bitcoin/${netprefix}cl-plugins-enabled"
|
||||
echo "# Add plugin-dir: /home/bitcoin/cl-plugins-available"
|
||||
# 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/cln-plugins-available 2>/dev/null
|
||||
sudo -u bitcoin mkdir /home/bitcoin/${netprefix}cl-plugins-enabled 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 "# 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}
|
||||
fi
|
||||
|
||||
if ! sudo ls ${CLNCONF};then
|
||||
echo "# Create ${CLNCONF}"
|
||||
if ! sudo ls ${CLCONF};then
|
||||
echo "# Create ${CLCONF}"
|
||||
echo "# lightningd configuration for ${network} ${CHAIN}
|
||||
|
||||
network=${CLNETWORK}
|
||||
announce-addr=127.0.0.1:${portprefix}9736
|
||||
log-file=cl.log
|
||||
log-level=info
|
||||
plugin-dir=/home/bitcoin/${netprefix}cln-plugins-enabled
|
||||
plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled
|
||||
|
||||
# Tor settings
|
||||
proxy=127.0.0.1:9050
|
||||
bind-addr=127.0.0.1:${portprefix}9736
|
||||
addr=statictor:127.0.0.1:9051/torport=${portprefix}9736
|
||||
always-use-proxy=true
|
||||
" | sudo tee ${CLNCONF}
|
||||
" | sudo tee ${CLCONF}
|
||||
else
|
||||
echo "# The file ${CLNCONF} is already present"
|
||||
echo "# The file ${CLCONF} is already present"
|
||||
fi
|
||||
sudo chown -R bitcoin:bitcoin /mnt/hdd/app-data/.lightning
|
||||
sudo chown -R bitcoin:bitcoin /home/bitcoin/
|
||||
|
@ -187,24 +187,24 @@ always-use-proxy=true
|
|||
#################
|
||||
# Backup plugin #
|
||||
#################
|
||||
/home/admin/config.scripts/cln-plugin.backup.sh on $CHAIN
|
||||
/home/admin/config.scripts/cl-plugin.backup.sh on $CHAIN
|
||||
|
||||
###################
|
||||
# Systemd service #
|
||||
###################
|
||||
/home/admin/config.scripts/cln.install-service.sh $CHAIN
|
||||
/home/admin/config.scripts/cl.install-service.sh $CHAIN
|
||||
|
||||
echo
|
||||
echo "# Adding aliases"
|
||||
echo "\
|
||||
alias ${netprefix}lightning-cli=\"sudo -u bitcoin /usr/local/bin/lightning-cli\
|
||||
--conf=${CLNCONF}\"
|
||||
alias ${netprefix}cln=\"sudo -u bitcoin /usr/local/bin/lightning-cli\
|
||||
--conf=${CLNCONF}\"
|
||||
alias ${netprefix}clnlog=\"sudo\
|
||||
--conf=${CLCONF}\"
|
||||
alias ${netprefix}cl=\"sudo -u bitcoin /usr/local/bin/lightning-cli\
|
||||
--conf=${CLCONF}\"
|
||||
alias ${netprefix}cllog=\"sudo\
|
||||
tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log\"
|
||||
alias ${netprefix}clnconf=\"sudo\
|
||||
nano ${CLNCONF}\"
|
||||
alias ${netprefix}clconf=\"sudo\
|
||||
nano ${CLCONF}\"
|
||||
" | sudo tee -a /home/admin/_aliases
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
|
||||
|
@ -222,12 +222,12 @@ alias ${netprefix}clnconf=\"sudo\
|
|||
echo
|
||||
|
||||
# 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 [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "" ]; then
|
||||
echo "# CLN is now the default lightning implementation"
|
||||
sudo sed -i "s/^lightning=.*/lightning=cln/g" /mnt/hdd/raspiblitz.conf
|
||||
echo "# CL is now the default lightning implementation"
|
||||
sudo sed -i "s/^lightning=.*/lightning=cl/g" /mnt/hdd/raspiblitz.conf
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@ -246,7 +246,7 @@ if [ "$1" = "display-seed" ]; then
|
|||
if [ "${displayNetwork}" == "" ]; then
|
||||
displayNetwork="mainnet"
|
||||
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
|
||||
seedwordFile="/home/bitcoin/.lightning/${CLNETWORK}/seedwords.info"
|
||||
|
@ -288,11 +288,11 @@ if [ "$1" = "off" ];then
|
|||
sudo rm -f /usr/local/bin/lightning-cli
|
||||
fi
|
||||
# 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 [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "cln" ]; then
|
||||
echo "# CLN is REMOVED as the default lightning implementation"
|
||||
# if cl mainnet was default - remove
|
||||
if [ "${CHAIN}" == "mainnet" ] && [ "${lightning}" == "cl" ]; then
|
||||
echo "# CL is REMOVED as the default lightning implementation"
|
||||
sudo sed -i "s/^lightning=.*/lightning=/g" /mnt/hdd/raspiblitz.conf
|
||||
if [ "${lnd}" == "on" ]; then
|
||||
echo "# LND is now the new default lightning implementation"
|
|
@ -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
|
||||
echo "Usage:"
|
||||
echo "cln.rest.sh [on|off|connect] <mainnet|testnet|signet>"
|
||||
echo "cl.rest.sh [on|off|connect] <mainnet|testnet|signet>"
|
||||
echo
|
||||
exit 1
|
||||
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
|
||||
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'/')
|
||||
# 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')
|
||||
url="https://${localip}:${portprefix}6100/"
|
||||
#string="${url}?${hex_macaroon}"
|
||||
|
@ -75,8 +75,8 @@ fi
|
|||
if [ $1 = on ];then
|
||||
echo "# Setting up c-lightning-REST for $CHAIN"
|
||||
|
||||
sudo systemctl stop ${netprefix}clnrest
|
||||
sudo systemctl disable ${netprefix}clnrest
|
||||
sudo systemctl stop ${netprefix}clrest
|
||||
sudo systemctl disable ${netprefix}clrest
|
||||
|
||||
if [ ! -f /home/bitcoin/c-lightning-REST/cl-rest.js ];then
|
||||
cd /home/bitcoin || exit 1
|
||||
|
@ -101,7 +101,7 @@ if [ $1 = on ];then
|
|||
|
||||
echo "
|
||||
# systemd unit for c-lightning-REST for ${CHAIN}
|
||||
# /etc/systemd/system/${netprefix}clnrest.service
|
||||
# /etc/systemd/system/${netprefix}clrest.service
|
||||
[Unit]
|
||||
Description=c-lightning-REST daemon for ${CHAIN}
|
||||
Wants=${netprefix}lightningd.service
|
||||
|
@ -123,30 +123,30 @@ PrivateDevices=true
|
|||
|
||||
[Install]
|
||||
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
|
||||
if [ "${state}" == "ready" ]; then
|
||||
echo "# OK - the clnrest.service is enabled, system is ready so starting service"
|
||||
sudo systemctl start ${netprefix}clnrest
|
||||
echo "# OK - the clrest.service is enabled, system is ready so starting service"
|
||||
sudo systemctl start ${netprefix}clrest
|
||||
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
|
||||
echo
|
||||
echo "# Monitor with:"
|
||||
echo "sudo journalctl -f -u clnrest"
|
||||
echo "sudo journalctl -f -u clrest"
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ $1 = off ];then
|
||||
echo "# Removing c-lightning-REST for ${CHAIN}"
|
||||
sudo systemctl stop ${netprefix}clnrest
|
||||
sudo systemctl disable ${netprefix}clnrest
|
||||
sudo systemctl stop ${netprefix}clrest
|
||||
sudo systemctl disable ${netprefix}clrest
|
||||
sudo rm -rf /home/bitcoin/c-lightning-REST/${CLNETWORK}
|
||||
echo "# Deny port ${portprefix}6100 through the firewall"
|
||||
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
|
||||
echo "# Removing the source code and binaries"
|
||||
sudo rm -rf /home/bitcoin/c-lightning-REST
|
|
@ -4,7 +4,7 @@
|
|||
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
|
@ -13,13 +13,13 @@ fi
|
|||
newName=$2
|
||||
|
||||
# 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
|
||||
if [ ${#newName} -eq 0 ]; then
|
||||
|
||||
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)
|
||||
" 8 56 2>./.tmp
|
||||
newName=$( cat ./.tmp | tr -dc '[:alnum:]\n\r' )
|
||||
|
@ -32,8 +32,8 @@ fi
|
|||
# config file
|
||||
blitzConfig="/mnt/hdd/raspiblitz.conf"
|
||||
|
||||
# cln conf file
|
||||
clnConfig="${CLNCONF}"
|
||||
# cl conf file
|
||||
clConfig="${CLCONF}"
|
||||
|
||||
# check if raspiblitz config file exists
|
||||
if [ ! -f ${blitzConfig} ]; then
|
||||
|
@ -41,16 +41,16 @@ if [ ! -f ${blitzConfig} ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# check if cln config file exists
|
||||
if sudo ls ${clnConfig}; then
|
||||
echo "FAIL - missing ${clnConfig}"
|
||||
# check if cl config file exists
|
||||
if sudo ls ${clConfig}; then
|
||||
echo "FAIL - missing ${clConfig}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# make sure entry line for 'alias' exists
|
||||
entryExists=$(cat ${clnConfig} | grep -c "alias=")
|
||||
entryExists=$(cat ${clConfig} | grep -c "alias=")
|
||||
if [ ${entryExists} -eq 0 ]; then
|
||||
echo "alias=" >> ${clnConfig}
|
||||
echo "alias=" >> ${clConfig}
|
||||
fi
|
||||
|
||||
# stop services
|
||||
|
@ -58,7 +58,7 @@ echo "making sure services are not running"
|
|||
sudo systemctl stop ${netprefix}lightningd 2>/dev/null
|
||||
|
||||
# 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
|
||||
if [ "${state}" == "ready" ]; then
|
|
@ -216,7 +216,7 @@ alias ${netprefix}lncli=\"sudo -u bitcoin /usr/local/bin/lncli\
|
|||
# setting value in raspi blitz config
|
||||
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
|
||||
echo "# LND is now default lighthning implementation"
|
||||
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
|
||||
echo "# LND is REMOVED as default lightning implementation"
|
||||
sudo sed -i "s/^lightning=.*/lightning=/g" /mnt/hdd/raspiblitz.conf
|
||||
if [ "${cln}" == "on" ]; then
|
||||
echo "# CLN is now new default lightning implementation"
|
||||
sudo sed -i "s/^lightning=.*/lightning=cln/g" /mnt/hdd/raspiblitz.conf
|
||||
if [ "${cl}" == "on" ]; then
|
||||
echo "# CL is now the new default lightning implementation"
|
||||
sudo sed -i "s/^lightning=.*/lightning=cl/g" /mnt/hdd/raspiblitz.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
||||
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
|
||||
echo "# chain is: main | test ; from raspiblitz.conf or raspiblitz.info or defaults to main"
|
||||
echo
|
||||
echo "# LNTYPE is: lnd | cln ; default: lnd"
|
||||
echo "# LNTYPE is: lnd | cl ; default: lnd"
|
||||
echo "# typeprefix is: "" | c"
|
||||
echo
|
||||
echo "# CHAIN is: mainnet | testnet | signet"
|
||||
|
@ -23,7 +23,7 @@ source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
|||
|
||||
if [ $1 = getvars ];then
|
||||
|
||||
# LNTYPE is: lnd | cln
|
||||
# LNTYPE is: lnd | cl
|
||||
if [ $# -gt 1 ];then
|
||||
LNTYPE=$2
|
||||
else
|
||||
|
@ -72,7 +72,7 @@ if [ $1 = getvars ];then
|
|||
echo "portprefix=${portprefix}"
|
||||
echo "L2rpcportmod=${L2rpcportmod}"
|
||||
|
||||
if [ "${LNTYPE}" == "cln" ];then
|
||||
if [ "${LNTYPE}" == "cl" ];then
|
||||
# CLNETWORK is: bitcoin / signet / testnet
|
||||
if [ "${chain}" == "main" ];then
|
||||
CLNETWORK=${network}
|
||||
|
@ -81,13 +81,13 @@ if [ $1 = getvars ];then
|
|||
fi
|
||||
echo "CLNETWORK=${CLNETWORK}"
|
||||
|
||||
# CLNCONF is the path to the config
|
||||
# CLCONF is the path to the config
|
||||
if [ "${CLNETWORK}" == "bitcoin" ]; then
|
||||
CLNCONF="/home/bitcoin/.lightning/config"
|
||||
CLCONF="/home/bitcoin/.lightning/config"
|
||||
else
|
||||
CLNCONF="/home/bitcoin/.lightning/${CLNETWORK}/config"
|
||||
CLCONF="/home/bitcoin/.lightning/${CLNETWORK}/config"
|
||||
fi
|
||||
echo "CLNCONF=${CLNCONF}"
|
||||
echo "CLCONF=${CLCONF}"
|
||||
typeprefix=c
|
||||
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\""
|
||||
# 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 "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
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ source ${SETUPFILE}
|
|||
# SHOW SEED WORDS AFTER SETUP
|
||||
if [ "${lightning}" == "lnd" ]; then
|
||||
walletName="LND"
|
||||
elif [ "${lightning}" == "cln" ]; then
|
||||
elif [ "${lightning}" == "cl" ]; then
|
||||
walletName="C-lightning"
|
||||
fi
|
||||
if [ "${setupPhase}" == "setup" ] && [ "${seedwords6x4NEW}" != "" ]; then
|
||||
|
|
|
@ -262,10 +262,10 @@ if [ "${setupPhase}" == "setup" ]; then
|
|||
/home/admin/setup.scripts/dialogLightningWallet-lnd.sh
|
||||
dialogResult=$?
|
||||
|
||||
elif [ "${lightning}" == "cln" ]; then
|
||||
elif [ "${lightning}" == "cl" ]; then
|
||||
|
||||
echo "# Starting lightning wallet dialog for C-LIGHTNING ..."
|
||||
/home/admin/setup.scripts/dialogLightningWallet-cln.sh
|
||||
/home/admin/setup.scripts/dialogLightningWallet-cl.sh
|
||||
dialogResult=$?
|
||||
|
||||
else
|
||||
|
|
|
@ -55,7 +55,7 @@ if [ "${network}" == "bitcoin" ]; then
|
|||
# choose lightning client
|
||||
OPTIONS=()
|
||||
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")
|
||||
CHOICE=$(dialog --clear \
|
||||
--backtitle "RaspiBlitz ${codeVersion} - Setup" \
|
||||
|
@ -69,8 +69,8 @@ if [ "${network}" == "bitcoin" ]; then
|
|||
LND)
|
||||
lightning="lnd"
|
||||
;;
|
||||
CLN)
|
||||
lightning="cln"
|
||||
CL)
|
||||
lightning="cl"
|
||||
;;
|
||||
NONE)
|
||||
lightning="none"
|
||||
|
|
|
@ -23,7 +23,7 @@ if [ "${CHOICE}" == "NEW" ]; then
|
|||
sudo sed -i '/^setPasswordB=/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 "setPasswordB=1" >> $SETUPFILE
|
||||
echo "setPasswordC=0" >> $SETUPFILE
|
||||
|
@ -36,11 +36,11 @@ elif [ "${CHOICE}" == "OLD" ]; then
|
|||
|
||||
# get more details what kind of old lightning wallet user has
|
||||
OPTIONS=()
|
||||
OPTIONS+=(CLNRESCUE "CLN tar.gz-Backupfile (BEST)")
|
||||
OPTIONS+=(CLRESCUE "CL tar.gz-Backupfile (BEST)")
|
||||
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
|
||||
uploadRESCUE=1
|
||||
|
@ -94,27 +94,27 @@ else
|
|||
exit 1
|
||||
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
|
||||
|
||||
# run upload dialog and get result
|
||||
_temp="/var/cache/raspiblitz/temp/.temp.tmp"
|
||||
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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
|
||||
# if user canceled upload
|
||||
if [ "${clnrescue}" == "" ]; then
|
||||
# signal cancel to the calling script by exit code (3 = exit on clnrescue)
|
||||
if [ "${clrescue}" == "" ]; then
|
||||
# signal cancel to the calling script by exit code (3 = exit on clrescue)
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# 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
|
||||
echo "clnrescue='${clnrescue}'" >> $SETUPFILE
|
||||
echo "clrescue='${clrescue}'" >> $SETUPFILE
|
||||
fi
|
||||
|
||||
# INPUT LIGHTNING SEED dialog (if activated by dialogs above)
|
||||
|
@ -122,7 +122,7 @@ if [ ${enterSEED} -eq 1 ]; then
|
|||
|
||||
# start seed input and get results
|
||||
_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
|
||||
sudo rm $_temp 2>/dev/null
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ do
|
|||
# setting info string
|
||||
infoStr=" Blockchain Progress : ${syncProgress}\n"
|
||||
|
||||
if [ "${lightning}" == "lnd" ] || [ "${lightning}" == "cln" ]; then
|
||||
if [ "${lightning}" == "lnd" ] || [ "${lightning}" == "cl" ]; then
|
||||
infoStr="${infoStr} Lightning Progress : ${scanProgress}\n ${actionString}"
|
||||
else
|
||||
# if lightning is deactivated (leave line clear)
|
||||
|
|
Loading…
Add table
Reference in a new issue