2019-06-15 23:02:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
source /usr/share/mynode/mynode_config.sh
|
|
|
|
|
|
|
|
if [ -f $QUICKSYNC_DIR/.quicksync_complete ] && [ -f $QUICKSYNC_DIR/.quicksync_download_complete ]; then
|
|
|
|
echo "Exiting quicksync_complete. Quicksync already completed. This was just a re-download."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Mark download complete
|
|
|
|
touch $QUICKSYNC_DIR/.quicksync_download_complete
|
|
|
|
sync
|
|
|
|
|
|
|
|
# Copy files
|
|
|
|
echo "quicksync_copy" > $MYNODE_DIR/.mynode_status
|
2019-08-01 02:46:22 +00:00
|
|
|
rm -rf $MYNODE_DIR/bitcoin/blocks/
|
|
|
|
rm -rf $MYNODE_DIR/bitcoin/chainstate/
|
2019-08-08 01:46:58 +00:00
|
|
|
#tar -xvf $QUICKSYNC_DIR/blockchain*.tar.gz -C $MYNODE_DIR/bitcoin/ --dereference
|
|
|
|
pv -L 15m $QUICKSYNC_DIR/blockchain*.tar.gz | tar xzvf - -C $MYNODE_DIR/bitcoin/ --dereference
|
2019-06-15 23:02:44 +00:00
|
|
|
|
2019-08-01 02:46:22 +00:00
|
|
|
# Mark quicksync complete and give BTC a few minutes to startup with its new data
|
2019-06-15 23:02:44 +00:00
|
|
|
touch $QUICKSYNC_DIR/.quicksync_complete
|
|
|
|
sync
|
2019-08-01 02:46:22 +00:00
|
|
|
sleep 5m
|
|
|
|
echo "stable" > $MYNODE_DIR/.mynode_status
|
|
|
|
sync
|
2019-06-15 23:02:44 +00:00
|
|
|
|
|
|
|
exit 0
|