# Snapshot

<figure><img src="https://github.com/takeshi-val/Logo/raw/main/provenanced_logo_name.png" alt="" width="150"><figcaption></figcaption></figure>

{% hint style="info" %}
Snapshots allows a new node to join the network by recovering application state from a backup file. Snapshot contains compressed copy of chain data directory. To keep backup files as small as plausible, snapshot server is periodically beeing state-synced.
{% endhint %}

Snapshots are taken automatically every 4 hours

**Instructions**

```bash
cd $HOME
sudo apt install -y lz4 wget  # if needed
```

**Stop the node**

```bash
sudo systemctl stop provenanced
```

**Backup validator**

{% code overflow="wrap" %}

```bash
sudo cp $HOME/.provenanced/data/priv_validator_state.json $HOME/.provenanced/priv_validator_state.json.backup
```

{% endcode %}

**Remove old data**

```bash
sudo rm -rf $HOME/.provenanced/data
sudo rm -rf $HOME/.provenanced/wasm
```

**Download and extract the latest snapshot**

{% code overflow="wrap" %}

```bash
curl -L https://snapshots.takeshi.team/provenance/provenance_latest.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.provenanced
```

{% endcode %}

**Restore validator**

{% code overflow="wrap" %}

```bash
mv $HOME/.provenanced/priv_validator_state.json.backup $HOME/.provenanced/data/priv_validator_state.json
```

{% endcode %}

**Download addrbook.json**

{% code overflow="wrap" %}

```bash
wget -O $HOME/.provenanced/config/addrbook.json "https://snapshots.takeshi.team/provenance/addrbook.json"
```

{% endcode %}

**Start the node**

{% code overflow="wrap" %}

```bash
sudo systemctl start provenanced && sudo journalctl -u provenanced -f --no-hostname -o cat
```

{% endcode %}


---

# 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://services.takeshi.team/chain/mainnet/provenance/snapshot.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.
