Testnet
State Sync

State Sync

Stop the service

1sudo systemctl stop initiad

Backup val state and reset data

1cp $HOME/.initia/data/priv_validator_state.json $HOME/.initia/priv_validator_state.json.backup
2initiad tendermint unsafe-reset-all --home $HOME/.initia

Enable State-sync config

1SNAP_RPC="https://rpc.t.initia.bh.rocks:443"
2
3LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height);
4BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000));
5TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
6
7echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && sleep 1
8
9sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ;
10s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ;
11s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ;
12s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ;
13s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.initia/config/config.toml

Restart node

1sudo systemctl restart initiad && sudo journalctl -u initiad -f