Testnet-2
Lava
beta v.0.321.084
State sync allows a new node to join a network by fetching a snapshot of the application state at a recent height instead of fetching and replaying all historical blocks. This can reduce the time needed to sync with the network from hours/days to minutes, but you will not have an old data (earlier than snapshot height).
You should have installed and initialized node on your server, this script works with your config files and service, if you are running a node without a service or in any other ways you should be able to modify this script by your needs.
# Set variablesdaemon_name="lavad"statesync_rpc="https://rpc-1.testnet.lava.nodes.guru"rpc_servers="https:\/\/rpc-1.testnet.lava.nodes.guru:443,https:\/\/rpc-1.testnet.lava.nodes.guru:443"statesync_homedir="$HOME/.lava"height_offset=2000# Get height and hashlatest_height=$(curl -s $statesync_rpc/block | jq -r .result.block.header.height)height=$((latest_height - $height_offset))hash=$(curl -s "$statesync_rpc/block?height=$height" | jq -r .result.block_id.hash)# Get peerpeer_status=$(curl -s "$statesync_rpc"/status | jq .result)peer_node_id=$(echo $peer_status | jq .node_info.id | sed 's/"//g')striped_rpc=$(echo $statesync_rpc | sed 's/https\?:\/\///')peer_port=$(echo $peer_status | jq .node_info.listen_addr | sed 's/"//g' | awk -F'[/:]' '{print $NF}')peer_id="${peer_node_id}@${striped_rpc}:${peer_port}"# Setupsed -i '/\[statesync\]/{:a;n;/enable/s/false/true/;Ta;}' $statesync_homedir/config/config.tomlsed -i.bak -e "s/rpc_servers *=.*/rpc_servers = \"$rpc_servers\"/g" $statesync_homedir/config/config.tomlsed -i.bak -e "s/trust_height *=.*/trust_height = \"$height\"/g" $statesync_homedir/config/config.tomlsed -i.bak -e "s/trust_hash *=.*/trust_hash = \"$hash\"/g" $statesync_homedir/config/config.tomlsed -i "s/^persistent_peers *=.*/persistent_peers = \"$peer_id\"/;" $statesync_homedir/config/config.toml# Wipe databasesudo systemctl stop $daemon_nameunsafe_reset_response=$($daemon_name unsafe-reset-all --home $statesync_homedir 2>&1)if echo "$unsafe_reset_response" | grep -q -E "Error|error"; then$daemon_name tendermint unsafe-reset-all --home $statesync_homedir --keep-addr-bookfi# Restart servicesudo systemctl restart $daemon_namesudo journalctl -u $daemon_name -f -o cat