💡State Sync
Stop existing service and reset database.
sudo systemctl stop gravity-node
gravity tendermint unsafe-reset-all --home $HOME/.gravity --keep-addr-book
Add peers.
SEEDS="[email protected]:26656,[email protected]:26656"
PEERS="[email protected]:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.gravity/config/config.toml
Fill variables with data for State Sync.
RPC="https://gravity-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
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/.gravity/config/config.toml
Start service and check journal.
sudo systemctl restart gravity-node
sudo journalctl -u gravity-node -f -o cat
Last updated