Skip to main content
If you want to run a Full Validator, you need to set up your node to publish a history archive covering the network’s complete history. You can host an archive using a blob store such as Amazon’s S3 or Digital Ocean’s spaces, or you can simply serve a local archive directly via an HTTP server such as Nginx or Apache. If you’re setting up a Basic Validator, you can skip this section. No matter what kind of node you’re planning to run, make sure to set it up to get history, which is covered in Environment Preparation. Getting to a complete archive takes two stages:
  • Configuring your node to publish, described in the sections below. This fills the archive forward from the moment your node starts.
  • Completing the archive, which backfills everything from before that point.
One archive per nodeEach node must publish to its own dedicated archive. Writing to the same archive from multiple nodes is not supported and will result in undefined behavior, potentially including data loss. If you’re running multiple Full Validators (as Tier 1 organizations do), configure a separate archive for each — for example, history-a.example.com, history-b.example.com, and history-c.example.com.

Caching and History Archives

The primary cost of running a validator will very likely be egress bandwidth. A crucial part of your strategy to manage those costs should be caching. You can significantly reduce these data transfer costs by using common caching techniques or a CDN. Three simple rules apply to caching the History archives:
  1. Do not cache the archive state file .well-known/stellar-history.json (Cache-Control: no-cache)
  2. Do not cache HTTP 4xx responses (Cache-Control: no-cache)
  3. Cache everything else for as long as possible (> 1 day)

Local History Archive Using nginx

Here, we’ll demonstrate how you can configure your node to store its history files in the local filesystem, and then publish that history using nginx for our webserver software. First, you must add a history configuration stanza to your /etc/stellar/stellar-core.cfg configuration file.
Then, you must run Stellar Core’s new-hist command to create the local history archive.
This command creates the history archive structure:
Now that the history archive’s file structure is ready, you can configure a virtual host in nginx to serve the local archive.

Amazon S3 History Archive

Now, let’s demonstrate a configuration where your node stores its history files using Amazon’s S3 service. You can then publish that history using an Amazon S3 static site, or again use nginx for your webserver software. This time, using nginx, we’ll include some proxy and CDN configuration, as well. Start by adding a history configuration stanza to your /etc/stellar/stellar-core.cfg configuration file.
Then, you must run Stellar Core’s new-hist command to create and initialize the S3 archive.
These S3 history files can be served with something as simple as an Amazon S3 static site. Optionally, you may want to place a reverse proxy and CDN in front of the S3 static site (we’ll use nginx for this example).

Backfilling a History Archive

Given the choice, it’s best to configure your history archive prior to your node’s initial sync with an existing network. That way your validator’s history publishes as you join, and subsequently sync with, the network. However, if you have not published an archive during the node’s initial sync, the steps required to start publishing from an existing validator are quite straightforward. This is the first of the two stages on the way to a Full Validator; completing the archive follows. First, you’ll need to stop your stellar-core instance:
Then, add the history archive configuration to your node’s /etc/stellar/stellar-core.cfg configuration file.
Next, you must run Stellar Core’s new-hist command to create and initialize the local archive. (This is done as the stellar user.)
Now you can start your Stellar Core instance again:
As you allow your node to join the network again, you can watch it start publishing a few checkpoints to the newly created archive.
At this stage your validator is publishing each new checkpoint as the network advances, which lets other nodes catch up from your archive as far back as the point where you started publishing. Everything before that point is still missing, and filling it in is the second stage.

Complete History Archive

This is the second stage. A Full Validator publishes an archive reaching back to the network’s first ledger. The stellar-archivist command line tool gives you what you need to close the gap.

Installing stellar-archivist

Using the SDF package repositories, you can install it by running:
The tool is also published on crates.io. For detailed usage, please run stellar-archivist-rs --help (or stellar-archivist --help if installed from crates.io).

Where to run stellar-archivist

stellar-archivist is a standalone tool. It does not link against or communicate with stellar-core; all it needs is read and write access to the archive itself. That access can be a local filesystem path (file://), an HTTP(S) source, or a cloud object store (s3://, gcs://, azblob://, b2://), so you can run it from any machine that can reach your archive.
Run stellar-archivist on a separate host from your validator to avoid resource contention.Do not stop your validator to work on its archive. stellar-archivist operates on the archive files directly and does not interfere with live publishing. Your node should stay online and keep publishing checkpoints throughout.

Choosing a command

All three accept --low and --high to restrict the work to a ledger range; both bounds are rounded outward to the nearest checkpoint.

Checking file contents with --verify

By default, every command checks only that files exist. Adding --verify also checks that their contents are sound, which requires significantly more CPU and memory. Leave it off for routine completeness checks and for fixing missing files. Turn it on to find and fix corruption, where a file exists but its contents are wrong.

Scanning an archive

scan is read-only. It walks the archive and reports the files that are missing, which is how you find out whether your archive has a gap and exactly where it is.1
--report writes the same findings as JSON:
  • files maps a checkpoint ledger to the file types broken at that checkpoint.
  • buckets lists bucket hashes that are missing or failed their SHA-256 check.
  • checkpoints lists cross-file and hash chain failures, which are re-fetched whole.
  • well_known is the checkpoint to restore .well-known/stellar-history.json from, or null when it is healthy.

Repairing an archive

Once a scan has told you what is broken, repair fixes it in place: it identifies missing or broken files at the destination and re-fetches them from a known-good source — such as the SDF public history archive.
Repair runs in stages and reports each one separately: a main pass that audits the destination, a file retry that re-fetches everything recorded as broken, and a checkpoint retry for cross-file and chain failures.
The JSON report written by scan can be handed straight back to repair as a plan, using --plan. Repair then re-fetches exactly those files.
A final scan confirms the archive has been repaired:
Add --dry-run to report what would be repaired without writing anything. Combined with --report, this writes a plan you can review and apply later.

Mirroring an archive

mirror copies a source archive to a destination. It is the command to reach for when backfilling: run it once to build a complete archive from scratch, or scope it with --low and --high to fill in just the range of history your validator did not publish itself. For example, run the following command against an empty destination:
Afterwards, the destination contains a new archive covering history up to checkpoint 1023.
Mirroring is resumable. Running it again against the same destination with a higher --high picks up from the destination’s current checkpoint and copies only what is missing.Files already present at the destination are skipped rather than re-fetched. Use --overwrite to re-fetch and replace them instead.Filling in a range older than your archive’s latest checkpoint (recorded in .well-known/stellar-history.json) requires --overwrite:
You should now have a complete history archive being written by your full validator. Congratulations!

Footnotes

  1. The sample output on this page was captured with --verify, which is why it reports hash mismatches alongside the missing files. ↩