Skip to content

Instantly share code, notes, and snippets.

@ryssroad
Last active July 14, 2022 22:17
Show Gist options
  • Save ryssroad/d634489160976a35c611e6d029018540 to your computer and use it in GitHub Desktop.
Save ryssroad/d634489160976a35c611e6d029018540 to your computer and use it in GitHub Desktop.
stride-1 statesync
peers="18b247adff3b1aa374f2e2fff049df89093f8013@158.101.199.10:26656"; \
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.stride/config/config.toml
SNAP_RPC="http://158.101.199.10:26657"; \
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\"|" ~/.stride/config/config.toml
sudo systemctl stop strided && \
strided tendermint unsafe-reset-all --home $HOME/.stride && \
sudo systemctl restart strided && journalctl -fu strided -o cat
после начала синхронизации:
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1false|" $HOME/.stride/config/config.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment