State Sync
State Sync allows a new node to join the network by fetching a snapshot of the application state at a recent height instead of fetching and replaying all historical blocks. Since the application state
sudo systemctl stop celestia-appd
cp $HOME/.celestia-app/data/priv_validator_state.json $HOME/.celestia-app/priv_validator_state.json.backup
celestia-appd tendermint unsafe-reset-all --home $HOME/.celestia-app
peers="202a224f679b63cf08bf3b6f9844ff51c68fdcc9@94.237.25.73:26656,a86cfe5a22e73ff0c9ceec388e9b52bf8355efdd@85.239.233.57:2000,dd712ce528ed012d9d9fe3c3362cd74a77ed191d@103.219.171.69:26656,85e38748d8c2af556f5c7d595d6f05f5f6fce524@157.90.36.48:26656,9a179402b03fa08f4b635439a0cd857184c87979@65.21.69.230:26656,14e09bbe1c157653b0ff862fab941e2bba31c56b@65.108.9.59:26010,5d93d0e21fed3924c729051356ff31a1fd3ef468@65.21.69.250:26656,3e9edb7aa157894b498e75373e2148f7c22100b2@103.219.171.67:26656,ff476823607d3c73da21662238083b10040d3ecc@65.108.44.124:26001,adc8267fd1f1cbfdf68b9a054088c7f4057763eb@3.37.79.90:26656"
SNAP_RPC="https://celestia-mainnet-rpc.suntzu.dev:443"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.celestia-app/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/.celestia-app/config/config.toml
mv $HOME/.celestia-app/priv_validator_state.json.backup $HOME/.celestia-app/data/priv_validator_state.json
sudo systemctl restart celestia-appd && sudo journalctl -u celestia-appd -f
Last updated