app

package
v1.9.7-0...-ba03429 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2025 License: LGPL-3.0 Imports: 81 Imported by: 0

README

Erigon Sub Commands

Backup

Import

Init

Support

This command connects erigon to diagnostics tools by establishing websocket connection.

In order to connect diagnostics run

./build/bin/erigon support --debug.addrs <value> --diagnostics.addr <value> --diagnostics.sessions <PINs>
diagnostics.addr Address of the diagnostics system provided by the support team, include unique session PIN. Instructions how to get proper adderess
debug.addrs Comma separated list of URLs to the debug endpoints thats are being diagnosed. This endpoints must match values of diagnostics.endpoint.addr:diagnostics.endpoint.port by default its localhost:6060
diagnostics.sessions Comma separated list of session PINs to connect to Instructions how to obtain PIN

Snapshots

This sub command can be used for manipulating snapshot files

Danger zone: seg sqeeze

To perform foreign-key-awared re-compression of 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 entities are transferred to snapshots

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

  • maximises the workers allocated to snapshot 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 location to upload snapshot to
upload.from=earliest Sets the upload start location to be the earliest available block, which will be 0 in the case of a fresh installation, 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 seg 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

Documentation

Overview

Package app contains framework for building a command-line based Erigon node.

Index

Constants

View Source
const Version = 1

Variables

View Source
var (
	SnapshotFromFlag = cli.Uint64Flag{
		Name:  "from",
		Usage: "From block number",
		Value: 0,
	}
	SnapshotToFlag = cli.Uint64Flag{
		Name:  "to",
		Usage: "To block number. Zero - means unlimited.",
		Value: 0,
	}
	SnapshotEveryFlag = cli.Uint64Flag{
		Name:  "every",
		Usage: "Do operation every N blocks",
		Value: 1_000,
	}
	SnapshotRebuildFlag = cli.BoolFlag{
		Name:  "rebuild",
		Usage: "Force rebuild",
	}
)

Functions

func ChainHasBlock

func ChainHasBlock(chainDB kv.RwDB, block *types.Block) bool

func ConnectDiagnostics

func ConnectDiagnostics(cliCtx *cli.Context, logger log.Logger) error

Setting up the connection to the diagnostics system by creating a tunnel between the diagnostics system and the debug endpoints (Erigon node) <--------> ( Support cmd ) <---> (diagnostics system) (debug.addrs) (wss,http) (current program) (wss) ( diagnostics.addr )

func ImportChain

func ImportChain(ethereum *eth.Ethereum, chainDB kv.RwDB, fn string, logger log.Logger) error

func InsertChain

func InsertChain(ethereum *eth.Ethereum, chain *core.ChainPack, logger log.Logger) error

func MakeApp

func MakeApp(name string, action cli.ActionFunc, cliFlags []cli.Flag) *cli.App

MakeApp creates a cli application (based on `github.com/urlfave/cli` package). The application exits when `action` returns. Parameters: * action: the main function for the application. receives `*cli.Context` with parsed command-line flags. * cliFlags: the list of flags `cli.Flag` that the app should set and parse. By default, use `DefaultFlags()`. If you want to specify your own flag, use `append(DefaultFlags(), myFlag)` for this parameter.

func MakeNodeWithDefaultConfig

func MakeNodeWithDefaultConfig(cliCtx *cli.Context, logger log.Logger) (*node.Node, error)

func MigrateFlags

func MigrateFlags(action cli.ActionFunc) cli.ActionFunc

MigrateFlags makes all global flag values available in the context. This should be called as early as possible in app.Before.

Example:

geth account new --keystore /tmp/mykeystore --lightkdf

is equivalent after calling this method with:

geth --keystore /tmp/mykeystore --lightkdf account new

i.e. in the subcommand Action function of 'account new', ctx.Bool("lightkdf) will return true even if --lightkdf is set as a global option.

This function may become unnecessary when https://github.com/urfave/cli/pull/1245 is merged.

func NewNodeConfig

func NewNodeConfig(ctx *cli.Context, logger log.Logger) (*nodecfg.Config, error)

Types

type Sqeeze

type Sqeeze string
var (
	SqeezeCommitment Sqeeze = "commitment"
	SqeezeStorage    Sqeeze = "storage"
	SqeezeCode       Sqeeze = "code"
	SqeezeBlocks     Sqeeze = "blocks"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL