|
| 1 | +--- |
| 2 | +title: Archival Snapshots |
| 3 | +sidebar_position: 2 |
| 4 | +--- |
| 5 | + |
| 6 | +# Archival Snapshots |
| 7 | + |
| 8 | +ChainSafe hosts two kinds of snapshots: hourly snapshots (guaranteed to be no |
| 9 | +more than a few hours old) and archival snapshots (similar to the regular |
| 10 | +snapshots, but with less duplicate data). Archival snapshots come as 'lite' |
| 11 | +snapshots, which include the entire block header history back to genesis, and |
| 12 | +'diff' snapshots, which only contain the new data since the previous diff |
| 13 | +snapshot. |
| 14 | + |
| 15 | +Archival snapshots are publicly available here: |
| 16 | + |
| 17 | +- Mainnet lites: https://forest-archive.chainsafe.dev/list/mainnet/lite |
| 18 | +- Mainnet diffs: https://forest-archive.chainsafe.dev/list/mainnet/diff |
| 19 | +- Calibnet lites: https://forest-archive.chainsafe.dev/list/calibnet/lite |
| 20 | +- Calibnet diffs: https://forest-archive.chainsafe.dev/list/calibnet/diff |
| 21 | + |
| 22 | +## Merging snapshots |
| 23 | + |
| 24 | +Since 'diff' snapshots only contain the new data since the previous diff |
| 25 | +snapshot, they need to be merged with the previous 'lite' snapshot to form a |
| 26 | +complete snapshot. This can be done with the `forest-tool archive merge` |
| 27 | +command. |
| 28 | + |
| 29 | +```shell |
| 30 | +forest-tool archive merge --output-file <output-file> <lite-snapshot> <diff-snapshots> |
| 31 | +``` |
| 32 | + |
| 33 | +As an example, to get a snapshot that covers epoch 30_000 to epoch 36_000, you |
| 34 | +merge `forest_snapshot_mainnet_2020-09-04_height_30000.forest.car.zst` with |
| 35 | +`forest_diff_mainnet_2020-09-04_height_30000+3000.forest.car.zst` and |
| 36 | +`forest_diff_mainnet_2020-09-05_height_33000+3000.forest.car.zst`. |
| 37 | + |
| 38 | +## Generating archival snapshots |
| 39 | + |
| 40 | +New archival snapshots can be generated either manually with `forest-tool |
| 41 | +archive export` or automatically with `forest-tool archive sync-bucket`. Both |
| 42 | +commands require a large snapshot file as input. |
| 43 | + |
| 44 | +To generate archival snapshots manually, use these settings: |
| 45 | + |
| 46 | +- one lite snapshot every 30_000 epochs, |
| 47 | +- one diff snapshot every 3_000 epochs, |
| 48 | +- a depth of 900 epochs for the diff snapshots, |
| 49 | +- a depth of 900 for the lite snapshots. |
| 50 | + |
| 51 | +Manual generation of archival snapshots should be a last resort. The |
| 52 | +`forest-tool archive sync-bucket` command is recommended for generating |
| 53 | +archival snapshots. |
0 commit comments