Stop osmosisd and reset database
Copy sudo systemctl stop osmosisd
cp $HOME /.osmosisd/data/priv_validator_state.json $HOME /.osmosisd/priv_validator_state.json.backup
osmosisd tendermint unsafe-reset-all --home $HOME /.osmosisd --keep-addr-book
Copy STATE_SYNC_RPC = https://rpc.cosmos.directory:443/osmosis
BACKUP_RPC = https://osmosis-rpc.lavenderfive.com:443
LATEST_HEIGHT = $( curl -s $STATE_SYNC_RPC /block | jq -r .result.block.header.height )
BLOCK_HEIGHT = $( echo LATEST_HEIGHT | awk '{print $1 - ($1 % 6000)}' ); \
TRUST_HASH = $( curl -s "$STATE_SYNC_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash )
SEEDS="f515a8599b40f0e84dfad935ba414674ab11a668@osmosis.blockpane.com:26656,ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:12556,20e1000e88125698264454a884812746c2eb4807@seeds.lavenderfive.com:12556,ebc272824924ea1a27ea3183dd0b9ba713494f83@osmosis-mainnet-seed.autostake.com:26716,3cc024d1c760c9cd96e6413abaf3b36a8bdca58e@seeds.goldenratiostaking.net:1630,e891d42c31064fb7e0d99839536164473c4905c2@seed-osmosis.freshstaking.com:31656,c28827cb96c14c905b127b92065a3fb4cd77d7f6@seeds.whispernode.com:12556,38ab18cb2ea1dfeb6232b429e1508f56b6ae5031@seed-osmosis-01.stakeflow.io:65535,954ab3a0551b592b654b1554af8fc8746ed7b362@seed-node.mms.team:31656,8542cd7e6bf9d260fef543bc49e59be5a3fa9074@seed.publicnode.com:26656,2cb8dd6195c65458e3c18505bb70ce2ff624f85c@seed.osmosis.validatus.com:2000,b85358e035343a3b15e77e1102857dcdaf70053b@seeds.bluestake.net:24856"
echo -e "Modifying $HOME/.osmosisd/config/config.toml based on the following values:"
echo -e "RPC Address: $STATE_SYNC_RPC"
echo -e "Latest Block Height: $LATEST_HEIGHT"
echo -e "Sync Block Height: $BLOCK_HEIGHT"
echo -e "Trust Hash: $TRUST_HASH"
sed -i \
-e "s|^enable *=.*|enable = true|" \
-e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$BACKUP_RPC\"|" \
-e "s|^trust_height *=.*|trust_height = $BLOCK_HEIGHT|" \
-e "s|^trust_hash *=.*|trust_hash = \"$TRUST_HASH\"|" \
-e "s|^seeds *=.*|seeds = \"$SEEDS\"|" \
$HOME /.osmosisd/config/config.toml
mv $HOME /.osmosisd/priv_validator_state.json.backup $HOME /.osmosisd/data/priv_validator_state.json
Copy curl -L https://snapshots.lavenderfive.com/wasm/$HOME/.osmosisd/wasmonly.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.osmosisd
Restart osmosisd and check the log
Copy sudo systemctl restart osmosisd && sudo journalctl -u osmosisd -f --no-hostname -o cat