publishing history archives

If you want to run a Full Validator or an Archiver, you need to set up your node to publish a history archive. 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 Watcher or 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 Configuration.

Caching and History Archives

You can significantly reduce the data transfer costs associated with running a public History archive by using common caching techniques or a CDN.

Three simple rules apply to caching the History archives:

  • Do not cache the archive state file .well-known/history-bantu.json ("Cache-Control: no-cache")

  • Do not cache HTTP 4xx responses ("Cache-Control: no-cache")

  • Cache everything else for as long as possible (> 1 day)

Local History Archive Using nginx

To publish a local history archive using nginx:

  • Add a history configuration stanza to your /etc/bantu/bantu-core.cfg:

[HISTORY.local]
get="cp /mnt/xvdf/bantu-core-archive/node_001/{0} {1}"
put="cp {0} /mnt/xvdf/bantu-core-archive/node_001/{1}"
mkdir="mkdir -p /mnt/xvdf/bantu-core-archive/node_001/{0}"
  • Run new-hist to create the local archive

# sudo -u bantu bantu-core --conf /etc/bantu/bantu-core.cfg new-hist local

This command creates the history archive structure:

  • Configure a virtual host to serve the local archive (Nginx)

Amazon S3 History Archive

To publish a history archive using Amazon S3:

  • Add a history configuration stanza to your /etc/bantu/bantu-core.cfg:

  • Run new-hist to create the s3 archive

# sudo -u bantu bantu-core --conf /etc/bantu/bantu-core.cfg new-hist s3

  • Serve the archive using an Amazon S3 static site

  • Optionally place a reverse proxy and CDN in front of the S3 static site

Backfilling a history archive

Given the choice, it's best to configure your history archive prior to your node's initial synch to the network. That way your validator's history publishes as you join/synch to the network.

However, if you have not published an archive during the node's initial synch, it's still possible to use the bantu-archivist command line tool to mirror, scan, and repair existing archives.

Using the BBF package repositories you can install bantu-archivist by running apt-get install bantu-archivist

The steps required to create a History archive for an existing validator — in other words, to upgrade a Basic Validator to a Full Validator — are straightforward:

  • Stop your bantu-core instance (systemctl stop bantu-core)

  • Configure a history archive for the new node

  • Run new-hist to create the local archive

# sudo -u bantu bantu-core --conf /etc/bantu/bantu-core.cfg new-hist local

This command creates the History archive structure:

  • Start your bantu Core instance (systemctl start bantu-core)

  • Allow your node to join the network and watch it start publishing a few checkpoints to the newly created archive

At this stage your validator is successfully publishing its history, which enables other users to join the network using your archive (although it won't allow them to CATCHUP_COMPLETE=true as the archive only has partial network history).

Complete History Archive

If you decide to publish a complete archive — which enables other users to join the network from the genesis ledger — it's also possible to use bantu-archivist to add all missing history data to your partial archive, and to verify the state and integrity of your archive. For example:

As you can tell from the output of the scan command, some history, ledger, transactions, and results are missing from the local history archive.

You can repair the missing data using bantu-archivist's repair command combined with a known full archive — such as the BBF public history archive:

# bantu-archivist repair http://history.bantu.org/prd/core-testnet/core_testnet_001/ file:///mnt/xvdf/bantu-core-archive/node_001/

A final scan of the local archive confirms that it has been successfully repaired

# bantu-archivist scan file:///mnt/xvdf/bantu-core-archive/node_001

Start your bantu-core instance (systemctl start bantu-core), and you should have a complete history archive being written to by your full validator.

Last updated

Was this helpful?