# 스냅샷

GIWA 노드 스냅샷은 최신 노드 데이터를 압축해둔 파일로, 스냅샷 부터 동기화하면 비교적 빠르게 노드를 구성할 수 있어요.

스냅샷 데이터는 일주일에 한번씩 업데이트 됩니다.

{% hint style="info" %}
스냅샷은 체인의 tip (latest block) 상태를 담고있지 않아요.

스냅샷을 통해 노드를 구성한 뒤에는 스냅샷 시점 이후의 블록을 추가로 동기화하여 최신 tip까지 따라잡는 캐치업 과정이 필요합니다.
{% endhint %}

### 스냅샷으로 노드 구성하기

아래 가이드는 [giwa-io/node](https://github.com/giwa-io/node) 레포지토리 기반 Docker 구성을 사용하는 것을 전제로 합니다.

#### 1. 기존 리소스 정리

기존 노드를 멈추고 노드 데이터를 비우거나 별도로 백업해주세요.

Geth:

```zsh
docker compose down && rm -rf ./geth_data
```

Reth:

```zsh
docker compose down && rm -rf ./reth_data
```

#### 2. 노드 데이터 디렉토리 준비

Geth:

```zsh
mkdir ./geth_data
```

Reth:

```zsh
mkdir ./reth_data
```

#### 3. 스냅샷 다운로드

운영하고자 하는 노드 클라이언트 및 프루닝(pruning)모드에 따라 아래 명령어 중 하나를 실행해주세요.

{% hint style="warning" %}
아래 명령어 실행 전에 디스크 공간이 충분한지 확인해야해요.
{% endhint %}

<table><thead><tr><th width="145.967041015625">네트워크</th><th width="112.8428955078125">클라이언트</th><th width="104.3818359375">프루닝</th><th>명령어</th></tr></thead><tbody><tr><td>GIWA Sepolia</td><td>Geth</td><td>Full</td><td><pre class="language-zsh"><code class="lang-zsh">curl -sL https://sepolia-snapshot.giwa.io/download.sh | sh -s -- -c geth -p full -o ./geth_data
</code></pre></td></tr><tr><td>GIWA Sepolia</td><td>Geth</td><td>Archive</td><td><pre class="language-zsh"><code class="lang-zsh">curl -sL https://sepolia-snapshot.giwa.io/download.sh | sh -s -- -c geth -p archive -o ./geth_data
</code></pre></td></tr><tr><td>GIWA Sepolia</td><td>Reth</td><td>Full</td><td><pre class="language-zsh"><code class="lang-zsh">curl -sL https://sepolia-snapshot.giwa.io/download.sh | sh -s -- -c reth -p full -o ./reth_data
</code></pre></td></tr><tr><td>GIWA Sepolia</td><td>Reth</td><td>Archive</td><td><pre class="language-zsh"><code class="lang-zsh">curl -sL https://sepolia-snapshot.giwa.io/download.sh | sh -s -- -c reth -p archive -o ./reth_data
</code></pre></td></tr></tbody></table>

#### 4. 스냅샷 압축해제

다운로드 받은 스냅샷 파일을 아래 명령어를 통해 압축해제합니다.

Geth:

```zsh
tar --zstd -xf <snapshot-file.tar.zst> -C ./geth_data
```

Reth:

```zsh
tar --zstd -xf <snapshot-file.tar.zst> -C ./reth_data
```

#### 5. GIWA 노드 실행

[giwa-io/node](https://github.com/giwa-io/node) 레포지토리에 나와있는 가이드를 참고해 `docker compose` 명령어를 사용하여 노드를 실행하세요.


---

# 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.giwa.io/node-operators/snapshots.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.
