mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-02 17:08:28 +02:00
lnd.check.sh prestart alse set REST/RPC ports
This commit is contained in:
parent
9f3ac78a75
commit
0958946db4
@ -660,12 +660,6 @@ else
|
||||
# Blockchain & Lightning not running
|
||||
############################
|
||||
|
||||
######################################################################
|
||||
# MAKE SURE LND RPC/REST ports are standard & open to all connections
|
||||
######################################################################
|
||||
sudo sed -i "s/^rpclisten=.*/rpclisten=0.0.0.0:10009/g" /mnt/hdd/lnd/lnd.conf
|
||||
sudo sed -i "s/^restlisten=.*/restlisten=0.0.0.0:8080/g" /mnt/hdd/lnd/lnd.conf
|
||||
|
||||
#################################
|
||||
# FIX BLOCKCHAINDATA OWNER (just in case)
|
||||
# https://github.com/rootzoll/raspiblitz/issues/239#issuecomment-450887567
|
||||
@ -707,7 +701,7 @@ if [ ${configWifiExists} -eq 1 ]; then
|
||||
sudo cp /etc/wpa_supplicant/wpa_supplicant.conf /mnt/hdd/app-data/wpa_supplicant.conf
|
||||
fi
|
||||
|
||||
# make sure lndAddress & lndPort exist in cofigfile
|
||||
# make sure lndAddress & lndPort exist in configfile
|
||||
valueExists=$(cat ${configFile} | grep -c 'lndPort=')
|
||||
if [ ${valueExists} -eq 0 ]; then
|
||||
lndPort=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "^listen=*" | cut -f2 -d':')
|
||||
|
@ -106,22 +106,6 @@ ${bitcoinprefix}.zmqpubrawtx=tcp://127.0.0.1:${zmqprefix}333"|\
|
||||
sudo tee -a /mnt/hdd/${network}/${network}.conf
|
||||
fi
|
||||
|
||||
if [ -f /mnt/hdd/lnd/lnd.conf ];then
|
||||
echo "# Check mainnet lnd.conf"
|
||||
RPCUSER=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcuser | cut -c 9-)
|
||||
RPCPSW=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-)
|
||||
# it does not pick up main.zmqpubraw entries from bitcoin.conf, need to set manually
|
||||
if [ $(grep -c zmqpubrawblock /mnt/hdd/lnd/lnd.conf) -eq 0 ];then
|
||||
echo "
|
||||
[bitcoind]
|
||||
bitcoind.rpcuser=$RPCUSER
|
||||
bitcoind.rpcpass=$RPCPSW
|
||||
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
|
||||
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
|
||||
" | sudo tee -a /mnt/hdd/lnd/lnd.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# addnode
|
||||
if [ ${bitcoinprefix} = signet ];then
|
||||
if [ $(grep -c "${bitcoinprefix}.addnode" < /mnt/hdd/${network}/${network}.conf) -eq 0 ];then
|
||||
|
@ -128,6 +128,10 @@ if [ "$1" == "prestart" ]; then
|
||||
# SET/UPDATE rpchost
|
||||
setting ${lndConfFile} ${insertLine} "${network}d\.rpchost" "127\.0\.0\.1\:${portprefix}8332"
|
||||
|
||||
# make sure API ports are set to standard
|
||||
sed -i "s/^rpclisten=.*/rpclisten=0\.0\.0\.0\:1${rpcportmod}009/g" ${lndConfFile}
|
||||
sed -i "s/^restlisten=.*/restlisten=0\.0\.0\.0\:${portprefix}8080/g" ${lndConfFile}
|
||||
|
||||
echo "# OK PRESTART DONE"
|
||||
|
||||
######################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user