State Sync
Clean previous configuration
sed -i "/\[statesync\]/, /^enable =/ s/=.*/= false/;\
/^rpc_servers =/ s|=.*|= \"\"|;\
/^trust_height =/ s/=.*/= 0/;\
/^trust_hash =/ s/=.*/= \"\"/" $HOME/.cheqdnode/config/config.toml
Stop your node
sudo systemctl stop cheqd
Config parameters
SNAP_RPC="https://rpc-cheqd.blockval.io:443"
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)
Check parameters
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
Save config
sed -i "/\[statesync\]/, /^enable =/ s/=.*/= true/;\
/^rpc_servers =/ s|=.*|= \"$SNAP_RPC,$SNAP_RPC\"|;\
/^trust_height =/ s/=.*/= $BLOCK_HEIGHT/;\
/^trust_hash =/ s/=.*/= \"$TRUST_HASH\"/" $HOME/.cheqdnode/config/config.toml
Check parameters
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
Backup your validator state ,reset data and finally restore your validator state
cp $HOME/.cheqdnode/data/priv_validator_state.json $HOME/.cheqdnode/priv_validator_state.json.backup
cheqd-noded tendermint unsafe-reset-all --home $HOME/.cheqdnode --keep-addr-book
mv $HOME/.cheqdnode/priv_validator_state.json.backup $HOME/.cheqdnode/data/priv_validator_state.json
Add wasm folder
curl -L https://snap.blockval.io/cheqd/cheqd-mainnet-1_wasm_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.cheqdnode/data
Start your node
sudo systemctl start cheqd
Make sure that your node is running
sudo service cheqd status
sudo journalctl -u cheqd -f