Advance

Upgrading and Checking a Node using Node Binary

In this tutorial, we will go through the process of upgrading and checking a node using the node binary on the Harmony blockchain. We will start by backing up the necessary files and downloading the node binary. Then, we will restart the systemd service and check the node version and syncing status. Finally, we will verify that the node has caught up to the latest block height. These steps will help ensure that your node is running smoothly and up-to-date on the Harmony network.

Upgrading A Node

1. Backup Files

Create a folder called “backup” in case it does not exist:

//Create folder
mkdir -p backup

Backup the harmony binary file:

//Backup
cp harmony backup

2. Download Node Binary

Before we proceed to next steps we need to download the node binary first:

Mainnet

//Mainnet
curl -LO https://harmony.one/binary && mv binary harmony && chmod +x harmony

Testnet

//Testnet
curl -LO https://harmony.one/binary_testnet && mv binary_testnet harmony && chmod +x harmony

Check the node binary version that was downloaded:

//Version
./harmony -V

3. Restart Systemd Service

//Restart service
sudo service harmony restart

To check your node follow instructions on Checking a Node

Non-Validating/Explorer Nodes

 

Explorer Node: Recommendation

Setup: AWS i3en.12xlarge or equivalent, with local disk storage Storage: ~24TB (4x NVMe SSD) is recommended for Archival Explorer Nodes on Shard 0 OS: Latest Ubuntu Linux (LTS Version) Network: 100M+ bandwidth

1. Download New Explorer DB

//Download new explorer DB
wget https://s3.us-west-1.amazonaws.com/pub.harmony.one/mainnet.archival/harmony_storage_db_0/explorer_storage_s0.tar.gz

2. Backup Files

mkdir -p backup
cp harmony backup

3. Download Node Binary and Stop Service

curl -LO https://harmony.one/binary && mv binary harmony && chmod +x harmony

sudo service harmony stop

4. Backup Old Explorer DB

//Backup old explorer DB
mv explorer_storage_0.0.0.0_9000 explorer_storage_0.0.0.0_9000.backup

5. Extract New DB

//Extract new DB
tar xvzf explorer_storage_s0.tar.gz

6. Change RPC Rate Limit

Change harmony.conf file and add make sure the RPC Rate Limit is set to at least 50000:

[RPCOpt]
  RequestsPerSecond = 50000

7. Start Systemd Service

//Start service
sudo service harmony start

DB migration should take no more than a few hours to conclude.

Checking A Node

1. Check Node Running Version

To check the node version that is running, run the command below:

//Check node running version
./hmy utility metadata

2. Check if Node is Syncing

  1. To check if your node is syncing properly, run the command below and check that the block height of the shard(s).

 

1./hmy blockchain latest-headers

 

Harmony relies on a beacon shard chain (aka shard 0) to facilitate cross shard transaction. For the node to be fully working both your non shard 0 and shard 0 needs to be fully synced .

2. Before continuing, check if your node is fully synced using an external endpoint. Replace parameter --node with the endpoint you want to compare with. Check the examples below for shard 0 on mainnet and testnet. Just change the endpoints to do the comparison with other shards.

Mainnet

//Mainnet
./hmy --node="https://api.s0.t.hmny.io" blockchain latest-headers

Testnet

//Testnet
./hmy --node="https://api.s0.b.hmny.io" blockchain latest-headers

You can use the Block Explorers for a visual comparison.

3. Verify if the blocks shown on steps 1 and 2 are closer or equal to each other. If so, your node should have caught up!

By this, you complete this workshop successfully!!