Skip to content

Instantly share code, notes, and snippets.

@ryssroad
Last active August 2, 2022 20:01
Show Gist options
  • Save ryssroad/6fe2461a557118214f986effc3d4456e to your computer and use it in GitHub Desktop.
Save ryssroad/6fe2461a557118214f986effc3d4456e to your computer and use it in GitHub Desktop.
Sei statesync
peers="be57b67269ae3464a5cb86403be7c59a25e55c1a@167.235.232.175:12656"; \
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.sei/config/config.toml
SNAP_RPC="http://167.235.232.175:12657/"; \
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash); \
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
sed -i -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\"|" ~/.sei/config/config.toml
sudo systemctl stop seid && \
seid tendermint unsafe-reset-all --home $HOME/.sei && \
sudo systemctl restart seid && journalctl -fu seid -o cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment