💡State Sync
Stop existing service and reset database.
sudo systemctl stop tgrade
tgrade tendermint unsafe-reset-all --home $HOME/.tgrade --keep-addr-book
Add peers.
SEEDS="[email protected]:26656,[email protected]:26656,2df762919720bca5f46042f77148de73c06049d8@seed.tgrade.validator.run:26656"
PEERS="[email protected]:26656,[email protected]:26656,[email protected]:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.tgrade/config/config.toml
Fill variables with data for State Sync.
RPC="https://tgrade-rpc.stakeangle.com:443"
RECENT_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height)
TRUST_HEIGHT=$((RECENT_HEIGHT - 500))
TRUST_HASH=$(curl -s "$RPC/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)
echo $RECENT_HEIGHT $TRUST_HEIGHT $TRUST_HASH
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/.tgrade/config/config.toml
Start service and check journal.
sudo systemctl restart tgrade
sudo journalctl -u tgrade -f -o cat
Last updated