# Statesync

## Statesync

<figure><img src="https://pbs.twimg.com/profile_images/1721764048403116032/rIoQhC14_400x400.jpg" alt="" width="188"><figcaption></figcaption></figure>

***

| Latest Version | Chain-id | Wasm    |
| -------------- | -------- | ------- |
| v3.0.0         | source-1 | ENABLED |

#### Statesync

```shell
sudo systemctl stop sourced
cp $HOME/.source/data/priv_validator_state.json $HOME/.source/priv_validator_state.json.backup
sourced tendermint unsafe-reset-all --keep-addr-book --home $HOME/.source


STATE_SYNC_RPC=https://rpc.source.indonode.net:443
STATE_SYNC_PEER=7e153e83fbe2f5618fffbdfd803f70ee78ad797d@rpc.source.indonode.net:12656
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)

sed -i \
  -e "s|^enable *=.*|enable = true|" \
  -e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
  -e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
  -e "s|^trust_hash *=.*|trust_hash = \"$SYNC_BLOCK_HASH\"|" \
  -e "s|^persistent_peers *=.*|persistent_peers = \"$STATE_SYNC_PEER\"|" \
  $HOME/.source/config/config.toml

mv $HOME/.source/priv_validator_state.json.backup $HOME/.source/data/priv_validator_state.json
```

## Download WASM

```shell
curl -L https://snapshots.indonode.net/source/wasm.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.source
```

```shell
sudo systemctl start sourced && sudo journalctl -u sourced -f
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.indonode.net/mainnet/source/statesync.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
