mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-13 03:30:49 +02:00
fix bitcoin aliases, whitespaces and comments (#3483)
* fix bitcoin aliases, whitespaces and comments * fix typo
This commit is contained in:
parent
c69b2603de
commit
41e75d9d8f
@ -43,7 +43,7 @@ do
|
|||||||
source ${infoFile} 2>/dev/null
|
source ${infoFile} 2>/dev/null
|
||||||
source ${configFile} 2>/dev/null
|
source ${configFile} 2>/dev/null
|
||||||
source <(/home/admin/_cache.sh get state setupPhase)
|
source <(/home/admin/_cache.sh get state setupPhase)
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
# SKIP BACKGROUND TASK LOOP ON CERTAIN SYSTEM STATES
|
# SKIP BACKGROUND TASK LOOP ON CERTAIN SYSTEM STATES
|
||||||
# https://github.com/rootzoll/raspiblitz/issues/160
|
# https://github.com/rootzoll/raspiblitz/issues/160
|
||||||
@ -266,7 +266,7 @@ do
|
|||||||
# first check if flags need to be reset (manually delete of blockchain)
|
# first check if flags need to be reset (manually delete of blockchain)
|
||||||
if [ "${flagBtcDone}" == "1" ] && [ "${flagBtcActive}" == "1" ]; then
|
if [ "${flagBtcDone}" == "1" ] && [ "${flagBtcActive}" == "1" ]; then
|
||||||
flagBtcDone=0
|
flagBtcDone=0
|
||||||
/home/admin/config.scripts/blitz.conf.sh set btc_${CHAIN}net_sync_initial_done ${flagBtcDone} /home/admin/raspiblitz.info
|
/home/admin/config.scripts/blitz.conf.sh set btc_${CHAIN}net_sync_initial_done ${flagBtcDone} /home/admin/raspiblitz.info
|
||||||
echo "EVENT --> btc_${CHAIN}net_sync_initial_done changed to ${flagBtcDone}"
|
echo "EVENT --> btc_${CHAIN}net_sync_initial_done changed to ${flagBtcDone}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ do
|
|||||||
# when started done is set - but not not active anymore --> end of IDB event detected
|
# when started done is set - but not not active anymore --> end of IDB event detected
|
||||||
if [ "${flagBtcDone}" == "0" ] && [ "${flagBtcOnline}" == "1" ] && [ "${flagBtcSynced}" == "1" ]; then
|
if [ "${flagBtcDone}" == "0" ] && [ "${flagBtcOnline}" == "1" ] && [ "${flagBtcSynced}" == "1" ]; then
|
||||||
flagBtcDone=1
|
flagBtcDone=1
|
||||||
/home/admin/config.scripts/blitz.conf.sh set btc_${CHAIN}net_sync_initial_done ${flagBtcDone} /home/admin/raspiblitz.info
|
/home/admin/config.scripts/blitz.conf.sh set btc_${CHAIN}net_sync_initial_done ${flagBtcDone} /home/admin/raspiblitz.info
|
||||||
echo "EVENT --> btc_${CHAIN}net_sync_initial_done changed to ${flagBtcDone}"
|
echo "EVENT --> btc_${CHAIN}net_sync_initial_done changed to ${flagBtcDone}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
# CHECK FOR End of Intial Blockhain & Lightning Sync
|
# Check for end of Initial Blockhain & Lightning Sync
|
||||||
# bitcoin mainnet only / special on dbcache size
|
# bitcoin mainnet only / special on dbcache size
|
||||||
####################################################
|
####################################################
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ do
|
|||||||
# this flag signals that an initial blockchain sync/chatchup was happening
|
# this flag signals that an initial blockchain sync/chatchup was happening
|
||||||
flagExists=$(ls /mnt/hdd/bitcoin/blocks/selfsync.flag 2>/dev/null | grep -c "selfsync.flag")
|
flagExists=$(ls /mnt/hdd/bitcoin/blocks/selfsync.flag 2>/dev/null | grep -c "selfsync.flag")
|
||||||
if [ ${flagExists} -eq 1 ]; then
|
if [ ${flagExists} -eq 1 ]; then
|
||||||
|
|
||||||
source <(/home/admin/_cache.sh get btc_default_sync_initialblockdownload)
|
source <(/home/admin/_cache.sh get btc_default_sync_initialblockdownload)
|
||||||
if [ "${btc_default_sync_initialblockdownload}" == "0" ]; then
|
if [ "${btc_default_sync_initialblockdownload}" == "0" ]; then
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ do
|
|||||||
# check every 30sec
|
# check every 30sec
|
||||||
recheckBlitzTUI=$(($counter % 30))
|
recheckBlitzTUI=$(($counter % 30))
|
||||||
if [ "${touchscreen}" == "1" ] && [ ${recheckBlitzTUI} -eq 1 ]; then
|
if [ "${touchscreen}" == "1" ] && [ ${recheckBlitzTUI} -eq 1 ]; then
|
||||||
|
|
||||||
echo "BlitzTUI Monitoring Check"
|
echo "BlitzTUI Monitoring Check"
|
||||||
if [ -d "/var/cache/raspiblitz" ]; then
|
if [ -d "/var/cache/raspiblitz" ]; then
|
||||||
latestHeartBeatLine=$(tail -n 300 /var/cache/raspiblitz/pi/blitz-tui.log | grep beat | tail -n 1)
|
latestHeartBeatLine=$(tail -n 300 /var/cache/raspiblitz/pi/blitz-tui.log | grep beat | tail -n 1)
|
||||||
@ -621,7 +621,7 @@ do
|
|||||||
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# SUBSCRIPTION RENWES
|
# SUBSCRIPTION RENEWS
|
||||||
###############################
|
###############################
|
||||||
|
|
||||||
# check every 20min
|
# check every 20min
|
||||||
@ -681,4 +681,4 @@ do
|
|||||||
# sleep 1 sec
|
# sleep 1 sec
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
done
|
done
|
||||||
|
@ -16,11 +16,11 @@ if [ "$1" = "install" ]; then
|
|||||||
# set version (change if update is available)
|
# set version (change if update is available)
|
||||||
# https://bitcoincore.org/en/download/
|
# https://bitcoincore.org/en/download/
|
||||||
bitcoinVersion="24.0"
|
bitcoinVersion="24.0"
|
||||||
|
|
||||||
# needed to check code signing
|
# needed to check code signing
|
||||||
# https://github.com/laanwj
|
# https://github.com/laanwj
|
||||||
laanwjPGP="71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
laanwjPGP="71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
||||||
|
|
||||||
# prepare directories
|
# prepare directories
|
||||||
sudo rm -rf /home/admin/download
|
sudo rm -rf /home/admin/download
|
||||||
sudo -u admin mkdir /home/admin/download
|
sudo -u admin mkdir /home/admin/download
|
||||||
@ -32,10 +32,10 @@ if [ "$1" = "install" ]; then
|
|||||||
echo "# FAIL # Couldn't download Wladimir J. van der Laan's PGP pubkey"
|
echo "# FAIL # Couldn't download Wladimir J. van der Laan's PGP pubkey"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# download signed binary sha256 hash sum file
|
# download signed binary sha256 hash sum file
|
||||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||||
|
|
||||||
# download signed binary sha256 hash sum file and check
|
# download signed binary sha256 hash sum file and check
|
||||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||||
verifyResult=$(LANG=en_US.utf8; gpg --verify SHA256SUMS.asc 2>&1)
|
verifyResult=$(LANG=en_US.utf8; gpg --verify SHA256SUMS.asc 2>&1)
|
||||||
@ -54,7 +54,7 @@ if [ "$1" = "install" ]; then
|
|||||||
echo "****************************************"
|
echo "****************************************"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# bitcoinOSversion
|
# bitcoinOSversion
|
||||||
if [ "$(uname -m | grep -c 'arm')" -gt 0 ]; then
|
if [ "$(uname -m | grep -c 'arm')" -gt 0 ]; then
|
||||||
bitcoinOSversion="arm-linux-gnueabihf"
|
bitcoinOSversion="arm-linux-gnueabihf"
|
||||||
@ -63,7 +63,7 @@ if [ "$1" = "install" ]; then
|
|||||||
elif [ "$(uname -m | grep -c 'x86_64')" -gt 0 ]; then
|
elif [ "$(uname -m | grep -c 'x86_64')" -gt 0 ]; then
|
||||||
bitcoinOSversion="x86_64-linux-gnu"
|
bitcoinOSversion="x86_64-linux-gnu"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "*** BITCOIN CORE v${bitcoinVersion} for ${bitcoinOSversion} ***"
|
echo "*** BITCOIN CORE v${bitcoinVersion} for ${bitcoinOSversion} ***"
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ if [ "$1" = "install" ]; then
|
|||||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
|
||||||
# check binary checksum test
|
# check binary checksum test
|
||||||
echo "- checksum test"
|
echo "- checksum test"
|
||||||
# get the sha256 value for the corresponding platform from signed hash sum file
|
# get the sha256 value for the corresponding platform from signed hash sum file
|
||||||
@ -98,7 +98,7 @@ if [ "$1" = "install" ]; then
|
|||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install
|
# install
|
||||||
sudo -u admin tar -xvf ${binaryName}
|
sudo -u admin tar -xvf ${binaryName}
|
||||||
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
|
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
|
||||||
@ -109,7 +109,7 @@ if [ "$1" = "install" ]; then
|
|||||||
echo "# BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
|
echo "# BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$(alias | grep -c "alias bitcoinlog")" -eq 0 ];then
|
if [ "$(alias | grep -c "alias bitcoinlog")" -eq 0 ];then
|
||||||
echo "alias bitcoinlog=\"sudo tail -n 30 -f /mnt/hdd/bitcoin/debug.log\"" | sudo tee -a /home/admin/_aliases
|
echo "alias bitcoinlog=\"sudo tail -n 30 -f /mnt/hdd/bitcoin/debug.log\"" | sudo tee -a /home/admin/_aliases
|
||||||
fi
|
fi
|
||||||
sudo chown admin:admin /home/admin/_aliases
|
sudo chown admin:admin /home/admin/_aliases
|
||||||
@ -148,7 +148,7 @@ if [ ${CHAIN} = signet ]; then
|
|||||||
elif [ ${CHAIN} = testnet ]; then
|
elif [ ${CHAIN} = testnet ]; then
|
||||||
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||||
elif [ ${CHAIN} = mainnet ]; then
|
elif [ ${CHAIN} = mainnet ]; then
|
||||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ function removeParallelService() {
|
|||||||
sudo systemctl disable ${prefix}bitcoind
|
sudo systemctl disable ${prefix}bitcoind
|
||||||
sudo rm /etc/systemd/system/${prefix}bitcoind.service 2>/dev/null
|
sudo rm /etc/systemd/system/${prefix}bitcoind.service 2>/dev/null
|
||||||
if [ ${bitcoinprefix} = signet ];then
|
if [ ${bitcoinprefix} = signet ];then
|
||||||
# check for signet service set up by joininbox
|
# check for signet service set up by joininbox
|
||||||
if [ -f "/etc/systemd/system/signetd.service" ];then
|
if [ -f "/etc/systemd/system/signetd.service" ];then
|
||||||
sudo systemctl stop signetd
|
sudo systemctl stop signetd
|
||||||
sudo systemctl disable signetd
|
sudo systemctl disable signetd
|
||||||
@ -198,7 +198,7 @@ datadir=/mnt/hdd/bitcoin
|
|||||||
else
|
else
|
||||||
echo "# /home/bitcoin/.bitcoin/bitcoin.conf is present"
|
echo "# /home/bitcoin/.bitcoin/bitcoin.conf is present"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make sure rpcbind is correctly configured
|
# make sure rpcbind is correctly configured
|
||||||
sudo sed -i s/^rpcbind=/main.rpcbind=/g /mnt/hdd/bitcoin/bitcoin.conf
|
sudo sed -i s/^rpcbind=/main.rpcbind=/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||||
if [ $(grep -c "rpcallowip" < /mnt/hdd/bitcoin/bitcoin.conf) -gt 0 ];then
|
if [ $(grep -c "rpcallowip" < /mnt/hdd/bitcoin/bitcoin.conf) -gt 0 ];then
|
||||||
@ -243,7 +243,7 @@ signet.addnode=nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion:38
|
|||||||
|
|
||||||
if [ ${CHAIN} = mainnet ];then
|
if [ ${CHAIN} = mainnet ];then
|
||||||
sudo cp /home/admin/assets/bitcoind.service /etc/systemd/system/bitcoind.service
|
sudo cp /home/admin/assets/bitcoind.service /etc/systemd/system/bitcoind.service
|
||||||
else
|
else
|
||||||
# /etc/systemd/system/${prefix}bitcoind.service
|
# /etc/systemd/system/${prefix}bitcoind.service
|
||||||
# based on https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service
|
# based on https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service
|
||||||
echo "
|
echo "
|
||||||
@ -307,16 +307,16 @@ WantedBy=multi-user.target
|
|||||||
|
|
||||||
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoind, ${prefix}bitcoinlog"
|
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoind, ${prefix}bitcoinlog"
|
||||||
sudo -u admin touch /home/admin/_aliases
|
sudo -u admin touch /home/admin/_aliases
|
||||||
if [ "$(alias | grep -c "alias ${prefix}bitcoin-cli")" -eq 0 ];then
|
if [ "$(alias | grep -c "alias ${prefix}bitcoin-cli")" -eq 0 ];then
|
||||||
echo "\
|
echo "\
|
||||||
alias ${prefix}bitcoin-cli=\"/usr/local/bin/bitcoin-cli\
|
alias ${prefix}bitcoin-cli=\"sudo -u bitcoin /usr/local/bin/bitcoin-cli\
|
||||||
-rpcport=${rpcprefix}8332\"
|
-rpcport=${rpcprefix}8332\"
|
||||||
alias ${prefix}bitcoind=\"/usr/local/bin/bitcoind -${CHAIN}\"\
|
alias ${prefix}bitcoind=\"sudo -u bitcoin /usr/local/bin/bitcoind -${CHAIN}\"\
|
||||||
" | sudo tee -a /home/admin/_aliases
|
" | sudo tee -a /home/admin/_aliases
|
||||||
fi
|
fi
|
||||||
if [ "$(alias | grep -c "alias ${prefix}bitcoinlog")" -eq 0 ];then
|
if [ "$(alias | grep -c "alias ${prefix}bitcoinlog")" -eq 0 ];then
|
||||||
echo "\
|
echo "\
|
||||||
alias ${prefix}bitcoinlog=\"sudo tail -n 30 -f ${bitcoinlogpath}\"\
|
alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"\
|
||||||
" | sudo tee -a /home/admin/_aliases
|
" | sudo tee -a /home/admin/_aliases
|
||||||
fi
|
fi
|
||||||
sudo chown admin:admin /home/admin/_aliases
|
sudo chown admin:admin /home/admin/_aliases
|
||||||
@ -332,9 +332,9 @@ alias ${prefix}bitcoinlog=\"sudo tail -n 30 -f ${bitcoinlogpath}\"\
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
isInstalled=$(systemctl status ${prefix}bitcoind | grep -c active)
|
isInstalled=$(systemctl status ${prefix}bitcoind | grep -c active)
|
||||||
if [ $isInstalled -gt 0 ];then
|
if [ $isInstalled -gt 0 ]; then
|
||||||
echo "# Installed $(bitcoind --version | grep version)"
|
echo "# Installed $(bitcoind --version | grep version)"
|
||||||
echo
|
echo
|
||||||
echo "# Monitor the ${prefix}bitcoind with:"
|
echo "# Monitor the ${prefix}bitcoind with:"
|
||||||
echo "# sudo tail -f /mnt/hdd/bitcoin/${prefix}debug.log"
|
echo "# sudo tail -f /mnt/hdd/bitcoin/${prefix}debug.log"
|
||||||
echo
|
echo
|
||||||
|
@ -58,7 +58,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||||||
rm -f node-$VERSION-$DISTRO.tar.xz*
|
rm -f node-$VERSION-$DISTRO.tar.xz*
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "OK the checkdum of nodeJS is OK"
|
echo "OK the checksum of nodeJS is OK"
|
||||||
sleep 3
|
sleep 3
|
||||||
# install
|
# install
|
||||||
sudo mkdir -p /usr/local/lib/nodejs
|
sudo mkdir -p /usr/local/lib/nodejs
|
||||||
|
@ -59,19 +59,16 @@ if [ "$1" = getvars ];then
|
|||||||
# zmqprefix is: 28 | 21 | 23
|
# zmqprefix is: 28 | 21 | 23
|
||||||
if [ "${chain}" == "main" ];then
|
if [ "${chain}" == "main" ];then
|
||||||
netprefix=""
|
netprefix=""
|
||||||
L1rpcportmod=""
|
|
||||||
L2rpcportmod=0
|
L2rpcportmod=0
|
||||||
portprefix=""
|
portprefix=""
|
||||||
zmqprefix=28
|
zmqprefix=28
|
||||||
elif [ "${chain}" == "test" ];then
|
elif [ "${chain}" == "test" ];then
|
||||||
netprefix="t"
|
netprefix="t"
|
||||||
L1rpcportmod=1
|
|
||||||
L2rpcportmod=1
|
L2rpcportmod=1
|
||||||
portprefix=1
|
portprefix=1
|
||||||
zmqprefix=21
|
zmqprefix=21
|
||||||
elif [ "${chain}" == "sig" ];then
|
elif [ "${chain}" == "sig" ];then
|
||||||
netprefix="s"
|
netprefix="s"
|
||||||
L1rpcportmod=3
|
|
||||||
L2rpcportmod=3
|
L2rpcportmod=3
|
||||||
portprefix=3
|
portprefix=3
|
||||||
zmqprefix=23
|
zmqprefix=23
|
||||||
@ -114,9 +111,9 @@ if [ "$1" = getvars ];then
|
|||||||
# sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net
|
# sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net
|
||||||
echo "lncli_alias=\"sudo -u bitcoin /usr/local/bin/lncli -n=${chain}net --rpcserver localhost:1${L2rpcportmod}009\""
|
echo "lncli_alias=\"sudo -u bitcoin /usr/local/bin/lncli -n=${chain}net --rpcserver localhost:1${L2rpcportmod}009\""
|
||||||
# sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network}
|
# sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network}
|
||||||
echo "bitcoincli_alias=\"/usr/local/bin/${network}-cli -datadir=/home/bitcoin/.${network} -rpcport=${L1rpcportmod}8332\""
|
echo "bitcoincli_alias=\"/usr/local/bin/${network}-cli -datadir=/home/bitcoin/.${network} -rpcport=${portprefix}8332\""
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#TODO
|
#TODO
|
||||||
# where /lnd.conf is not changed to /${netprefix}lnd.conf the service remains for mainnet only
|
# where /lnd.conf is not changed to /${netprefix}lnd.conf the service remains for mainnet only
|
||||||
|
Loading…
Reference in New Issue
Block a user