Snapshot & State sync
Snapshot
sudo systemctl stop oraid
cp $HOME/.oraid/data/priv_validator_state.json $HOME/.oraid/priv_validator_state.json.backup
oraid tendermint unsafe-reset-all --home ~/.oraid/ --keep-addr-book
curl https://snapshot2.syanodes.my.id/orai/snapshot2-orai.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.oraid
mv $HOME/.oraid/priv_validator_state.json.backup $HOME/.oraid/data/priv_validator_state.json
sudo systemctl restart oraid && sudo journalctl -fu oraid -o cat
State Sync
sudo systemctl stop oraid
cp $HOME/.oraid/data/priv_validator_state.json $HOME/.oraid/priv_validator_state.json.backup
oraid tendermint unsafe-reset-all --home $HOME/.oraid
peers="[email protected]:26656,[email protected]:11256,[email protected]:26656,[email protected]:27656,[email protected]:26696,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:37095,[email protected]:26656,[email protected]:30456,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26643,[email protected]:25956,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:34656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:27436,[email protected]:38801,[email protected]:24556,[email protected]:26656,[email protected]:26656,[email protected]:11256,[email protected]:26656,[email protected]:23356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:42656,[email protected]:26656,[email protected]:26656,[email protected]:11256,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:23356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:16456,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:23356,[email protected]:26656,[email protected]:26656,[email protected]:23356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:22656,[email protected]:26656,[email protected]:11256,[email protected]:26656,[email protected]:26656,[email protected]:27656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:35656,[email protected]:26656,[email protected]:23356,[email protected]:26656,[email protected]:2056,[email protected]:12356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:23356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:40656,[email protected]:26656,[email protected]:27656,[email protected]:11256,[email protected]:30456,[email protected]:26656,[email protected]:33656,[email protected]:23177,[email protected]:11256"
SNAP_RPC="https://orai-m-rpc.syanodes.my.id:443"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.oraid/config/config.toml
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 && 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/.oraid/config/config.toml
mv $HOME/.oraid/priv_validator_state.json.backup $HOME/.oraid/data/priv_validator_state.json
sudo systemctl restart oraid && sudo journalctl -fu oraid -o cat
Last updated