Snapshot & State sync
Snapshot
sudo systemctl stop shentud
cp $HOME/.shentud/data/priv_validator_state.json $HOME/.shentud/priv_validator_state.json.backup
shentud tendermint unsafe-reset-all --home ~/.shentud/ --keep-addr-book
curl https://ss.syanodes.my.id/shentu/ss-shentu.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.shentud
mv $HOME/.shentud/priv_validator_state.json.backup $HOME/.shentud/data/priv_validator_state.json
sudo systemctl restart shentud && sudo journalctl -fu shentud -o cat
State Sync
sudo systemctl stop shentud
cp $HOME/.shentud/data/priv_validator_state.json $HOME/.shentud/priv_validator_state.json.backup
shentud tendermint unsafe-reset-all --home $HOME/.shentud
peers="[email protected]:14056,[email protected]:26656,[email protected]:15607,[email protected]:14056,[email protected]:26656,[email protected]:30022,[email protected]:26656,[email protected]:36656,[email protected]:14031,[email protected]:15607,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26956,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:15604,[email protected]:26656,[email protected]:26656,[email protected]:6656,[email protected]:28656,[email protected]:20016,[email protected]:26656,[email protected]:46656,[email protected]:27656,[email protected]:15607,[email protected]:14056,[email protected]:29856,[email protected]:26656,[email protected]:26656,[email protected]:41656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:14056,[email protected]:28656,[email protected]:26456,[email protected]:26656,[email protected]:3000,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:46656,[email protected]:26716,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:19656,[email protected]:56656,[email protected]:3000,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:31457,[email protected]:15607,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26706,[email protected]:27656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:12456,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:12456,[email protected]:6656,[email protected]:26656,[email protected]:26756,[email protected]:15604,[email protected]:26656,[email protected]:26656,[email protected]:14056,[email protected]:26656,[email protected]:26656,[email protected]:24656,[email protected]:26656,[email protected]:28656,[email protected]:26656,[email protected]:26656,[email protected]:2407,[email protected]:25656,[email protected]:15200,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:14056,[email protected]:26656,[email protected]:15200,[email protected]:20016,[email protected]:46656,[email protected]:14056,[email protected]:14056"
SNAP_RPC="https://shentu-m-rpc.syanodes.my.id:443"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.shentud/config/config.toml
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height);
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000));
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && sleep 2
sed -i.bak -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\"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.shentud/config/config.toml
mv $HOME/.shentud/priv_validator_state.json.backup $HOME/.shentud/data/priv_validator_state.json
sudo systemctl restart shentud && sudo journalctl -fu shentud -o cat
Last updated