Documentation ¶
Overview ¶
Package app contains framework for building a command-line based Erigon node.
Index ¶
- Constants
- Variables
- func ChainHasBlock(chainDB kv.RwDB, block *types.Block) bool
- func ImportChain(ethereum *eth.Ethereum, chainDB kv.RwDB, fn string) error
- func InsertChain(ethereum *eth.Ethereum, chain *core.ChainPack) error
- func MakeApp(action cli.ActionFunc, cliFlags []cli.Flag) *cli.App
- func MakeConfigNodeDefault(ctx *cli.Context) *node.Node
- func MigrateFlags(action cli.ActionFunc) cli.ActionFunc
- func NewNodeConfig(ctx *cli.Context) *nodecfg.Config
Constants ¶
const Version = 1
Variables ¶
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 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 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 ¶
Types ¶
This section is empty.