State Sync

Catching up to the latest block like a magic!

Reset blockchain data

sudo systemctl stop artela
cp $HOME/.artelad/data/priv_validator_state.json $HOME/.artelad/priv_validator_state.json.backup
artelad tendermint unsafe-reset-all --keep-addr-book --home $HOME/.artelad

Configure state sync

SYNC_RPC="https://artela-testnet-rpc.inux.dev"
SYNC_PEER="[email protected]:26656"
LATEST_HEIGHT=$(curl -s $SYNC_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
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/.artelad/config/config.toml

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

Start artelad service & monitor logs

sudo systemctl restart artelad && \
sudo journalctl -u artelad -f --output cat

Last updated