Skip to content

Commit

Permalink
Add snapshot section
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschakki committed Feb 11, 2025
1 parent 8c39b2f commit ad8be86
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion docs/building-on-lisk/run-a-lisk-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,41 @@ $( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Cont
[partners]: /lisk-tools/node-providers
[lisk node]: https://github.com/LiskHQ/lisk-node
[lisk node]: https://github.com/LiskHQ/lisk-node
### Snapshots
:::note
- Snapshots are available for both `op-geth` and `op-reth` clients:
- `op-geth` supports both export and datadir snapshots
- `op-reth` only supports datadir snapshots
- All snapshots are from archival nodes
- Snapshot types:
- `export`: small download size, slow to restore from, data is verified during restore (`op-geth` only)
- `datadir`: large download size, fast to restore from, no data verification during restore
:::
To enable auto-snapshot download and application, set the `APPLY_SNAPSHOT` environment variable to true when starting the node:
```sh
APPLY_SNAPSHOT=true docker compose up --build --detach
```
To specify the client and snapshot type, set both the `CLIENT` and `SNAPSHOT_TYPE` environment variables:

```sh
# For op-geth with export snapshot (default)
APPLY_SNAPSHOT=true CLIENT=geth SNAPSHOT_TYPE=export docker compose up --build --detach

# For op-geth with datadir snapshot
APPLY_SNAPSHOT=true CLIENT=geth SNAPSHOT_TYPE=datadir docker compose up --build --detach

# For op-reth (only supports datadir)
APPLY_SNAPSHOT=true CLIENT=reth SNAPSHOT_TYPE=datadir docker compose up --build --detach
```

You can also download and apply a snapshot from a custom URL by setting the `SNAPSHOT_URL` environment variable.
Please make sure the snapshot file ends with `*.tar.gz`.

```sh
APPLY_SNAPSHOT=true SNAPSHOT_URL=<custom-snapshot-url> docker compose up --build --detach
```

0 comments on commit ad8be86

Please sign in to comment.