Sync
This guide will walk you through how to sync the chain from genesis or use a snapshot for a quicker 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.
- Sync from snapshot: Quickly sync from a recent snapshot of the chain.
- Sync from genesis: Sync from the chain's genesis.
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
- After choosing the appropriate download type, examine your node and ensure that
.terra/data
is empty.
Example:
If you are a validator, ensure that you do not remove your private key.
Example of a removed private key:
- 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:
Sync from genesis
The process for syncing your full node from genesis will differ between the Pisco testnet and Phoenix mainnet networks.
- For the testnet, follow the Pisco testnet sync instructions.
- For the mainnet, follow the Pheonix mainnet sync instructions.
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
.
- To switch to version
v2.0.0-rc.0
of terrad, change into yourcore
directory and execute the following commands in your terminal:
After running these commands, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.0.0-rc.0
.
- After you have the correct terrad version, you will need to download the genesis file for Pisco in the terrad config directory:
-
Next, update the
persistent_peers
setting with a list of stable persistent peers in yourconfig.toml
file. -
Now, you can start the syncing process:
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.
- To sync your Pisco testnet node from block
838500
to block2777777
you will need to navigate to thecore
directory and change your terrad version tov2.1.0-beta.1
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.1.0
.
- Again, you can resume the syncing process:
Syncing will halt at block 2777777
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Pisco testnet node from block
2777777
to block4712048
, you will need to navigate to thecore
directory and change your terrad version tov2.2.0
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.2.0
.
- Now, you can resume the syncing process:
Syncing will halt at block 4712048
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Pisco testnet node from block
4712048
to the most recent block, you will need to navigate to thecore
directory and change your terrad version tov2.3.0-rc.0
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.3.0-rc.0
.
- Now, you can resume the syncing process:
Syncing will halt at block 6272928
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Pisco testnet node from block
6272928
to block7432000
, you will need to navigate to thecore
directory and change your terrad version tov2.4.0-rc5
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.4.0
.
- Now, you can resume the syncing process:
Syncing will halt at block 7432000
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Pisco testnet node from block
7432000
to the most recent block, you will need to navigate to thecore
directory and change your terrad version tov2.5.0-rc5
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.5.0
.
- Now, you can resume and finalize the syncing process:
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
until block 8782000
, use version v2.6.1
. From block 8782000
onward, use version v2.9.3
to complete the sync.
- To switch to version
v2.0.0
of terrad, change into yourcore
directory and execute the following commands in your terminal:
After running these commands, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.0.0
.
- After you have the correct terrad version, you will need to download the genesis file for Phoenix in the terrad config directory:
- Next, download the
addrbook.json
file containing a list of stable persistent peers into the~/.terra/config/
directory:
- Now, you can start the syncing process:
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.
- To sync your Phoenix mainnet node from block
890000
to block2979805
, you will need to navigate to thecore
directory and change your terrad version tov2.1.1
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.1.1
.
- Again, you can resume the syncing process:
Syncing will halt at block 2979805
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Phoenix mainnet node from block
2979805
to block4711800
, you will need to navigate to thecore
directory and change your terrad version tov2.2.0
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.2.0
.
- again, you can resume the syncing process:
Syncing will halt at block 4711800
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Phoenix mainnet node from block
4711800
to block5994365
, you will need to navigate to thecore
directory and change your terrad version tov2.3.1
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.3.1
.
- Now, you can resume the syncing process:
Syncing will halt at block 5994365
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Phoenix mainnet node from block
5994365
until block block7316000
, you will need to navigate to thecore
directory and change your terrad version tov2.4.0
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.4.0
.
- Now, you can resume the syncing process:
Syncing will halt at block 7316000
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Phoenix mainnet node from block
7316000
until block block7722000
, you will need to navigate to thecore
directory and change your terrad version tov2.5.2
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.5.2
.
- Now, you can resume the syncing process:
Syncing will halt at block 7316000
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Phoenix mainnet node from block
7722000
until block block8782000
, you will need to navigate to thecore
directory and change your terrad version tov2.6.1
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.6.1
.
- Now, you can resume the syncing process:
Syncing will halt at block 8782000
, at which point you will need to change the version of terrad and then resume the syncing process.
- To sync your Phoenix mainnet node from block
8782000
to the most recent block, you will need to navigate to thecore
directory and change your terrad version tov2.9.3
.
Again, make sure that you have switched to the correct version of terrad by running the following command:
The result of this command should be v2.9.3
.
- Now, you can resume and finalize the syncing process:
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.
The following command should only be used by advanced users in non-production environments:
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:
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.
Example:
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.