erigon-pulse/turbo/app/README.md
Mark Holt 79ed8cad35
E2 snapshot uploading (#9056)
This change introduces additional processes to manage snapshot uploading
for E2 snapshots:

## erigon snapshots upload

The `snapshots uploader` command starts a version of erigon customized
for uploading snapshot files to
a remote location.  

It breaks the stage execution process after the senders stage and then
uses the snapshot stage to send
uploaded headers, bodies and (in the case of polygon) bor spans and
events to snapshot files. Because
this process avoids execution in run signifigantly faster than a
standard erigon configuration.

The uploader uses rclone to send seedable (100K or 500K blocks) to a
remote storage location specified
in the rclone config file.

The **uploader** is configured to minimize disk usage by doing the
following:

* It removes snapshots once they are loaded
* It aggressively prunes the database once entities are transferred to
snapshots

in addition to this it has the following performance related features:

* maximizes the workers allocated to snapshot processing to improve
throughput
* Can be started from scratch by downloading the latest snapshots from
the remote location to seed processing

## snapshots command

Is a stand alone command for managing remote snapshots it has the
following sub commands

* **cmp** - compare snapshots
* **copy** - copy snapshots
* **verify** - verify snapshots
* **manifest** - manage the manifest file in the root of remote snapshot
locations
* **torrent** - manage snapshot torrent files
2023-12-27 22:05:09 +00:00

2.7 KiB

Erigon Sub Commands

Backup

Import

Init

Support

Snapshots

This sub command can be used for manipulating snapshot files

Uploader

The snapshots uploader command starts a version of erigon customized for uploading snapshot files to a remote location.

It breaks the stage execution process after the senders stage and then uses the snapshot stage to send uploaded headers, bodies and (in the case of polygon) bor spans and events to snapshot files. Because this process avoids execution in run signifigantly faster than a standard erigon configuration.

The uploader uses rclone to send seedable (100K or 500K blocks) to a remote storage location specified in the rclone config file.

The uploader is configured to minimize disk usage by doing the following:

  • It removes snapshots once they are loaded
  • It agressively prunes the database once entites are transferred to snapshots

in addition to this it has the following performance related features:

  • maximises the workers allocated to snaphot processing to improve thoughtput
  • Can be started from scratch by downloading the latest snapshots from the remote location to seed processing

The following configuration can be used to upload blocks from genesis where:

sync.loop.prune.limit=500000 Sets the records to be pruned to the database to 500,000 per iteration (as opposed to 100)
upload.location=r2:erigon-v2-snapshots-bor-mainnet Specified the rclone loaction to upload snapshot to
upload.from=earliest Sets the upload start location to be the earliest availible block, which will be 0 in the case of a fresh installtion, or specified by the last block in the chaindata db
upload.snapshot.limit=1500000 Tells the uploader to keep a maximum 1,500,000 blocks in the snapshots before deleting the aged snapshot
snapshot.version=2 Indivates the version to be appended to snapshot file names when they are creatated
erigon/build/bin/erigon snapshots uploader --datadir=~/snapshots/bor-mainnet --chain=bor-mainnet \
  --bor.heimdall=https://heimdall-api.polygon.technology --bor.milestone=false --sync.loop.prune.limit=500000 \
  --upload.location=r2:erigon-v2-snapshots-bor-mainnet --upload.from=earliest --snapshot.version=2 \
  --upload.snapshot.limit=1500000 

In order to start with the lates uploaded block when starting with an empty drive set the upload.from flag to latest. e.g.

--upload.from=latest

The configuration of the uploader implicitly sets the following flag values on start-up:

    --sync.loop.break.after=Senders
	--sync.loop.block.limit=100000
	--sync.loop.prune.limit=100000
	--upload.snapshot.limit=1500000 
	--nodownloader=true
	--http.enables=false
	--txpool.disable=true