Skip to content

Choose a network

Height3,504,932 Producing blocks Chain IDlatanda-testnet-1 Version Explorer (opens in a new tab)

La Tanda testnet state sync

State sync starts a La Tanda testnet node from a recent block that our RPC serves, instead of replaying the chain's history.

Step 1: Stop the node, back up the validator state and reset

sudo service latanda stop
cp $HOME/.latanda/data/priv_validator_state.json $HOME/.latanda/priv_validator_state.json.backup
latandad tendermint unsafe-reset-all --home $HOME/.latanda --keep-addr-book

Step 2: Configure state sync

The commands read a trusted height and hash from https://latanda-testnet-rpc.stakerhouse.com, set the peer to sync from and restore the validator state.

SYNC_RPC="https://latanda-testnet-rpc.stakerhouse.com:443"
SYNC_PEER="6e5e4b1927dd476e4343c2c9b86f32b59bdce961@[2001:41d0:a:2ee1::1]:11956"
LATEST_HEIGHT=$(curl -s $SYNC_RPC/block | jq -r .result.block.header.height)
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000))
TRUST_HASH=$(curl -s "$SYNC_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i \
-e "s|^enable *=.*|enable = true|" \
-e "s|^rpc_servers *=.*|rpc_servers = \"$SYNC_RPC,$SYNC_RPC\"|" \
-e "s|^trust_height *=.*|trust_height = $BLOCK_HEIGHT|" \
-e "s|^trust_hash *=.*|trust_hash = \"$TRUST_HASH\"|" \
-e "s|^persistent_peers *=.*|persistent_peers = \"$SYNC_PEER\"|" \
$HOME/.latanda/config/config.toml

mv $HOME/.latanda/priv_validator_state.json.backup $HOME/.latanda/data/priv_validator_state.json

Step 3: Start the node and follow the logs

sudo service latanda start && sudo journalctl -fu latanda -o cat