# SnapsVault Docs > SnapsVault is an open snapshot marketplace for node snapshots. Contributors publish their snapshots in one format, and node operators find, verify and download them in one place, through a web Marketplace, the SnapsOS CLI or a REST API. --- Source: https://docs.snapsvault.xyz/overview/what-is-snapsvault # SnapsVault Open Snapshot Marketplace SnapsVault is a community-driven marketplace for sharing and discovering verified snapshots published by trusted contributors. Snapshots are usually scattered across many sources, each with its own format. SnapsVault brings them into one catalog with one format, so picking one takes seconds. ## Components SnapsVault has two sides. Contributors, the snapshot providers, publish a snapshot feed and list it in the registry. Node operators and developers use the same catalog through the Marketplace, the SnapsOS CLI or the REST API. | Component | What it does | |---|---| | [Snapshot feed](https://docs.snapsvault.xyz/contributing/feed-format) | A JSON file served over HTTPS, one entry per snapshot | | [Registry](https://docs.snapsvault.xyz/contributing/registry-file) | A [GitHub repository](https://github.com/denodesxyz/snapsvault-registry) listing each contributor and its feed URLs | | [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace) | Web app to search, filter and compare snapshots | | [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli) | Terminal client to find and download snapshots | | [REST API](https://docs.snapsvault.xyz/core-components/rest-api) | Public JSON endpoints over the same data | ::: tip Under the hood [How it works](https://docs.snapsvault.xyz/overview/how-it-works) follows a feed to the Marketplace, the SnapsOS CLI and the REST API. ::: ## Supported networks A network can have several chain IDs, each a mainnet or testnet chain. The [Glossary](https://docs.snapsvault.xyz/overview/glossary) defines these terms. More networks are planned on the [roadmap](https://snapsvault.xyz/#roadmap). | Network | Chain ID | Chain | |---|---|---| | **Celestia** | `celestia` | Mainnet | | **Celestia** | `mocha-4` | Testnet | | **Celestia** | `mocha-5` | Testnet | ## Trust and verification - Each listing shows what the contributor publishes: size, block height, creation time and a SHA256 checksum. - Snapshot files stay on the contributor's servers. Each listing can be verified locally against the published checksum, as shown in the [Quickstart](https://docs.snapsvault.xyz/overview/quickstart#verify-the-checksum). ## Where to go next **Find and download a snapshot.** Start with the [Quickstart](https://docs.snapsvault.xyz/overview/quickstart). It shows the two ways to use SnapsVault. For more detail: - [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace): search, filter and open snapshots in the browser - [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli): the terminal client - [REST API](https://docs.snapsvault.xyz/core-components/rest-api): the same data for scripts and automation **List your snapshots.** [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots) shows how a contributor publishes a feed and gets listed with one file and a pull request. **Get help or share feedback.** [Feedback](https://docs.snapsvault.xyz/contributing/feedback) lists where to ask and how to report a problem. --- Source: https://docs.snapsvault.xyz/overview/how-it-works # How it works This page follows a snapshot from a contributor feed to a node operator in five stages: a JSON feed, an entry in the registry, a scheduled sync, a database, and access through the Marketplace, the SnapsOS CLI and the REST API. ![SnapsVault end-to-end path: contributor feed, registry, sync, database, then the REST API serving the Marketplace and the SnapsOS CLI](https://docs.snapsvault.xyz/diagrams/how-it-works.svg) ## The path 1. **Feed.** Each listing has a JSON [feed](https://docs.snapsvault.xyz/contributing/feed-format) served over HTTPS, with any file name such as `index.json`. It is a JSON array with one entry per snapshot: download URL, size, creation date, block height and SHA256 checksum. 2. **Registry.** One [registry file](https://docs.snapsvault.xyz/contributing/registry-file) per contributor and chain ID holds the contributor profile and the URL of each feed with its snapshot type and update period. 3. **Sync.** The application reads the registry and every listed feed every 2 minutes. 4. **Database.** Snapshots are stored and listed while they appear in their feed. Older ones stay available through the historical route of the REST API. 5. **Access.** The stored data is available in the [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace), in the terminal with the [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli), and through the [REST API](https://docs.snapsvault.xyz/core-components/rest-api) for scripts. ## Next steps - [Quickstart](https://docs.snapsvault.xyz/overview/quickstart): find, download and restore a snapshot - [Glossary](https://docs.snapsvault.xyz/overview/glossary): the terms used across the docs - [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots): publish your own snapshots --- Source: https://docs.snapsvault.xyz/overview/quickstart # Quickstart This page gets a snapshot onto a node: find one, download it, check it and restore a Celestia node. A snapshot lets a node start from a recent block instead of syncing from genesis. SnapsVault collects snapshots from many contributors in one place, for mainnet (`celestia`) and testnets (`mocha-4`, `mocha-5`). Pruned snapshots keep recent state and are small; archive snapshots keep full history and are much larger. There are two ways to use it: - [Web interface](#web-interface): browse, filter and download in the browser - [Terminal](#terminal): the SnapsOS CLI or the REST API, for servers and scripts ## Web interface Open the [Marketplace](https://celestia.snapsvault.xyz), filter by mainnet or testnet, search by contributor or type, and open a snapshot. The snapshot page has the download command and the SHA256 checksum. ::: tip More on the Marketplace The [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace) page covers the filters, card and table view, and the snapshot page. ::: ## Terminal Use the [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli) or the [REST API](https://docs.snapsvault.xyz/core-components/rest-api). Both return the same data as the Marketplace and need no account or key. ::: code-group ```bash [SnapsOS CLI] curl -fsSL https://snapsvault.xyz/snapsos.sh -o snapsos.sh bash snapsos.sh -n Celestia --latest ``` ```bash [curl] curl -s "https://celestia.snapsvault.xyz/api/cli/latest?network=celestia" \ | jq -r '.data.download_url' ``` ::: Both print the newest mainnet snapshot. ::: tip More on the terminal The [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli) page covers the flags and interactive mode, and the [REST API](https://docs.snapsvault.xyz/core-components/rest-api) page covers every endpoint. ::: ## Restore a node from a snapshot Once a snapshot is chosen, in the Marketplace or in the terminal, these steps download it, check it and restore a node. ### Download a snapshot 1. Copy the download URL from the snapshot page. 2. Download the snapshot file. `-c` resumes an interrupted download. ```bash wget -c -O snapshot.tar.lz4 "" ``` ::: info File formats Most snapshots are `.tar.lz4`. Some contributors publish `.tar.bz2`, a plain `.tar` or `.tar.gz`. Use the matching extension as the output name. ::: ::: warning Disk space Free disk space must exceed the snapshot file size plus its extracted size. ::: ### Verify the checksum Check the snapshot file against the SHA256 shown on the snapshot page before extracting. 1. Copy the SHA256 from the snapshot page. 2. Run the check for the operating system. ::: code-group ```bash [Linux] echo " snapshot.tar.lz4" | sha256sum -c - ``` ```bash [macOS] echo " snapshot.tar.lz4" | shasum -a 256 -c - ``` ::: 3. The output reads `OK`. On a mismatch, download again before extracting. If it still fails, report the URL and the local hash to the contributor. ::: info No checksum published When the snapshot shows "N/A" for SHA256, the contributor publishes no checksum and there is nothing to compare. ::: ### Restore a Celestia consensus node These steps are for a `celestia-app` consensus node that runs the same chain ID as the snapshot. ::: info Assumed setup Paths assume the default home directory `~/.celestia-app` and a systemd service named `celestia-appd`. Adjust both to the local setup. ::: ::: danger Validator state `data/priv_validator_state.json` records the last block the validator signed. Restoring a snapshot that carries an older copy can make the validator sign a height twice (double-sign), which is slashable. Back the file up before extraction and put it back afterwards. Never run two validators with the same `priv_validator_key.json`. ::: 1. Stop the service. ```bash sudo systemctl stop celestia-appd ``` 2. Back up the validator state. ```bash cp ~/.celestia-app/data/priv_validator_state.json ~/priv_validator_state.json.bak ``` 3. Remove the old data directory contents. Keep `config/`, which holds the node and validator keys. ```bash rm -rf ~/.celestia-app/data mkdir -p ~/.celestia-app/data ``` 4. Check the root of the snapshot file, because layouts differ by contributor, then extract. ::: code-group ```bash [.tar.lz4] lz4 -dc snapshot.tar.lz4 | tar -tf - | head -3 # root should be data/ lz4 -dc snapshot.tar.lz4 | tar -xf - -C ~/.celestia-app ``` ```bash [.tar.bz2] tar -tjf snapshot.tar.bz2 | head -3 # root should be data/ tar -xjf snapshot.tar.bz2 -C ~/.celestia-app ``` ```bash [.tar] tar -tf snapshot.tar | head -3 # root should be ./ (contents of data/) tar -xf snapshot.tar -C ~/.celestia-app/data ``` ```bash [.tar.gz] tar -tzf snapshot.tar.gz | head -3 tar -xzf snapshot.tar.gz -C ~/.celestia-app # if the root is data/ ``` ::: ::: details Snapshot file layouts Some `.tar.lz4` files start with a `data/` entry and extract into `~/.celestia-app`. Some `.tar` files start at the data directory itself and extract into `~/.celestia-app/data`. If the listing shows another root, extract so that the files end up in `~/.celestia-app/data`. ::: 5. Put the validator state back over the one in the snapshot file. ```bash mv ~/priv_validator_state.json.bak ~/.celestia-app/data/priv_validator_state.json ``` 6. Start the service and follow the log. ```bash sudo systemctl start celestia-appd journalctl -u celestia-appd -f ``` :::: details Save disk space with a streamed extraction Skip the download file and extract while downloading. This skips the SHA256 check, because no file is saved to check. To check the snapshot file, use the [download](#download-a-snapshot) and [verify](#verify-the-checksum) steps instead. Pick the tab for the format of the snapshot file. The commands assume the root is `data/`; for another root, change the target directory as in step 4. ::: code-group ```bash [.tar.lz4] wget -qO- "" | lz4 -dc | tar -xf - -C ~/.celestia-app ``` ```bash [.tar.bz2] wget -qO- "" | tar -xjf - -C ~/.celestia-app ``` ```bash [.tar] wget -qO- "" | tar -xf - -C ~/.celestia-app ``` ```bash [.tar.gz] wget -qO- "" | tar -xzf - -C ~/.celestia-app ``` ::: :::: ::: tip Need help? Ask on [Telegram](https://t.me/goldzn) or open an issue in the [SnapsVault repository](https://github.com/denodesxyz/snapsvault/issues/new/choose). More options are on the [Feedback](https://docs.snapsvault.xyz/contributing/feedback) page. ::: ## Next steps - [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace): filters, views and the snapshot page - [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli): flags and interactive mode - [REST API](https://docs.snapsvault.xyz/core-components/rest-api): every endpoint, for scripts and automation - [How it works](https://docs.snapsvault.xyz/overview/how-it-works): how a snapshot gets from a feed to a listing - [Glossary](https://docs.snapsvault.xyz/overview/glossary): the terms used across the docs --- Source: https://docs.snapsvault.xyz/overview/glossary # Glossary These are the terms used across SnapsVault, so the docs, the Marketplace, the API and the CLI mean the same thing by them. Each entry links to the page where the term is used. ## Networks and chains | Term | Definition | Used in | |---|---|---| | Network | A blockchain network, such as Celestia. A network has one or more chain IDs. | [Introduction](https://docs.snapsvault.xyz/overview/what-is-snapsvault#supported-networks) | | Chain | `mainnet` or `testnet`. Every chain ID belongs to one of the two. | [REST API](https://docs.snapsvault.xyz/core-components/rest-api#conventions) | | Chain ID | The identifier of one chain of a network: `celestia` (mainnet), `mocha-4` and `mocha-5` (testnets). Snapshots are listed per chain ID. | [Registry file](https://docs.snapsvault.xyz/contributing/registry-file#file-location) | ## Snapshots | Term | Definition | Used in | |---|---|---| | Snapshot | A copy of a node's data at one block height. A node restored from it starts at that height instead of syncing from genesis. | [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace) | | Pruned | A snapshot type that keeps recent state only. It is small. | [Registry file](https://docs.snapsvault.xyz/contributing/registry-file#fields) | | Archive | A snapshot type that keeps the full history. It is very large and may start at genesis, with block height `0`. | [Feed format](https://docs.snapsvault.xyz/contributing/feed-format#height-rule) | | Checksum (SHA256) | A 64-character fingerprint of the snapshot file. Comparing it with the hash of the downloaded file shows that the file is complete and unchanged. | [Quickstart](https://docs.snapsvault.xyz/overview/quickstart#verify-the-checksum) | | TX index | Whether a snapshot includes the transaction index. The contributor sets it as `tx_index` and the snapshot page shows Enabled or Disabled. | [Registry file](https://docs.snapsvault.xyz/contributing/registry-file#fields) | | Period | How often a contributor publishes a new snapshot, such as `4h` or `1d`. It drives the "next update" estimate on the snapshot page. | [Registry file](https://docs.snapsvault.xyz/contributing/registry-file#fields) | ## Contributors and listings | Term | Definition | Used in | |---|---|---| | Contributor | A snapshot provider: a person or team that publishes snapshots and lists them on SnapsVault. | [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots) | | Feed | A JSON file served over HTTPS with one entry per current snapshot of a contributor, for one chain ID and snapshot type. | [Feed format](https://docs.snapsvault.xyz/contributing/feed-format) | | Registry | The public [registry repository](https://github.com/denodesxyz/snapsvault-registry) on GitHub that lists every contributor and its feeds. | [How it works](https://docs.snapsvault.xyz/overview/how-it-works) | | Registry file | One JSON file per contributor and chain ID in the registry. It holds the contributor profile and the URL of each feed with its type and period. | [Registry file](https://docs.snapsvault.xyz/contributing/registry-file) | ## Tools | Term | Definition | Used in | |---|---|---| | Marketplace | The SnapsVault web app, where snapshots are searched, filtered and compared. The Quickstart calls it the web interface. | [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace) | | SnapsOS CLI | The SnapsVault command-line client, `snapsos.sh`, a single bash script that finds snapshots, prints their links and can download them with a checksum check. | [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli) | | REST API | The public JSON endpoints over the same snapshot data. | [REST API](https://docs.snapsvault.xyz/core-components/rest-api) | --- Source: https://docs.snapsvault.xyz/core-components/marketplace # Marketplace The [Marketplace](https://celestia.snapsvault.xyz) is the SnapsVault web app. It lists the current snapshots of every contributor, mainnet and testnet, in one place, and shows what is needed to download and check one. This page covers searching and filtering, the card and table views and the snapshot page. ::: info Freshness The list refreshes every 5 minutes and the data is synced from the contributor feeds every 2 minutes, so a new snapshot appears within a few minutes. ::: ## Search and filter Marketplace home: hero with counters, and the Latest snapshots toolbar with the Chains filter, search box and card or table toggle Marketplace home: hero with counters, and the Latest snapshots toolbar with the Chains filter, search box and card or table toggle The Latest snapshots list has a toolbar: | Element | Behavior | |---|---| | Search box | Free text over network, chain, type, contributor and height | | Chains filter | All chains, Mainnet or Testnet, with a count per option | | View toggle | Cards or table. The choice is remembered in the browser. | ## Card and table view Each card shows the network and chain ID, a Mainnet or Testnet badge, height, relative time (the full date is in a tooltip), size, type and contributor. The table view has sortable columns. Its Network column holds the network name and its Chain column holds the Mainnet or Testnet badge. Table view filtered by a contributor search Table view filtered by a contributor search ## Snapshot page Opening a card or row shows the snapshot page. Snapshot page: network panel, snapshot details with SHA256, and the wget command Snapshot page: network panel, snapshot details with SHA256, and the wget command | Item | Meaning | |---|---| | Block height, time, size, type | As published in the feed | | SHA256 | Shown shortened with a copy button when the feed publishes it, otherwise "N/A" | | TX index | Enabled or Disabled, as set by the contributor | | Next update | Estimated from the snapshot time plus the update period the contributor declares | | Download snapshot | A `wget` line to copy and a Download button for the same URL, which is on the contributor's own server | | Contributor panel | Name, description and contact links when the contributor listed them | | More snapshots | Up to 12 related current snapshots: same chain ID first, then the same contributor on other chain IDs | ::: tip Large snapshot files The `wget -c` command from the [download steps](https://docs.snapsvault.xyz/overview/quickstart#download-a-snapshot) resumes an interrupted download. ::: ::: info Time zones The Marketplace shows every date and time in the viewer's local time zone, and hovering one shows the same moment in UTC. The CLI prints times in UTC, and the API returns ISO 8601 values in UTC. ::: ## Next steps - [Quickstart](https://docs.snapsvault.xyz/overview/quickstart#restore-a-node-from-a-snapshot): download, verify and restore a node - [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli): the same data in a terminal - [REST API](https://docs.snapsvault.xyz/core-components/rest-api): the same data for scripts - [How it works](https://docs.snapsvault.xyz/overview/how-it-works): how a snapshot gets from a feed to a listing - [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots): publish your own snapshots --- Source: https://docs.snapsvault.xyz/core-components/snapsos-cli # SnapsOS CLI SnapsOS is a terminal client for the SnapsVault snapshot data. It is a single bash script, `cli/snapsos.sh`, that calls the [REST API](https://docs.snapsvault.xyz/core-components/rest-api). There are two ways to use it: - [Interactive mode](#interactive-mode): a menu to pick a snapshot, then view its link or download it and check its checksum - [Flag mode](#flag-mode): one command with flags prints a link or a list, for scripts and servers ![The script calls three API routes, prints a link or downloads the snapshot file from the contributor host with curl](https://docs.snapsvault.xyz/diagrams/snapsos-flow.svg) ## Install Download the script and run it with `bash`: ```bash curl -fsSL https://snapsvault.xyz/snapsos.sh -o snapsos.sh && bash snapsos.sh ``` ::: info Where the script comes from The download link serves the current version of [`cli/snapsos.sh`](https://github.com/denodesxyz/snapsvault/blob/main/cli/snapsos.sh) from the `main` branch of the [SnapsVault repository](https://github.com/denodesxyz/snapsvault). ::: ::: tip Read it before it runs The script is plain bash. Download it, review it, then run it: ```bash curl -fsSL https://snapsvault.xyz/snapsos.sh -o snapsos.sh less snapsos.sh bash snapsos.sh ``` ::: | Requirement | Used for | |---|---| | `bash`, `curl`, `jq`, `tr` | Required. The script checks them on start. | | `sha256sum`, or `shasum` on macOS | The checksum check | | `tput`, `awk` | Styling only | The examples below assume `snapsos.sh` is in the current directory. ## First command Print the newest mainnet Celestia snapshot: ```bash bash snapsos.sh -n Celestia --latest ``` The output is two lines, a summary and the download URL: ```text Celestia mainnet # by () - ``` ## Interactive mode ```bash bash snapsos.sh ``` The menu fetches `/api/networks` and asks in order for network, chain ID, type, then a snapshot from a table (height, type, size, time, contributor). A step with a single option is selected automatically. Entering `b`, `back` or `0` goes back. After a snapshot is chosen: | Choice | Action | |---|---| | 1) View link | Prints the URL, waits for Enter, returns to the same menu | | 2) Download | Runs `curl -fL -o ` in the current directory, checks the SHA256, then exits | ::: details How the saved file name is chosen The saved file name is the one the API reports, which is the last segment of the download URL. The script uses it only when it is a plain name: not empty, no `/`, no control characters and not starting with `.` or `-`. Otherwise it takes the last segment of the download URL under the same rules, and `snapshot.bin` when that fails too. ::: ## Flag mode All filtering and sorting happens in the API. The exit code is `0` on success and `1` otherwise. `--latest` uses `GET /api/cli/latest` for the newest snapshot. Without it, the script uses `GET /api/cli/snapshots?format=cli` and prints the first `--limit` rows. ```bash bash snapsos.sh -n Celestia -t archive --latest # newest snapshot bash snapsos.sh -n Celestia -i mocha-5 --latest # newest mocha-5 testnet snapshot bash snapsos.sh -n Celestia -m 5 # list 5 snapshots bash snapsos.sh -n Celestia --latest -q # only the URL, for piping ``` ::: details How the chain is chosen With `-i` and no `-c`, the chain follows from the chain ID, so `-i mocha-5` selects testnet. With neither, `--latest` uses mainnet. List mode does not default the chain, so it lists mainnet and testnet snapshots together unless `-c` or `-i` narrows them. Each list row is the same two lines, separated by a blank line. `-c`, `-i` and `-t` are case-insensitive. ::: ### Download from flag mode Flag mode prints the link. Combine `-q` with `curl` to download. The file name comes from the URL, so the extension matches the snapshot file format: ```bash url=$(bash snapsos.sh -n Celestia --latest -q) curl -fL -o "$(basename "$url")" "$url" ``` A download this way is not checked automatically. Check it with [`--verify`](#verify-a-file-on-disk). ## Verify a download After an interactive download, the script checks the file against the SHA256 checksum the contributor publishes for the snapshot. The hash is computed with `sha256sum`, or `shasum -a 256` where `sha256sum` is missing, as on macOS. `--no-verify` skips the check. ::: details Results and exit codes | Result | Output | Exit code | |---|---|---| | Hash matches | `SHA256 match: ` | `0` | | Hash differs | `Error: SHA256 mismatch.` plus the expected and the actual hash | `1` | | No checksum published | `No SHA256 is published for this snapshot, so the file was not checked.` | `0` | | Published hash malformed | `Error: The published SHA256 is not 64 hex characters, so the file was not checked.` | `1` | | Hash tool missing | `Error: Neither sha256sum nor shasum is installed, so the SHA256 was not checked.` | `1` | | `--no-verify` given | `SHA256 check skipped (--no-verify).` | `0` | ::: ::: warning Mismatch On a mismatch, the downloaded file is not safe to extract. The [Quickstart](https://docs.snapsvault.xyz/overview/quickstart#verify-the-checksum) says what to do next. ::: ### Verify a file on disk To check a file that is already on disk, pass the expected hash from the snapshot page: ```bash bash snapsos.sh --verify "$(basename "$url")" --sha256 ``` `--verify` makes no API request. It exits `0` on a match and `1` on a mismatch, a missing file, a path that is not a regular file, a malformed hash or a missing hash tool. ## Flags | Flag | Default | Meaning | |---|---|---| | `-n`, `--network NAME` | none | Network, for example `Celestia`, case-insensitive. Its presence selects flag mode. | | `-c`, `--chain NAME` | the chain of `-i` | Chain, `mainnet` or `testnet`, case-insensitive. Without `-c` and `-i`, `--latest` uses mainnet and a list shows both chains. | | `-i`, `--chain-id ID` | none | Chain ID, for example `celestia` or `mocha-5`, case-insensitive | | `-t`, `--type TYPE` | none | Snapshot type, for example `pruned` or `archive`, case-insensitive | | `-l`, `--latest` | off | Resolve only the newest snapshot | | `-m`, `--limit NUM` | 15 | Rows to print in list mode. A positive integer. | | `-q`, `--quiet` | off | Print only the download URL or URLs | | `--no-verify` | off | Skip the SHA256 check after an interactive download | | `--verify FILE` | none | Check a file on disk against `--sha256`, then exit. Makes no API request. | | `--sha256 HEX` | none | Expected SHA256 for `--verify`, 64 hex characters | | `--api-base URL` | `https://celestia.snapsvault.xyz` | API address. Env: `SNAPSV_API_BASE`. A trailing slash is removed. | | `-h`, `--help` | | Print help and exit | ::: details Flag combinations and environment Flag mode starts with `-n`. `--verify` runs on its own and is rejected with an error when combined with `-n`, `-c`, `-i`, `-t`, `-l`, `-m` or `-q` (or their long forms). Using `-c` or `-i` without `-n` exits with an error. With none of these flags, the script opens interactive mode. Requests time out after 20 seconds. Times are printed in UTC. `NO_COLOR` disables color, and output degrades on a non-terminal. ::: ## Next steps - [Quickstart](https://docs.snapsvault.xyz/overview/quickstart#restore-a-node-from-a-snapshot): verify and restore a node from the downloaded snapshot file - [REST API](https://docs.snapsvault.xyz/core-components/rest-api): the routes the script calls - [Feedback](https://docs.snapsvault.xyz/contributing/feedback): report a problem or suggest an improvement --- Source: https://docs.snapsvault.xyz/core-components/rest-api # REST API The REST API returns the same snapshot data as the [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace) as JSON. It has nine public routes, all `GET`, with no API key. Scripts that pick a snapshot automatically use it, and the [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli) is a client of it. Base URL: `https://celestia.snapsvault.xyz/api` ## First request Get the newest mainnet snapshot of one contributor: ```bash curl -s "https://celestia.snapsvault.xyz/api/cli/latest?network=celestia&contributor=denodes" ``` ::: details Response (trimmed) ```json { "success": true, "data": { "chain": "mainnet", "chain_id": "celestia", "height": 15374529, "contributor": { "name": "deNodes", "website": "https://denodes.io", "...": "profile fields" }, "type": "pruned", "size": "44Gb", "download_url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15374529.tar.bz2", "filename": "celestia-mainnet_15374529.tar.bz2", "time": "2026-10-28T16:03:13.000Z", "checksum": { "sha256": "02f15479e16faa68d214582c4f34983fc81ae4b4a8efc85238e9d3367161854e" } } } ``` ::: The routes read the current snapshots from the database, which the sync job refreshes every 2 minutes. ::: info About the examples Responses on this page are trimmed and were captured from production. Snapshot values change on every sync. Contributors remove older snapshot files, so a sample download URL can return `404`, while the request itself always returns the current URL. ::: ![The app reads the database and serves nine public routes; JSON routes are cached for about a minute](https://docs.snapsvault.xyz/diagrams/rest-api-flow.svg) ## Routes | Route | Purpose | |---|---| | [`GET /api/snapshots`](#get-api-snapshots) | All current snapshots | | [`GET /api/snapshots/historical`](#get-api-snapshots-historical) | Current and archived snapshots | | [`GET /api/networks`](#get-api-networks) | Networks with their chains, chain IDs, counts and the newest snapshot | | [`GET /api/cli`](#get-api-cli) | Self-description of the CLI routes | | [`GET /api/cli/snapshots`](#get-api-cli-snapshots) | Filtered snapshot list for scripts | | [`GET /api/cli/latest`](#get-api-cli-latest) | The newest snapshot for a filter | | [`GET /api/contributors`](#get-api-contributors) | Contributor list and profile | | [`GET /api/snapshot-configurations`](#get-api-snapshot-configurations) | Feed status per contributor and chain ID | | [`GET /api/keybase-avatar/{identity}`](#get-api-keybase-avatar) | Contributor avatar proxy | ## Conventions | Topic | Rule | |---|---| | Terms | `network` is the network name (`celestia`), `chain` is `mainnet` or `testnet`, and `chain_id` is one of `celestia`, `mocha-4`, `mocha-5`. See the [Glossary](https://docs.snapsvault.xyz/overview/glossary). | | `network` format | Must match `^[A-Za-z0-9._-]{1,64}$`, otherwise the response is `400` with `Invalid network parameter`. Matching is case-insensitive. | | Timestamps | ISO 8601 values in UTC | | CORS | Public routes send `Access-Control-Allow-Origin: *` | | Caching | JSON routes are cached by the CDN for 60 seconds and can serve the previous response for up to 2 more minutes while it refreshes, so a new snapshot can take a few minutes to show up. Avatars are cached for a day. | ## GET /api/snapshots All current snapshots, optionally for one network and chain. | Parameter | Default | Meaning | |---|---|---| | `network` | none | Network name, for example `celestia`. Without it, all current snapshots. | | `chain` | none | `mainnet` or `testnet`, case-insensitive. Applied only together with `network`. | ```bash curl -s "https://celestia.snapsvault.xyz/api/snapshots?network=celestia&chain=mainnet" ``` ::: details Response (trimmed to one snapshot) ```json { "success": true, "data": [ { "block_height": 15374529, "time": "2026-10-28T16:03:13.000Z", "size": "44Gb", "url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15374529.tar.bz2", "type": "pruned", "network": { "name": "Celestia", "display_name": "Celestia", "image": "https://celestia.snapsvault.xyz/celestia-logo.svg" }, "chain": "mainnet", "chain_id": "celestia", "contributor": { "name": "deNodes", "website": "https://denodes.io", "email": "hello@denodes.io", "...": "profile fields" }, "period": "4h", "tx_index": "false", "checksum": { "sha256": "02f15479e16faa68d214582c4f34983fc81ae4b4a8efc85238e9d3367161854e" }, "is_available": true } ], "last_updated": "2026-10-28T18:21:00.000Z" } ``` `contributor` is an object here. `checksum` is absent when the contributor publishes no checksum. `is_available` is `true` on a stored snapshot. Without `network`, a feed that has no stored snapshot is added as a placeholder row with `is_available: false`, `is_unavailable: true` and an `unavailable_reason`. ::: ## GET /api/snapshots/historical Current and archived snapshots. An archived snapshot is one that left its feed. | Parameter | Default | Meaning | |---|---|---| | `network` | none | Network name. With it, current and archived snapshots, newest first, at most 100. Without it, current snapshots only. | | `startDate`, `endDate` | none | Any parseable date string. An invalid value returns `400`. | | `currentOnly` | `false` | `true` limits the result to current snapshots. | ```bash curl -s "https://celestia.snapsvault.xyz/api/snapshots/historical?network=celestia" ``` ::: details Response (trimmed) ```json { "success": true, "data": [ { "...": "same shape as /api/snapshots, one object per snapshot" } ], "count": 100 } ``` An archived snapshot has `is_available: false` when a newer snapshot uses the same download URL, because that URL now serves the newer snapshot file. ::: ## GET /api/networks Networks with their chain IDs. No parameters. One row per network and chain ID. ```bash curl -s "https://celestia.snapsvault.xyz/api/networks" ``` ::: details Response (trimmed to one row) ```json { "success": true, "data": [ { "network": "Celestia", "chain_id": "mocha-5", "chains": ["testnet"], "has_snapshots": true, "snapshot_count": 5, "contributors": ["Polkachu", "QubeLabs", "deNodes", "kjnodes"], "types": ["archive", "pruned"], "latest_snapshot": { "height": 2106285, "time": "2026-10-28T18:01:33.000Z", "contributor": "deNodes" }, "display_name": "Celestia (mocha-5)", "cli_id": "celestia-mocha-5" } ], "total": 3, "summary": { "total_networks": 1, "total_chain_ids": 3, "chain_ids_with_snapshots": 3, "total_snapshots": 15, "total_chains": 2 }, "last_updated": "2026-10-28T18:20:52.556Z" } ``` The live response has one row per chain ID. `snapshot_count` counts stored snapshots, so a contributor with two current snapshots adds two. In `summary`, `total_networks` counts distinct networks, `total_chain_ids` and `chain_ids_with_snapshots` count rows, and `total_chains` counts distinct values of mainnet and testnet. ::: ## GET /api/cli A static description of the CLI routes. No parameters. The response has the keys `endpoints`, `workflow`, `examples` and `tips`. ```bash curl -s "https://celestia.snapsvault.xyz/api/cli" ``` ## GET /api/cli/snapshots A filtered snapshot list for scripts, sorted by height, then time, newest first. | Parameter | Default | Meaning | |---|---|---| | `network` | required | Network name. Missing returns `400` with a `usage` object. | | `chain_id` | none | Chain ID, case-insensitive | | `chain` | none | `mainnet` or `testnet`, case-insensitive | | `contributor` | none | Case-insensitive substring of the contributor name | | `type` | none | Type, for example `pruned`, case-insensitive | | `latest` | `false` | `true` keeps the newest snapshot per chain ID and chain | | `format` | `detailed` | `cli` returns flat rows, `detailed` returns the full objects | ::: code-group ```bash [SnapsOS CLI] bash snapsos.sh -n Celestia -m 5 ``` ```bash [curl] curl -s "https://celestia.snapsvault.xyz/api/cli/snapshots?network=celestia&contributor=denodes&format=cli" ``` ::: ::: details Response (trimmed to one row) ```json { "success": true, "data": [ { "network": "Celestia", "chain_id": "celestia", "chain": "mainnet", "height": 15374529, "contributor": "deNodes", "type": "pruned", "size": "44Gb", "download_url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15374529.tar.bz2", "time": "2026-10-28T16:03:13.000Z", "id": "celestia-celestia-mainnet-15374529-denodes-pruned", "display_name": "Celestia mainnet #15374529 by deNodes (pruned)", "file_size": "44 GB", "filename": "celestia-mainnet_15374529.tar.bz2" } ], "total": 4, "filters": { "network": "celestia", "chain_id": null, "chain": null, "latest": false, "contributor": "denodes", "type": null, "format": "cli" }, "available_options": { "chain_ids": ["celestia", "mocha-4", "mocha-5"], "chains": ["mainnet", "testnet"], "contributors": ["ITRocket", "NodeStake", "Noders", "Polkachu", "QubeLabs", "UnityNodes", "deNodes", "kjnodes"], "types": ["archive", "pruned"] }, "last_updated": "2026-10-28T18:21:51.430Z" } ``` With `format=detailed`, `network` and `contributor` are objects, and `period`, `tx_index` and `checksum` are added. Checksums are part of the detailed format. ::: ## GET /api/cli/latest The newest snapshot for a filter, which is the one with the highest block height. | Parameter | Default | Meaning | |---|---|---| | `network` | required | Network name | | `chain_id` | none | Chain ID, case-insensitive | | `chain` | the chain of `chain_id`, else `mainnet` | `mainnet` or `testnet`, case-insensitive | | `type` | none | Type, case-insensitive | | `contributor` | none | Case-insensitive substring of the contributor name | With `chain_id` and no `chain`, the chain follows from the chain ID, so `chain_id=mocha-5` returns the newest testnet snapshot of `mocha-5`. ::: code-group ```bash [SnapsOS CLI] bash snapsos.sh -n Celestia -i mocha-5 --latest ``` ```bash [curl] curl -s "https://celestia.snapsvault.xyz/api/cli/latest?network=celestia&chain_id=mocha-5" ``` ::: ::: details Response (trimmed) ```json { "success": true, "data": { "network": { "name": "Celestia", "display_name": "Celestia", "image": "https://celestia.snapsvault.xyz/celestia-logo.svg" }, "chain": "testnet", "chain_id": "mocha-5", "height": 2106285, "contributor": { "name": "deNodes", "website": "https://denodes.io", "...": "profile fields" }, "type": "pruned", "size": "18Gb", "file_size": "18 GB", "download_url": "https://celestia-mocha-snap.denodes.xyz/celestia-mocha_2106285.tar.bz2", "filename": "celestia-mocha_2106285.tar.bz2", "time": "2026-10-28T18:01:33.000Z", "checksum": { "sha256": "ba24b98465189a7bbc5ec2c3f53790f057a2154708a8ab8917ef3573bdee2b14" }, "contributor_info": { "name": "deNodes", "website": "https://denodes.io", "identity": "C89053F92B77D8C0" } }, "alternatives": { "other_contributors": ["kjnodes", "Polkachu", "QubeLabs"], "other_types": ["archive"], "total_snapshots": 5 }, "last_updated": "2026-10-28T18:21:42.387Z" } ``` ::: ## GET /api/contributors One contributor profile, or a list of contributors. | Parameter | Default | Meaning | |---|---|---| | `name` | none | Exact contributor name. Returns the full profile, or `404` when unknown. | | `limit` | 10 | Number of contributors returned when `name` is absent, ordered by name. Maximum 100. | ```bash curl -s "https://celestia.snapsvault.xyz/api/contributors?name=deNodes" ``` ::: details Response (description and links trimmed) ```json { "success": true, "data": { "name": "deNodes", "email": "hello@denodes.io", "website": "https://denodes.io", "identity": "C89053F92B77D8C0", "contributor_since": "2025-07-24T21:16:52.000Z", "number_of_snapshots": 4, "networks_covered": ["celestia"], "snapshot_freshness": { "periods": ["4h"], "averagePeriodHours": 4 }, "uptime_availability": { "totalChecks": 13124, "successfulChecks": 13121, "percentage": 99.97714111551358, "lastChecked": "2026-10-28T18:20:51.782Z" }, "created_at": "2026-10-19T16:44:49.225Z", "updated_at": "2026-10-28T18:20:51.878Z" } } ``` `snapshot_freshness.averagePeriodHours` is the average of the known periods in hours, and `null` when no period is known. `number_of_snapshots` counts the contributor's current snapshots. `contributor_since` is the date the contributor was added to the registry, and `null` until it is known. ::: ## GET /api/snapshot-configurations The status of each contributor feed, one element per contributor, chain ID and type. | Parameter | Default | Meaning | |---|---|---| | `network`, `chain_id` | none | Together: the feeds of that chain ID. `network` is the registry directory name, matched exactly. | | `contributor` | none | The feeds of one contributor | | (none) | | A `summary` and `stats` object over all feeds. `summary.chain_ids` and `stats.configurations_by_network` list the chain IDs and networks with their counts. | ```bash curl -s "https://celestia.snapsvault.xyz/api/snapshot-configurations?network=celestia&chain_id=celestia" ``` ::: details Response (trimmed to one element) ```json { "success": true, "data": [ { "contributor_name": "deNodes", "type": "pruned", "period": "4h", "tx_index": false, "chain": "mainnet", "is_active": true, "is_available": true, "latest_snapshot": { "filename": "celestia-mainnet_15374529.tar.bz2", "url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15374529.tar.bz2", "size": "44Gb", "height": 15374529, "creationDate": "2026-10-28T16:03:13.000Z" }, "last_successful_fetch": "2026-10-28T18:20:51.111Z", "consecutive_failures": 0, "uptime_percentage": 99.96952613134238 } ] } ``` `is_available` is `true` when the feed has a stored latest snapshot. With `contributor`, each element carries `network` and `chain_id` instead of `contributor_name`. ::: ## GET /api/keybase-avatar/{identity} A contributor avatar. `identity` is the 16-hex Keybase key suffix of a contributor. The route proxies the Keybase picture (PNG, JPEG, GIF or WebP). Without a picture, a default avatar is returned. ```bash curl -s "https://celestia.snapsvault.xyz/api/keybase-avatar/C89053F92B77D8C0" -o avatar.img ``` ## Errors Failed requests return JSON with `success: false` and an `error` message. | Status | When | Body | |---|---|---| | `400` | Invalid `network`, or a missing `network` on the `cli` routes | `{ "success": false, "error": "Invalid network parameter" }` | | `404` | No contributor with that name | `{ "success": false, "error": "Contributor not found" }` | | `404` | Any other path under `/api/` | `{ "success": false, "error": "Not found" }` | | `404` | `/api/cli/latest` finds no match | See below | | `500` | Server error | `success: false` with an `error` message | ::: details No match on /api/cli/latest `mocha-5` is a testnet chain ID, so a mainnet filter finds no snapshot: ```bash curl -s "https://celestia.snapsvault.xyz/api/cli/latest?network=celestia&chain_id=mocha-5&chain=mainnet" ``` ```json { "success": false, "error": "No snapshots found matching criteria", "criteria": { "network": "celestia", "chain_id": "mocha-5", "chain": "mainnet", "type": null, "contributor": null }, "suggestion": "Try removing some filters or check available networks at /api/networks" } ``` The same request without `chain` returns the newest `mocha-5` snapshot. ::: ## Next steps - [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace): the same data in the browser - [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli): the same `cli` routes from a terminal - [Feed format](https://docs.snapsvault.xyz/contributing/feed-format): how feed entries become these fields - [Feedback](https://docs.snapsvault.xyz/contributing/feedback): report a problem or ask for help --- Source: https://docs.snapsvault.xyz/contributing/list-your-snapshots # Contribute snapshots This page shows how a contributor, a snapshot provider, lists its snapshots on SnapsVault. Nothing needs to be installed on the snapshot server: the feed is a plain file, and the registry file is checked automatically on the pull request. ## The process The process includes three steps: 1. Publish a JSON feed over HTTPS, one entry per snapshot, in the format of the [feed example](#feed-example). 2. Add one file at `chains/celestia//.json` to the [registry repository](https://github.com/denodesxyz/snapsvault-registry) by pull request, in the format of the [registry file example](#registry-file-example). `` is `celestia` (mainnet), `mocha-4` or `mocha-5` (testnets). `` is a file name of your choice, such as your contributor name, and you reuse it in every chain ID folder. 3. Once the pull request is merged, the snapshots appear on SnapsVault, in the [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace), the [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli) and the [REST API](https://docs.snapsvault.xyz/core-components/rest-api), within a few minutes. ::: info Already on SnapsVault? Some contributors are already listed. They edit their existing file in `chains/celestia//` and replace its feed URL with their own, keeping the file name, instead of adding a new file. A new file with the same contributor name fails the check. ::: ::: tip Need help? Ask in your pull request, or on [Telegram](https://t.me/goldzn). More options are on the [Feedback](https://docs.snapsvault.xyz/contributing/feedback) page. ::: ::: tip Using an AI agent? A ready prompt in [Set it up with an AI agent](#set-it-up-with-an-ai-agent) lets a coding agent create the feed on the snapshot server. ::: ## Feed example A feed is a JSON array served over HTTPS, one entry per current snapshot, one feed per chain ID and snapshot type. The file can have any name, for example `index.json`. Fill all six fields: `url`, `filename`, `size`, `creation_date`, `latest_block_height` and `sha256sum`. A missing field is shown as "N/A" on SnapsVault (see [Feed format](https://docs.snapsvault.xyz/contributing/feed-format#feed-fields) for the few that get a fallback), and the check fails when `url` is missing, or `latest_block_height` is missing (except for an archive). A snapshot of type `archive` that starts at genesis may use height `0`. This example is based on the deNodes mainnet feed: ```json [ { "url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15318997.tar.bz2", "filename": "celestia-mainnet_15318997.tar.bz2", "size": "38Gb", "creation_date": "2026-10-26T20:02:47Z", "latest_block_height": "15318997", "sha256sum": "931f722be05699d02cbc082c476aa48d07b9fa1ea1c336dc6844e8298838b598" } ] ``` Each field and its rules are described in the [Feed format](https://docs.snapsvault.xyz/contributing/feed-format#feed-fields) page. ::: details Publishing several snapshots List every current snapshot of the same chain ID and snapshot type as one more entry in the same array. Each entry needs its own `url` and its own `latest_block_height`. ```json [ { "url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15318997.tar.bz2", "filename": "celestia-mainnet_15318997.tar.bz2", "size": "38Gb", "creation_date": "2026-10-26T20:02:47Z", "latest_block_height": "15318997", "sha256sum": "931f722be05699d02cbc082c476aa48d07b9fa1ea1c336dc6844e8298838b598" }, { "url": "https://celestia-mainnet-snap.denodes.xyz/celestia-mainnet_15313940.tar.bz2", "filename": "celestia-mainnet_15313940.tar.bz2", "size": "37Gb", "creation_date": "2026-10-26T16:02:43Z", "latest_block_height": "15313940", "sha256sum": "d0d08cf821578bca2b14aebdc56f17d6b51417b1539df43b37a918b2d3265214" } ] ``` A feed holds one snapshot type. To publish both `pruned` and `archive` snapshots, publish two feeds and list both in the registry file. ::: ## Registry file example The registry file names the contributor and points at each feed with its snapshot type and update period. This is the deNodes file for mainnet, `chains/celestia/celestia/deNodes.json`: ```json { "contributor": { "name": "deNodes", "email": "hello@denodes.io", "discord": "bombermine", "telegram": "https://t.me/denodes", "x": "https://x.com/denodes_io", "description": "An institutional-grade staking provider delivering secure operations and superior performance for PoS networks", "website": "https://denodes.io", "identity": "C89053F92B77D8C0" }, "snapshots": [ { "snapshots": "https://celestia-mainnet-snap.denodes.xyz/index.json", "type": "pruned", "period": "4h", "tx_index": false } ] } ``` - `snapshots` is the URL of the feed. - `type` is `pruned` or `archive`. - `period` is how often a new snapshot appears, such as `4h`, `6h` or `1d`. - `tx_index` is `true` only if the node keeps the transaction index. `snapshots` is an array, so one file can list several feeds, one per type. A contributor with snapshots for several chain IDs adds one file to each chain ID folder, with the same file name and the same `contributor` object. The fields are described in [Registry file](https://docs.snapsvault.xyz/contributing/registry-file). ## Check the file Every pull request runs the **Validate registry** check on the files it adds or changes. It reads the file, fetches every feed it lists and applies the rules of the reference pages. ::: tip Run it before the pull request From a clone of the registry, with Node.js 22.18 or later: ```bash node scripts/validate.mjs chains/celestia//.json ``` ::: Each problem names the field, the value found, what is expected and what SnapsVault does with it. An entry stops at its first problem, so run the check again after each fix. | Result | Effect | Typical cause | |---|---|---| | Error | Fails the check | A rule of the reference pages is broken | | Warning | Does not fail the check | A missing `size` or `sha256sum`, data shown as "N/A", a value read differently from what was written (such as a size without a unit), a snapshot file that does not answer the reachability request | ## Open a pull request 1. Fork the [registry repository](https://github.com/denodesxyz/snapsvault-registry). 2. Add the file at `chains/celestia//.json`, one per chain ID, where `` is `celestia`, `mocha-4` or `mocha-5` and the file name is the same in every chain ID folder. 3. Open a pull request that lists the feed URLs and the snapshot types they cover. 4. The SnapsVault team reviews the file against the checklist and merges it. ### Review checklist The pull request template carries the same checklist. | Area | What the review checks | |---|---| | File | Path `chains/celestia//.json`, one file per chain ID, with the same file name in every folder. The contributor name and every feed URL are not used by another contributor. | | Feed | Returns a JSON array, smaller than 1 MiB, within 10 seconds, without redirects. | | URLs | Every feed and download URL starts with `https://`, uses a public DNS name, and has no port, credentials or IP address. | | Entries | Every entry has all six fields: `url`, `filename`, `size`, `creation_date`, `latest_block_height` and `sha256sum`. A `pruned` entry has a `latest_block_height` above `0` (height `0` is only for an `archive` that starts at genesis). | | Size | Has a unit, such as `38Gb`. A bare number is read as GB; a bare value above `100000` is an error. | | Type and period | The registry `type` matches the feed and wins over the `type` of each entry. `period` matches how often the feed really updates. | | Snapshot files | The newest snapshot file answers a HEAD request over HTTPS (a warning if not). A stable latest URL, such as `latest.tar.lz4`, comes with a `latest_block_height` that changes for each new snapshot file, so history is kept. | | Check | **Validate registry** passes on the pull request, or the [local run](#check-the-file) passes. | ## After the merge A new listing appears within a few minutes. Search for the contributor name in the [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace) or query the [REST API](https://docs.snapsvault.xyz/core-components/rest-api). If the listing does not appear, re-check the checklist above. A contributor is listed while its feed can be read, and a snapshot stays listed while it is in the feed. ## Update or remove a listing Changes to the profile, feed URL, type or period go through a pull request that edits the registry file. A pull request that deletes the file removes the contributor. Its snapshots leave the Marketplace at the next sync. ## Generate a feed with a script A contributor can produce the feed with any tool in its own stack, because only the [feed format](https://docs.snapsvault.xyz/contributing/feed-format) matters. Below is an example for a typical Linux server, to adapt as needed. It needs bash, GNU coreutils and awk, and writes a one-entry feed next to the snapshot. :::: details make-feed.sh ```bash #!/usr/bin/env bash # Usage: make-feed.sh FILE TYPE HEIGHT BASE_URL [FEED] # TYPE is pruned or archive. FEED defaults to index.json next to the snapshot file. # Example: make-feed.sh /srv/snap/celestia-mainnet_15318997.tar.bz2 pruned 15318997 https://snap.example.com set -euo pipefail export LC_ALL=C file=${1:?usage: make-feed.sh FILE TYPE HEIGHT BASE_URL [FEED]} type=${2:?missing TYPE} height=${3:?missing HEIGHT} base=${4:?missing BASE_URL} feed=${5:-$(dirname "$file")/index.json} name=$(basename "$file") die() { echo "error: $*" >&2; exit 1; } [[ -s $file ]] || die "file not found or empty: $file" [[ $type == pruned || $type == archive ]] || die "TYPE must be pruned or archive" if [[ $type == pruned ]]; then [[ $height =~ ^[1-9][0-9]{0,14}$ ]] || die "every type except archive needs a height above 0" else [[ $height =~ ^(0|[1-9][0-9]{0,14})$ ]] || die "HEIGHT must be a whole number (0 only for an archive from genesis)" fi [[ $base =~ ^https://([A-Za-z0-9-]+\.)+[A-Za-z]+(/[A-Za-z0-9._~/-]*)?$ ]] || die "BASE_URL must be https:// followed by a public host name and an optional plain path" [[ $name =~ ^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$ && $name != *..* ]] || die "invalid file name: $name" bytes=$(stat -c %s "$file") size=$(awk -v b="$bytes" 'BEGIN { if (b >= 1e9) printf "%.1fGB", b / 1e9; else if (b >= 1e6) printf "%.1fMB", b / 1e6; else printf "%dB", b }') created=$(date -u -d "@$(stat -c %Y "$file")" +%Y-%m-%dT%H:%M:%SZ) sum=$(sha256sum "$file" | awk '{ print $1 }') tmp=$(mktemp "$feed.XXXXXX") trap 'rm -f "$tmp"' EXIT printf '[\n {\n "url": "%s/%s",\n "filename": "%s",\n "size": "%s",\n "creation_date": "%s",\n "latest_block_height": "%s",\n "sha256sum": "%s"\n }\n]\n' \ "${base%/}" "$name" "$name" "$size" "$created" "$height" "$sum" > "$tmp" chmod 644 "$tmp" mv "$tmp" "$feed" echo "wrote $feed" ``` ```bash ./make-feed.sh /srv/snap/celestia-mainnet_15318997.tar.bz2 pruned 15318997 https://snap.example.com ``` The script works as follows: - The contributor passes the type and the block height, because only the contributor knows them. - It takes the size, the modification time and the SHA256 from the file, and rejects input that breaks the [feed format](https://docs.snapsvault.xyz/contributing/feed-format) rules. If the server already writes a `.sha256` file, use only its first 64 characters (the hash) for `sha256sum`, not the whole line with the file name. - It moves the finished feed into place, so the sync never reads a half-written file. - The feed URL for the registry file is then `https://snap.example.com/index.json`. - Call it at the end of the snapshot job, once the snapshot file is complete. Each feed covers one chain ID and one snapshot type, so give each its own `FEED` path. - One entry is enough, because older snapshots move to the history when they leave the feed. ::: tip Check the JSON To check the file without Node.js, run `python3 -m json.tool index.json`. ::: :::: ## Set it up with an AI agent An AI coding agent can set up the feed on the snapshot server. Fill in the four values at the top and paste the prompt into the agent, running on that server. The agent shows its plan before it changes anything. ```text Set up a SnapsVault snapshot feed on this server. Snapshot folder: Public base URL: Chain ID: Snapshot type: Rules: follow these pages exactly and treat them as the source of truth: - https://docs.snapsvault.xyz/contributing/feed-format - https://docs.snapsvault.xyz/contributing/list-your-snapshots Steps: 1. Inspect the snapshot folder and the job that creates the snapshots (cron, systemd timer or script). Do not move, rename or delete any snapshot file. 2. Find the block height of each snapshot from the snapshot job: its file name, its log or the node state at the time the snapshot was taken. Never use the current height of a running node for an older file. If the height cannot be found, stop and ask me. 3. Write the feed: a JSON array with one entry per current snapshot and the six fields url, filename, size, creation_date, latest_block_height and sha256sum. Compute sha256sum from the file, or take the 64-character hash from an existing .sha256 file. Write it under a new name and move it into place, so a reader never sees a half-written feed. 4. Run the feed update at the end of the snapshot job, once the snapshot file is complete, so the feed changes with every new snapshot. 5. Check the result: the JSON parses, every entry has the six fields in the documented formats, and the feed URL and every snapshot url answer over HTTPS. 6. Print the feed URL and a draft registry file for chains/celestia//.json in the format of the registry file example, with the period that matches the snapshot job. Before step 3, show me the plan: the files you will create or change and the exact feed you will write for the newest snapshot. Wait for my approval. ``` The agent ends with the feed URL and a draft registry file. Review the draft, then [open a pull request](#open-a-pull-request) or ask the SnapsVault team to update an existing listing. --- Source: https://docs.snapsvault.xyz/contributing/feed-format # Feed format This page is the reference for the snapshot feed: a JSON array served over HTTPS, one entry per current snapshot. To publish one, follow [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots). The registry side is described in [Registry file](https://docs.snapsvault.xyz/contributing/registry-file). ## Feed fields Fill all six fields below for each entry. A missing field is shown as "N/A" on SnapsVault, except where the table names a fallback. A value of `null` or `""` counts as absent, and unknown keys are ignored. A present field with an invalid value skips that entry. | Field | What to provide | Rule | When absent | |---|---|---|---| | `url` | HTTPS download URL of the snapshot file | [URL rules](#url-rules), no fragment. Alias `download_url`. | The entry is skipped | | `filename` | File name of the snapshot file | `^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$`, no `..` | Last path segment of `url` | | `size` | Size of the snapshot file with a unit, such as `38Gb` or `4.4GB` | A number with a unit (`B`, or `K`, `M`, `G`, `T`, `P` with optional `B` or `iB`), case-insensitive, so `38Gb` and `38GB` both mean 38 gigabytes. At most 24 characters. | Shown as "N/A"; the API returns `"0GB"` | | `creation_date` | When the snapshot was made | ISO 8601 with `Z` or an offset, a real date between 2019-01-01 and one day from now. Alias `time`. | Time of the sync | | `latest_block_height` | Block height of the snapshot | Safe integer or a string of 1 to 15 digits. Aliases `block_height`, `height`. See the [height rule](#height-rule). | Counts as 0 | | `sha256sum` | SHA256 of the snapshot file | 64 hex characters, stored lower case. Alias `checksum.sha256`. If the server already writes a `.sha256` file, use only its first 64 characters (the hash), not the whole line with the file name. | No checksum is shown | ::: details Size units A bare number is read as GB, and a digit string without a unit is shown without one. Never publish bytes: the check fails a bare value above `100000`. Sorting by size across units is approximate. ::: ### Also accepted in a feed `type`, `period` and `tx_index` belong in the [registry file](https://docs.snapsvault.xyz/contributing/registry-file#feeds), which explains each of them. The registry values win, and the feed values are used only when the registry file leaves them out. | Field | Rule | |---|---| | `type` | Matches `^[A-Za-z0-9._-]{1,32}$` | | `period` | Matches `^[A-Za-z0-9._-]{1,32}$` | | `tx_index` | A boolean, or `"true"` or `"false"` | When neither file sets the `type`, the type of the newest entry is used. ## What the check requires The registry check fails an entry only when it has no valid `url`, when a present field has an invalid value, or when it breaks the height rule. A missing `size` or `sha256sum` gives a warning. Everything else missing is shown as "N/A" or replaced by the fallback in the table. Fill all six fields so every snapshot shows its size, date, height and checksum. ### Height rule ::: warning Height above 0 `latest_block_height` must be above 0 for every entry, unless the effective type is exactly `archive` (lower case), an archive that starts at genesis. A missing height counts as 0. The effective type is the `type` in the registry file, else the `type` of the newest entry in the feed (by `creation_date`), else the `type` of the entry itself. An entry that breaks the rule is skipped. ::: ## How fields show on SnapsVault - **SHA256** is shown next to the snapshot. - **Type** applies to every entry of a feed, so one feed carries one type. An entry whose own `type` differs from the registry `type` gets a warning from the check. - **Period** values in the `4h`, `1d` and `1w` style are parsed for "next update". - **Size** is shown as published. - **Reachability.** The check sends a HEAD request to the `url` of the newest entry and warns when the snapshot file does not answer with a success status. ## Feed limits | Limit | Value | |---|---| | Transport | HTTPS only, redirects refused | | Timeout | 10 seconds | | Body size | At most 1 MiB, checked on `Content-Length` and while reading | | Top level | JSON array with at least one entry | | Entries kept | 500 newest | ::: details How a snapshot is identified A snapshot is identified by network, chain ID, type, contributor and height. A snapshot without a height (an `archive`, stored as height 0) is identified by its download URL instead, so each snapshot file is its own snapshot. A feed that repeats the same height still updates that one snapshot in place, so publish a new height for each snapshot to build history. Snapshots that leave the feed move to the history, which the API returns through `/api/snapshots/historical`. ::: ## URL rules These apply to feed URLs, download URLs and profile links. | Rule | Detail | |---|---| | Length and characters | At most 2048 characters from `A-Z a-z 0-9 . _ ~ : / ? & = % + , @ -` (profile links may also contain `#`) | | Scheme | Starts with lowercase `https://` | | Host characters | Only letters, digits, dots and hyphens: no user, password, port or percent-encoding | | Host name | A public DNS name with at least two labels and an alphabetic top-level label. IP addresses, `localhost` and names ending in `.local`, `.localhost`, `.internal`, `.localdomain`, `.lan` or `.home.arpa` are rejected. | ## Next steps - [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots): publish your feed and get listed - [Registry file](https://docs.snapsvault.xyz/contributing/registry-file): describe the feed in the registry - [REST API](https://docs.snapsvault.xyz/core-components/rest-api): the same fields as the API returns them --- Source: https://docs.snapsvault.xyz/contributing/registry-file # Registry file This page is the reference for the registry file: one JSON file per contributor and chain ID in the [registry repository](https://github.com/denodesxyz/snapsvault-registry). To add one, follow [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots). The feed it points at is described in [Feed format](https://docs.snapsvault.xyz/contributing/feed-format). ## File location The file lives at `chains///.json`. The first directory level is the network, capitalized for display. The second level is the chain ID, which decides the chain. Each file holds one contributor and one chain ID. | Folder | Chain ID | Chain | |---|---|---| | `celestia/` | `celestia` | Mainnet | | `mocha-4/` | `mocha-4` | Testnet | | `mocha-5/` | `mocha-5` | Testnet | ::: info New chain IDs A new chain ID needs an issue first. ::: | Item | Rule | |---|---| | Directory names | Match `^[A-Za-z0-9._-]{1,64}$` | | File names | Match `^[A-Za-z0-9._-]{1,100}\.json$` and are not only dots before `.json`. The file name does not have to equal `contributor.name`, but every file of one contributor uses the same file name. | | Chain | A chain ID is testnet when it is exactly `mocha-4` or `mocha-5`, or when it contains `test` (case-insensitive). Every other chain ID is mainnet. | ## Fields A value of `null` or `""` counts as absent. An invalid profile field is dropped from the profile, and an invalid `snapshots[]` element skips that feed. ### Contributor profile | Field | Required | Rule | |---|---|---| | `contributor` | Yes | Object | | `contributor.name` | Yes | Display name, 1 to 64 characters after trimming, no control, bidirectional or zero-width characters. Compared without case and extra spaces, so a name belongs to one contributor. | | `contributor.website`, `x`, `telegram` | Optional | Profile links. [URL rules](https://docs.snapsvault.xyz/contributing/feed-format#url-rules), `#` fragment allowed. | | `contributor.description` | Optional | One line about the contributor, at most 500 characters. Control characters become spaces. | | `contributor.email` | Optional | Contact address: `^[A-Za-z0-9._+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,63}$`, at most 254 characters | | `contributor.discord` | Optional | Discord username, such as `bombermine`, shown as text: `^[A-Za-z0-9._#-]{2,40}$`, not a link | | `contributor.identity` or `contributor.logoUrl` | Optional | Avatar: the 16-character Keybase key suffix (`identity`, 16 hex characters), or an HTTPS image URL (`logoUrl`, URL rules with `#` allowed). Without either, the default avatar is shown. | ### Feeds `snapshots` is an array with at least one feed. One file can list several feeds, for example a `pruned` feed and an `archive` feed. | Field | Required | Meaning | |---|---|---| | `snapshots[].snapshots` | Yes | URL of the feed. URL rules, no fragment. A feed URL belongs to one contributor. | | `snapshots[].type` | Yes, here or in the feed | `pruned` or `archive`. Applies to every entry of the feed. Matches `^[A-Za-z0-9._-]{1,32}$`. | | `snapshots[].period` | Recommended | How often the feed updates, such as `4h`, `6h` or `1d`. Drives "next update". Matches `^[A-Za-z0-9._-]{1,32}$`. | | `snapshots[].tx_index` | Optional | `true` when the snapshots include the TX index. A boolean or `"true"` or `"false"`. | ## Next steps - [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots): add your registry file by pull request - [Feed format](https://docs.snapsvault.xyz/contributing/feed-format): the fields of each feed entry - [Glossary](https://docs.snapsvault.xyz/overview/glossary): the terms used across the docs --- Source: https://docs.snapsvault.xyz/contributing/contribute # Improvements SnapsVault is open source under the Apache-2.0 license, and improvements to its code, tools and docs are welcome. This page covers the repositories, issues, pull requests, the local setup and the checks. Contributors who list snapshots follow [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots) instead. Questions and bug reports are on the [Feedback](https://docs.snapsvault.xyz/contributing/feedback) page. ## Repositories The Marketplace, the SnapsOS CLI, the REST API, the website and these docs live in one public repository, and the contributor listings live in a second one. | Repository | Contents | Changes by | |---|---|---| | [SnapsVault repository](https://github.com/denodesxyz/snapsvault) | Marketplace app and REST API, SnapsOS CLI, website, docs | Issues and pull requests | | [Registry repository](https://github.com/denodesxyz/snapsvault-registry) | One JSON file per contributor and chain ID, pointing at its feeds | Pull requests from contributors, see [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots) | ::: details Layout of the SnapsVault repository | Path | What it holds | |---|---| | `/` (root) | The [Marketplace](https://celestia.snapsvault.xyz) app and the REST API, built with Next.js | | `cli/snapsos.sh` | [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli), a single bash script | | `landing/` | The [website](https://snapsvault.xyz), a separate Next.js app | | `docs-site/` | These docs, built with VitePress | | `docs/` | Feed and registry contract as the code reads it, design rules | ::: ::: info Full rules This page is the short version of [CONTRIBUTING.md](https://github.com/denodesxyz/snapsvault/blob/main/CONTRIBUTING.md) on GitHub. ::: ## Issues Bugs and feature requests go to [GitHub issues](https://github.com/denodesxyz/snapsvault/issues/new/choose). The issue form offers a template for each kind. Searching existing issues first avoids duplicates. | A good bug report has | | |---|---| | What happened | The page, API route or CLI command, and the result | | What was expected | The result that should have appeared instead | | How to reproduce | Steps, the chain ID and contributor if relevant, the CLI flags or the request URL | | Environment | Browser, or operating system and `bash` version for the CLI | | A good feature request has | | |---|---| | Problem | What cannot be done today, or what is slow or unclear | | Who it helps | Node operators, contributors or developers, and in which situation | | Example | A concrete case, such as a network, chain ID, contributor or command, with the expected result | Describe the need rather than the implementation. Planned work is listed on the [SnapsVault website](https://snapsvault.xyz/#roadmap). A request is not a commitment to build. ## Pull requests 1. Fork the [SnapsVault repository](https://github.com/denodesxyz/snapsvault) and clone the fork. 2. Create a branch from `main` named `/`, for example `fix/cli-latest-testnet`. Common types are `feat`, `fix`, `docs`, `design`, `copy`, `chore`. 3. Set up the project as described in [Local setup](#local-setup) and make the change. 4. Run the [checks](#checks) for every part the change touches. 5. Push the branch and open a pull request against `main`. The description states the current behavior, the change and how it can be checked. A linked issue goes in the description. 6. A maintainer reviews the pull request. Review comments are answered with new commits on the same branch. An accepted pull request is merged into `main`. A pull request stays small and covers one change. A larger change, such as a new route or a new page, starts as an issue so the approach can be agreed first. Registry pull requests (contributor files) are reviewed and merged in the registry repository. ## Local setup Requirements: Node.js 22.18 or later, npm, `git`, and a MongoDB instance for the app. A local MongoDB, or one in Docker, is enough. Clone the fork and install: ```bash git clone https://github.com//snapsvault.git cd snapsvault npm ci ``` Then set up the part to change. ::: code-group ```bash [App and API] cp .env.example .env.local npm run dev ``` ```bash [Website] cd landing npm ci npm run dev ``` ```bash [Docs] cd docs-site npm ci npm run docs:dev ``` ```bash [SnapsOS CLI] bash cli/snapsos.sh --api-base http://localhost:3000 ``` ::: | Part | Runs at | Notes | |---|---|---| | App and API | `http://localhost:3000` | Needs `.env.local`, see below | | Website | `http://localhost:3001` | Reads the live REST API and needs no environment variables. Set `SNAPSHOTS_API_URL=http://localhost:3000` to point it at a local app. | | Docs | The address VitePress prints, by default `http://localhost:5173` | | | SnapsOS CLI | N/A | Needs no build. It runs against the production API by default, or against a local app with `--api-base`. | ### App environment In `.env.local`, set: - `MONGODB_URI` to the local MongoDB, for example `mongodb://localhost:27017/snapsvault`. - `GITHUB_TOKEN` to a GitHub token with read access to public repositories. The registry is public, and the token raises the GitHub API rate limit for the sync. The other variables are described in the [README](https://github.com/denodesxyz/snapsvault#environment-variables). The database starts empty. A sync reads the registry and every feed into it. With `CRON_SECRET` set in `.env.local`, run one sync with: ```bash curl -H "Authorization: Bearer " http://localhost:3000/api/sync-snapshots ``` ## Checks | Part | Commands | |---|---| | App and REST API (root) | `npx tsc --noEmit`, `npm run lint`, `npm run build` | | Website (`landing/`) | `npx tsc --noEmit`, `npm run lint`, `npm run build` | | Docs (`docs-site/`) | `npm run docs:build` | | Node tests | `node --test "src/**/*.test.mjs"` runs every `*.test.mjs` file (Node.js 22.18 or later, which runs the imported `.ts` files directly) | | CLI | `bash -n cli/snapsos.sh`, `bash cli/tests/run.sh`, and `shellcheck cli/snapsos.sh` when available | A pull request with failing checks is not accepted. ## Style - Code follows the style of the file it changes. New dependencies are added only when the change needs them. - Interface and docs text follows `docs/DESIGN.md`. Docs are written in the third person or the imperative. - Commit messages are short, in English and in the imperative, for example `Fix testnet default in --latest`. ## License SnapsVault is licensed under the [Apache License 2.0](https://github.com/denodesxyz/snapsvault/blob/main/LICENSE). A contribution submitted to the repository is licensed under the same terms. ::: tip Need help? Ask on [Telegram](https://t.me/goldzn) or open an issue in the [SnapsVault repository](https://github.com/denodesxyz/snapsvault/issues/new/choose). More options are on the [Feedback](https://docs.snapsvault.xyz/contributing/feedback) page. ::: ## Next steps - [Feedback](https://docs.snapsvault.xyz/contributing/feedback): ask a question, report a bug or report a security issue - [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots): list your snapshots on SnapsVault - [SnapsOS CLI](https://docs.snapsvault.xyz/core-components/snapsos-cli): the script in `cli/snapsos.sh` --- Source: https://docs.snapsvault.xyz/contributing/feedback # Feedback This page says where to send feedback, questions and reports about SnapsVault, so a message reaches the right place the first time. ## Where to go | I want to | Go to | |---|---| | Ask a question or get help | [Telegram](https://t.me/goldzn) or email [hello@denodes.io](mailto:hello@denodes.io) | | Give feedback or suggest a feature | [GitHub issues](https://github.com/denodesxyz/snapsvault/issues/new/choose) | | Report a bug in the Marketplace, the SnapsOS CLI, the REST API or these docs | [GitHub issues](https://github.com/denodesxyz/snapsvault/issues/new/choose) | | Report a problem with a listing or a feed file | [Registry issues](https://github.com/denodesxyz/snapsvault-registry/issues) | | Report a security issue | See [Report a security issue](#report-a-security-issue). Do not open a public issue. | ## Give feedback and get support Questions about how SnapsVault works, ideas and general feedback go to the SnapsVault team on [Telegram](https://t.me/goldzn) or by email at [hello@denodes.io](mailto:hello@denodes.io). A concrete feature request is best as a [GitHub issue](https://github.com/denodesxyz/snapsvault/issues/new/choose), because the discussion stays next to the code. ## Report a bug Open an issue in the [SnapsVault repository](https://github.com/denodesxyz/snapsvault/issues/new/choose) and pick the bug template. Search existing issues first. [Improvements](https://docs.snapsvault.xyz/contributing/contribute#issues) lists what a good report contains. ## Report a listing problem A wrong value on a snapshot, a snapshot that does not appear, or a problem with a contributor's feed or registry file goes to the [registry issues](https://github.com/denodesxyz/snapsvault-registry/issues). Name the contributor, the chain ID and the feed URL. A problem with a contributor's server or a snapshot file that does not download is best reported to that contributor. Its contact details are on its snapshot page in the [Marketplace](https://docs.snapsvault.xyz/core-components/marketplace#snapshot-page). ## Report a security issue ::: warning Keep it private Do not report security problems in public issues, pull requests or discussions. ::: Use GitHub private vulnerability reporting on the [SnapsVault repository](https://github.com/denodesxyz/snapsvault/security/policy) (Security tab, "Report a vulnerability"), or email [hello@denodes.io](mailto:hello@denodes.io). The process and the scope are in [SECURITY.md](https://github.com/denodesxyz/snapsvault/blob/main/SECURITY.md). ## Next steps - [Improvements](https://docs.snapsvault.xyz/contributing/contribute): propose a change to the code, tools or docs by pull request - [Contribute snapshots](https://docs.snapsvault.xyz/contributing/list-your-snapshots): list your snapshots on SnapsVault