Statesync
Setup
This is the settings we use , you dont have to change anything
- snapshot-interval= 1000
- snapshot-keep-recent = 5
Intruction
systemctl stop 8ball
8ball tendermint unsafe-reset-all --home $HOME/.8ball --keep-addr-book
STATE_SYNC_RPC="https://rpc.8ball.indonode.net:443"
LATEST_HEIGHT=$(curl -s $STATE_SYNC_RPC/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(($LATEST_HEIGHT - 1000))
SYNC_BLOCK_HASH=$(curl -s "$STATE_SYNC_RPC/block?height=$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)
PEERS=7aec1b580eb960853aadd0edca6062438c3c4bb3@rpc.8ball.indonode.net:22656
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.8ball/config/config.toml
sed -i.bak -e "s|^enable *=.*|enable = true|" $HOME/.8ball/config/config.toml
sed -i.bak -e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
$HOME/.8ball/config/config.toml
sed -i.bak -e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
$HOME/.8ball/config/config.toml
sed -i.bak -e "s|^trust_hash *=.*|trust_hash = \"$SYNC_BLOCK_HASH\"|" \
$HOME/.8ball/config/config.toml
systemctl restart 8ball && journalctl -fu 8ball -o cat
Turn Off State-sync
sed -i.bak -e "s|^enable *=.*|enable = false|" $HOME/.8ball/config/config.toml
systemctl restart 8ball && journalctl -fu 8ball -o cat