mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-12 19:20:48 +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 ${configFile} 2>/dev/null
|
||||
source <(/home/admin/_cache.sh get state setupPhase)
|
||||
|
||||
|
||||
####################################################
|
||||
# SKIP BACKGROUND TASK LOOP ON CERTAIN SYSTEM STATES
|
||||
# https://github.com/rootzoll/raspiblitz/issues/160
|
||||
@ -266,7 +266,7 @@ do
|
||||
# first check if flags need to be reset (manually delete of blockchain)
|
||||
if [ "${flagBtcDone}" == "1" ] && [ "${flagBtcActive}" == "1" ]; then
|
||||
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}"
|
||||
fi
|
||||
|
||||
@ -280,7 +280,7 @@ do
|
||||
# when started done is set - but not not active anymore --> end of IDB event detected
|
||||
if [ "${flagBtcDone}" == "0" ] && [ "${flagBtcOnline}" == "1" ] && [ "${flagBtcSynced}" == "1" ]; then
|
||||
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}"
|
||||
fi
|
||||
|
||||
@ -335,7 +335,7 @@ do
|
||||
fi
|
||||
|
||||
####################################################
|
||||
# CHECK FOR End of Intial Blockhain & Lightning Sync
|
||||
# Check for end of Initial Blockhain & Lightning Sync
|
||||
# bitcoin mainnet only / special on dbcache size
|
||||
####################################################
|
||||
|
||||
@ -347,7 +347,7 @@ do
|
||||
# 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")
|
||||
if [ ${flagExists} -eq 1 ]; then
|
||||
|
||||
|
||||
source <(/home/admin/_cache.sh get btc_default_sync_initialblockdownload)
|
||||
if [ "${btc_default_sync_initialblockdownload}" == "0" ]; then
|
||||
|
||||
@ -387,7 +387,7 @@ do
|
||||
# check every 30sec
|
||||
recheckBlitzTUI=$(($counter % 30))
|
||||
if [ "${touchscreen}" == "1" ] && [ ${recheckBlitzTUI} -eq 1 ]; then
|
||||
|
||||
|
||||
echo "BlitzTUI Monitoring Check"
|
||||
if [ -d "/var/cache/raspiblitz" ]; then
|
||||
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
|
||||
@ -681,4 +681,4 @@ do
|
||||
# sleep 1 sec
|
||||
sleep 1
|
||||
|
||||
done
|
||||
done
|
||||
|
@ -16,11 +16,11 @@ if [ "$1" = "install" ]; then
|
||||
# set version (change if update is available)
|
||||
# https://bitcoincore.org/en/download/
|
||||
bitcoinVersion="24.0"
|
||||
|
||||
|
||||
# needed to check code signing
|
||||
# https://github.com/laanwj
|
||||
laanwjPGP="71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
||||
|
||||
|
||||
# prepare directories
|
||||
sudo rm -rf /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"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# download signed binary sha256 hash sum file
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
|
||||
|
||||
# download signed binary sha256 hash sum file and check
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
verifyResult=$(LANG=en_US.utf8; gpg --verify SHA256SUMS.asc 2>&1)
|
||||
@ -54,7 +54,7 @@ if [ "$1" = "install" ]; then
|
||||
echo "****************************************"
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
# bitcoinOSversion
|
||||
if [ "$(uname -m | grep -c 'arm')" -gt 0 ]; then
|
||||
bitcoinOSversion="arm-linux-gnueabihf"
|
||||
@ -63,7 +63,7 @@ if [ "$1" = "install" ]; then
|
||||
elif [ "$(uname -m | grep -c 'x86_64')" -gt 0 ]; then
|
||||
bitcoinOSversion="x86_64-linux-gnu"
|
||||
fi
|
||||
|
||||
|
||||
echo
|
||||
echo "*** BITCOIN CORE v${bitcoinVersion} for ${bitcoinOSversion} ***"
|
||||
|
||||
@ -76,7 +76,7 @@ if [ "$1" = "install" ]; then
|
||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||
exit 1
|
||||
else
|
||||
|
||||
|
||||
# check binary checksum test
|
||||
echo "- checksum test"
|
||||
# get the sha256 value for the corresponding platform from signed hash sum file
|
||||
@ -98,7 +98,7 @@ if [ "$1" = "install" ]; then
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# install
|
||||
sudo -u admin tar -xvf ${binaryName}
|
||||
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})"
|
||||
exit 1
|
||||
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
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
@ -148,7 +148,7 @@ if [ ${CHAIN} = signet ]; then
|
||||
elif [ ${CHAIN} = testnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||
fi
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ function removeParallelService() {
|
||||
sudo systemctl disable ${prefix}bitcoind
|
||||
sudo rm /etc/systemd/system/${prefix}bitcoind.service 2>/dev/null
|
||||
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
|
||||
sudo systemctl stop signetd
|
||||
sudo systemctl disable signetd
|
||||
@ -198,7 +198,7 @@ datadir=/mnt/hdd/bitcoin
|
||||
else
|
||||
echo "# /home/bitcoin/.bitcoin/bitcoin.conf is present"
|
||||
fi
|
||||
|
||||
|
||||
# make sure rpcbind is correctly configured
|
||||
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
|
||||
@ -243,7 +243,7 @@ signet.addnode=nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion:38
|
||||
|
||||
if [ ${CHAIN} = mainnet ];then
|
||||
sudo cp /home/admin/assets/bitcoind.service /etc/systemd/system/bitcoind.service
|
||||
else
|
||||
else
|
||||
# /etc/systemd/system/${prefix}bitcoind.service
|
||||
# based on https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service
|
||||
echo "
|
||||
@ -307,16 +307,16 @@ WantedBy=multi-user.target
|
||||
|
||||
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoind, ${prefix}bitcoinlog"
|
||||
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 "\
|
||||
alias ${prefix}bitcoin-cli=\"/usr/local/bin/bitcoin-cli\
|
||||
alias ${prefix}bitcoin-cli=\"sudo -u bitcoin /usr/local/bin/bitcoin-cli\
|
||||
-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
|
||||
fi
|
||||
if [ "$(alias | grep -c "alias ${prefix}bitcoinlog")" -eq 0 ];then
|
||||
if [ "$(alias | grep -c "alias ${prefix}bitcoinlog")" -eq 0 ];then
|
||||
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
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
@ -332,9 +332,9 @@ alias ${prefix}bitcoinlog=\"sudo tail -n 30 -f ${bitcoinlogpath}\"\
|
||||
fi
|
||||
|
||||
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
|
||||
echo
|
||||
echo "# Monitor the ${prefix}bitcoind with:"
|
||||
echo "# sudo tail -f /mnt/hdd/bitcoin/${prefix}debug.log"
|
||||
echo
|
||||
|
@ -58,7 +58,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
rm -f node-$VERSION-$DISTRO.tar.xz*
|
||||
exit 1
|
||||
fi
|
||||
echo "OK the checkdum of nodeJS is OK"
|
||||
echo "OK the checksum of nodeJS is OK"
|
||||
sleep 3
|
||||
# install
|
||||
sudo mkdir -p /usr/local/lib/nodejs
|
||||
|
@ -59,19 +59,16 @@ if [ "$1" = getvars ];then
|
||||
# zmqprefix is: 28 | 21 | 23
|
||||
if [ "${chain}" == "main" ];then
|
||||
netprefix=""
|
||||
L1rpcportmod=""
|
||||
L2rpcportmod=0
|
||||
portprefix=""
|
||||
zmqprefix=28
|
||||
elif [ "${chain}" == "test" ];then
|
||||
netprefix="t"
|
||||
L1rpcportmod=1
|
||||
L2rpcportmod=1
|
||||
portprefix=1
|
||||
zmqprefix=21
|
||||
elif [ "${chain}" == "sig" ];then
|
||||
netprefix="s"
|
||||
L1rpcportmod=3
|
||||
L2rpcportmod=3
|
||||
portprefix=3
|
||||
zmqprefix=23
|
||||
@ -114,9 +111,9 @@ if [ "$1" = getvars ];then
|
||||
# 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\""
|
||||
# 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
|
||||
|
||||
#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