mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
cmd: reformatted comments I changed before to agree with Godoc conventions
This commit is contained in:
parent
10cfaada3c
commit
7bebe6fd28
4 changed files with 22 additions and 21 deletions
|
|
@ -38,7 +38,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// DumpConfigCommand flag definition for the dumpconfig command
|
// DumpConfigCommand defines the flag for the dumpconfig command.
|
||||||
DumpConfigCommand = cli.Command{
|
DumpConfigCommand = cli.Command{
|
||||||
Action: utils.MigrateFlags(dumpConfig),
|
Action: utils.MigrateFlags(dumpConfig),
|
||||||
Name: "dumpconfig",
|
Name: "dumpconfig",
|
||||||
|
|
@ -49,7 +49,7 @@ var (
|
||||||
Description: `The dumpconfig command shows configuration values.`,
|
Description: `The dumpconfig command shows configuration values.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
// SwarmTomlConfigPathFlag flag definition for the config file command
|
// SwarmTomlConfigPathFlag defines the flag for the config file command.
|
||||||
SwarmTomlConfigPathFlag = cli.StringFlag{
|
SwarmTomlConfigPathFlag = cli.StringFlag{
|
||||||
Name: "config",
|
Name: "config",
|
||||||
Usage: "TOML configuration file",
|
Usage: "TOML configuration file",
|
||||||
|
|
|
||||||
|
|
@ -142,11 +142,12 @@ var (
|
||||||
EnvVar: SWARM_ENV_CORS,
|
EnvVar: SWARM_ENV_CORS,
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeprecatedEthAPIFlag the following flags are deprecated and should be removed in the future
|
// DeprecatedEthAPIFlag is deprecated and should be removed in the future.
|
||||||
DeprecatedEthAPIFlag = cli.StringFlag{
|
DeprecatedEthAPIFlag = cli.StringFlag{
|
||||||
Name: "ethapi",
|
Name: "ethapi",
|
||||||
Usage: "DEPRECATED: please use --ens-api and --swap-api",
|
Usage: "DEPRECATED: please use --ens-api and --swap-api",
|
||||||
}
|
}
|
||||||
|
// DeprecatedEnsAddrFlag is deprecated and should be removed in the future.
|
||||||
DeprecatedEnsAddrFlag = cli.StringFlag{
|
DeprecatedEnsAddrFlag = cli.StringFlag{
|
||||||
Name: "ens-addr",
|
Name: "ens-addr",
|
||||||
Usage: "DEPRECATED: ENS contract address, please use --ens-api with contract address according to its format",
|
Usage: "DEPRECATED: ENS contract address, please use --ens-api with contract address according to its format",
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ import (
|
||||||
"gopkg.in/urfave/cli.v1"
|
"gopkg.in/urfave/cli.v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DirectoryString custom type which is registered in the flags library which cli uses for
|
// DirectoryString is a custom type that is registered in the flags library which cli
|
||||||
// argument parsing. This allows us to expand Value to an absolute path when
|
// uses for argument parsing. This allows us to expand Value to an absolute path when
|
||||||
// the argument is parsed
|
// the argument is parsed.
|
||||||
type DirectoryString struct {
|
type DirectoryString struct {
|
||||||
Value string
|
Value string
|
||||||
}
|
}
|
||||||
|
|
@ -47,7 +47,7 @@ func (ds *DirectoryString) Set(value string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DirectoryFlag custom cli.Flag type which expand the received string to an absolute path.
|
// DirectoryFlag is a custom cli.Flag type that expands the received string to an absolute path.
|
||||||
// e.g. ~/.ethereum -> /home/username/.ethereum
|
// e.g. ~/.ethereum -> /home/username/.ethereum
|
||||||
type DirectoryFlag struct {
|
type DirectoryFlag struct {
|
||||||
Name string
|
Name string
|
||||||
|
|
@ -71,8 +71,8 @@ func eachName(longName string, fn func(string)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply called by cli library, grabs variable from environment (if in env)
|
// Apply grabs variable from environment (if in env) and adds the variable to flagSet for parsing.
|
||||||
// and adds variable to flag set for parsing.
|
// It is called by cli library.
|
||||||
func (df DirectoryFlag) Apply(set *flag.FlagSet) {
|
func (df DirectoryFlag) Apply(set *flag.FlagSet) {
|
||||||
eachName(df.Name, func(name string) {
|
eachName(df.Name, func(name string) {
|
||||||
set.Var(&df.Value, df.Name, df.Usage)
|
set.Var(&df.Value, df.Name, df.Usage)
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ func NewApp(gitCommit, usage string) *cli.App {
|
||||||
// are the same for all commands.
|
// are the same for all commands.
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// DataDirFlag general settings
|
// DataDirFlag is the flag for general settings.
|
||||||
DataDirFlag = DirectoryFlag{
|
DataDirFlag = DirectoryFlag{
|
||||||
Name: "datadir",
|
Name: "datadir",
|
||||||
Usage: "Data directory for the databases and keystore",
|
Usage: "Data directory for the databases and keystore",
|
||||||
|
|
@ -189,7 +189,7 @@ var (
|
||||||
Name: "lightkdf",
|
Name: "lightkdf",
|
||||||
Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength",
|
Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength",
|
||||||
}
|
}
|
||||||
// DashboardEnabledFlag dashboard settings
|
// DashboardEnabledFlag is the flag for dashboard settings.
|
||||||
DashboardEnabledFlag = cli.BoolFlag{
|
DashboardEnabledFlag = cli.BoolFlag{
|
||||||
Name: "dashboard",
|
Name: "dashboard",
|
||||||
Usage: "Enable the dashboard",
|
Usage: "Enable the dashboard",
|
||||||
|
|
@ -209,7 +209,7 @@ var (
|
||||||
Usage: "Dashboard metrics collection refresh rate",
|
Usage: "Dashboard metrics collection refresh rate",
|
||||||
Value: dashboard.DefaultConfig.Refresh,
|
Value: dashboard.DefaultConfig.Refresh,
|
||||||
}
|
}
|
||||||
// EthashCacheDirFlag ethash settings
|
// EthashCacheDirFlag is the flag for ethash settings.
|
||||||
EthashCacheDirFlag = DirectoryFlag{
|
EthashCacheDirFlag = DirectoryFlag{
|
||||||
Name: "ethash.cachedir",
|
Name: "ethash.cachedir",
|
||||||
Usage: "Directory to store the ethash verification caches (default = inside the datadir)",
|
Usage: "Directory to store the ethash verification caches (default = inside the datadir)",
|
||||||
|
|
@ -239,7 +239,7 @@ var (
|
||||||
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
|
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
|
||||||
Value: eth.DefaultConfig.Ethash.DatasetsOnDisk,
|
Value: eth.DefaultConfig.Ethash.DatasetsOnDisk,
|
||||||
}
|
}
|
||||||
// TxPoolNoLocalsFlag transaction pool settings
|
// TxPoolNoLocalsFlag is the flag for transaction pool settings.
|
||||||
TxPoolNoLocalsFlag = cli.BoolFlag{
|
TxPoolNoLocalsFlag = cli.BoolFlag{
|
||||||
Name: "txpool.nolocals",
|
Name: "txpool.nolocals",
|
||||||
Usage: "Disables price exemptions for locally submitted transactions",
|
Usage: "Disables price exemptions for locally submitted transactions",
|
||||||
|
|
@ -289,7 +289,7 @@ var (
|
||||||
Usage: "Maximum amount of time non-executable transaction are queued",
|
Usage: "Maximum amount of time non-executable transaction are queued",
|
||||||
Value: eth.DefaultConfig.TxPool.Lifetime,
|
Value: eth.DefaultConfig.TxPool.Lifetime,
|
||||||
}
|
}
|
||||||
// CacheFlag performance tuning settings
|
// CacheFlag is the flag for performance tuning settings.
|
||||||
CacheFlag = cli.IntFlag{
|
CacheFlag = cli.IntFlag{
|
||||||
Name: "cache",
|
Name: "cache",
|
||||||
Usage: "Megabytes of memory allocated to internal caching",
|
Usage: "Megabytes of memory allocated to internal caching",
|
||||||
|
|
@ -310,7 +310,7 @@ var (
|
||||||
Usage: "Number of trie node generations to keep in memory",
|
Usage: "Number of trie node generations to keep in memory",
|
||||||
Value: int(state.MaxTrieCacheGen),
|
Value: int(state.MaxTrieCacheGen),
|
||||||
}
|
}
|
||||||
// MiningEnabledFlag miner settings
|
// MiningEnabledFlag is the flag for miner settings.
|
||||||
MiningEnabledFlag = cli.BoolFlag{
|
MiningEnabledFlag = cli.BoolFlag{
|
||||||
Name: "mine",
|
Name: "mine",
|
||||||
Usage: "Enable mining",
|
Usage: "Enable mining",
|
||||||
|
|
@ -339,7 +339,7 @@ var (
|
||||||
Name: "extradata",
|
Name: "extradata",
|
||||||
Usage: "Block extra data set by the miner (default = client version)",
|
Usage: "Block extra data set by the miner (default = client version)",
|
||||||
}
|
}
|
||||||
// UnlockedAccountFlag account settings
|
// UnlockedAccountFlag is the flag for account settings.
|
||||||
UnlockedAccountFlag = cli.StringFlag{
|
UnlockedAccountFlag = cli.StringFlag{
|
||||||
Name: "unlock",
|
Name: "unlock",
|
||||||
Usage: "Comma separated list of accounts to unlock",
|
Usage: "Comma separated list of accounts to unlock",
|
||||||
|
|
@ -355,7 +355,7 @@ var (
|
||||||
Name: "vmdebug",
|
Name: "vmdebug",
|
||||||
Usage: "Record information useful for VM and contract debugging",
|
Usage: "Record information useful for VM and contract debugging",
|
||||||
}
|
}
|
||||||
// EthStatsURLFlag logging and debug settings
|
// EthStatsURLFlag is the flag for logging and debug settings.
|
||||||
EthStatsURLFlag = cli.StringFlag{
|
EthStatsURLFlag = cli.StringFlag{
|
||||||
Name: "ethstats",
|
Name: "ethstats",
|
||||||
Usage: "Reporting URL of a ethstats service (nodename:secret@host:port)",
|
Usage: "Reporting URL of a ethstats service (nodename:secret@host:port)",
|
||||||
|
|
@ -372,7 +372,7 @@ var (
|
||||||
Name: "nocompaction",
|
Name: "nocompaction",
|
||||||
Usage: "Disables db compaction after import",
|
Usage: "Disables db compaction after import",
|
||||||
}
|
}
|
||||||
// RPCEnabledFlag RPC settings
|
// RPCEnabledFlag is the flag for RPC settings.
|
||||||
RPCEnabledFlag = cli.BoolFlag{
|
RPCEnabledFlag = cli.BoolFlag{
|
||||||
Name: "rpc",
|
Name: "rpc",
|
||||||
Usage: "Enable the HTTP-RPC server",
|
Usage: "Enable the HTTP-RPC server",
|
||||||
|
|
@ -443,7 +443,7 @@ var (
|
||||||
Usage: "Comma separated list of JavaScript files to preload into the console",
|
Usage: "Comma separated list of JavaScript files to preload into the console",
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxPeersFlag network settings
|
// MaxPeersFlag is the flag for network settings.
|
||||||
MaxPeersFlag = cli.IntFlag{
|
MaxPeersFlag = cli.IntFlag{
|
||||||
Name: "maxpeers",
|
Name: "maxpeers",
|
||||||
Usage: "Maximum number of network peers (network disabled if set to 0)",
|
Usage: "Maximum number of network peers (network disabled if set to 0)",
|
||||||
|
|
@ -500,14 +500,14 @@ var (
|
||||||
Usage: "Restricts network communication to the given IP networks (CIDR masks)",
|
Usage: "Restricts network communication to the given IP networks (CIDR masks)",
|
||||||
}
|
}
|
||||||
|
|
||||||
// JSpathFlag ATM the url is left to the user and deployment to
|
// JSpathFlag leaves the url and deployment to the user (for now).
|
||||||
JSpathFlag = cli.StringFlag{
|
JSpathFlag = cli.StringFlag{
|
||||||
Name: "jspath",
|
Name: "jspath",
|
||||||
Usage: "JavaScript root path for `loadScript`",
|
Usage: "JavaScript root path for `loadScript`",
|
||||||
Value: ".",
|
Value: ".",
|
||||||
}
|
}
|
||||||
|
|
||||||
// GpoBlocksFlag gas price oracle settings
|
// GpoBlocksFlag is the flag for gas price oracle settings.
|
||||||
GpoBlocksFlag = cli.IntFlag{
|
GpoBlocksFlag = cli.IntFlag{
|
||||||
Name: "gpoblocks",
|
Name: "gpoblocks",
|
||||||
Usage: "Number of recent blocks to check for gas prices",
|
Usage: "Number of recent blocks to check for gas prices",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue