State Sync
state-sync is a feature that allows nodes to quickly sync their state by fetching a snapshot of the application state at a specific block height. This greatly reduces the time required for node to sync with the network, compared to the default method of replaying all blocks from the genesis block. An advantage of state-sync is that the database is very small in comparison to a fully synced node, therefore using state-sync to resync your node to the network can help keep running costs lower by minimizing storage usage.
Note: A snapshot-enabled RPC and from a trusted block height is required for state-sync.
Set SNAP_RPC variable to the snapshot RPC
SNAP_RPC="https://testnet-rpc.side.one:443"
Fetch the
LATEST_HEIGHT
from the snapshot RPC, set the state-syncBLOCK_HEIGHT
and fetch theTRUST_HASH
from the snapshot RPC. TheBLOCK_HEIGHT
to sync is determined by subtracting the snapshot-interval from theLATEST_HEIGHT
.Check variables to ensure they have been set
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
Set the required variables in ~/.side/config/config.toml
Stop the node and reset the node database
Restart node and check logs
Last updated