# State sync

In order to use this feature, you will have to edit a couple of things inside your `~/.realionetwork/config/config.toml` file, under the `statesync` section:

1. Enable state sync by setting `enable=true`
2. Set the RPC addresses from where to get the snapshots using the `rpc_servers` field:
   * See Peer & Seeds information in order to get RPC addresses in our [discord group](https://discord.gg/Nv9EUbRnKb)
3. Get a trusted chain height, and the associated block hash. To do this, you will have to:
   * Get the current chain height by running:

     <pre class="language-bash" data-full-width="false"><code class="lang-bash">curl -s &#x3C;rpc-endpoint>/commit | jq "{height: .result.signed_header.header.height}"
     </code></pre>
   * Once you have the current chain height, get a height that is a little lower (200 blocks) than the current one.\
     To do this you can execute:

     <pre class="language-bash" data-full-width="false"><code class="lang-bash">curl -s &#x3C;rpc-endpoint>/commit?height=&#x3C;your-height> | jq "{height: .result.signed_header.header.height, hash: .result.signed_header.commit.block_id.hash}"

     # Example
     # curl -s &#x3C;rpc-endpoint>/commit?height=100000 | jq "{height: .result.signed_header.header.height, hash: .result.signed_header.commit.block_id.hash}"
     </code></pre>
   * Now that you have a trusted height and block hash, use those values as the `trust_height` and `trust_hash` values. Also, make sure they're the right values for the Realio Network version you're starting to synchronize:

     | **State sync height range** | **RealioNetwork version** |
     | --------------------------- | ------------------------- |
     | `0 - 1235764`               | `v1.0.2`                  |
   * Here is an EXAMPLE (no not copy!) of what the `statesync` section of your `~/.realionetwork/config/config.toml` file should look like in the end (the `trust_height` and `trust_hash` should contain your values instead):

     ```
       enable = true

       rpc_servers = "0.0.0.0:26657"
       trust_height = 100
       trust_hash = "E8ED7A890A64986246EEB02D7D8C4A6D497E3B60C0CAFDDE30F2EE385204C314"
       trust_period = "336h0m0s"
     ```
4. Add peers to `~/.realionetwork/config/config.toml` file:

{% hint style="success" %}
TIP\
Our discord group is a great source for getting peer information from the community. After joining the [Discord Group](https://discord.gg/Nv9EUbRnKb), look for the #testnet-seeds-peers channel or the #mainnet-seeds-peers channel and ask the current members for one if needed.
{% endhint %}

Add these seeds here to the `~/.realionetwork/config/config.toml` file

```
seeds = "....." 
peers = "....."
```


---

# 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.realio.network/running-a-full-node/state-sync.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.
