StateSync Configuration
Run the following commands on your server to configure StateSync for La Tanda.
1. Stop Service and Backup
sudo systemctl stop latandad
cp $HOME/.latanda/data/priv_validator_state.json $HOME/.latanda/priv_validator_state.json.backup
2. Reset Chain Data
# CometBFT
latandad comet unsafe-reset-all --home $HOME/.latanda --keep-addr-book
# Tendermint (legacy)
# latandad tendermint unsafe-reset-all --home $HOME/.latanda --keep-addr-book
3. Configure StateSync
SNAP_RPC="https://latanda-rpctest.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://latanda-rpctest.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/.latanda/config/config.toml
5. Restart Service
sudo systemctl restart latandad
sudo journalctl -u latandad -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