Initia is a VM-agnostic network for 0-to-1 omnichain rollups, built by fusing a novel L1 with an interwoven application-specific L2 infrastructure system.
StateSync allows you to rapidly bootstrap a new node by syncing state machine snapshots at a given height, rather than downloading and replaying the entire blockchain history from genesis.
Using StateSync
Here is a step-by-step guide on how to set up StateSync:
Set the SNAP_RPC variable with the following command:
SNAP_RPC="https://initia-testnet-rpc.denodes.xyz:443"Get the latest height and trust hash with the following commands:
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)Update your configuration file:
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\\1\\"$SNAP_RPC,$SNAP_RPC\\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\\1\\"$TRUST_HASH\\"|" $HOME/.initia/config/config.tomlStop the initiad service:
systemctl stop initiadReset all Tendermint data:
initiad tendermint unsafe-reset-all --home $HOME/.initia --keep-addr-bookStart the initiad service:
systemctl start initiad