cli

package
v1.9.7-0...-079db7f Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: LGPL-3.0 Imports: 30 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: "512M",
	}
	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,
	}

	PruneModeFlag = cli.StringFlag{
		Name: "prune.mode",
		Usage: `Choose a pruning preset to run onto. Available values: "full", "archive", "minimal".
				Full: Keep only blocks and latest state,
				Archive: Keep the entire indexed database, aka. no pruning,
				Minimal: Keep only latest state`,
		Value: "full",
	}
	PruneDistanceFlag = cli.Uint64Flag{
		Name:  "prune.distance",
		Usage: `Keep state history for the latest N blocks (default: everything)`,
	}
	PruneBlocksDistanceFlag = cli.Uint64Flag{
		Name:  "prune.distance.blocks",
		Usage: `Keep block history for the latest N blocks (default: everything)`,
	}
	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: "",
	}

	SyncLoopBreakAfterFlag = cli.StringFlag{
		Name:  "sync.loop.break.after",
		Usage: "Sets the last stage of the sync loop to run",
		Value: "",
	}

	SyncLoopBlockLimitFlag = cli.UintFlag{
		Name:  "sync.loop.block.limit",
		Usage: "Sets the maximum number of blocks to process per loop iteration",
		Value: 5_000,
	}

	SyncParallelStateFlushing = cli.BoolFlag{
		Name:  "sync.parallel-state-flushing",
		Usage: "Enables parallel state flushing",
		Value: true,
	}

	UploadLocationFlag = cli.StringFlag{
		Name:  "upload.location",
		Usage: "Location to upload snapshot segments to",
		Value: "",
	}

	UploadFromFlag = cli.StringFlag{
		Name:  "upload.from",
		Usage: "Blocks to upload from: number, or 'earliest' (start of the chain), 'latest' (last segment previously uploaded)",
		Value: "latest",
	}

	FrozenBlockLimitFlag = cli.UintFlag{
		Name:  "upload.snapshot.limit",
		Usage: "Sets the maximum number of snapshot blocks to hold on the local disk when uploading",
		Value: 1500000,
	}

	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,
	}

	OverlayGetLogsFlag = cli.DurationFlag{
		Name:  "rpc.overlay.getlogstimeout",
		Usage: "Maximum amount of time to wait for the answer from the overlay_getLogs call.",
		Value: rpccfg.DefaultOverlayGetLogsTimeout,
	}

	OverlayReplayBlockFlag = cli.DurationFlag{
		Name:  "rpc.overlay.replayblocktimeout",
		Usage: "Maximum amount of time to wait for the answer to replay a single block when called from an overlay_getLogs call.",
		Value: rpccfg.DefaultOverlayReplayBlockTimeout,
	}

	RpcSubscriptionFiltersMaxLogsFlag = cli.IntFlag{
		Name:  "rpc.subscription.filters.maxlogs",
		Usage: "Maximum number of logs to store per subscription.",
		Value: rpchelper.DefaultFiltersConfig.RpcSubscriptionFiltersMaxLogs,
	}
	RpcSubscriptionFiltersMaxHeadersFlag = cli.IntFlag{
		Name:  "rpc.subscription.filters.maxheaders",
		Usage: "Maximum number of block headers to store per subscription.",
		Value: rpchelper.DefaultFiltersConfig.RpcSubscriptionFiltersMaxHeaders,
	}
	RpcSubscriptionFiltersMaxTxsFlag = cli.IntFlag{
		Name:  "rpc.subscription.filters.maxtxs",
		Usage: "Maximum number of transactions to store per subscription.",
		Value: rpchelper.DefaultFiltersConfig.RpcSubscriptionFiltersMaxTxs,
	}
	RpcSubscriptionFiltersMaxAddressesFlag = cli.IntFlag{
		Name:  "rpc.subscription.filters.maxaddresses",
		Usage: "Maximum number of addresses per subscription to filter logs by.",
		Value: rpchelper.DefaultFiltersConfig.RpcSubscriptionFiltersMaxAddresses,
	}
	RpcSubscriptionFiltersMaxTopicsFlag = cli.IntFlag{
		Name:  "rpc.subscription.filters.maxtopics",
		Usage: "Maximum number of topics per subscription to filter logs by.",
		Value: rpchelper.DefaultFiltersConfig.RpcSubscriptionFiltersMaxTopics,
	}

	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{}/* 206 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, logger log.Logger)

func ApplyFlagsForEthConfigCobra

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

func ApplyFlagsForNodeConfig

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

func NewApp

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

NewApp creates an app with sane defaults.

func SetFlagsFromConfigFile

func SetFlagsFromConfigFile(ctx *cli.Context, filePath string) error

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