Use SCP to Copy Blocks and Chainsate Folders and Files From an Existing Node
This guide will only work if the destination node has NOT been secured by RSA-Key authorization
NOTE: These steps are only for those who have an existing node with a full copy of the blockchain; depending on your node's location, this may take between 5 and 10 minutes, if you have a fast connection for both nodes involved
- Preparing Nodes
- File Transfer
- Bring Source Node Online
- Start Destination Node
Source Node | Command & Description | Destination Node | |
---|---|---|---|
Preparing Nodes | |||
1 | You should see the following if zend is stopped Source Node zenops@node01:~$ sudo systemctl stop zend zentracker | Open a second terminal and SSH into your source node (left) with it's non-root user NOTE: You should now have two terminal windows open and connected to two separate nodes. Arrange the source node on the left side of your screen, and the destination node on the right side of your screen NOTE: The zend daemon should be stopped to prevent transfer errors in the following steps, the tracker is also stopped to limit errors from the source node (left)
sudo systemctl stop zend zentracker
zen-cli stop
zen-cli getinfo | You should see the following if zend is stopped Destination Node zenops@node02:~$ zen-cli stop |
File Transfer - Transfer blocks and chainstate folders and files recursively to the destination node from the source node | |||
2 | DON'T RUN THIS UNTIL AFTER THE COMMAND FOR THE DESTINATION NODE HAS BEEN EXECUTED! Source Node zenops@node01:~$ scp -r ~/.zen/blocks/* zenops@node02.zentest.win:~/.zen/blocks/ zenops@node01:~$ scp -r ~/.zen/chainstate/* zenops@node02.zentest.win:~/.zen/chainstate/ | Executed from the destination node (right)
rm -rf ~/.zen/blocks/* rm -rf ~/.zen/chainstate/* ____________________________________________________________________________________________________ Executed from the source node (left)
scp -r ~/.zen/blocks/* <D_USER>@<D_FQDN>:~/.zen/blocks/ scp -r ~/.zen/chainstate/* <D_USER>@<D_FQDN>:~/.zen/chainstate/ | RUN ON THE DESTINATION NODE FIRST, DO NOT RUN ON THE SOURCE NODE! Destination Node zenops@node02:~$ rm -r ~/.zen/blocks/* NOTE: You may get an error if these files do not exist, you can ignore this |
Bring Source Node Online | |||
3 | Start zend and zentracker on the source node (left)
sudo systemctl start zend && sleep 8 && sudo systemctl start zentracker
exit | ||
Start Destination Node | |||
4 | Execute the zend daemon on the destination node (right) with the rescan option
NOTE: If your node is using systemd or monit and pm2, start those after the following, using instructions from step 3
sudo chown -R $USER ~/.zen/{blocks,chainstate}
zend --rescan && sleep 30
watch -n 30 zen-cli getblockcount
| Destination Node Every 30.0s: zen-cli getblockcount.............................................Fri Jun 8 08:25:24 2018 321301 | |
Continue With Installation Guide | |||
5 | Return to part 3, step 17 Part 3.17 - Package Installation and Initial Configuration << Click Here |