app

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 55 Imported by: 0

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,
	}
	SnapshotSegmentSizeFlag = cli.Uint64Flag{
		Name:  "segment.size",
		Usage: "Amount of blocks in each segment",
		Value: snaptype.Erigon2SegmentSize,
	}
	SnapshotRebuildFlag = cli.BoolFlag{
		Name:  "rebuild",
		Usage: "Force rebuild",
	}
)

Functions

func ChainHasBlock

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

func ImportChain

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

func InsertChain

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

func MakeApp

func MakeApp(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 MakeConfigNodeDefault

func MakeConfigNodeDefault(ctx *cli.Context) *node.Node

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) *nodecfg.Config

Types

This section is empty.

Jump to

Keyboard shortcuts

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