fix sync bitcoin

This commit is contained in:
rootzoll 2019-12-14 02:36:18 +01:00
parent f90884f4ac
commit dad7c556d0
2 changed files with 5 additions and 7 deletions

View File

@ -73,8 +73,8 @@ echo "*** Activating Blockain Sync ***"
sudo mkdir /mnt/hdd/${network} 2>/dev/null
sudo /home/admin/XXcleanHDD.sh -blockchain -force
sudo mkdir /mnt/hdd/${network}/blocks 2>/dev/null
sudo mkdir /mnt/hdd/${network}/chainstate 2>/dev/null
sudo -u bitcoin mkdir /mnt/hdd/${network}/blocks 2>/dev/null
sudo -u bitcoin mkdir /mnt/hdd/${network}/chainstate 2>/dev/null
# set so that 10raspiblitz.sh has a flag to see that resync is running
sudo touch /mnt/hdd/${network}/blocks/.selfsync

View File

@ -2,7 +2,7 @@
## get basic info
source /home/admin/raspiblitz.info
source /mnt/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
echo ""
echo "*** 60finishHDD.sh ***"
@ -58,20 +58,18 @@ sudo cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.s
sudo systemctl daemon-reload
sudo systemctl enable ${network}d.service
sudo systemctl start ${network}d.service
echo "- Started ... wait 20 secs"
sleep 20
# check if bitcoin has started
bitcoinRunning=0
loopcount=0
while [ ${bitcoinRunning} -eq 0 ]
do
>&2 echo "# (${loopcount}/50) checking if ${network}d is running ... "
>&2 echo "# (${loopcount}/100) checking if ${network}d is running ... "
bitcoinRunning=$(${network}-cli getblockchaininfo 2>/dev/null | grep "initialblockdownload" -c)
sleep 2
sync
loopcount=$(($loopcount +1))
if [ ${loopcount} -gt 50 ]; then
if [ ${loopcount} -gt 100 ]; then
/home/admin/XXdebugLogs.sh
echo "***********************************"
echo "FAIL: ${network} failed to start :("