var img = document.createElement('img'); img.src = "https://terradocs.matomo.cloud//piwik.php?idsite=1&rec=1&url=https://docs.terra.money" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
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 Terra core.

There are two types of syncs you can perform.

To speed up a sync for testing purposes, you can forego checks.

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 Terra community, such as Polkachu Phoenix mainnet snapshotor the Polkachu Pisco testnet snapshot. These snapshots are provided by Polkachu, and are 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.

Snapshot sync

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

Example:

Terminal
Copy

_2
_2
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:

Terminal
Copy

_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

  1. If you have an address book downloaded, you may keep it. Otherwise, you will need to download the appropriate addressbook. Then you can run the following:
Terminal
Copy

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

Sync from genesis

The process for syncing your full node from genesis will differ between the Pisco testnet and Phoenix mainnet networks.

Pisco testnet

To sync a Pisco testnet node, you will need to use version v2.0.0-rc.0 of terrad up until the block height of 838500. To sync your node from block 838500 until block 2777777, you will need to use version v2.1.0-beta.1 of terrad. From block 2777777 until 4712048, use version v2.2.0 of terrad. From block 4712048 until 6272928, use version v2.3.0-rc.0 of terrad. From block 6272928 to until block 7432000, use v2.4.0-rc5. From block 7432000 onwards, use v2.5.0-rc5.

  1. To switch to version v2.0.0-rc.0 of terrad, change into your core directory and execute the following commands in your terminal:
Terminal
Copy

_2
git checkout v2.0.0-rc.0
_2
make install

After running these commands, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.0.0-rc.0.

  1. After you have the correct terrad version, you will need to download the genesis file for Pisco in the terrad config directory:
Terminal
Copy

_1
wget https://raw.githubusercontent.com/terra-money/testnet/master/pisco-1/genesis.json -O ~/.terra/config/genesis.json

  1. Next, update the persistent_peers setting with a list of stable persistent peers in your config.toml file.

  2. Now, you can start the syncing process:

Terminal
Copy

_1
terrad start

☢️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.

Syncing will halt at block 838500, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Pisco testnet node from block 838500 to block 2777777 you will need to navigate to the core directory and change your terrad version to v2.1.0-beta.1.
Terminal
Copy

_2
git checkout v2.1.0-beta.1
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.1.0.

  1. Again, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 2777777, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Pisco testnet node from block 2777777 to block 4712048, you will need to navigate to the core directory and change your terrad version to v2.2.0.
Terminal
Copy

_2
git checkout v2.2.0
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.2.0.

  1. Now, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 4712048, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Pisco testnet node from block 4712048 to the most recent block, you will need to navigate to the core directory and change your terrad version to v2.3.0-rc.0.
Terminal
Copy

_2
git checkout v2.3.0-rc.0
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.3.0-rc.0.

  1. Now, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 6272928, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Pisco testnet node from block 6272928 to block 7432000, you will need to navigate to the core directory and change your terrad version to v2.4.0-rc5.
Terminal
Copy

_2
git checkout v2.4.0-rc5
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.4.0.

  1. Now, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 7432000, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Pisco testnet node from block 7432000 to the most recent block, you will need to navigate to the core directory and change your terrad version to v2.5.0-rc5.
Terminal
Copy

_2
git checkout v2.5.0-rc5
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.5.0.

  1. Now, you can resume and finalize the syncing process:
Terminal
Copy

_1
terrad start

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

Phoenix mainnet

If you would like to sync your node using the Phoenix mainnet, you will need to use version v2.0.0 of terrad up until the block height of 890000. To sync your node from block 890000 to block 2979805, you will need to use version v2.1.1 of terrad. From block 2979805 until block 4711800, use version v2.2.0 of terrad until block 4711800. From block 4711800 until block 5994365, use version v2.3.0. From block 5994365 until block 7316000, use version v2.4.0. From block 7316000 until block 7722000, use version v2.5.2. From block 7722000 onward, use version v2.6.1 to complete the sync.

  1. To switch to version v2.0.0 of terrad, change into your core directory and execute the following commands in your terminal:
Terminal
Copy

_2
git checkout v2.0.0
_2
make install

After running these commands, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.0.0.

  1. After you have the correct terrad version, you will need to download the genesis file for Phoenix in the terrad config directory:
Terminal
Copy

_1
wget https://phoenix-genesis.s3.us-west-1.amazonaws.com/genesis.json -O ~/.terra/config/genesis.json

  1. Next, download the addrbook.json file containing a list of stable persistent peers into the ~/.terra/config/ directory:
Terminal
Copy

_1
wget https://snapshots.polkachu.com/addrbook/terra/addrbook.json -O ~/.terra/config/addrbook.json

  1. Now, you can start the syncing process:
Terminal
Copy

_1
terrad start

☢️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.

Syncing will halt at block 890,000, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Phoenix mainnet node from block 890000 to block 2979805, you will need to navigate to the core directory and change your terrad version to v2.1.1.
Terminal
Copy

_2
git checkout v2.1.1
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.1.1.

  1. Again, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 2979805, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Phoenix mainnet node from block 2979805 to block 4711800, you will need to navigate to the core directory and change your terrad version to v2.2.0.
Terminal
Copy

_2
git checkout v2.2.0
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.2.0.

  1. again, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 4711800, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Phoenix mainnet node from block 4711800 to block 5994365, you will need to navigate to the core directory and change your terrad version to v2.3.1.
Terminal
Copy

_2
git checkout v2.3.1
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.3.1.

  1. Now, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 5994365, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Phoenix mainnet node from block 5994365 until block block 7316000, you will need to navigate to the core directory and change your terrad version to v2.4.0.
Terminal
Copy

_2
git checkout v2.4.0
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.4.0.

  1. Now, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 7316000, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Phoenix mainnet node from block 7316000 until block block 7722000, you will need to navigate to the core directory and change your terrad version to v2.5.2.
Terminal
Copy

_2
git checkout v2.5.2
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.5.2.

  1. Now, you can resume the syncing process:
Terminal
Copy

_1
terrad start

Syncing will halt at block 7316000, at which point you will need to change the version of terrad and then resume the syncing process.

  1. To sync your Phoenix mainnet node from block 7722000 to the most recent block, you will need to navigate to the core directory and change your terrad version to v2.6.1.
Terminal
Copy

_2
git checkout v2.6.1
_2
make install

Again, make sure that you have switched to the correct version of terrad by running the following command:

Terminal
Copy

_1
terrad version

The result of this command should be v2.6.1.

  1. Now, you can resume and finalize the syncing process:
Terminal
Copy

_1
terrad start

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

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
}

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 terrad start command.

☢️caution

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

Terminal
Copy

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

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:

Response
Copy

_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.

Terminal
Copy

_1
terrad status

Example:

Example
Copy

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

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

Congratulations!

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