💡State Sync

State Sync allows to sync a new node by fetching a snapshot of the network state at a recent height, instead of fetching and replaying all historical blocks.

Some networks which use wasm may not yet support wasm folder transfers with State Sync. In this case you may need to download wasm folder separately.

Depending on network, State Sync may need different amount of RAM to successfully fish sync process. It is recommended to have at least 8GB RAM.

  1. Stop existing service and reset database.

sudo systemctl stop desmos
desmo tendermint unsafe-reset-all --home $HOME/.desmos --keep-addr-book
  1. Add peers.

PEERS="bdd98ec74fe56146f08e886239e52373f6821ce3@95.216.148.253:26656,7ea74a6fd693c8a04fb11d3e31f231c2c949db5c@157.90.230.83:26656,86451fccaa2745dba3c5e88f289cb8a7fccda107@139.162.131.107:26656,af4e9b5cc3509893877e82bf1de1d6316fe0bb1c@152.228.216.224:26656,c880aded1fd96647e85bd301c18dafb6ae7dd3a8@5.9.121.55:41856"
sed -i -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.desmos/config/config.toml
  1. Fill variables with data for State Sync.

RPC="https://desmos-rpc.stakeangle.com:443"
RECENT_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height)
TRUST_HEIGHT=$((RECENT_HEIGHT - 2000))
TRUST_HASH=$(curl -s "$RPC/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)

echo $RECENT_HEIGHT $TRUST_HEIGHT $TRUST_HASH
  1. Add variable values to config.toml.

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC,$RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$TRUST_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.desmos/config/config.toml
  1. Start service and check journal.

sudo systemctl restart desmos
sudo journalctl -u desmos -f -o cat

State Sync typically takes up to 10 minutes.

Last updated