cli

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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DatabaseVerbosityFlag = cli.IntFlag{
		Name:  "database.verbosity",
		Usage: "Enabling internal db logs. Very high verbosity levels may require recompile db. Default: 2, means warning.",
		Value: 2,
	}
	BatchSizeFlag = cli.StringFlag{
		Name:  "batchSize",
		Usage: "Batch size for the execution stage",
		Value: "256M",
	}
	EtlBufferSizeFlag = cli.StringFlag{
		Name:  "etl.bufferSize",
		Usage: "Buffer size for ETL operations.",
		Value: etl.BufferOptimalSize.String(),
	}
	BodyCacheLimitFlag = cli.StringFlag{
		Name:  "bodies.cache",
		Usage: "Limit on the cache for block bodies",
		Value: fmt.Sprintf("%d", ethconfig.Defaults.Sync.BodyCacheLimit),
	}

	PrivateApiAddr = cli.StringFlag{
		Name:  "private.api.addr",
		Usage: "Erigon's components (txpool, rpcdaemon, sentry, downloader, ...) can be deployed as independent Processes on same/another server. Then components will connect to erigon by this internal grpc API. example: 127.0.0.1:9090, empty string means not to start the listener. do not expose to public network. serves remote database interface",
		Value: "127.0.0.1:9090",
	}

	PrivateApiRateLimit = cli.IntFlag{
		Name:  "private.api.ratelimit",
		Usage: "Amount of requests server handle simultaneously - requests over this limit will wait. Increase it - if clients see 'request timeout' while server load is low - it means your 'hot data' is small or have much RAM. ",
		Value: kv.ReadersLimit - 128,
	}

	PruneFlag = cli.StringFlag{
		Name: "prune",
		Usage: `Choose which ancient data delete from DB:
	h - prune history (ChangeSets, HistoryIndices - used by historical state access, like eth_getStorageAt, eth_getBalanceAt, debug_traceTransaction, trace_block, trace_transaction, etc.)
	r - prune receipts (Receipts, Logs, LogTopicIndex, LogAddressIndex - used by eth_getLogs and similar RPC methods)
	t - prune transaction by it's hash index
	c - prune call traces (used by trace_filter method)
	Does delete data older than 90K blocks, --prune=h is shortcut for: --prune.h.older=90000.
	Similarly, --prune=t is shortcut for: --prune.t.older=90000 and --prune=c is shortcut for: --prune.c.older=90000.
	However, --prune=r means to prune receipts before the Beacon Chain genesis (Consensus Layer might need receipts after that).
	If an item is NOT on the list - means NO pruning for this data.
	Example: --prune=htc`,
		Value: "disabled",
	}
	PruneHistoryFlag = cli.Uint64Flag{
		Name:  "prune.h.older",
		Usage: `Prune data older than this number of blocks from the tip of the chain (if --prune flag has 'h', then default is 90K)`,
	}
	PruneReceiptFlag = cli.Uint64Flag{
		Name:  "prune.r.older",
		Usage: `Prune data older than this number of blocks from the tip of the chain`,
	}
	PruneTxIndexFlag = cli.Uint64Flag{
		Name:  "prune.t.older",
		Usage: `Prune data older than this number of blocks from the tip of the chain (if --prune flag has 't', then default is 90K)`,
	}
	PruneCallTracesFlag = cli.Uint64Flag{
		Name:  "prune.c.older",
		Usage: `Prune data older than this number of blocks from the tip of the chain (if --prune flag has 'c', then default is 90K)`,
	}

	PruneHistoryBeforeFlag = cli.Uint64Flag{
		Name:  "prune.h.before",
		Usage: `Prune data before this block`,
	}
	PruneReceiptBeforeFlag = cli.Uint64Flag{
		Name:  "prune.r.before",
		Usage: `Prune data before this block`,
	}
	PruneTxIndexBeforeFlag = cli.Uint64Flag{
		Name:  "prune.t.before",
		Usage: `Prune data before this block`,
	}
	PruneCallTracesBeforeFlag = cli.Uint64Flag{
		Name:  "prune.c.before",
		Usage: `Prune data before this block`,
	}

	ExperimentsFlag = cli.StringFlag{
		Name: "experiments",
		Usage: `Enable some experimental stages:
* tevm - write TEVM translated code to the DB`,
		Value: "default",
	}

	// mTLS flags
	TLSFlag = cli.BoolFlag{
		Name:  "tls",
		Usage: "Enable TLS handshake",
	}
	TLSCertFlag = cli.StringFlag{
		Name:  "tls.cert",
		Usage: "Specify certificate",
		Value: "",
	}
	TLSKeyFlag = cli.StringFlag{
		Name:  "tls.key",
		Usage: "Specify key file",
		Value: "",
	}
	TLSCACertFlag = cli.StringFlag{
		Name:  "tls.cacert",
		Usage: "Specify certificate authority",
		Value: "",
	}
	StateStreamDisableFlag = cli.BoolFlag{
		Name:  "state.stream.disable",
		Usage: "Disable streaming of state changes from core to RPC daemon",
	}

	// Throttling Flags
	SyncLoopThrottleFlag = cli.StringFlag{
		Name:  "sync.loop.throttle",
		Usage: "Sets the minimum time between sync loop starts (e.g. 1h30m, default is none)",
		Value: "",
	}

	BadBlockFlag = cli.StringFlag{
		Name:  "bad.block",
		Usage: "Marks block with given hex string as bad and forces initial reorg before normal staged sync",
		Value: "",
	}

	HealthCheckFlag = cli.BoolFlag{
		Name:  "healthcheck",
		Usage: "Enable grpc health check",
	}

	HTTPReadTimeoutFlag = cli.DurationFlag{
		Name:  "http.timeouts.read",
		Usage: "Maximum duration for reading the entire request, including the body.",
		Value: rpccfg.DefaultHTTPTimeouts.ReadTimeout,
	}
	HTTPWriteTimeoutFlag = cli.DurationFlag{
		Name:  "http.timeouts.write",
		Usage: "Maximum duration before timing out writes of the response. It is reset whenever a new request's header is read.",
		Value: rpccfg.DefaultHTTPTimeouts.WriteTimeout,
	}
	HTTPIdleTimeoutFlag = cli.DurationFlag{
		Name:  "http.timeouts.idle",
		Usage: "Maximum amount of time to wait for the next request when keep-alives are enabled. If http.timeouts.idle is zero, the value of http.timeouts.read is used.",
		Value: rpccfg.DefaultHTTPTimeouts.IdleTimeout,
	}

	AuthRpcReadTimeoutFlag = cli.DurationFlag{
		Name:  "authrpc.timeouts.read",
		Usage: "Maximum duration for reading the entire request, including the body.",
		Value: rpccfg.DefaultHTTPTimeouts.ReadTimeout,
	}
	AuthRpcWriteTimeoutFlag = cli.DurationFlag{
		Name:  "authrpc.timeouts.write",
		Usage: "Maximum duration before timing out writes of the response. It is reset whenever a new request's header is read.",
		Value: rpccfg.DefaultHTTPTimeouts.WriteTimeout,
	}
	AuthRpcIdleTimeoutFlag = cli.DurationFlag{
		Name:  "authrpc.timeouts.idle",
		Usage: "Maximum amount of time to wait for the next request when keep-alives are enabled. If authrpc.timeouts.idle is zero, the value of authrpc.timeouts.read is used.",
		Value: rpccfg.DefaultHTTPTimeouts.IdleTimeout,
	}

	EvmCallTimeoutFlag = cli.DurationFlag{
		Name:  "rpc.evmtimeout",
		Usage: "Maximum amount of time to wait for the answer from EVM call.",
		Value: rpccfg.DefaultEvmCallTimeout,
	}

	TxPoolCommitEvery = cli.DurationFlag{
		Name:  "txpool.commit.every",
		Usage: "How often transactions should be committed to the storage",
		Value: txpoolcfg.DefaultConfig.CommitEvery,
	}
)
View Source
var DefaultFlags = []cli.Flag{}/* 163 elements not displayed */

DefaultFlags contains all flags that are used and supported by Erigon binary.

Functions

func ApplyFlagsForEthConfig

func ApplyFlagsForEthConfig(ctx *cli.Context, cfg *ethconfig.Config)

func ApplyFlagsForEthConfigCobra

func ApplyFlagsForEthConfigCobra(f *pflag.FlagSet, cfg *ethconfig.Config)

func ApplyFlagsForNodeConfig

func ApplyFlagsForNodeConfig(ctx *cli.Context, cfg *nodecfg.Config)

func ApplyFlagsForZkConfig

func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config)

func NewApp

func NewApp(gitCommit, usage string) *cli.App

NewApp creates an app with sane defaults.

Types

type ByCategory

type ByCategory []FlagGroup

ByCategory sorts an array of FlagGroup by Name in the order defined in AppHelpFlagGroups.

func (ByCategory) Len

func (a ByCategory) Len() int

func (ByCategory) Less

func (a ByCategory) Less(i, j int) bool

func (ByCategory) Swap

func (a ByCategory) Swap(i, j int)

type FlagGroup

type FlagGroup struct {
	Name  string
	Flags []cli.Flag
}

FlagGroup is a collection of flags belonging to a single topic.

type HelpData

type HelpData struct {
	App        interface{}
	FlagGroups []FlagGroup
}

HelpData is a one shot struct to pass to the usage template

Jump to

Keyboard shortcuts

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