💡State Sync
Stop existing service and reset database.
sudo systemctl stop althea
althea tendermint unsafe-reset-all --home $HOME/.althea --keep-addr-book
Add peers.
seeds="[email protected]:14656"
peers="[email protected]:17200,[email protected]:17200,[email protected]:17200"
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.althea/config/config.toml
Fill variables with data for State Sync.
RPC="https://althea-rpc.stakeangle.com:443"
RECENT_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height)
TRUST_HEIGHT=$((RECENT_HEIGHT - 2000))
TRUST_HASH=$(curl -s "$RPC/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)
echo $RECENT_HEIGHT $TRUST_HEIGHT $TRUST_HASH
Add variable values to config.toml.
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC,$RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$TRUST_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.althea/config/config.toml
Start service and check journal.
sudo systemctl restart althea
sudo journalctl -u althea -f -o cat
Last updated