mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-03-01 00:59:23 +01:00
fix: lnd check for rpcmiddleware (#3804)
This commit is contained in:
parent
4e1f2a4ae9
commit
029525ab4d
2 changed files with 53 additions and 57 deletions
|
@ -170,11 +170,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
|
||||
# extract the SHA256 hash from the manifest file for the corresponding platform
|
||||
wget -N https://github.com/lightninglabs/lightning-terminal/releases/download/v${LITVERSION}/manifest-v${LITVERSION}.txt
|
||||
if [ ${isARM} -eq 1 ] ; then
|
||||
if [ ${isARM} -eq 1 ]; then
|
||||
OSversion="armv7"
|
||||
elif [ ${isAARCH64} -eq 1 ] ; then
|
||||
elif [ ${isAARCH64} -eq 1 ]; then
|
||||
OSversion="arm64"
|
||||
elif [ ${isX86_64} -eq 1 ] ; then
|
||||
elif [ ${isX86_64} -eq 1 ]; then
|
||||
OSversion="amd64"
|
||||
fi
|
||||
SHA256=$(grep -i "linux-$OSversion" manifest-v$LITVERSION.txt | cut -d " " -f1)
|
||||
|
@ -198,8 +198,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
|
||||
echo "# check gpg finger print"
|
||||
gpg --show-keys --keyid-format LONG ./pgp_keys.asc
|
||||
fingerprint=$(gpg --show-keys --keyid-format LONG "./pgp_keys.asc" 2>/dev/null \
|
||||
| grep "${PGPcheck}" -c)
|
||||
fingerprint=$(gpg --show-keys --keyid-format LONG "./pgp_keys.asc" 2>/dev/null |
|
||||
grep "${PGPcheck}" -c)
|
||||
if [ ${fingerprint} -lt 1 ]; then
|
||||
echo ""
|
||||
echo "# BUILD WARNING --> LiT PGP author not as expected"
|
||||
|
@ -209,7 +209,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
fi
|
||||
gpg --import ./pgp_keys.asc
|
||||
sleep 3
|
||||
verifyResult=$(LANG=en_US.utf8; gpg --verify manifest-v${LITVERSION}.sig manifest-v${LITVERSION}.txt 2>&1)
|
||||
verifyResult=$(
|
||||
LANG=en_US.utf8
|
||||
gpg --verify manifest-v${LITVERSION}.sig manifest-v${LITVERSION}.txt 2>&1
|
||||
)
|
||||
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
|
||||
echo "goodSignature(${goodSignature})"
|
||||
correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${GPGcheck}" -c)
|
||||
|
@ -235,16 +238,13 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
###########
|
||||
# config #
|
||||
###########
|
||||
|
||||
# check if lnd.conf has rpcmiddleware.enable entry under section Application Options
|
||||
entryExists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c "rpcmiddleware.enable=")
|
||||
if [ "${entryExists}" == "0" ]; then
|
||||
echo "# add rpcmiddleware.enable=true to lnd.conf"
|
||||
sudo sed -i "/^\[Application Options\]$/arpcmiddleware.enable=true" /mnt/hdd/lnd/lnd.conf
|
||||
fi
|
||||
|
||||
# make sure lnd.conf has rpcmiddleware.enable=true
|
||||
# check if lnd.conf has rpcmiddleware.enable entry under [rpcmiddleware]
|
||||
if sudo grep rpcmiddleware /mnt/hdd/lnd/lnd.conf; then
|
||||
sudo sed -i "s/^rpcmiddleware.enable=.*/rpcmiddleware.enable=true/g" /mnt/hdd/lnd/lnd.conf
|
||||
else
|
||||
sudo bash -c "echo '[rpcmiddleware]' >> /mnt/hdd/lnd/lnd.conf"
|
||||
sudo bash -c "echo 'rpcmiddleware.enable=true' >> /mnt/hdd/lnd/lnd.conf"
|
||||
fi
|
||||
|
||||
if [ "${runBehindTor}" = "on" ]; then
|
||||
echo "# Connect to the Pool, Loop and Terminal server through Tor"
|
||||
|
@ -408,4 +408,3 @@ fi
|
|||
echo "FAIL - Unknown Parameter $1"
|
||||
echo "may need reboot to run normal again"
|
||||
exit 1
|
||||
|
||||
|
|
|
@ -22,8 +22,7 @@ echo "# lndConfFile(${lndConfFile})"
|
|||
# so it tries to make sure the config is in valid shape
|
||||
######################################################################
|
||||
|
||||
function setting() # FILE LINENUMBER NAME VALUE
|
||||
{
|
||||
function setting() { # FILE LINENUMBER NAME VALUE
|
||||
FILE=$1
|
||||
LINENUMBER=$2
|
||||
NAME=$3
|
||||
|
@ -118,7 +117,6 @@ if [ "$1" == "prestart" ]; then
|
|||
echo "# ${network}.node insert/update"
|
||||
setting ${lndConfFile} ${insertLine} "${network}\.node" "${network}d"
|
||||
|
||||
|
||||
##### BITCOIND OPTIONS SECTION #####
|
||||
|
||||
# [bitcoind]
|
||||
|
@ -164,7 +162,7 @@ if [ "$1" == "prestart" ]; then
|
|||
RPCPSW=$(cat /mnt/hdd/${network}/${network}.conf | grep "^${network}d.rpcpassword=" | cut -d "=" -f2 | tail -n 1)
|
||||
fi
|
||||
if [ "${RPCPSW}" == "" ]; then
|
||||
1>&2 echo "FAIL: 'rpcpassword' not found in /mnt/hdd/${network}/${network}.conf"
|
||||
echo 1>&2 "FAIL: 'rpcpassword' not found in /mnt/hdd/${network}/${network}.conf"
|
||||
exit 11
|
||||
fi
|
||||
setting ${lndConfFile} ${insertLine} "${network}d\.rpcpass" "${RPCPSW}"
|
||||
|
@ -175,7 +173,7 @@ if [ "$1" == "prestart" ]; then
|
|||
RPCUSER=$(cat /mnt/hdd/${network}/${network}.conf | grep "^${network}d.rpcuser=" | cut -d "=" -f2 | tail -n 1)
|
||||
fi
|
||||
if [ "${RPCUSER}" == "" ]; then
|
||||
1>&2 echo "FAIL: 'rpcuser' not found in /mnt/hdd/${network}/${network}.conf"
|
||||
echo 1>&2 "FAIL: 'rpcuser' not found in /mnt/hdd/${network}/${network}.conf"
|
||||
exit 12
|
||||
fi
|
||||
setting ${lndConfFile} ${insertLine} "${network}d\.rpcuser" "${RPCUSER}"
|
||||
|
@ -258,7 +256,7 @@ if [ "$1" == "prestart" ]; then
|
|||
# limit workers to the number of cores
|
||||
setting ${lndConfFile} ${insertLine} "workers.write" "${cores}"
|
||||
setting ${lndConfFile} ${insertLine} "workers.sig" "${cores}"
|
||||
fi
|
||||
fi
|
||||
|
||||
##### TOR SECTION #####
|
||||
|
||||
|
@ -308,7 +306,7 @@ fi
|
|||
##### RPCMIDDLEWARE SECTION #####
|
||||
|
||||
# [rpcmiddleware]
|
||||
sectionName="[Rr]pcmiddleware"
|
||||
sectionName="rpcmiddleware"
|
||||
echo "# [${sectionName}] config ..."
|
||||
|
||||
# make sure lnd config has a [rpcmiddleware] section
|
||||
|
@ -337,7 +335,6 @@ fi
|
|||
# SET/UPDATE rpcmiddleware.enable
|
||||
setting ${lndConfFile} ${insertLine} "rpcmiddleware.enable" "true"
|
||||
|
||||
|
||||
echo "# OK PRESTART DONE"
|
||||
|
||||
######################################################################
|
||||
|
@ -411,25 +408,25 @@ elif [ "$1" == "basic-setup" ]; then
|
|||
echo "err='$(netprefix)lnd.conf: blockchain network in $(netprefix)lnd.conf (${lndNetwork}) is different from raspiblitz.conf (${network})'"
|
||||
fi
|
||||
|
||||
# # get chain from config (TESTNET / MAINNET)
|
||||
# lndChain=""
|
||||
# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.mainnet" | sed 's/^[a-z]*\.//g')
|
||||
# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.testnet" | sed 's/^[a-z]*\.//g')
|
||||
# if [ "${mainnet}" == "1" ] && [ "${testnet}" == "1" ]; then
|
||||
# echo "err='lnd.conf: mainnet and testnet are set active at the same time'"
|
||||
# elif [ "${mainnet}" == "1" ]; then
|
||||
# lndChain="main"
|
||||
# elif [ "${testnet}" == "1" ]; then
|
||||
# lndChain="test"
|
||||
# else
|
||||
# echo "err='lnd.conf: neither testnet or mainnet is set active (raspiblitz needs one of them active in lnd.conf)'"
|
||||
# fi
|
||||
# echo "chain='${lndChain}'"
|
||||
#
|
||||
# # check if chain is same the raspiblitz config
|
||||
# if [ "${chain}" != "${lndChain}" ]; then
|
||||
# echo "err='lnd.conf: testnet/mainnet in lnd.conf (${lndChain}) is different from raspiblitz.conf (${chain})'"
|
||||
# fi
|
||||
# # get chain from config (TESTNET / MAINNET)
|
||||
# lndChain=""
|
||||
# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.mainnet" | sed 's/^[a-z]*\.//g')
|
||||
# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.testnet" | sed 's/^[a-z]*\.//g')
|
||||
# if [ "${mainnet}" == "1" ] && [ "${testnet}" == "1" ]; then
|
||||
# echo "err='lnd.conf: mainnet and testnet are set active at the same time'"
|
||||
# elif [ "${mainnet}" == "1" ]; then
|
||||
# lndChain="main"
|
||||
# elif [ "${testnet}" == "1" ]; then
|
||||
# lndChain="test"
|
||||
# else
|
||||
# echo "err='lnd.conf: neither testnet or mainnet is set active (raspiblitz needs one of them active in lnd.conf)'"
|
||||
# fi
|
||||
# echo "chain='${lndChain}'"
|
||||
#
|
||||
# # check if chain is same the raspiblitz config
|
||||
# if [ "${chain}" != "${lndChain}" ]; then
|
||||
# echo "err='lnd.conf: testnet/mainnet in lnd.conf (${lndChain}) is different from raspiblitz.conf (${chain})'"
|
||||
# fi
|
||||
|
||||
# check for admin macaroon exist (on HDD)
|
||||
adminMacaroonExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/admin.macaroon 2>/dev/null | grep -c 'admin.macaroon')
|
||||
|
|
Loading…
Add table
Reference in a new issue