cln update to v23.02, backup-plugin update, add poetry (#3684)

* cln backup-plugin update, add poetry
* fix mkdir error, remove commented code, fmt #3677
* poetry and path fixes
* add terminal feedback, format #3676
* detect the full name of the plugin
* install pyln-client tqdm with pip
* git-verify: add --keyid-format LONG
to recognise if the signing key is not the main key
* cln update to v23.02
* cln-grpc: add protobuf-compiler dep
* rtl update to v0.13.6 and formatting
* C-lightningREST update to v0.10.1
This commit is contained in:
openoms 2023-03-07 20:06:39 +00:00 committed by GitHub
parent 2f88ea9d25
commit 7639b75311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 204 additions and 246 deletions

View file

@ -14,10 +14,11 @@
- New on WebUI: Jam (JoinMarket Web UI) v0.1.4 [details](https://github.com/joinmarket-webui/joinmarket-webui/releases/tag/v0.1.4) - New on WebUI: Jam (JoinMarket Web UI) v0.1.4 [details](https://github.com/joinmarket-webui/joinmarket-webui/releases/tag/v0.1.4)
- Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md) - Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md)
- Update: LND v0.15.5 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.15.5-beta) - Update: LND v0.15.5 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.15.5-beta)
- Update: Core Lightning v22.11.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v22.11.1) - Update: Core Lightning v23.02 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02)
- Update: C-lightningREST v0.10.1 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.1)
- Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023) - Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023)
- Update: Lightning Terminal v0.8.4-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.4-alpha) - Update: Lightning Terminal v0.8.4-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.4-alpha)
- Update: RTL v0.13.0 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.12.3) - Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6)
- Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16) - Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16)
- Update: LNbits 0.9.6 [details](https://github.com/lnbits/lnbits-legend/releases/tag/0.9.6) - Update: LNbits 0.9.6 [details](https://github.com/lnbits/lnbits-legend/releases/tag/0.9.6)
- Update: BTCPayServer 1.7.5 (using postgres for new installs) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.7.5) - Update: BTCPayServer 1.7.5 (using postgres for new installs) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.7.5)

View file

@ -441,6 +441,7 @@ if [ "${clNode}" != "${choice}" ]; then
fi fi
# make sure that cln-grpc is on for the WebAPI # make sure that cln-grpc is on for the WebAPI
echo "# install the cln-grpc plugin"
/home/admin/config.scripts/cl-plugin.cln-grpc.sh install /home/admin/config.scripts/cl-plugin.cln-grpc.sh install
/home/admin/config.scripts/cl-plugin.cln-grpc.sh on /home/admin/config.scripts/cl-plugin.cln-grpc.sh on

View file

@ -94,7 +94,7 @@ case $CHOICE in
fi fi
cd /home/bitcoin/suez || exit 1 cd /home/bitcoin/suez || exit 1
echo echo
sudo -u bitcoin /home/bitcoin/.local/bin/poetry run ./suez --client=c-lightning --client-args=--conf=${CLCONF} sudo -u bitcoin poetry run ./suez --client=c-lightning --client-args=--conf=${CLCONF}
echo echo
echo "Press ENTER to return to main menu." echo "Press ENTER to return to main menu."
read key read key

View file

@ -118,7 +118,7 @@ case $CHOICE in
/home/admin/config.scripts/bonus.suez.sh on /home/admin/config.scripts/bonus.suez.sh on
fi fi
cd /home/bitcoin/suez || exit 1 cd /home/bitcoin/suez || exit 1
sudo -u bitcoin /home/bitcoin/.local/bin/poetry run ./suez \ sudo -u bitcoin poetry run ./suez \
--client-args=-n=${CHAIN} \ --client-args=-n=${CHAIN} \
--client-args=--rpcserver=localhost:1${L2rpcportmod}009 --client-args=--rpcserver=localhost:1${L2rpcportmod}009
echo echo

View file

@ -570,10 +570,10 @@ function suez() {
clear clear
echo "# Showing the channels of ${lightning} ${chain}net - consider reducing the font size (press CTRL- or CMD-)" echo "# Showing the channels of ${lightning} ${chain}net - consider reducing the font size (press CTRL- or CMD-)"
if [ ${lightning} = cl ]; then if [ ${lightning} = cl ]; then
sudo -u bitcoin /home/bitcoin/.local/bin/poetry run ./suez \ sudo -u bitcoin poetry run ./suez \
--client=c-lightning --client-args=--conf=${CLCONF} --client=c-lightning --client-args=--conf=${CLCONF}
elif [ ${lightning} = lnd ]; then elif [ ${lightning} = lnd ]; then
sudo -u bitcoin /home/bitcoin/.local/bin/poetry run ./suez \ sudo -u bitcoin poetry run ./suez \
--client-args=-n=${CHAIN} \ --client-args=-n=${CHAIN} \
--client-args=--rpcserver=localhost:1${L2rpcportmod}009 --client-args=--rpcserver=localhost:1${L2rpcportmod}009
fi fi

View file

@ -30,10 +30,9 @@ PGPsigner="$1"
PGPpubkeyLink="$2" PGPpubkeyLink="$2"
PGPpubkeyFingerprint="$3" PGPpubkeyFingerprint="$3"
wget -O /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc "${PGPpubkeyLink}" wget -O /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc "${PGPpubkeyLink}"
gpg --import --import-options show-only /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc gpg --import --import-options show-only /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc
fingerprint=$(gpg --show-keys /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc 2>/dev/null | grep "${PGPpubkeyFingerprint}" -c) fingerprint=$(gpg --show-keys --keyid-format LONG /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc 2>/dev/null | grep "${PGPpubkeyFingerprint}" -c)
if [ "${fingerprint}" -lt 1 ]; then if [ "${fingerprint}" -lt 1 ]; then
echo echo
echo "# WARNING --> the PGP fingerprint is not as expected for ${PGPsigner}" >&2 echo "# WARNING --> the PGP fingerprint is not as expected for ${PGPsigner}" >&2
@ -65,7 +64,7 @@ echo
cat "$_temp" cat "$_temp"
echo "# goodSignature(${goodSignature})" echo "# goodSignature(${goodSignature})"
correctKey=$(tr -d " \t\n\r" < "$_temp" | grep "${PGPpubkeyFingerprint}" -c) correctKey=$(tr -d " \t\n\r" <"$_temp" | grep "${PGPpubkeyFingerprint}" -c)
echo "# correctKey(${correctKey})" echo "# correctKey(${correctKey})"
if [ "${correctKey}" -lt 1 ] || [ "${goodSignature}" -lt 1 ]; then if [ "${correctKey}" -lt 1 ] || [ "${goodSignature}" -lt 1 ]; then

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# https://github.com/Ride-The-Lightning/RTL/releases # https://github.com/Ride-The-Lightning/RTL/releases
RTLVERSION="v0.13.0" RTLVERSION="v0.13.6"
# check and load raspiblitz config # check and load raspiblitz config
# to know which network is running # to know which network is running
@ -63,7 +63,7 @@ if [ "$1" = "status" ] || [ "$1" = "menu" ]; then
localip=$(hostname -I | awk '{print $1}') localip=$(hostname -I | awk '{print $1}')
toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}${typeprefix}RTL/hostname 2>/dev/null) toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}${typeprefix}RTL/hostname 2>/dev/null)
fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2)
RTLHTTPS=$((RTLHTTP+1)) RTLHTTPS=$((RTLHTTP + 1))
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
@ -96,7 +96,7 @@ if [ "$1" = "menu" ]; then
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}" sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title "Ride The Lightning (RTL - $LNTYPE - $CHAIN)" --msgbox "Open in your local web browser: whiptail --title "Ride The Lightning (RTL - $LNTYPE - $CHAIN)" --msgbox "Open in your local web browser:
http://${localip}:${RTLHTTP}\n http://${localip}:${RTLHTTP}\n
https://${localip}:$((RTLHTTP+1)) with Fingerprint: https://${localip}:$((RTLHTTP + 1)) with Fingerprint:
${fingerprint}\n ${fingerprint}\n
Use your Password B to login.\n Use your Password B to login.\n
Hidden Service address for Tor Browser (QRcode on LCD):\n${toraddress} Hidden Service address for Tor Browser (QRcode on LCD):\n${toraddress}
@ -107,7 +107,7 @@ Hidden Service address for Tor Browser (QRcode on LCD):\n${toraddress}
else else
whiptail --title "Ride The Lightning (RTL - $LNTYPE - $CHAIN)" --msgbox "Open in your local web browser & accept self-signed cert: whiptail --title "Ride The Lightning (RTL - $LNTYPE - $CHAIN)" --msgbox "Open in your local web browser & accept self-signed cert:
http://${localip}:${RTLHTTP}\n http://${localip}:${RTLHTTP}\n
https://${localip}:$((RTLHTTP+1)) with Fingerprint: https://${localip}:$((RTLHTTP + 1)) with Fingerprint:
${fingerprint}\n ${fingerprint}\n
Use your Password B to login.\n Use your Password B to login.\n
Activate Tor to access the web interface from outside your local network. Activate Tor to access the web interface from outside your local network.
@ -117,7 +117,6 @@ Activate Tor to access the web interface from outside your local network.
exit 0 exit 0
fi fi
######################################## ########################################
# INSTALL (just user, code & compile) # INSTALL (just user, code & compile)
######################################## ########################################
@ -125,7 +124,7 @@ fi
if [ "$1" = "install" ]; then if [ "$1" = "install" ]; then
# check if already installed # check if already installed
if [ -f /home/rtl/RTL/LICENSE ];then if [ -f /home/rtl/RTL/LICENSE ]; then
echo "# RTL already installed - skipping" echo "# RTL already installed - skipping"
exit 0 exit 0
fi fi
@ -136,7 +135,7 @@ if [ "$1" = "install" ]; then
/home/admin/config.scripts/bonus.nodejs.sh on /home/admin/config.scripts/bonus.nodejs.sh on
# create rtl user (one for all instances) # create rtl user (one for all instances)
if [ $(compgen -u | grep -c rtl) -eq 0 ];then if [ $(compgen -u | grep -c rtl) -eq 0 ]; then
sudo adduser --disabled-password --gecos "" rtl || exit 1 sudo adduser --disabled-password --gecos "" rtl || exit 1
fi fi
@ -229,7 +228,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
fi fi
# make sure softwarte is installed # make sure softwarte is installed
if [ -f /home/rtl/RTL/LICENSE ];then if [ -f /home/rtl/RTL/LICENSE ]; then
echo "# OK - the RTL code is already present" echo "# OK - the RTL code is already present"
else else
echo "# install of codebase is needed first" echo "# install of codebase is needed first"
@ -253,7 +252,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "# Updating Firewall" echo "# Updating Firewall"
sudo ufw allow ${RTLHTTP} comment "${systemdService} HTTP" sudo ufw allow ${RTLHTTP} comment "${systemdService} HTTP"
sudo ufw allow $((RTLHTTP+1)) comment "${systemdService} HTTPS" sudo ufw allow $((RTLHTTP + 1)) comment "${systemdService} HTTPS"
echo echo
# make sure config directory exists # make sure config directory exists
@ -314,7 +313,7 @@ WantedBy=multi-user.target
# Hidden Service for RTL if Tor is active # Hidden Service for RTL if Tor is active
if [ "${runBehindTor}" = "on" ]; then if [ "${runBehindTor}" = "on" ]; then
# make sure to keep in sync with tor.network.sh script # make sure to keep in sync with tor.network.sh script
/home/admin/config.scripts/tor.onion-service.sh ${netprefix}${typeprefix}RTL 80 $((RTLHTTP+2)) 443 $((RTLHTTP+3)) /home/admin/config.scripts/tor.onion-service.sh ${netprefix}${typeprefix}RTL 80 $((RTLHTTP + 2)) 443 $((RTLHTTP + 3))
fi fi
# nginx configuration # nginx configuration
@ -323,11 +322,11 @@ WantedBy=multi-user.target
sudo cp /home/admin/assets/nginx/sites-available/rtl_tor.conf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf sudo cp /home/admin/assets/nginx/sites-available/rtl_tor.conf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf
sudo cp /home/admin/assets/nginx/sites-available/rtl_tor_ssl.conf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf sudo cp /home/admin/assets/nginx/sites-available/rtl_tor_ssl.conf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf
sudo sed -i "s/3000/$RTLHTTP/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_ssl.conf sudo sed -i "s/3000/$RTLHTTP/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_ssl.conf
sudo sed -i "s/3001/$((RTLHTTP+1))/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_ssl.conf sudo sed -i "s/3001/$((RTLHTTP + 1))/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_ssl.conf
sudo sed -i "s/3000/$RTLHTTP/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf sudo sed -i "s/3000/$RTLHTTP/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf
sudo sed -i "s/3002/$((RTLHTTP+2))/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf sudo sed -i "s/3002/$((RTLHTTP + 2))/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf
sudo sed -i "s/3000/$RTLHTTP/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf sudo sed -i "s/3000/$RTLHTTP/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf
sudo sed -i "s/3003/$((RTLHTTP+3))/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf sudo sed -i "s/3003/$((RTLHTTP + 3))/g" /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf
sudo ln -sf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_ssl.conf /etc/nginx/sites-enabled/ sudo ln -sf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_ssl.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf /etc/nginx/sites-enabled/ sudo ln -sf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf /etc/nginx/sites-enabled/ sudo ln -sf /etc/nginx/sites-available/${netprefix}${typeprefix}rtl_tor_ssl.conf /etc/nginx/sites-enabled/
@ -455,20 +454,20 @@ if [ "$1" = "prestart" ]; then
# LND changes of config # LND changes of config
if [ "${LNTYPE}" == "lnd" ]; then if [ "${LNTYPE}" == "lnd" ]; then
echo "# LND Config" echo "# LND Config"
cat /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json | \ cat /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json |
jq ".port = \"${RTLHTTP}\"" | \ jq ".port = \"${RTLHTTP}\"" |
jq ".multiPass = \"${RPCPASSWORD}\"" | \ jq ".multiPass = \"${RPCPASSWORD}\"" |
jq ".multiPassHashed = \"\"" | \ jq ".multiPassHashed = \"\"" |
jq ".nodes[0].lnNode = \"${hostname}\"" | \ jq ".nodes[0].lnNode = \"${hostname}\"" |
jq ".nodes[0].lnImplementation = \"LND\"" | \ jq ".nodes[0].lnImplementation = \"LND\"" |
jq ".nodes[0].Authentication.macaroonPath = \"/home/rtl/.lnd/data/chain/${network}/${CHAIN}/\"" | \ jq ".nodes[0].Authentication.macaroonPath = \"/home/rtl/.lnd/data/chain/${network}/${CHAIN}/\"" |
jq ".nodes[0].Authentication.configPath = \"/home/rtl/.lnd/${netprefix}lnd.conf\"" | \ jq ".nodes[0].Authentication.configPath = \"/home/rtl/.lnd/${netprefix}lnd.conf\"" |
jq ".nodes[0].Authentication.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" | \ jq ".nodes[0].Authentication.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" |
jq ".nodes[0].Authentication.boltzMacaroonPath = \"/home/rtl/.boltz-lnd/macaroons/\"" | \ jq ".nodes[0].Authentication.boltzMacaroonPath = \"/home/rtl/.boltz-lnd/macaroons/\"" |
jq ".nodes[0].Settings.userPersona = \"OPERATOR\"" | \ jq ".nodes[0].Settings.userPersona = \"OPERATOR\"" |
jq ".nodes[0].Settings.lnServerUrl = \"https://127.0.0.1:${portprefix}8080\"" | \ jq ".nodes[0].Settings.lnServerUrl = \"https://127.0.0.1:${portprefix}8080\"" |
jq ".nodes[0].Settings.channelBackupPath = \"/mnt/hdd/app-data/rtl/${systemdService}-SCB-backup-$hostname\"" | \ jq ".nodes[0].Settings.channelBackupPath = \"/mnt/hdd/app-data/rtl/${systemdService}-SCB-backup-$hostname\"" |
jq ".nodes[0].Settings.swapServerUrl = \"https://127.0.0.1:${SWAPSERVERPORT}\"" > /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp jq ".nodes[0].Settings.swapServerUrl = \"https://127.0.0.1:${SWAPSERVERPORT}\"" >/mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp
mv /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json mv /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json
fi fi
@ -476,20 +475,20 @@ if [ "$1" = "prestart" ]; then
# https://github.com/Ride-The-Lightning/RTL/blob/master/docs/C-Lightning-setup.md # https://github.com/Ride-The-Lightning/RTL/blob/master/docs/C-Lightning-setup.md
if [ "${LNTYPE}" == "cl" ]; then if [ "${LNTYPE}" == "cl" ]; then
echo "# CL Config" echo "# CL Config"
cat /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json | \ cat /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json |
jq ".port = \"${RTLHTTP}\"" | \ jq ".port = \"${RTLHTTP}\"" |
jq ".multiPass = \"${RPCPASSWORD}\"" | \ jq ".multiPass = \"${RPCPASSWORD}\"" |
jq ".multiPassHashed = \"\"" | \ jq ".multiPassHashed = \"\"" |
jq ".nodes[0].lnNode = \"${hostname}\"" | \ jq ".nodes[0].lnNode = \"${hostname}\"" |
jq ".nodes[0].lnImplementation = \"CLT\"" | \ jq ".nodes[0].lnImplementation = \"CLT\"" |
jq ".nodes[0].Authentication.macaroonPath = \"/home/bitcoin/c-lightning-REST/${CLNETWORK}/certs\"" | \ jq ".nodes[0].Authentication.macaroonPath = \"/home/bitcoin/c-lightning-REST/${CLNETWORK}/certs\"" |
jq ".nodes[0].Authentication.configPath = \"${CLCONF}\"" | \ jq ".nodes[0].Authentication.configPath = \"${CLCONF}\"" |
jq ".nodes[0].Authentication.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" | \ jq ".nodes[0].Authentication.swapMacaroonPath = \"/home/rtl/.loop/${CHAIN}/\"" |
jq ".nodes[0].Authentication.boltzMacaroonPath = \"/home/rtl/.boltz-lnd/macaroons/\"" | \ jq ".nodes[0].Authentication.boltzMacaroonPath = \"/home/rtl/.boltz-lnd/macaroons/\"" |
jq ".nodes[0].Settings.userPersona = \"OPERATOR\"" | \ jq ".nodes[0].Settings.userPersona = \"OPERATOR\"" |
jq ".nodes[0].Settings.lnServerUrl = \"https://127.0.0.1:${portprefix}6100\"" | \ jq ".nodes[0].Settings.lnServerUrl = \"https://127.0.0.1:${portprefix}6100\"" |
jq ".nodes[0].Settings.channelBackupPath = \"/mnt/hdd/app-data/rtl/${systemdService}-SCB-backup-$hostname\"" | \ jq ".nodes[0].Settings.channelBackupPath = \"/mnt/hdd/app-data/rtl/${systemdService}-SCB-backup-$hostname\"" |
jq ".nodes[0].Settings.swapServerUrl = \"https://127.0.0.1:${SWAPSERVERPORT}\"" > /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp jq ".nodes[0].Settings.swapServerUrl = \"https://127.0.0.1:${SWAPSERVERPORT}\"" >/mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp
mv /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json mv /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json.tmp /mnt/hdd/app-data/rtl/${systemdService}/RTL-Config.json
fi fi
@ -546,9 +545,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
fi fi
# only if 'purge' is an additional parameter (other instances/services might need this) # only if 'purge' is an additional parameter (other instances/services might need this)
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ]; then
home/admin/config.scripts/bonus.rtl.sh uninstall home/admin/config.scripts/bonus.rtl.sh uninstall
if [ $LNTYPE = cl ];then if [ $LNTYPE = cl ]; then
/home/admin/config.scripts/cl.rest.sh off ${CHAIN} /home/admin/config.scripts/cl.rest.sh off ${CHAIN}
fi fi
echo "# Delete all configs" echo "# Delete all configs"
@ -557,14 +556,13 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# close ports on firewall # close ports on firewall
sudo ufw deny "${RTLHTTP}" sudo ufw deny "${RTLHTTP}"
sudo ufw deny $((RTLHTTP+1)) sudo ufw deny $((RTLHTTP + 1))
# needed for API/WebUI as signal that install ran thru # needed for API/WebUI as signal that install ran thru
echo "result='OK'" echo "result='OK'"
exit 0 exit 0
fi fi
if [ "$1" = "update" ]; then if [ "$1" = "update" ]; then
echo "# UPDATING RTL" echo "# UPDATING RTL"
cd /home/rtl/RTL || exit 1 cd /home/rtl/RTL || exit 1
@ -616,7 +614,10 @@ if [ "$1" = "update" ]; then
echo "# OK - RTL install looks good" echo "# OK - RTL install looks good"
echo echo
fi fi
currentRTLcommit=$(cd /home/rtl/RTL; git describe --tags) currentRTLcommit=$(
cd /home/rtl/RTL
git describe --tags
)
echo "# Updated RTL to $currentRTLcommit" echo "# Updated RTL to $currentRTLcommit"
else else
echo "# Unknown option: $updateOption" echo "# Unknown option: $updateOption"

View file

@ -33,9 +33,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
cd /home/bitcoin || exit 1 cd /home/bitcoin || exit 1
# dependency # poetry
sudo -u bitcoin curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py\ sudo pip3 install --upgrade pip
| sudo -u bitcoin python - sudo pip3 install poetry
# download source code # download source code
sudo -u bitcoin git clone https://github.com/prusnak/suez.git sudo -u bitcoin git clone https://github.com/prusnak/suez.git
@ -43,7 +43,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u bitcoin git reset --hard $SUEZVERSION sudo -u bitcoin git reset --hard $SUEZVERSION
sudo -u bitcoin /home/admin/config.scripts/blitz.git-verify.sh \ sudo -u bitcoin /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
sudo -u bitcoin /home/bitcoin/.local/bin/poetry install sudo -u bitcoin poetry install
# setting value in raspi blitz config # setting value in raspi blitz config
/home/admin/config.scripts/blitz.conf.sh set suez "on" /home/admin/config.scripts/blitz.conf.sh set suez "on"
@ -74,8 +74,8 @@ if [ "$1" = "update" ]; then
echo "# UPDATE SUEZ" echo "# UPDATE SUEZ"
cd /home/bitcoin || exit 1 cd /home/bitcoin || exit 1
# dependency # dependency
sudo -u bitcoin curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py\ sudo pip3 install --upgrade pip
| sudo -u bitcoin python - sudo pip3 install poetry
# download source code # download source code
if [ -d suez ]; then if [ -d suez ]; then
sudo -u bitcoin git clone https://github.com/prusnak/suez.git sudo -u bitcoin git clone https://github.com/prusnak/suez.git
@ -84,7 +84,7 @@ if [ "$1" = "update" ]; then
sudo -u bitcoin git pull sudo -u bitcoin git pull
sudo -u bitcoin /home/admin/config.scripts/blitz.git-verify.sh \ sudo -u bitcoin /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
sudo -u bitcoin /home/bitcoin/.local/bin/poetry install sudo -u bitcoin poetry install
echo "# Updated to the latest in https://github.com/prusnak/suez/commits/master" echo "# Updated to the latest in https://github.com/prusnak/suez/commits/master"
exit 0 exit 0
fi fi

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
function help(){ function help() {
echo echo
echo "Install the backup plugin for Core Lightning" echo "Install the backup plugin for Core Lightning"
echo "Replicates the lightningd.sqlite3 database on the SDcard" echo "Replicates the lightningd.sqlite3 database on the SDcard"
@ -16,11 +16,10 @@ function help(){
} }
# https://github.com/lightningd/plugins/commits/master/backup # https://github.com/lightningd/plugins/commits/master/backup
# use the version beore the migration to poetry pinnedVersion="30003279e35e5931fc85d7e6211ea4de6f9554d7"
pinnedVersion="4d3560b129b12cba0381fff0b1e30ac32ef84106"
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
help help
fi fi
@ -38,16 +37,23 @@ function install() {
sudo -u bitcoin git pull sudo -u bitcoin git pull
sudo -u bitcoin git reset --hard ${pinnedVersion} || exit 1 sudo -u bitcoin git reset --hard ${pinnedVersion} || exit 1
if [ $($lightningcli_alias plugin list 2>/dev/null | grep -c "${plugin}") -eq 0 ];then if [ $($lightningcli_alias plugin list 2>/dev/null | grep -c "/${plugin}") -eq 0 ]; then
echo "# Checking dependencies" echo "# Checking dependencies"
sudo -u bitcoin pip install --user -r ${plugindir}/${plugin}/requirements.txt 1>/dev/null # upgrade pip
if [ $(echo $PATH | grep -c "/home/bitcoin/.local/bin") -eq 0 ];then sudo pip3 install --upgrade pip
export PATH=$PATH:/home/bitcoin/.local/bin
echo "PATH=\$PATH:/home/bitcoin/.local/bin" | sudo tee -a /etc/profile # pip dependencies
fi sudo -u bitcoin pip3 install pyln-client tqdm
# poetry
sudo pip3 install poetry || exit 1
cd ${plugindir}/backup/ || exit 1
sudo -u bitcoin poetry install
sudo chmod +x ${plugindir}/${plugin}/${plugin}.py sudo chmod +x ${plugindir}/${plugin}/${plugin}.py
# symlink to the default plugin dir # symlink to the default plugin dir
if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/backup.py ];then if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/backup.py ]; then
sudo ln -s ${plugindir}/backup/backup.py \ sudo ln -s ${plugindir}/backup/backup.py \
/home/bitcoin/${netprefix}cl-plugins-enabled/ /home/bitcoin/${netprefix}cl-plugins-enabled/
fi fi
@ -56,7 +62,7 @@ function install() {
fi fi
} }
if [ "$1" = on ];then if [ "$1" = on ]; then
install install
@ -64,7 +70,7 @@ if [ "$1" = on ];then
sudo systemctl stop ${netprefix}lightningd sudo systemctl stop ${netprefix}lightningd
# don't overwrite old backup # don't overwrite old backup
if [ -f /home/bitcoin/${netprefix}lightningd.sqlite3.backup ];then if [ -f /home/bitcoin/${netprefix}lightningd.sqlite3.backup ]; then
echo "# Backup the existing old backup on the SDcard" echo "# Backup the existing old backup on the SDcard"
now=$(date +"%Y_%m_%d_%H%M%S") now=$(date +"%Y_%m_%d_%H%M%S")
sudo mv /home/bitcoin/${netprefix}lightningd.sqlite3.backup \ sudo mv /home/bitcoin/${netprefix}lightningd.sqlite3.backup \
@ -72,19 +78,22 @@ if [ "$1" = on ];then
fi fi
# always re-init plugin # always re-init plugin
if sudo ls /home/bitcoin/.lightning/${CLNETWORK}/backup.lock; then if sudo ls /home/bitcoin/.lightning/${CLNETWORK}/backup.lock 2>/dev/null; then
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/backup.lock sudo rm /home/bitcoin/.lightning/${CLNETWORK}/backup.lock
fi fi
# https://github.com/lightningd/plugins/tree/master/backup#setup # https://github.com/lightningd/plugins/tree/master/backup#setup
echo "# Initialize the backup plugin" echo "# Initialize the backup plugin"
sudo -u bitcoin ${plugindir}/backup/backup-cli init\ cd ${plugindir}/backup/ || exit 1
--lightning-dir /home/bitcoin/.lightning/${CLNETWORK} \ sudo -u bitcoin poetry run ./backup-cli init --lightning-dir /home/bitcoin/.lightning/${CLNETWORK} \
file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup
if [ $(crontab -u admin -l | grep -c "backup-compact $CHAIN") -eq 0 ]; then if [ $(crontab -u admin -l | grep -c "backup-compact $CHAIN") -eq 0 ]; then
echo "Add weekly backup-compact as a cronjob" echo "Add weekly backup-compact as a cronjob"
cronjob="@weekly /home/admin/config.scripts/cl-plugin.backup.sh backup-compact $CHAIN" cronjob="@weekly /home/admin/config.scripts/cl-plugin.backup.sh backup-compact $CHAIN"
(crontab -u admin -l; echo "$cronjob" ) | crontab -u admin - (
crontab -u admin -l
echo "$cronjob"
) | crontab -u admin -
fi fi
echo "# The crontab for admin now is:" echo "# The crontab for admin now is:"
crontab -u admin -l crontab -u admin -l
@ -96,8 +105,9 @@ if [ "$1" = on ];then
echo "# Started the ${netprefix}lightningd.service" echo "# Started the ${netprefix}lightningd.service"
fi fi
elif
elif [ "$1" = off ]; then [ "$1" = off ]
then
echo "# Removing the backup plugin" echo "# Removing the backup plugin"
sudo rm -f /home/bitcoin/${netprefix}cl-plugins-enabled/backup.py sudo rm -f /home/bitcoin/${netprefix}cl-plugins-enabled/backup.py
echo "# Backup the existing old backup on the SDcard" echo "# Backup the existing old backup on the SDcard"
@ -107,8 +117,9 @@ elif [ "$1" = off ]; then
echo "# Removing the backup.lock file" echo "# Removing the backup.lock file"
sudo rm -f /home/bitcoin/.lightning/${CLNETWORK}/backup.lock sudo rm -f /home/bitcoin/.lightning/${CLNETWORK}/backup.lock
elif
elif [ "$1" = restore ];then [ "$1" = restore ]
then
install install
@ -118,21 +129,22 @@ elif [ "$1" = restore ];then
sudo systemctl stop ${netprefix}lightningd sudo systemctl stop ${netprefix}lightningd
# https://github.com/lightningd/plugins/tree/master/backup#restoring-a-backup # https://github.com/lightningd/plugins/tree/master/backup#restoring-a-backup
# ./backup-cli restore file:///mnt/external/location ~/.lightning/bitcoin/lightningd.sqlite3 # poetry run ./backup-cli restore file:///mnt/external/location ~/.lightning/bitcoin/lightningd.sqlite3
# make sure to not overwrite old database # make sure to not overwrite old database
if sudo ls /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3;then if sudo ls /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3; then
now=$(date +"%Y_%m_%d_%H%M%S") now=$(date +"%Y_%m_%d_%H%M%S")
echo "# Backup the existing old database on the disk" echo "# Backup the existing old database on the disk"
sudo cp /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3 \ sudo cp /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3 \
/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3.backup.${now} || exit 1 /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3.backup.${now} || exit 1
if [ "$(echo "$@" | grep -c "force")" -gt 0 ];then if [ "$(echo "$@" | grep -c "force")" -gt 0 ]; then
sudo rm /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3 sudo rm /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3
fi fi
fi fi
# restore # restore
sudo -u bitcoin ${plugindir}/backup/backup-cli restore \ cd ${plugindir}/backup/ || exit 1
sudo -u bitcoin poetry run ./backup-cli restore \
file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup \ file:///home/bitcoin/${netprefix}lightningd.sqlite3.backup \
/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3 /home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3
@ -143,8 +155,9 @@ elif [ "$1" = restore ];then
fi fi
fi fi
elif
elif [ "$1" = backup-compact ];then [ "$1" = backup-compact ]
then
# https://github.com/lightningd/plugins/tree/master/backup#performing-backup-compaction # https://github.com/lightningd/plugins/tree/master/backup#performing-backup-compaction
dbPath="/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3" dbPath="/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3"
backupPath="/home/bitcoin/${netprefix}lightningd.sqlite3.backup" backupPath="/home/bitcoin/${netprefix}lightningd.sqlite3.backup"
@ -154,7 +167,7 @@ elif [ "$1" = backup-compact ];then
echo "$dbSize MB $dbPath" echo "$dbSize MB $dbPath"
backupSize=$(sudo du -m "${backupPath}" | awk '{print $1}') backupSize=$(sudo du -m "${backupPath}" | awk '{print $1}')
echo "$backupSize MB $backupPath" echo "$backupSize MB $backupPath"
if [ "$backupSize" -gt $((dbSize+200)) ] ; then if [ "$backupSize" -gt $((dbSize + 200)) ]; then
echo "# The backup is 200MB+ larger than the db, running '${netprefix}lightning-cli backup-compact' ..." echo "# The backup is 200MB+ larger than the db, running '${netprefix}lightning-cli backup-compact' ..."
$lightningcli_alias backup-compact $lightningcli_alias backup-compact
else else

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo echo
echo "Install the cln-grpc plugin for CLN" echo "Install the cln-grpc plugin for CLN"
echo "Usage:" echo "Usage:"
@ -31,10 +31,12 @@ function buildGRPCplugin() {
echo "# - Build the cln-grpc plugin" echo "# - Build the cln-grpc plugin"
if [ ! -f /home/bitcoin/cl-plugins-available/cln-grpc ]; then if [ ! -f /home/bitcoin/cl-plugins-available/cln-grpc ]; then
# check if the source code is present # check if the source code is present
if [ ! -d /home/bitcoin/lightning/plugins/grpc-plugin ];then if [ ! -d /home/bitcoin/lightning/plugins/grpc-plugin ]; then
echo "# - install Core Lightning ..." echo "# - install Core Lightning ..."
/home/admin/config.scripts/cl.install.sh install || exit 1 /home/admin/config.scripts/cl.install.sh install || exit 1
fi fi
echo "# install dependencies"
sudo apt-get install protobuf-compiler -y
echo "# rust for cln-grpc, includes rustfmt" echo "# rust for cln-grpc, includes rustfmt"
sudo -u bitcoin curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo -u bitcoin sh -s -- -y sudo -u bitcoin curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo -u bitcoin sh -s -- -y
cd /home/bitcoin/lightning/plugins/grpc-plugin || exit 1 cd /home/bitcoin/lightning/plugins/grpc-plugin || exit 1
@ -61,7 +63,7 @@ function switchOn() {
# symlink to plugin directory # symlink to plugin directory
echo "# symlink cln-grpc to /home/bitcoin/${netprefix}cl-plugins-enabled/" echo "# symlink cln-grpc to /home/bitcoin/${netprefix}cl-plugins-enabled/"
# delete old symlink # delete old symlink
sudo rm /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc sudo rm -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc
sudo ln -s /home/bitcoin/cl-plugins-available/cln-grpc /home/bitcoin/${netprefix}cl-plugins-enabled/ sudo ln -s /home/bitcoin/cl-plugins-available/cln-grpc /home/bitcoin/${netprefix}cl-plugins-enabled/
# blitz.conf.sh set [key] [value] [?conffile] <noquotes> # blitz.conf.sh set [key] [value] [?conffile] <noquotes>
@ -102,7 +104,7 @@ elif [ "$1" = on ]; then
elif [ "$1" = off ]; then elif [ "$1" = off ]; then
sed -i "/^grpc-port/d" "${CLCONF}" sed -i "/^grpc-port/d" "${CLCONF}"
sudo rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc sudo rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ]; then
sudo rm -rf /home/bitcoin/cl-plugins-available/cln-grpc sudo rm -rf /home/bitcoin/cl-plugins-available/cln-grpc
fi fi
/home/admin/config.scripts/blitz.conf.sh set "${netprefix}clnGRPCport" "off" /home/admin/config.scripts/blitz.conf.sh set "${netprefix}clnGRPCport" "off"
@ -113,7 +115,7 @@ elif [ "$1" = off ]; then
exit 0 exit 0
elif [ "$1" = update ]; then elif [ "$1" = update ]; then
if [ "$(echo "$@" | grep -c source)" -gt 0 ];then if [ "$(echo "$@" | grep -c source)" -gt 0 ]; then
cd /home/bitcoin/lightning/ || exit 1 cd /home/bitcoin/lightning/ || exit 1
sudo -u bitcoin git pull sudo -u bitcoin git pull
fi fi

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo echo
echo "Install and show the output of the chosen plugin for Core Lightning" echo "Install and show the output of the chosen plugin for Core Lightning"
echo "Usage:" echo "Usage:"
@ -16,7 +16,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
exit 1 exit 1
fi fi
if [ "$1" = "on" ];then if [ "$1" = "on" ]; then
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $3) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $3)
@ -29,8 +29,8 @@ if [ "$1" = "on" ];then
fi fi
# enable # enable
if [ "$(echo "$@" | grep -c "persist")" -gt 0 ];then if [ "$(echo "$@" | grep -c "persist")" -gt 0 ]; then
if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/${plugin}.py ];then if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/${plugin}.py ]; then
echo "# Symlink to /home/bitcoin/${netprefix}cl-plugins-enabled" echo "# Symlink to /home/bitcoin/${netprefix}cl-plugins-enabled"
sudo ln -s /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py \ sudo ln -s /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py \
/home/bitcoin/${netprefix}cl-plugins-enabled /home/bitcoin/${netprefix}cl-plugins-enabled
@ -43,7 +43,7 @@ if [ "$1" = "on" ];then
fi fi
else else
if [ $($lightningcli_alias | grep -c "${plugin}") -eq 0 ];then if [ $($lightningcli_alias | grep -c "/${plugin}") -eq 0 ]; then
echo "# Just start the ${plugin} plugin" echo "# Just start the ${plugin} plugin"
sudo -u bitcoin pip install -r /home/bitcoin/cl-plugins-available/plugins/${plugin}/requirements.txt sudo -u bitcoin pip install -r /home/bitcoin/cl-plugins-available/plugins/${plugin}/requirements.txt
$lightningcli_alias plugin start /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py $lightningcli_alias plugin start /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py
@ -64,7 +64,7 @@ if [ "$1" = "on" ];then
$lightningcli_alias ${plugin} $lightningcli_alias ${plugin}
echo echo
if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ];then if [ "$(echo "$@" | grep -c "runonce")" -gt 0 ]; then
$lightningcli_alias plugin stop /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py $lightningcli_alias plugin stop /home/bitcoin/cl-plugins-available/plugins/${plugin}/${plugin}.py
fi fi

View file

@ -2,19 +2,23 @@
# https://lightning.readthedocs.io/ # https://lightning.readthedocs.io/
# https://github.com/ElementsProject/lightning/releases # https://github.com/ElementsProject/lightning/releases
CLVERSION=v22.11.1 CLVERSION=v23.02
# install the latest master by using the last commit id # install the latest master by using the last commit id
# https://github.com/ElementsProject/lightning/commit/master # https://github.com/ElementsProject/lightning/commit/master
# CLVERSION="063366ed7e3b7cc12a8d1681acc2b639cf07fa23" # CLVERSION="063366ed7e3b7cc12a8d1681acc2b639cf07fa23"
PGPsigner="endothermicdev"
PGPpubkeyLink="https://github.com/${PGPsigner}.gpg"
PGPpubkeyFingerprint="8F55EE750D950E3E"
# https://github.com/ElementsProject/lightning/tree/master/contrib/keys # https://github.com/ElementsProject/lightning/tree/master/contrib/keys
PGPsigner="cdecker" # rustyrussel D9200E6CD1ADB8F1 # cdecker A26D6D9FE088ED58 # niftynei BFF0F67810C1EED1 # PGPsigner="cdecker" # rustyrussel D9200E6CD1ADB8F1 # cdecker A26D6D9FE088ED58 # niftynei BFF0F67810C1EED1
PGPpubkeyLink="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/${PGPsigner}.txt" # PGPpubkeyLink="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/${PGPsigner}.txt"
PGPpubkeyFingerprint="A26D6D9FE088ED58" # PGPpubkeyFingerprint="A26D6D9FE088ED58"
# help # help
if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo echo
echo "Core Lightning install script" echo "Core Lightning install script"
echo "The default version is: ${CLVERSION}" echo "The default version is: ${CLVERSION}"
@ -30,8 +34,7 @@ if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then
exit 1 exit 1
fi fi
function installDependencies() function installDependencies() {
{
echo "- installDependencies()" echo "- installDependencies()"
# from https://lightning.readthedocs.io/INSTALL.html#to-build-on-ubuntu # from https://lightning.readthedocs.io/INSTALL.html#to-build-on-ubuntu
sudo apt-get install -y \ sudo apt-get install -y \
@ -44,16 +47,15 @@ function installDependencies()
sudo pip3 install --upgrade pip sudo pip3 install --upgrade pip
sudo -u bitcoin pip install mako sudo -u bitcoin pip install mako
# poetry # poetry
sudo -u bitcoin pip3 install --user poetry sudo pip3 install poetry
if ! grep -Eq '^PATH="$HOME/.local/bin:$PATH"' /mnt/hdd/raspiblitz.conf; then if ! grep -Eq '^PATH="$HOME/.local/bin:$PATH"' /home/bitcoin/.profile; then
echo 'PATH="$HOME/.local/bin:$PATH"' | sudo tee -a /home/bitcoin/.profile echo 'PATH="$HOME/.local/bin:$PATH"' | sudo tee -a /home/bitcoin/.profile
fi fi
export PATH="home/bitcoin/.local/bin:$PATH" export PATH="home/bitcoin/.local/bin:$PATH"
sudo -u bitcoin /home/bitcoin/.local/bin/poetry install sudo -u bitcoin poetry install
} }
function buildAndInstallCLbinaries() function buildAndInstallCLbinaries() {
{
echo "- Configuring EXPERIMENTAL_FEATURES enabled" echo "- Configuring EXPERIMENTAL_FEATURES enabled"
echo echo
sudo -u bitcoin ./configure --enable-experimental-features sudo -u bitcoin ./configure --enable-experimental-features
@ -74,7 +76,7 @@ echo "# Running: 'cl.install.sh $*'"
if [ "$1" = "update" ] && [ $# -gt 1 ]; then if [ "$1" = "update" ] && [ $# -gt 1 ]; then
CLVERSION=$2 CLVERSION=$2
if curl --output /dev/null --silent --head --fail \ if curl --output /dev/null --silent --head --fail \
https://github.com/ElementsProject/lightning/releases/tag/${CLVERSION};then https://github.com/ElementsProject/lightning/releases/tag/${CLVERSION}; then
echo "# OK version exists at https://github.com/ElementsProject/lightning/releases/tag/${CLVERSION}" echo "# OK version exists at https://github.com/ElementsProject/lightning/releases/tag/${CLVERSION}"
else else
echo "# ${CLVERSION} does not exist" echo "# ${CLVERSION} does not exist"
@ -94,7 +96,7 @@ if [ "$1" = "testPR" ]; then
echo "# Using the PR:" echo "# Using the PR:"
echo "# https://github.com/ElementsProject/lightning/pull/${PRnumber}" echo "# https://github.com/ElementsProject/lightning/pull/${PRnumber}"
if curl --output /dev/null --silent --head --fail \ if curl --output /dev/null --silent --head --fail \
https://github.com/ElementsProject/lightning/pull/${PRnumber};then https://github.com/ElementsProject/lightning/pull/${PRnumber}; then
echo "# OK the PR exists at https://github.com/ElementsProject/lightning/pull/${PRnumber}" echo "# OK the PR exists at https://github.com/ElementsProject/lightning/pull/${PRnumber}"
echo "# Press ENTER to proceed to install Core Lightning with the PR ${PRnumber} or CTRL+C to abort." echo "# Press ENTER to proceed to install Core Lightning with the PR ${PRnumber} or CTRL+C to abort."
read key read key
@ -119,65 +121,6 @@ if [ "$1" = "install" ]; then
exit 1 exit 1
fi fi
## Download and verify zip
# # prepare download dir
# sudo rm -rf /home/bitcoin/download
# sudo -u bitcoin mkdir -p /home/bitcoin/download
# cd /home/bitcoin/download || exit 1
#
# sudo -u bitcoin wget -O "pgp_keys.asc" ${PGPpubkeyLink}
# sudo -u bitcoin gpg --import --import-options show-only ./pgp_keys.asc
# fingerprint=$(gpg "pgp_keys.asc" 2>/dev/null | grep "${PGPpubkeyFingerprint}" -c)
# if [ ${fingerprint} -lt 1 ]; then
# echo
# echo "# WARNING --> the PGP fingerprint is not as expected for ${PGPsigner}"
# echo "Should contain PGP: ${PGPpubkeyFingerprint}"
# echo "PRESS ENTER to TAKE THE RISK if you think all is OK"
# read key
# fi
# sudo -u bitcoin gpg --import ./pgp_keys.asc
#
# sudo -u bitcoin wget https://github.com/ElementsProject/lightning/releases/download/${CLVERSION}/SHA256SUMS
# sudo -u bitcoin wget https://github.com/ElementsProject/lightning/releases/download/${CLVERSION}/SHA256SUMS.asc
#
# verifyResult=$(LANG=en_US.utf8; sudo -u bitcoin gpg --verify SHA256SUMS.asc 2>&1)
#
# goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
# echo "goodSignature(${goodSignature})"
# correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${PGPpubkeyFingerprint}" -c)
# echo "correctKey(${correctKey})"
# if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
# echo
# echo "# DOWNLOAD FAILED --> PGP verification not OK / signature(${goodSignature}) verify(${correctKey})"
# exit 1
# else
# echo
# echo "****************************************************************"
# echo "OK --> the PGP signature of the Core Lightning SHA256SUMS is correct"
# echo "****************************************************************"
# echo
# fi
#
# sudo -u bitcoin wget https://github.com/ElementsProject/lightning/releases/download/${CLVERSION}/clightning-${CLVERSION}.zip
#
# hashCheckResult=$(sha256sum -c SHA256SUMS 2>&1)
# goodHash=$(echo ${hashCheckResult} | grep 'OK' -c)
# echo "goodHash(${goodHash})"
# if [ ${goodHash} -lt 1 ]; then
# echo
# echo "# BUILD FAILED --> Hash check not OK"
# exit 1
# else
# echo
# echo "********************************************************************"
# echo "OK --> the hash of the downloaded Core Lightning source code is correct"
# echo "********************************************************************"
# echo
# fi
#
# sudo -u bitcoin unzip clightning-${CLVERSION}.zip
# cd clightning-${CLVERSION} || exit 1
# download and verify the source from github # download and verify the source from github
cd /home/bitcoin || exit 1 cd /home/bitcoin || exit 1
echo echo
@ -220,7 +163,7 @@ source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
TORGROUP="debian-tor" TORGROUP="debian-tor"
if [ "$1" = update ]||[ "$1" = testPR ];then if [ "$1" = update ] || [ "$1" = testPR ]; then
source <(/home/admin/config.scripts/network.aliases.sh getvars cl mainnet) source <(/home/admin/config.scripts/network.aliases.sh getvars cl mainnet)
else else
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
@ -228,7 +171,7 @@ fi
echo "# Using the settings for: ${network} ${CHAIN}" echo "# Using the settings for: ${network} ${CHAIN}"
if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then if [ "$1" = on ] || [ "$1" = update ] || [ "$1" = testPR ]; then
if [ "${CHAIN}" == "testnet" ] && [ "${testnet}" != "on" ]; then if [ "${CHAIN}" == "testnet" ] && [ "${testnet}" != "on" ]; then
echo "# before activating testnet on cl, first activate testnet on bitcoind" echo "# before activating testnet on cl, first activate testnet on bitcoind"
@ -242,14 +185,14 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then
exit 1 exit 1
fi fi
if [ "$1" = "update" ]||[ "$1" = "testPR" ];then if [ "$1" = "update" ] || [ "$1" = "testPR" ]; then
echo "# apt update" echo "# apt update"
echo echo
sudo apt-get update sudo apt-get update
cd /home/bitcoin || exit 1 cd /home/bitcoin || exit 1
if [ "$1" = "update" ]||[ "$1" = "testPR" ];then if [ "$1" = "update" ] || [ "$1" = "testPR" ]; then
echo echo
echo "# Deleting the old source code" echo "# Deleting the old source code"
sudo rm -rf lightning sudo rm -rf lightning
@ -262,7 +205,7 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then
echo echo
if [ "$1" = "update" ]; then if [ "$1" = "update" ]; then
if [ $# -gt 1 ];then if [ $# -gt 1 ]; then
CLVERSION=$2 CLVERSION=$2
echo "# Installing the version ${CLVERSION}" echo "# Installing the version ${CLVERSION}"
sudo -u bitcoin git reset --hard ${CLVERSION} sudo -u bitcoin git reset --hard ${CLVERSION}
@ -284,8 +227,10 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then
installDependencies installDependencies
currentCLversion=$(cd /home/bitcoin/lightning 2>/dev/null; \ currentCLversion=$(
git describe --tags 2>/dev/null) cd /home/bitcoin/lightning 2>/dev/null
git describe --tags 2>/dev/null
)
echo "# Building from source Core Lightning $currentCLversion" echo "# Building from source Core Lightning $currentCLversion"
buildAndInstallCLbinaries buildAndInstallCLbinaries
@ -296,7 +241,7 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then
########## ##########
# make sure binary is installed (will skip if already done) # make sure binary is installed (will skip if already done)
/home/admin/config.scripts/cl.install.sh install /home/admin/config.scripts/cl.install.sh install || exit 1
echo "# Make sure bitcoin is in the ${TORGROUP} group" echo "# Make sure bitcoin is in the ${TORGROUP} group"
sudo usermod -a -G ${TORGROUP} bitcoin sudo usermod -a -G ${TORGROUP} bitcoin
@ -313,11 +258,11 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then
sudo mkdir -p /mnt/hdd/app-data/.lightning sudo mkdir -p /mnt/hdd/app-data/.lightning
sudo ln -s /mnt/hdd/app-data/.lightning /home/bitcoin/ sudo ln -s /mnt/hdd/app-data/.lightning /home/bitcoin/
if [ ${CLNETWORK} != "bitcoin" ] && [ ! -d /home/bitcoin/.lightning/${CLNETWORK} ] ;then if [ ${CLNETWORK} != "bitcoin" ] && [ ! -d /home/bitcoin/.lightning/${CLNETWORK} ]; then
sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK} sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK}
fi fi
if ! sudo ls ${CLCONF};then if ! sudo ls ${CLCONF}; then
echo "# Create ${CLCONF}" echo "# Create ${CLCONF}"
echo "# lightningd configuration for ${network} ${CHAIN} echo "# lightningd configuration for ${network} ${CHAIN}
@ -364,7 +309,9 @@ always-use-proxy=true
############# #############
echo echo
echo "# Set logrotate for ${netprefix}lightningd" echo "# Set logrotate for ${netprefix}lightningd"
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/cl.log_old; then
sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK}/cl.log_old sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK}/cl.log_old
fi
echo "\ echo "\
/home/bitcoin/.lightning/${CLNETWORK}/cl.log /home/bitcoin/.lightning/${CLNETWORK}/cl.log
{ {
@ -376,10 +323,6 @@ always-use-proxy=true
notifempty notifempty
nocompress nocompress
sharedscripts sharedscripts
# We don't need to kill as we use copytruncate
#postrotate
# kill -HUP \`cat /run/lightningd/lightningd.pid\'
#endscript
su bitcoin bitcoin su bitcoin bitcoin
}" | sudo tee /etc/logrotate.d/${netprefix}lightningd }" | sudo tee /etc/logrotate.d/${netprefix}lightningd
# debug: # debug:
@ -396,8 +339,7 @@ alias ${netprefix}cl=\"sudo -u bitcoin /usr/local/bin/lightning-cli\
--conf=${CLCONF}\" --conf=${CLCONF}\"
alias ${netprefix}cllog=\"sudo\ alias ${netprefix}cllog=\"sudo\
tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log\" tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log\"
alias ${netprefix}clconf=\"sudo\ alias ${netprefix}clconf=\"sudo nano ${CLCONF}\"
nano ${CLCONF}\"
" | sudo tee -a /home/admin/_aliases " | sudo tee -a /home/admin/_aliases
sudo chown admin:admin /home/admin/_aliases sudo chown admin:admin /home/admin/_aliases
fi fi
@ -418,16 +360,16 @@ alias ${netprefix}clconf=\"sudo\
# setting values in the raspiblitz.conf # setting values in the raspiblitz.conf
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}cl on /home/admin/config.scripts/blitz.conf.sh set ${netprefix}cl on
# blitz.conf.sh needs sudo access - cannot be run in cl.check.sh # blitz.conf.sh needs sudo access - cannot be run in cl.check.sh
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]; then
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}sparko "off" /home/admin/config.scripts/blitz.conf.sh set ${netprefix}sparko "off"
fi fi
if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ];then if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]; then
/home/admin/config.scripts/blitz.conf.sh set clHTTPplugin "off" /home/admin/config.scripts/blitz.conf.sh set clHTTPplugin "off"
fi fi
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]; then if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]; then
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}feeadjuster "off" /home/admin/config.scripts/blitz.conf.sh set ${netprefix}feeadjuster "off"
fi fi
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ];then if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]; then
/home/admin/config.scripts/blitz.conf.sh set "${netprefix}clnGRPCport" "off" /home/admin/config.scripts/blitz.conf.sh set "${netprefix}clnGRPCport" "off"
fi fi
@ -464,10 +406,9 @@ if [ "$1" = "display-seed" ]; then
source ${seedwordFile} source ${seedwordFile}
#echo "# seedwords(${seedwords})" #echo "# seedwords(${seedwords})"
#echo "# seedwords6x4(${seedwords6x4})" #echo "# seedwords6x4(${seedwords6x4})"
if [ ${#seedwords6x4} -gt 0 ];then if [ ${#seedwords6x4} -gt 0 ]; then
ack=0 ack=0
while [ ${ack} -eq 0 ] while [ ${ack} -eq 0 ]; do
do
whiptail --title "Core Lightning ${displayNetwork} Wallet" \ whiptail --title "Core Lightning ${displayNetwork} Wallet" \
--msgbox "This is your Core Lightning ${displayNetwork} wallet seed. Store these numbered words in a safe location:\n\n${seedwords6x4}" 13 76 --msgbox "This is your Core Lightning ${displayNetwork} wallet seed. Store these numbered words in a safe location:\n\n${seedwords6x4}" 13 76
whiptail --title "Please Confirm" --yes-button "Show Again" --no-button "CONTINUE" --yesno " Are you sure that you wrote down the word list?" 8 55 whiptail --title "Please Confirm" --yes-button "Show Again" --no-button "CONTINUE" --yesno " Are you sure that you wrote down the word list?" 8 55
@ -489,14 +430,14 @@ if [ "$1" = "display-seed" ]; then
exit 0 exit 0
fi fi
if [ "$1" = "off" ];then if [ "$1" = "off" ]; then
echo "# Removing the ${netprefix}lightningd.service" echo "# Removing the ${netprefix}lightningd.service"
sudo systemctl disable ${netprefix}lightningd sudo systemctl disable ${netprefix}lightningd
sudo systemctl stop ${netprefix}lightningd sudo systemctl stop ${netprefix}lightningd
echo "# Removing the aliases" echo "# Removing the aliases"
sudo sed -i "/${netprefix}lightning-cli/d" /home/admin/_aliases sudo sed -i "/${netprefix}lightning-cli/d" /home/admin/_aliases
sudo sed -i "/${netprefix}cl/d" /home/admin/_aliases sudo sed -i "/${netprefix}cl/d" /home/admin/_aliases
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then if [ "$(echo "$@" | grep -c purge)" -gt 0 ]; then
echo "# Removing the binaries" echo "# Removing the binaries"
sudo rm -f /usr/local/bin/lightningd sudo rm -f /usr/local/bin/lightningd
sudo rm -f /usr/local/bin/lightning-cli sudo rm -f /usr/local/bin/lightning-cli

View file

@ -1,18 +1,18 @@
#!/bin/bash #!/bin/bash
# https://github.com/Ride-The-Lightning/c-lightning-REST/releases/ # https://github.com/Ride-The-Lightning/c-lightning-REST/releases/
CLRESTVERSION="v0.9.0" CLRESTVERSION="v0.10.1"
# help # help
if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then
echo
echo "Core-Lightning-REST install script" echo "Core-Lightning-REST install script"
echo "The default version is: $CLRESTVERSION" echo "The default version is: $CLRESTVERSION"
echo "mainnet | testnet | signet instances can run parallel" echo "mainnet | testnet | signet instances can run parallel"
echo echo
echo "Usage:" echo "Usage:"
echo "cl.rest.sh [on|off|connect] <mainnet|testnet|signet> [?key-value]" echo "cl.rest.sh on <mainnet|testnet|signet>"
echo echo "cl.rest.sh connect <mainnet|testnet|signet> [?key-value]"
echo "cl.rest.sh off <mainnet|testnet|signet> <purge>"
exit 1 exit 1
fi fi