Skip to main content

Sync

This guide will walk you through how to sync the chain from genesis or use a snapshot for a quicker sync.

☢️Setup for successful sync

Before you attempt to sync your node, confirm that you have properly set up your system configuration and built JMES core.

Sync from genesis

JMES-testnet-1

  1. Update the persistent_peers setting with a list of stable persistent peers in your config.toml file. Use the following commands:

_2
PEERS=2a39d42bb299b913e5dbbaf9a5e458fb3ff7536b@164.92.191.45:26656,eb490967a016bbcb361ab2ba1f6d2a2ca1eb8593@46.101.197.51:26656
_2
sed -i.bak -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.jmes/config/config.toml

  1. Finally, you can start the syncing process:

_3
jmesd start
_3
# OR
_3
systemctl start jmesd # runs as a system service in the background

☢️Sync start times

Nodes take about an hour to start syncing. This wait time is normal. Before troubleshooting a sync, please wait an hour for the sync to start.

From here, you can monitor the sync. Make sure to check on your node periodically to ensure optimal performance.

Udo mainnet

  1. Update the persistent_peers setting with a list of stable persistent peers in your config.toml file. Use the following commands:

_2
PEERS=2a39d42bb299b913e5dbbaf9a5e458fb3ff7536b@164.92.191.45/:26656,eb490967a016bbcb361ab2ba1f6d2a2ca1eb8593@46.101.197.51:26656
_2
sed -i.bak -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.jmes/config/config.toml

  1. Finally, you can start the syncing process:

_3
jmesd start
_3
# OR
_3
systemctl start jmesd # runs as a system service in the background

☢️Sync start times

Nodes take about an hour to start syncing. This wait time is normal. Before troubleshooting a sync, please wait an hour for the sync to start.

From here, you can monitor the sync. Make sure to check on your node periodically to ensure optimal performance.

Healthy Node Status Example


_31
{
_31
"NodeInfo": {
_31
"protocol_version": { "p2p": "8", "block": "11", "app": "0" },
_31
"id": "c7323e759deafdc953e86344fd42cdb7654f18f2",
_31
"listen_addr": "165.232.126.11:26656",
_31
"network": "jmes-testnet-1",
_31
"version": "v0.34.21-terra.1",
_31
"channels": "40202122233038606100",
_31
"moniker": "rockbridge",
_31
"other": { "tx_index": "on", "rpc_address": "tcp://165.232.126.11:26657" }
_31
},
_31
"SyncInfo": {
_31
"latest_block_hash": "831AE8E7CA3CFEC269DA4A800C7EAD8F7FF9EF072A8691BE21263F47FCA8E23C",
_31
"latest_app_hash": "128F4B8FA0BB0F85CE47CA0B871704D014C2B6CA702B7A11DE584C1C351F9252",
_31
"latest_block_height": "4293",
_31
"latest_block_time": "2023-05-04T01:02:12.387416454Z",
_31
"earliest_block_hash": "A121600E4F9338A276F7BDC1ED11BA3F20B06E20709A68CCF37D03B96BE44A50",
_31
"earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
_31
"earliest_block_height": "1",
_31
"earliest_block_time": "2023-05-03T18:34:13.094118969Z",
_31
"catching_up": true
_31
},
_31
"ValidatorInfo": {
_31
"Address": "6868853EC398BB6A860FA516D9334B923B7AF26E",
_31
"PubKey": {
_31
"type": "tendermint/PubKeyEd25519",
_31
"value": "dkOFal7VimemCDGfxgOJY9XmqbQF1NAegXBSM0IO8WQ="
_31
},
_31
"VotingPower": "0"
_31
}
_31
}

Fast-sync for testing

Sometimes you may want to sync faster by foregoing checks. You may do so by adding the following flag to the jmesd start command.

☢️caution

The following command should only be used by advanced users in non-production environments:


_1
jmesd start --x-crisis-skip-assert-invariants

Sync from snapshot

You can significantly accelerate the synchronization process by providing jmesd with a recent snapshot of the network state. Snapshots are made publicly available by members of the JMES community one example can be downloaded from Polkachu - Udo Mainnet. Polkachu - Pisco Testnet is provided by Polkachu, and not maintained as part of this documentation.

Before using snapshots

Certain files will need to be absent or deleted before downloading a snapshot. A quicksync replaces blockchain data with a custom snapshot. For most use cases, a "pruned" version is adequate. Pruned versions will have certain transactions removed from the archive to improve node performance. If you are running a node for archival purposes, you will want an archive or default download.

After choosing the appropriate download type, examine your node and ensure that .jmes/data is empty.

Example:


_1
6:22PM INF Removed all blockchain history dir=/home/ubuntu/.jmes/data

☢️caution

If you are a validator, ensure that you do not remove your private key.

Example of a removed private key:


_1
6:22PM INF Reset private validator file to genesis state keyFile=/home/ubuntu/.jmes/config/priv_validator_key.json stateFile=/home/ubuntu/.jmes/data/priv_validator_state.json

If you have an address book downloaded, you may keep it. Otherwise, you will need to download the appropriate addressbook.

With an address book downloaded, run the following:


_3
jmesd start
_3
jmesd status
_3
# It will take a few seconds for jmesd to start.

Monitor the sync

Your node is catching up with the network by replaying all the transactions from genesis and recreating the blockchain state locally. You can verify this process by checking the latest_block_height in the SyncInfo of the jmesd status response:


_7
{
_7
"SyncInfo": {
_7
"latest_block_height": "42", <-----
_7
"catching_up" : true
_7
},
_7
...
_7
}

Sync complete

You can tell that your node is in sync with the network when SyncInfo.catching_up in the jmesd status response returns false and the latest_block_height corresponds to the public network blockheight.


_1
jmesd status

Example:


_7
{
_7
"SyncInfo": {
_7
"latest_block_height": "7356350",
_7
"catching_up" : false
_7
},
_7
...
_7
}

Congratulations!

You've successfully joined a network as a full node operator. If you are a validator, continue to manage a JMES validator for next steps.