Skip to main content
Follow this guide to join an existing network through statesync. To quickly spin up a fresh full node and join in the network, it’s recommended to sync through state sync.

State Sync

State sync allows a new node to join a network by fetching a snapshot of the application state at a recent height instead of fetching and replaying all historical blocks. This can reduce the time needed to sync with the network from days to minutes.
RocksDB support for the SeiDB state store will be removed. No target release has been published. Set ss-backend = "pebbledb" before you start state sync, especially when rebuilding a node that previously used RocksDB. See Move off RocksDB for the full migration checklist.
Do not use state sync to migrate an archive node. State sync starts from a recent height and does not preserve the earlier state-store versions. Follow the archive-node guidance in Move off RocksDB.

Clean Up

If you are not starting a node from fresh, then you need to do some backups and clean ups.
Note: This step is not needed for fresh nodes.
Assuming your sei home directory is $HOME/.sei, back up priv_validator_key.json and priv_validator_state.json:
Reset the state:
Finally, remove the existing data and wasm folders and restore the priv_validator_state.json: First, print the state-store section from app.toml:
If ss-db-directory or evm-ss-db-directory points outside $HOME/.sei/data, back up anything you need and clear the old state-store data there as well. The commands below do not remove custom directories. A PebbleDB state sync must not reuse RocksDB data.

Statesync script

Set up the RPC servers for primary and secondary endpoints. You can use one of these RPC endpoints for Statesyning For STATE_SYNC_RPC, pick:
  • mainnet (pacific-1): https://sei-rpc.polkachu.com:443 or https://rpc.sei-apis.com:443
  • testnet (atlantic-2): https://sei-testnet-rpc.polkachu.com:443 or https://rpc-testnet.sei-apis.com:443
For STATE_SYNC_PEER, pick the below as persistent-peers:
  • mainnet (pacific-1):
  • testnet (atlantic-2):
The script sets up trust_height and trust_hash automatically. Each statesync snapshot is created at a certain block height. The script uses the best practice here and sets the trust height to be earlier than the latest snapshot block height to avoid backward verifications. Script that you can use:
state_sync.sh
Confirm that the script output includes ss-backend = "pebbledb". If the key is absent, add it directly below [state-store] before you start seid. Finally start the daemon:

Troubleshooting statesync

Q: I can’t connect to the state sync url. A: Try another statesync url in that case and inform us in the Sei Tech Chat. Q: The statesync finishes, but immediately get AppHash errors upon regular block syncing: A: Make sure that you use the latest version of the chain node when you state-sync. Q: The statesync randomly stops. A: State-sync can be flaky at times, just try again. Please give it around 4-5 tries. Join our Sei Tech Chat for help if you have any issues.