Fatpack: LCD on & cl-plugin.cln-grpc OFF (#3817)

* make sure fatpack is LCD activated
* remove cl-plugin.cln-grpc.sh by default
* #3793 fix socket jrpc
This commit is contained in:
/rootzoll 2023-05-10 13:20:40 +02:00 committed by GitHub
parent 7335476a07
commit 019d78f398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 90 additions and 84 deletions

View File

@ -440,14 +440,8 @@ if [ "${clNode}" != "${choice}" ]; then
/home/admin/config.scripts/cl.install.sh on signet
fi
# 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 on
else
echo "# turning OFF"
/home/admin/config.scripts/cl-plugin.cln-grpc.sh off
/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

View File

@ -342,10 +342,6 @@ if [ "${lightning}" == "cl" ]; then
/home/admin/_cache.sh set message "Core Lightning Setup"
/home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile}
echo "# switch cln-grpc on" >> ${logFile}
/home/admin/config.scripts/cl-plugin.cln-grpc.sh install >> ${logFile}
/home/admin/config.scripts/cl-plugin.cln-grpc.sh on >> ${logFile}
# OLD WALLET FROM CLIGHTNING RESCUE
if [ "${clrescue}" != "" ]; then

View File

@ -315,9 +315,6 @@ if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ] || [ "${tcl}" == "on" ] ||
# if already installed by fatpack will skip
echo "Provisioning Core Lightning Binary - run config script" >> ${logFile}
/home/admin/config.scripts/cl.install.sh install >> ${logFile} 2>&1
echo "Provisioning cl-plugin.cln-grpc.sh - run config script" >> ${logFile}
/home/admin/config.scripts/cl-plugin.cln-grpc.sh install >> ${logFile}
/home/admin/config.scripts/cl-plugin.cln-grpc.sh on >> ${logFile}
else
echo "Provisioning Core Lightning Binary - not active" >> ${logFile}
fi
@ -346,6 +343,7 @@ else
echo "Provisioning CL Signet - not active" >> ${logFile}
fi
# TOR
if [ "${runBehindTor}" == "on" ]; then
echo "Provisioning TOR - run config script" >> ${logFile}

View File

@ -9,6 +9,9 @@ if [ "$EUID" -ne 0 ]
exit 1
fi
# make sure LCD is on (default for fatpack)
/home/admin/config.scripts/blitz.display.sh set-display lcd
# check if sd card needs expansion before fatpack
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
if [ "${needsExpansion}" == "1" ]; then
@ -71,8 +74,6 @@ echo "* Adding LND ..."
echo "* Adding Core Lightning ..."
/home/admin/config.scripts/cl.install.sh install || exit 1
echo "* Adding the cln-grpc plugin ..."
/home/admin/config.scripts/cl-plugin.cln-grpc.sh install || exit 1
# *** AUTO UPDATE FALLBACK NODE LIST FROM INTERNET (only in fatpack)
echo "*** FALLBACK NODE LIST ***"

View File

@ -123,17 +123,10 @@ if [ "$1" = "update-config" ]; then
# configure CL
elif [ "${lightning}" == "cl" ]; then
# make sure socket can be accessed by blitzapi
echo "# Access Rights Web API Lightning --> CL SOCKET: /mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc"
sudo chmod 770 /mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc
echo "# CONFIG Web API Lightning --> CL"
sed -i "s/^ln_node=.*/ln_node=cln_jrpc/g" ./.env
sed -i "s#^cln_jrpc_path=.*#cln_jrpc_path=\"/mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc\"#g" ./.env
# make sure cln-grpc is on
# sudo /home/admin/config.scripts/cl-plugin.cln-grpc.sh on mainnet
# get hex values of pem files
# hexClient=$(sudo xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client.pem)
# hexClientKey=$(sudo xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client-key.pem)

View File

@ -6,6 +6,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ];
echo "# script to check CL states"
echo "# cl.check.sh basic-setup"
echo "# cl.check.sh prestart [mainnet|testnet|signet]"
echo "# cl.check.sh poststart [mainnet|testnet|signet]"
echo
exit 1
fi
@ -17,71 +18,95 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
######################################################################
# PRESTART
# is executed by systemd cl services everytime before cl is started
# is executed by systemd cl services everytime BEFORE cl is started
# so it tries to make sure the config is in valid shape
######################################################################
# make sure plugins are loaded https://github.com/rootzoll/raspiblitz/issues/2953
if [ $(grep -c "^plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" < ${CLCONF}) -eq 0 ];then
echo "plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" | tee -a ${CLCONF}
fi
if [ "$1" == "prestart" ]; then
# do not announce 127.0.0.1 https://github.com/rootzoll/raspiblitz/issues/2634
if [ $(grep -c "^announce-addr=127.0.0.1" < ${CLCONF}) -gt 0 ];then
sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF}
fi
if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\
|| [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then
echo "# The Sparko plugin is not present but in config"
sed -i "/^sparko/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko
# make sure plugins are loaded https://github.com/rootzoll/raspiblitz/issues/2953
if [ $(grep -c "^plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" < ${CLCONF}) -eq 0 ];then
echo "plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" | tee -a ${CLCONF}
fi
# do not announce 127.0.0.1 https://github.com/rootzoll/raspiblitz/issues/2634
if [ $(grep -c "^announce-addr=127.0.0.1" < ${CLCONF}) -gt 0 ];then
sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF}
fi
if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\
|| [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then
echo "# The Sparko plugin is not present but in config"
sed -i "/^sparko/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko
fi
fi
if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\
|| [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then
echo "# The clboss plugin is not present but in config"
sed -i "/^clboss/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss
fi
fi
if [ $(grep -c "^http-pass" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]\
|| [ "${clHTTPplugin}" != "on" ]; then
echo "# The clHTTPplugin is not present but in config"
sed -i "/^http-pass/d" ${CLCONF}
rm -rf /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin
fi
fi
if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]\
|| [ "$(eval echo \$${netprefix}feeadjuster)" != "on" ]; then
echo "# The feeadjuster plugin is not present but in config"
sed -i "/^feeadjuster/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py
fi
fi
# https://github.com/rootzoll/raspiblitz/issues/3007
# add for test networks as well if needed on mainnet
if [ "${blitzapi}" = "on" ] || \
[ "${LNBitsFunding}" = "${netprefix}cl" ] || \
[ "${BTCPayServer}" = "on" ]; then
if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then
echo "rpc-file-mode=0660" | tee -a ${CLCONF}
fi
fi
if [ $(grep -c "^grpc-port" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]\
|| [ "$(eval echo \$${netprefix}cln-grpc-port)" = "off" ]; then
echo "# The cln-grpc plugin is not present but in config"
sed -i "/^grpc-port/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc
fi
fi
exit 0
fi
if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\
|| [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then
echo "# The clboss plugin is not present but in config"
sed -i "/^clboss/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss
fi
######################################################################
# POSTSTART
# is executed by systemd cl services everytime AFTER cl is started
# takes care of things that are just available when CL is running
######################################################################
if [ "$1" == "poststart" ]; then
# log info
info=$(ls -la /mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc)
logger "${info}"
exit 0
fi
if [ $(grep -c "^http-pass" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]\
|| [ "${clHTTPplugin}" != "on" ]; then
echo "# The clHTTPplugin is not present but in config"
sed -i "/^http-pass/d" ${CLCONF}
rm -rf /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin
fi
fi
if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]\
|| [ "$(eval echo \$${netprefix}feeadjuster)" != "on" ]; then
echo "# The feeadjuster plugin is not present but in config"
sed -i "/^feeadjuster/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py
fi
fi
# https://github.com/rootzoll/raspiblitz/issues/3007
# add for test networks as well if needed on mainnet
if [ "${blitzapi}" = "on" ] || \
[ "${LNBitsFunding}" = "${netprefix}cl" ] || \
[ "${BTCPayServer}" = "on" ]; then
if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then
echo "rpc-file-mode=0660" | tee -a ${CLCONF}
fi
fi
if [ $(grep -c "^grpc-port" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]\
|| [ "$(eval echo \$${netprefix}cln-grpc-port)" = "off" ]; then
echo "# The cln-grpc plugin is not present but in config"
sed -i "/^grpc-port/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc
fi
fi
echo "# Unkonwn Parameter $1 or missing"
exit 1

View File

@ -61,9 +61,8 @@ After=network-online.target
[Service]
ExecStartPre=-/home/admin/config.scripts/cl.check.sh prestart $CHAIN
ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd \\
--conf=${CLCONF} ${encryptedHSMoption} \\
--pid-file=/run/lightningd/${netprefix}lightningd.pid'
ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd --conf=${CLCONF} ${encryptedHSMoption} --pid-file=/run/lightningd/${netprefix}lightningd.pid --rpc-file-mode 0660'
ExecStartPost=-/home/admin/config.scripts/cl.check.sh poststart $CHAIN
# Creates /run/lightningd owned by bitcoin
RuntimeDirectory=lightningd