erigon-pulse/cmd/snapshots
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
..
cmp E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
copy E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
flags E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
manifest E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
sync E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
torrents E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
verify E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
main.go E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00
README.md E2 snapshot uploading (#9056) 2023-12-27 22:05:09 +00:00

Snapshots - tool for managing remote stanshots

In the root of Erigon project, use this command to build the the commands:

make snapshots

It can then be run using the following command

./buid/bin/snapshots sub-command options...

Snapshots supports the following sub commands:

cmp - compare snapshots

This command takes the follwoing form:

    snapshots cmp <location> <location>

This will cause the .seg files from each location to be copied to the local machine, indexed and then have their rlp contents compared.

Optionally a <start block> and optionally an <end block> may be specified to limit the scope of the operation

It is also possible to set the --types flag to limit the type of segment file being downloaded and compared. The currently supported types are header and body

copy - copy snapshots

This command can be used to copy segment files from one location to another.

This command takes the follwoing form:

    snapshots copy <source> <destination>

Optionally a <start block> and optionally an <end block> may be specified to limit the scope of the operation

verify - verify snapshots

-- TBD

manifest - manage the manifest file in the root of remote snapshot locations

The manifest command supports the following actions

Action Description
list list manifest from storage location
update update the manifest to match the files available at its storage location
verify verify that manifest matches the files available at its storage location

All actions take a <location> argument which specified the remote location which contains the manifest

Optionally a <start block> and optionally an <end block> may be specified to limit the scope of the operation

torrent - manage snapshot torrent files

The torrent command supports the following actions

Action Description
list list torrents available at the specified storage location
hashes list the hashes (in toml format) at the specified storage location
update update re-create the torrents for the contents available at its storage location
verify verify that manifest contents are available at its storage location

All actions take a <location> argument which specified the remote location which contains the torrents.

Optionally a <start block>`` and optionally an ` may be specified to limit the scope of the operation