Skip to main content

Bootstrap Chaindata

0. Introduction

This guide will help to speed up the Core Node sync process by downloading a set of chaindata files and extracting them into the local folder. Normally the synchronization process takes days to reach the highest block when the Core Node starts synchronization from scratch. Using the bootstrap script the process is reduced to hours.

The following actions are executed by the script:

  • Check if the NodeMon is running and stop it.
  • Check if the Core Node is running and stop it.
  • Check the existing chaindata file and ask the user if want to remove it.
  • If the remove chaindata option is selected, chaindata file is removed.
  • Start the download of the new chaindata file.
  • Start Core Node.
  • Start NodeMon.

1. Connect & login to your VPS

info

You can open a console window on the admin portal of your VPS provider (example: Vultr, Contabo, AWS, etc.) or use any SSH (secure shell) software to connect to the VPS. If you’re using Windows, we recommend PuTTY.

Success

On Mac and Linux both ssh and sftp already come with the system to login and securely transfer files.

1.2. - Connect from Windows

We will assume that you are using PuTTY.

In order to connect to your VPS, enter your server’s IP address, make sure SSH and Port 22 are selected and then click on Open:

putty-1.png

Success

You may get a security alert about the server’s rsa2 key fingerprint.

Just click Yes to trust the server and connect via SSH.

putty-2.png

Enter the username (nrgstaker) and password.

putty-3.png

Success

You are now connected to your VPS!

1.3. - Connect from Mac/Linux

In order to login to your VPS, open a Terminal and type this command in the following format:

ssh user@server_ip_address
# Example:
ssh root@144.202.73.194

Enter the username (nrgstaker) and password.

putty-3.png

Success

You are now connected to your VPS!

2. Running the bash script

Once logged on the nrgstaker user, run:

bash -ic "$(wget -4qO- -o- raw.githubusercontent.com/energicryptocurrency/energi3-provisioning/master/scripts/linux/sync-core-node.sh)" ; source ~/.bashrc

2.1. - The script will stop the NodeMon ( if it’s running ), will stop the Core Node, and will ask for confirmation to remove the current chaindata folder hosted in your node, press “Y” and then the [ ENTER ] key.

remove-chaindata.png

2.2. - Once confirmed, it will start to download a set of chaindata files and will extract them into the .energicore3 directory, the process will take 1-2 hours depending on the internet speed of the server where the node is hosted. Leave the console open until the process finishes.

end-chaindata.png

The NodeMon and Core Node will start automatically once the script finishes extracting the last chaindata file.

3. Accessing the Core Node

Run the following command to enter the console:

energi3 attach

3.1. - Once the console is attached, check the sync process by running:

nrg.syncing

It will return with an object. The value of currentBlock will need to reach the value of the heightesBlock parameter, wait some minutes, once the node is fully synced with the blockchain, the nrg.syncing command will return as false.

nrg.syncing.png

synced.png