mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-28 20:42:41 +02:00
migrate keysend to raspibltz.conf & lnd.check.sh
This commit is contained in:
@@ -167,6 +167,13 @@ if [ "${lightning}" == "lnd" ]; then
|
|||||||
sed -i "6s/.*/After=${network}d.service/" /home/admin/assets/lnd.service >> ${logFile} 2>&1
|
sed -i "6s/.*/After=${network}d.service/" /home/admin/assets/lnd.service >> ${logFile} 2>&1
|
||||||
sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1
|
sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1
|
||||||
|
|
||||||
|
# convert old keysend by lndExtraParameter to raspiblitz.conf setting (will be enforced by lnd.check.sh prestart) since 1.7.1
|
||||||
|
if [ "${lndExtraParameter}" == "--accept-keysend" ]; then
|
||||||
|
echo "# MIGRATION KEYSEND from lndExtraParameter --> raspiblitz.conf" >> ${logFile}
|
||||||
|
echo "lndKeysend=on" >> /mnt/hdd/raspiblitz.conf
|
||||||
|
sudo sed -i "/^lndExtraParameter=/d" /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# if old lnd.conf exists ...
|
# if old lnd.conf exists ...
|
||||||
configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf')
|
configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf')
|
||||||
if [ ${configExists} -eq 1 ]; then
|
if [ ${configExists} -eq 1 ]; then
|
||||||
|
@@ -74,7 +74,6 @@ bitcoin.${CHAIN}=1
|
|||||||
listen=0.0.0.0:${portprefix}9735
|
listen=0.0.0.0:${portprefix}9735
|
||||||
rpclisten=0.0.0.0:1${rpcportmod}009
|
rpclisten=0.0.0.0:1${rpcportmod}009
|
||||||
restlisten=0.0.0.0:${portprefix}8080
|
restlisten=0.0.0.0:${portprefix}8080
|
||||||
accept-keysend=true
|
|
||||||
nat=false
|
nat=false
|
||||||
debuglevel=debug
|
debuglevel=debug
|
||||||
gc-canceled-invoices-on-startup=true
|
gc-canceled-invoices-on-startup=true
|
||||||
@@ -91,13 +90,6 @@ tlskeypath=/home/bitcoin/.lnd/tls.key
|
|||||||
bitcoin.active=1
|
bitcoin.active=1
|
||||||
bitcoin.node=bitcoind
|
bitcoin.node=bitcoind
|
||||||
|
|
||||||
[Watchtower]
|
|
||||||
watchtower.active=1
|
|
||||||
watchtower.listen=0.0.0.0:${portprefix}9111
|
|
||||||
|
|
||||||
[Wtclient]
|
|
||||||
wtclient.active=1
|
|
||||||
|
|
||||||
[Tor]
|
[Tor]
|
||||||
tor.active=true
|
tor.active=true
|
||||||
tor.streamisolation=true
|
tor.streamisolation=true
|
||||||
|
@@ -128,9 +128,20 @@ if [ "$1" == "prestart" ]; then
|
|||||||
# SET/UPDATE rpchost
|
# SET/UPDATE rpchost
|
||||||
setting ${lndConfFile} ${insertLine} "${network}d\.rpchost" "127\.0\.0\.1\:${portprefix}8332"
|
setting ${lndConfFile} ${insertLine} "${network}d\.rpchost" "127\.0\.0\.1\:${portprefix}8332"
|
||||||
|
|
||||||
|
# Application Options
|
||||||
|
|
||||||
|
sectionLine=$(cat ${lndConfFile} | grep -n "^\[Application Options\]" | cut -d ":" -f1)
|
||||||
|
echo "# sectionLine(${sectionLine})"
|
||||||
|
insertLine=$(expr $sectionLine + 1)
|
||||||
|
|
||||||
# make sure API ports are set to standard
|
# make sure API ports are set to standard
|
||||||
sed -i "s/^rpclisten=.*/rpclisten=0\.0\.0\.0\:1${rpcportmod}009/g" ${lndConfFile}
|
setting ${lndConfFile} ${insertLine} "rpclisten" "0\.0\.0\.0\:1${rpcportmod}009"
|
||||||
sed -i "s/^restlisten=.*/restlisten=0\.0\.0\.0\:${portprefix}8080/g" ${lndConfFile}
|
setting ${lndConfFile} ${insertLine} "restlisten" "0\.0\.0\.0\:${portprefix}8080"
|
||||||
|
|
||||||
|
# enforce keysend if 'lndKeysend=on' in raspiblitz.conf
|
||||||
|
if [ "${lndKeysend}" == "on" ]; then
|
||||||
|
setting ${lndConfFile} ${insertLine} "accept-keysend" "true"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# OK PRESTART DONE"
|
echo "# OK PRESTART DONE"
|
||||||
|
|
||||||
|
@@ -19,23 +19,28 @@ if [ "${parameter}" == "on" ]; then
|
|||||||
|
|
||||||
# store to raspiblitz config (delete old line / add new)
|
# store to raspiblitz config (delete old line / add new)
|
||||||
sudo sed -i '/lndExtraParameter=.*/d' /mnt/hdd/raspiblitz.conf
|
sudo sed -i '/lndExtraParameter=.*/d' /mnt/hdd/raspiblitz.conf
|
||||||
echo "lndExtraParameter='--accept-keysend'" >> /mnt/hdd/raspiblitz.conf
|
echo "lndKeysend=on" >> /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
echo "# OK - keysend feature is switched ON"
|
echo "# OK - keysend feature is switched ON"
|
||||||
|
echo "# will be enfored by lnd.check.sh prestart"
|
||||||
echo "# LND or RaspiBlitz needs restart"
|
echo "# LND or RaspiBlitz needs restart"
|
||||||
|
|
||||||
elif [ "${parameter}" == "off" ]; then
|
elif [ "${parameter}" == "off" ]; then
|
||||||
|
|
||||||
# just remove the parameter from the config file
|
# just remove the parameter from the config file
|
||||||
sudo sed -i '/lndExtraParameter=.*/d' /mnt/hdd/raspiblitz.conf
|
sudo sed -i '/lndExtraParameter=.*/d' /mnt/hdd/raspiblitz.conf
|
||||||
|
sudo sed -i '/lndKeysend=.*/d' /mnt/hdd/raspiblitz.conf
|
||||||
|
sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/lnd.conf 2>/dev/null
|
||||||
|
sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/tlnd.conf 2>/dev/null
|
||||||
|
sudo sed -i '/accept-keysend=.*/d' /mnt/hdd/lnd/slnd.conf 2>/dev/null
|
||||||
|
|
||||||
echo "# OK - keysend feature is switched OFF"
|
echo "# OK - keysend enforcement is switched OFF"
|
||||||
echo "# LND or RaspiBlitz needs restart"
|
echo "# LND or RaspiBlitz needs restart"
|
||||||
|
|
||||||
elif [ "${parameter}" == "status" ]; then
|
elif [ "${parameter}" == "status" ]; then
|
||||||
|
|
||||||
keysendOn=$(echo "${lndExtraParameter}" | grep -c 'accept-keysend')
|
keysendOn=$(sudo cat /mnt/hdd/raspiblitz.conf | grep -c '^lndKeysend=on')
|
||||||
keysendRunning=$(sudo systemctl status lnd | grep -c 'accept-keysend')
|
keysendRunning=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend\=true')
|
||||||
echo "keysendOn=${keysendOn}"
|
echo "keysendOn=${keysendOn}"
|
||||||
echo "keysendRunning=${keysendRunning}"
|
echo "keysendRunning=${keysendRunning}"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user