Skip to main content

Sync

Use this guide to sync the chain from from genesis or use a snapshot for a quicker sync.

Sync from genesis

After choosing a network, start the sync and check that everything is running smoothly:


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

Your node is now syncing. This process will take a long time. Make sure you've set it up on a stable connection so this process is not interrupted.

Sync start times

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

Healthy Node Status Example


_38
{
_38
"NodeInfo": {
_38
"protocol_version": {
_38
"p2p": "8",
_38
"block": "11",
_38
"app": "0"
_38
},
_38
"id": "821dc1401fd0270487b3e615c652181b4d4566dd",
_38
"listen_addr": "18.157.84.154:26656",
_38
"network": "pisco-1",
_38
"version": "v0.34.19-terra.2",
_38
"channels": "40202122233038606100",
_38
"moniker": "terradocs",
_38
"other": {
_38
"tx_index": "on",
_38
"rpc_address": "tcp://127.0.0.1:26657"
_38
}
_38
},
_38
"SyncInfo": {
_38
"latest_block_hash": "ED9F6D0855FD92A5BA2F91082CD49ADB18A07DCE3F747529D357071E5B7C0D4C",
_38
"latest_app_hash": "D621068882E7FC5045CDD957ADEABE9BF8E90F2092C9526E22BE4767940D128B",
_38
"latest_block_height": "260770",
_38
"latest_block_time": "2022-06-09T15:22:48.792283245Z",
_38
"earliest_block_hash": "F948EF10AA663D182309790C51E5A7A9125D7CF4D60D9E735994059DB7CAD4D4",
_38
"earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
_38
"earliest_block_height": "1",
_38
"earliest_block_time": "2022-05-23T06:00:00Z",
_38
"catching_up": false
_38
},
_38
"ValidatorInfo": {
_38
"Address": "04024A7F76485B0D2B99570EC7DA3E9A3B3735CC",
_38
"PubKey": {
_38
"type": "tendermint/PubKeyEd25519",
_38
"value": "KUqIsRD9yzPt7k9et+ClFp6h8wXwEIcb/TVZPrC57+I="
_38
},
_38
"VotingPower": "0"
_38
}
_38
}

Proceed to the section.

Fast-sync for testing

Sometimes you may want to sync faster by foregoing checks.

caution

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


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

Sync from snapshot

You can significantly accelerate the synchronization process by providing Terrad with a recent snapshot of the network state. Snapshots are made publicly available by members of the Fluid community one example can be downloaded from Polkachu - Phoenix Mainnet. Polkachu - Pisco Testnet are 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 .terra/data is empty.

Example:


_1
6:22PM INF Removed all blockchain history dir=/home/ubuntu/.terra/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/.terra/config/priv_validator_key.json stateFile=/home/ubuntu/.terra/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
terrad start
_3
terrad status
_3
# It will take a few seconds for terrad 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 terrad status response:


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

Compare this height to the Latest Blocks by checking the API for the latest block heights on Phoenix, or Pisco to see your progress.

Sync complete

You can tell that your node is in sync with the network when SyncInfo.catching_up in the terrad status response returns false and the latest_block_height corresponds to the public network blockheight found on the API for either Phoenix, or Pisco.


_1
terrad status

Example:


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

Validators can view the status of the network using Fluid Finder.

Congratulations!

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