StateSync Configuration
Run the following commands on your server to configure StateSync for Axone.
1. Stop Service and Backup
sudo systemctl stop axoned
cp $HOME/.axoned/data/priv_validator_state.json $HOME/.axoned/priv_validator_state.json.backup
2. Reset Chain Data
# CometBFT
axoned comet unsafe-reset-all --home $HOME/.axoned --keep-addr-book
# Tendermint (legacy)
# axoned tendermint unsafe-reset-all --home $HOME/.axoned --keep-addr-book
3. Configure StateSync
SNAP_RPC="https://axone-rpc.codeblocklabs.com"
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)
echo "LATEST_HEIGHT=$LATEST_HEIGHT"
echo "BLOCK_HEIGHT=$BLOCK_HEIGHT"
echo "TRUST_HASH=$TRUST_HASH"
4. Apply StateSync Settings
SNAP_RPC="https://axone-rpc.codeblocklabs.com"
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)
sed -i.bak "/\[statesync\]/,/^enable =/ s/=.*/= true/" \
-e "/^rpc_servers =/ s|=.*|= \"$SNAP_RPC,$SNAP_RPC\"|" \
-e "/^trust_height =/ s|=.*|= $BLOCK_HEIGHT/" \
-e "/^trust_hash =/ s|=.*|= \"$TRUST_HASH\"/" $HOME/.axoned/config/config.toml
5. Restart Service
sudo systemctl restart axoned
sudo journalctl -u axoned -f -o cat
After restarting, check the logs to confirm the node is syncing via StateSync. You should see logs indicating state sync is in progress.
CodeBlockLabs