Part 3c - Bootstrap From an Existing Node (SCP Method)

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 NodeCommand & DescriptionDestination Node

Preparing Nodes
1

You should see the following if zend is stopped

Source Node

zenops@node01:~$ sudo systemctl stop zend zentracker
zenops@node01:~$ zen-cli getinfo
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)

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)

  • Execute the following on the source node (left)
sudo systemctl stop zend zentracker
  • Execute the following on the destination node (right)
zen-cli stop
  • Verify zend is stopped on both the source node (left) and destination node (right)
zen-cli getinfo

You should see the following if zend is stopped

Destination Node

zenops@node02:~$ zen-cli stop
Zen server stopping
zenops@node02:~$ zen-cli getinfo
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)


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)

  • Remove all files and folders from the blocks and chainstate directories on destination node (right)
rm -rf ~/.zen/blocks/*
rm -rf ~/.zen/chainstate/*

____________________________________________________________________________________________________

Executed from the source node (left)

  • Replace <D_USER> with the non-root user of the destination node, replace <D_FQDN> with the fully-qualified domain name of the destination node, remove <brackets>
  • When prompted, enter the non-root user password for the destination node to execute the transfer
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/*
zenops@node02:~$ rm -r ~/.zen/chainstate/*

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)

  • Execute the following on the source node (left)
sudo systemctl start zend && sleep 8 && sudo systemctl start zentracker
  • You may exit from the source node (left) and close your terminal
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

  • Change ownership of blocks and chainstate folders recursively to the current user
sudo chown -R $USER ~/.zen/{blocks,chainstate}
  • Start the zen daemon with rescanning
zend --rescan && sleep 30
  • Check your current block count every 30 seconds
watch -n 30 zen-cli getblockcount
  • Your destination node (right) has been successfully bootstrapped after verifying your blocks match the block height on the explorer linked above
  • exit the command with CTRL + c
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

Bootstrap From an Existing Node (SCP Method)



© 2020 Horizen. All rights reserved.