Skip to content

Instantly share code, notes, and snippets.

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