State Sync Troubleshooting / Resetting Chain Data

Steps for resetting / re-syncing a state synced node (or recovering from a failed state sync).

State Sync Failed!?

There are three main reasons why a state sync will fail:

  • RPC connection fails, or is rate limited

  • Not enough healthy peers / seeds configured

  • Incorrect trusted height / trusted hash

Steps to reset chain data without losing your accounts:

1) Stop the node process with ctrl^c (or sudo systemctl stop layer if it's a service)

2) Remove the chain data from ~/.layer/data/, being careful to NOT delete the priv_validator_state.json file:

# Delete the binaries
# This is useful if you're not sure that you downloaded the right binaries:
rm -rf ~/layer/binaries

# deletes chain data
# This is useful if state sync fails and you need to try a different config
rm -rf ~/.layer/data/application.db; \
rm -rf ~/.layer/data/blockstore.db; \
rm -rf ~/.layer/data/cs.wal; \
rm -rf ~/.layer/data/evidence.db; \
rm -rf ~/.layer/data/snapshots; \
rm -rf ~/.layer/data/state.db; \
rm -rf ~/.layer/data/tx_index.db

Next, open up your configs.

Use ctrl^w to search, or scroll down to the [p2p] section.

Try manually editing the seeds and persistent_peers to match those shown here.

In most cases addr_book_strict can be safely changed to true.

Find the [statesync] section.

Take a moment to check that enable = true , and check that your rpc_servers, trust_height , and trust_hash are configured using the steps shown in Node Setup. (be careful to choose the tabs that match your system)

The trust_period should be left alone, and the discovery_time can be safely increased to "30s".

Start your Node

If the sync is working, you will see your node quickly finding, downloading, and applying snapshots.

Last updated