Documentation
¶
Overview ¶
Package utils contains internal helper functions for go-ethereum commands.
Package utils contains internal helper functions for go-ethereum commands.
Index ¶
- Variables
- func CheckExclusive(cmd *cli.Command, args ...interface{})
- func DialRPCWithHeaders(endpoint string, headers []string) (*rpc.Client, error)
- func Fatalf(format string, args ...interface{})
- func ImportChain(chain *core.BlockChain, fn string) error
- func IsNetworkPreset(cmd *cli.Command) bool
- func MakeChain(cmd *cli.Command, stack *node.Node, readonly bool) (*core.BlockChain, ethdb.Database)
- func MakeChainDatabase(cmd *cli.Command, stack *node.Node, readonly bool) ethdb.Database
- func MakeDatabaseHandles(max int) int
- func MakeTrieDatabase(cmd *cli.Command, disk ethdb.Database, preimage bool, readOnly bool, ...) *triedb.Database
- func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (*eth.EthAPIBackend, *eth.Ethereum)
- func RegisterFilterAPI(stack *node.Node, backend ethapi.Backend, ethcfg *ethconfig.Config) *filters.FilterSystem
- func RegisterFullSyncTester(stack *node.Node, eth *eth.Ethereum, target common.Hash)
- func SetDNSDiscoveryDefaults(cfg *ethconfig.Config, genesis common.Hash)
- func SetDataDir(cmd *cli.Command, cfg *node.Config)
- func SetEthConfig(cmd *cli.Command, stack *node.Node, cfg *ethconfig.Config)
- func SetNodeConfig(cmd *cli.Command, cfg *node.Config)
- func SetP2PConfig(cmd *cli.Command, cfg *p2p.Config)
- func SetupMetrics(cmd *cli.Command)
- func SplitAndTrim(input string) (ret []string)
- func StartNode(cmd *cli.Command, stack *node.Node, isConsole bool)
Constants ¶
This section is empty.
Variables ¶
var ( // General settings DataDirFlag = &flags.DirectoryFlag{ Name: "datadir", Usage: "Data directory for the databases", Value: node.DefaultDataDir(), } RemoteDBFlag = &cli.StringFlag{ Name: "remotedb", Usage: "URL for remote database", Category: flags.LoggingCategory, } AncientFlag = &flags.DirectoryFlag{ Name: "datadir.ancient", Usage: "Root directory for ancient data (default = inside chaindata)", } SentryBlocksFlag = &cli.StringMapFlag{ Name: "sentry.blocks", Usage: "Comma separated number-to-hash mappings to require for peering", } SyncTargetFlag = &cli.StringFlag{ Name: "sync.target", Usage: `Hash of the block to full sync to (dev testing feature)`, } SyncExitFlag = &cli.BoolFlag{ Name: "sync.exit", Usage: "Exits after block synchronisation completes", } SyncModeFlag = &cli.StringFlag{ Name: "sync.mode", Usage: `Blockchain sync mode ("snap" or "full")`, Value: ethconfig.Defaults.SyncMode.String(), } TestnetSepoliaFlag = &cli.BoolFlag{ Name: "testnet.sepolia", Usage: "Sepolia network: pre-configured test network", } TestnetHoleskyFlag = &cli.BoolFlag{ Name: "testnet.holesky", Usage: "Holesky network: pre-configured test network", } CustomGenesisFlag = &flags.DirectoryFlag{ Name: "testnet.custom.genesis", Usage: "Custom testnet: path to the genesis.json file", Value: "", } CustomNetworkIdFlag = &cli.UintFlag{ Name: "testnet.custom.networkid", Usage: "Custom testnet: network id for devp2p connections", Value: ethconfig.Defaults.NetworkId, } // Dev mode DeveloperFlag = &cli.BoolFlag{ Name: "dev", Usage: "Ephemeral testnet with a pre-funded developer account, auto-mining", Category: flags.DevCategory, } DeveloperPeriodFlag = &cli.UintFlag{ Name: "dev.period", Usage: "Block period to use in developer mode (0 = mine only if transaction pending)", Category: flags.DevCategory, } DeveloperGasLimitFlag = &cli.UintFlag{ Name: "dev.gaslimit", Usage: "Initial block gas limit", Value: 11500000, Category: flags.DevCategory, } OverrideCancun = &cli.UintFlag{ Name: "override.cancun", Usage: "Manually specify the Cancun fork timestamp, overriding the bundled setting", } OverrideVerkle = &cli.UintFlag{ Name: "override.verkle", Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting", } StateHistoryFlag = &cli.UintFlag{ Name: "history.state", Usage: "Number of recent blocks to retain state history for (default = 90,000 blocks, 0 = entire chain)", Value: ethconfig.Defaults.StateHistory, Category: flags.StateCategory, } TransactionHistoryFlag = &cli.UintFlag{ Name: "history.transactions", Usage: "Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain)", Value: ethconfig.Defaults.TransactionHistory, Category: flags.StateCategory, } // Beacon client light sync settings BeaconApiFlag = &cli.StringSliceFlag{ Name: "beacon.api", Usage: "Beacon node (CL) light client API URL. This flag can be given multiple times.", Category: flags.BeaconCategory, } BeaconApiHeaderFlag = &cli.StringSliceFlag{ Name: "beacon.api.header", Usage: "Pass custom HTTP header fields to the remote beacon node API in \"key:value\" format. This flag can be given multiple times.", Category: flags.BeaconCategory, } BeaconThresholdFlag = &cli.UintFlag{ Name: "beacon.threshold", Usage: "Beacon sync committee participation threshold", Value: bparams.SyncCommitteeSupermajority, Category: flags.BeaconCategory, } BeaconNoFilterFlag = &cli.BoolFlag{ Name: "beacon.nofilter", Usage: "Disable future slot signature filter", Category: flags.BeaconCategory, } BeaconConfigFlag = &cli.StringFlag{ Name: "beacon.config", Usage: "Beacon chain config YAML file", Category: flags.BeaconCategory, } BeaconGenesisRootFlag = &cli.StringFlag{ Name: "beacon.genesis.gvroot", Usage: "Beacon chain genesis validators root", Category: flags.BeaconCategory, } BeaconGenesisTimeFlag = &cli.UintFlag{ Name: "beacon.genesis.time", Usage: "Beacon chain genesis time", Category: flags.BeaconCategory, } BeaconCheckpointFlag = &cli.StringFlag{ Name: "beacon.checkpoint", Usage: "Beacon chain weak subjectivity checkpoint block hash", Category: flags.BeaconCategory, } // Transaction pool settings TxPoolLocalsFlag = &cli.StringFlag{ Name: "txpool.locals", Usage: "Comma separated accounts to treat as locals (no flush, priority inclusion)", Category: flags.TxPoolCategory, } TxPoolNoLocalsFlag = &cli.BoolFlag{ Name: "txpool.nolocals", Usage: "Disables price exemptions for locally submitted transactions", Category: flags.TxPoolCategory, } TxPoolJournalFlag = &cli.StringFlag{ Name: "txpool.journal", Usage: "Disk journal for local transaction to survive node restarts", Value: ethconfig.Defaults.TxPool.Journal, Category: flags.TxPoolCategory, } TxPoolRejournalFlag = &cli.DurationFlag{ Name: "txpool.rejournal", Usage: "Time interval to regenerate the local transaction journal", Value: ethconfig.Defaults.TxPool.Rejournal, Category: flags.TxPoolCategory, } TxPoolPriceLimitFlag = &cli.UintFlag{ Name: "txpool.pricelimit", Usage: "Minimum gas price tip to enforce for acceptance into the pool", Value: ethconfig.Defaults.TxPool.PriceLimit, Category: flags.TxPoolCategory, } TxPoolPriceBumpFlag = &cli.UintFlag{ Name: "txpool.pricebump", Usage: "Price bump percentage to replace an already existing transaction", Value: ethconfig.Defaults.TxPool.PriceBump, Category: flags.TxPoolCategory, } TxPoolAccountSlotsFlag = &cli.UintFlag{ Name: "txpool.accountslots", Usage: "Minimum number of executable transaction slots guaranteed per account", Value: ethconfig.Defaults.TxPool.AccountSlots, Category: flags.TxPoolCategory, } TxPoolGlobalSlotsFlag = &cli.UintFlag{ Name: "txpool.globalslots", Usage: "Maximum number of executable transaction slots for all accounts", Value: ethconfig.Defaults.TxPool.GlobalSlots, Category: flags.TxPoolCategory, } TxPoolAccountQueueFlag = &cli.UintFlag{ Name: "txpool.accountqueue", Usage: "Maximum number of non-executable transaction slots permitted per account", Value: ethconfig.Defaults.TxPool.AccountQueue, Category: flags.TxPoolCategory, } TxPoolGlobalQueueFlag = &cli.UintFlag{ Name: "txpool.globalqueue", Usage: "Maximum number of non-executable transaction slots for all accounts", Value: ethconfig.Defaults.TxPool.GlobalQueue, Category: flags.TxPoolCategory, } TxPoolLifetimeFlag = &cli.DurationFlag{ Name: "txpool.lifetime", Usage: "Maximum amount of time non-executable transaction are queued", Value: ethconfig.Defaults.TxPool.Lifetime, Category: flags.TxPoolCategory, } // Blob transaction pool settings BlobPoolDataDirFlag = &cli.StringFlag{ Name: "blobpool.datadir", Usage: "Data directory to store blob transactions in", Value: ethconfig.Defaults.BlobPool.Datadir, Category: flags.BlobPoolCategory, } BlobPoolDataCapFlag = &cli.UintFlag{ Name: "blobpool.datacap", Usage: "Disk space to allocate for pending blob transactions (soft limit)", Value: ethconfig.Defaults.BlobPool.Datacap, Category: flags.BlobPoolCategory, } BlobPoolPriceBumpFlag = &cli.UintFlag{ Name: "blobpool.pricebump", Usage: "Price bump percentage to replace an already existing blob transaction", Value: ethconfig.Defaults.BlobPool.PriceBump, Category: flags.BlobPoolCategory, } // Performance tuning settings CacheFlag = &cli.UintFlag{ Name: "cache", Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode)", Value: 1024, Category: flags.PerfCategory, } CacheDatabaseFlag = &cli.UintFlag{ Name: "cache.database", Usage: "Percentage of cache memory allowance to use for database io", Value: 50, Category: flags.PerfCategory, } CacheTrieFlag = &cli.UintFlag{ Name: "cache.trie", Usage: "Percentage of cache memory allowance to use for trie caching (default = 15% full mode, 30% archive mode)", Value: 15, Category: flags.PerfCategory, } CacheGCFlag = &cli.UintFlag{ Name: "cache.gc", Usage: "Percentage of cache memory allowance to use for trie pruning (default = 25% full mode, 0% archive mode)", Value: 25, Category: flags.PerfCategory, } CacheSnapshotFlag = &cli.UintFlag{ Name: "cache.snapshot", Usage: "Percentage of cache memory allowance to use for snapshot caching (default = 10% full mode, 20% archive mode)", Value: 10, Category: flags.PerfCategory, } CacheNoPrefetchFlag = &cli.BoolFlag{ Name: "cache.noprefetch", Usage: "Disable heuristic state prefetch during block import (less CPU and disk IO, more time waiting for data)", Category: flags.PerfCategory, } CachePreimagesFlag = &cli.BoolFlag{ Name: "cache.preimages", Usage: "Enable recording the SHA3/keccak preimages of trie keys", Category: flags.PerfCategory, } CacheLogSizeFlag = &cli.UintFlag{ Name: "cache.blocklogs", Usage: "Size (in number of blocks) of the log cache for filtering", Category: flags.PerfCategory, Value: uint64(ethconfig.Defaults.FilterLogCacheSize), } CryptoKZGFlag = &cli.StringFlag{ Name: "crypto.kzg", Usage: "KZG library implementation to use; gokzg (recommended) or ckzg", Value: "gokzg", Category: flags.PerfCategory, } // Miner settings MinerGasLimitFlag = &cli.UintFlag{ Name: "miner.gaslimit", Usage: "Target gas ceiling for mined blocks", Value: ethconfig.Defaults.Miner.GasCeil, Category: flags.MinerCategory, } MinerGasPriceFlag = &flags.Uint256Flag{ Name: "miner.gasprice", Usage: "Minimum gas price for mining a transaction", Value: ethconfig.Defaults.Miner.GasPrice, Category: flags.MinerCategory, } MinerExtraDataFlag = &cli.StringFlag{ Name: "miner.extradata", Usage: "Block extra data set by the miner (default = client version)", Category: flags.MinerCategory, } MinerRecommitIntervalFlag = &cli.DurationFlag{ Name: "miner.recommit", Usage: "Time interval to recreate the block being mined", Value: ethconfig.Defaults.Miner.Recommit, Category: flags.MinerCategory, } // EVM settings VMEnableDebugFlag = &cli.BoolFlag{ Name: "vmdebug", Usage: "Record information useful for VM and contract debugging", Category: flags.VMCategory, } VMTraceFlag = &cli.StringFlag{ Name: "vmtrace", Usage: "Name of tracer which should record internal VM operations (costly)", Category: flags.VMCategory, } VMTraceJsonConfigFlag = &cli.StringFlag{ Name: "vmtrace.jsonconfig", Usage: "Tracer configuration (JSON)", Value: "{}", Category: flags.VMCategory, } // API options. RPCGlobalGasCapFlag = &cli.UintFlag{ Name: "rpc.gascap", Usage: "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)", Value: ethconfig.Defaults.RPCGasCap, Category: flags.APICategory, } RPCGlobalEVMTimeoutFlag = &cli.DurationFlag{ Name: "rpc.evmtimeout", Usage: "Sets a timeout used for eth_call (0=infinite)", Value: ethconfig.Defaults.RPCEVMTimeout, Category: flags.APICategory, } RPCGlobalTxFeeCapFlag = &cli.FloatFlag{ Name: "rpc.txfeecap", Usage: "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)", Value: ethconfig.Defaults.RPCTxFeeCap, Category: flags.APICategory, } // Authenticated RPC HTTP settings AuthListenFlag = &cli.StringFlag{ Name: "authrpc.addr", Usage: "Listening address for authenticated APIs", Value: node.DefaultConfig.AuthAddr, Category: flags.APICategory, } AuthPortFlag = &cli.UintFlag{ Name: "authrpc.port", Usage: "Listening port for authenticated APIs", Value: uint64(node.DefaultConfig.AuthPort), Category: flags.APICategory, } AuthVirtualHostsFlag = &cli.StringFlag{ Name: "authrpc.vhosts", Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.", Value: strings.Join(node.DefaultConfig.AuthVirtualHosts, ","), Category: flags.APICategory, } JWTSecretFlag = &flags.DirectoryFlag{ Name: "authrpc.jwtsecret", Usage: "Path to a JWT secret to use for authenticated RPC endpoints", Category: flags.APICategory, } // RPC settings IPCDisabledFlag = &cli.BoolFlag{ Name: "ipc.disable", Usage: "Disable the IPC-RPC server", Category: flags.APICategory, } IPCPathFlag = &flags.DirectoryFlag{ Name: "ipc.path", Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)", Category: flags.APICategory, } HTTPEnabledFlag = &cli.BoolFlag{ Name: "http", Usage: "Enable the HTTP-RPC server", Category: flags.APICategory, } HTTPListenAddrFlag = &cli.StringFlag{ Name: "http.addr", Usage: "HTTP-RPC server listening interface", Value: node.DefaultHTTPHost, Category: flags.APICategory, } HTTPPortFlag = &cli.UintFlag{ Name: "http.port", Usage: "HTTP-RPC server listening port", Value: node.DefaultHTTPPort, Category: flags.APICategory, } HTTPCORSDomainFlag = &cli.StringFlag{ Name: "http.corsdomain", Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)", Value: "", Category: flags.APICategory, } HTTPVirtualHostsFlag = &cli.StringFlag{ Name: "http.vhosts", Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.", Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","), Category: flags.APICategory, } HTTPApiFlag = &cli.StringFlag{ Name: "http.api", Usage: "API's offered over the HTTP-RPC interface", Value: "", Category: flags.APICategory, } HTTPPathPrefixFlag = &cli.StringFlag{ Name: "http.rpcprefix", Usage: "HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.", Value: "", Category: flags.APICategory, } WSEnabledFlag = &cli.BoolFlag{ Name: "ws", Usage: "Enable the WS-RPC server", Category: flags.APICategory, } WSListenAddrFlag = &cli.StringFlag{ Name: "ws.addr", Usage: "WS-RPC server listening interface", Value: node.DefaultWSHost, Category: flags.APICategory, } WSPortFlag = &cli.UintFlag{ Name: "ws.port", Usage: "WS-RPC server listening port", Value: node.DefaultWSPort, Category: flags.APICategory, } WSApiFlag = &cli.StringFlag{ Name: "ws.api", Usage: "API's offered over the WS-RPC interface", Value: "", Category: flags.APICategory, } WSAllowedOriginsFlag = &cli.StringFlag{ Name: "ws.origins", Usage: "Origins from which to accept websockets requests", Value: "", Category: flags.APICategory, } WSPathPrefixFlag = &cli.StringFlag{ Name: "ws.rpcprefix", Usage: "HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.", Value: "", Category: flags.APICategory, } AllowUnprotectedTxs = &cli.BoolFlag{ Name: "rpc.allow-unprotected-txs", Usage: "Allow for unprotected (non EIP155 signed) transactions to be submitted via RPC", Category: flags.APICategory, } BatchRequestLimit = &cli.UintFlag{ Name: "rpc.batch-request-limit", Usage: "Maximum number of requests in a batch", Value: uint64(node.DefaultConfig.BatchRequestLimit), Category: flags.APICategory, } BatchResponseMaxSize = &cli.UintFlag{ Name: "rpc.batch-response-max-size", Usage: "Maximum number of bytes returned from a batched call", Value: uint64(node.DefaultConfig.BatchResponseMaxSize), Category: flags.APICategory, } // Network Settings IdentityFlag = &cli.StringFlag{ Name: "p2p.identity", Usage: "Custom node name to advertise on the network", Category: flags.NetworkingCategory, } MaxPeersFlag = &cli.UintFlag{ Name: "p2p.maxpeers", Usage: "Maximum number of network peers (network disabled if set to 0)", Value: uint64(node.DefaultConfig.P2P.MaxPeers), Category: flags.NetworkingCategory, } MaxPendingPeersFlag = &cli.UintFlag{ Name: "p2p.maxpendpeers", Usage: "Maximum number of pending connection attempts (defaults used if set to 0)", Value: uint64(node.DefaultConfig.P2P.MaxPendingPeers), Category: flags.NetworkingCategory, } ListenPortFlag = &cli.UintFlag{ Name: "p2p.port", Usage: "Network listening port", Value: 30303, Category: flags.NetworkingCategory, } BootnodesFlag = &cli.StringFlag{ Name: "bootnodes", Usage: "Comma separated enode URLs for P2P discovery bootstrap", Value: "", Category: flags.NetworkingCategory, } NATFlag = &cli.StringFlag{ Name: "p2p.nat", Usage: "NAT port mapping mechanism (any|none|upnp|pmp|pmp:<IP>|extip:<IP>)", Value: "any", Category: flags.NetworkingCategory, } NoDiscoverFlag = &cli.BoolFlag{ Name: "discovery.disable", Usage: "Disables the peer discovery mechanism (manual peer addition)", Category: flags.NetworkingCategory, } DiscoveryV4Flag = &cli.BoolFlag{ Name: "discovery.v4", Aliases: []string{"discv4"}, Usage: "Enables the V4 discovery mechanism", Category: flags.NetworkingCategory, Value: true, } DiscoveryV5Flag = &cli.BoolFlag{ Name: "discovery.v5", Aliases: []string{"discv5"}, Usage: "Enables the V5 discovery mechanism", Category: flags.NetworkingCategory, Value: true, } NetrestrictFlag = &cli.StringFlag{ Name: "p2p.netrestrict", Usage: "Restricts network communication to the given IP networks (CIDR masks)", Category: flags.NetworkingCategory, } DNSDiscoveryFlag = &cli.StringFlag{ Name: "discovery.dns", Usage: "Sets DNS discovery entry points (use \"\" to disable DNS)", Category: flags.NetworkingCategory, } DiscoveryPortFlag = &cli.UintFlag{ Name: "discovery.port", Usage: "Use a custom UDP port for P2P discovery", Value: 30303, Category: flags.NetworkingCategory, } // Gas price oracle settings GpoBlocksFlag = &cli.UintFlag{ Name: "gpo.blocks", Usage: "Number of recent blocks to check for gas prices", Value: uint64(ethconfig.Defaults.GPO.Blocks), Category: flags.GasPriceCategory, } GpoPercentileFlag = &cli.UintFlag{ Name: "gpo.percentile", Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices", Value: uint64(ethconfig.Defaults.GPO.Percentile), Category: flags.GasPriceCategory, } GpoMaxGasPriceFlag = &cli.UintFlag{ Name: "gpo.maxprice", Usage: "Maximum transaction priority fee (or gasprice before London fork) to be recommended by gpo", Value: ethconfig.Defaults.GPO.MaxPrice.Uint64(), Category: flags.GasPriceCategory, } GpoIgnoreGasPriceFlag = &cli.UintFlag{ Name: "gpo.ignoreprice", Usage: "Gas price below which gpo will ignore transactions", Value: ethconfig.Defaults.GPO.IgnorePrice.Uint64(), Category: flags.GasPriceCategory, } // Metrics flags MetricsEnabledFlag = &cli.BoolFlag{ Name: "metrics", Usage: "Enable metrics collection and reporting", Category: flags.MetricsCategory, } // MetricsHTTPFlag defines the endpoint for a stand-alone metrics HTTP endpoint. // Since the pprof service enables sensitive/vulnerable behavior, this allows a user // to enable a public-OK metrics endpoint without having to worry about ALSO exposing // other profiling behavior or information. MetricsHTTPFlag = &cli.StringFlag{ Name: "metrics.addr", Usage: `Enable stand-alone metrics HTTP server listening interface.`, Category: flags.MetricsCategory, } MetricsPortFlag = &cli.UintFlag{ Name: "metrics.port", Usage: `Metrics HTTP server listening port. Please note that --` + MetricsHTTPFlag.Name + ` must be set to start the server.`, Value: uint64(metrics.DefaultConfig.Port), Category: flags.MetricsCategory, } MetricsEnableInfluxDBFlag = &cli.BoolFlag{ Name: "metrics.influxdb", Usage: "Enable metrics export/push to an external InfluxDB database", Category: flags.MetricsCategory, } MetricsInfluxDBEndpointFlag = &cli.StringFlag{ Name: "metrics.influxdb.endpoint", Usage: "InfluxDB API endpoint to report metrics to", Value: metrics.DefaultConfig.InfluxDBEndpoint, Category: flags.MetricsCategory, } MetricsInfluxDBDatabaseFlag = &cli.StringFlag{ Name: "metrics.influxdb.database", Usage: "InfluxDB database name to push reported metrics to", Value: metrics.DefaultConfig.InfluxDBDatabase, Category: flags.MetricsCategory, } MetricsInfluxDBUsernameFlag = &cli.StringFlag{ Name: "metrics.influxdb.username", Usage: "Username to authorize access to the database", Value: metrics.DefaultConfig.InfluxDBUsername, Category: flags.MetricsCategory, } MetricsInfluxDBPasswordFlag = &cli.StringFlag{ Name: "metrics.influxdb.password", Usage: "Password to authorize access to the database", Value: metrics.DefaultConfig.InfluxDBPassword, Category: flags.MetricsCategory, } // Tags are part of every measurement sent to InfluxDB. Queries on tags are faster in InfluxDB. // For example `host` tag could be used so that we can group all nodes and average a measurement // across all of them, but also so that we can select a specific node and inspect its measurements. // https://docs.influxdata.com/influxdb/v1.4/concepts/key_concepts/#tag-key MetricsInfluxDBTagsFlag = &cli.StringMapFlag{ Name: "metrics.influxdb.tags", Usage: "Comma-separated InfluxDB tags (key/values) attached to all measurements", Value: map[string]string{"host": "localhost"}, Category: flags.MetricsCategory, } MetricsEnableInfluxDBV2Flag = &cli.BoolFlag{ Name: "metrics.influxdbv2", Usage: "Enable metrics export/push to an external InfluxDB v2 database", Category: flags.MetricsCategory, } MetricsInfluxDBTokenFlag = &cli.StringFlag{ Name: "metrics.influxdb.token", Usage: "Token to authorize access to the database (v2 only)", Value: metrics.DefaultConfig.InfluxDBToken, Category: flags.MetricsCategory, } MetricsInfluxDBBucketFlag = &cli.StringFlag{ Name: "metrics.influxdb.bucket", Usage: "InfluxDB bucket name to push reported metrics to (v2 only)", Value: metrics.DefaultConfig.InfluxDBBucket, Category: flags.MetricsCategory, } MetricsInfluxDBOrganizationFlag = &cli.StringFlag{ Name: "metrics.influxdb.organization", Usage: "InfluxDB organization name (v2 only)", Value: metrics.DefaultConfig.InfluxDBOrganization, Category: flags.MetricsCategory, } )
var ( // TestnetFlags is the flag group of all built-in supported testnets. TestnetFlags = []cli.Flag{ TestnetSepoliaFlag, TestnetHoleskyFlag, } // DatabaseFlags is the flag group of all database flags. DatabaseFlags = []cli.Flag{ DataDirFlag, AncientFlag, RemoteDBFlag, } )
var DeprecatedFlags = []cli.Flag{}
Functions ¶
func CheckExclusive ¶
CheckExclusive verifies that only a single instance of the provided flags was set by the user. Each flag might optionally be followed by a string type to specialize it further.
func DialRPCWithHeaders ¶
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf formats a message to standard error and exits the program. The message is also printed to standard output if standard error is redirected to a different file.
func ImportChain ¶
func ImportChain(chain *core.BlockChain, fn string) error
func IsNetworkPreset ¶
func MakeChain ¶
func MakeChain(cmd *cli.Command, stack *node.Node, readonly bool) (*core.BlockChain, ethdb.Database)
MakeChain creates a chain manager from set command line flags.
func MakeChainDatabase ¶
MakeChainDatabase opens a database using the flags passed to the client and will hard crash if it fails.
func MakeDatabaseHandles ¶
MakeDatabaseHandles raises out the number of allowed file handles per process for Geth and returns half of the allowance to assign to the database.
func MakeTrieDatabase ¶
func MakeTrieDatabase(cmd *cli.Command, disk ethdb.Database, preimage bool, readOnly bool, isVerkle bool) *triedb.Database
MakeTrieDatabase constructs a trie database based on the configured scheme.
func RegisterEthService ¶
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (*eth.EthAPIBackend, *eth.Ethereum)
RegisterEthService adds an Ethereum client to the stack. The second return value is the full node instance.
func RegisterFilterAPI ¶
func RegisterFilterAPI(stack *node.Node, backend ethapi.Backend, ethcfg *ethconfig.Config) *filters.FilterSystem
RegisterFilterAPI adds the eth log filtering RPC API to the node.
func RegisterFullSyncTester ¶
RegisterFullSyncTester adds the full-sync tester service into node.
func SetDNSDiscoveryDefaults ¶
SetDNSDiscoveryDefaults configures DNS discovery with the given URL if no URLs are set.
func SetEthConfig ¶
SetEthConfig applies eth-related command line flags to the config.
func SetNodeConfig ¶
SetNodeConfig applies node-related command line flags to the config.
func SetupMetrics ¶
func SplitAndTrim ¶
SplitAndTrim splits input separated by a comma and trims excessive white space from the substrings.
Types ¶
This section is empty.