top of page

State-Sync for Bitcanna

Our state-sync RPC server for Bitcanna is:

Cosmovisor is recommended to manage your node. If you do not use Cosmovisor, you may need to customize the next instruction.

Copy our and give it the necessary right (chmod 700


This script grabs important state-sync information (such as block height and trust hash) from our server and update your config.toml file accordingly.

The code of is:

#!/bin/bash SNAP_RPC=""

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \


TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \

s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \

s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \

s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.bcna/config/config.toml

Now run the script:


Stop the node:

 sudo service bcnad stop

Reset the node:

 bcnad tendermint unsafe-reset-all --home $HOME/.bcna --keep-addr-book

Restart the node:

 sudo service bnad start

bottom of page