flags

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataDirFlagName = "datadir"
	LogFileFlagName = "logfile"
	RunModeFlagName = "runmode"
)
View Source
const (
	PasswordFlagName = "password"
	LightKdfFlagName = "lightkdf"
	UnlockFlagName   = "unlock"
)
View Source
const (
	NetworkIDFlagName     = "networkid"
	NoCompactionFlagName  = "nocompaction"
	CacheFlagName         = "cache"
	CacheDatabaseFlagName = "cache.database"
	CacheGCFlagName       = "cache.gc"
	MaxTxMapSizeFlagName  = "txpoolsize"
	FifoTxPoolQueue       = "fifotxpool"
)
View Source
const (
	MineFlagName      = "mine"
	ValidatorFlagName = "validator"
)
View Source
const (
	IpcAddrFlagName = "ipcaddr"
	RpcAddrFlagName = "rpcaddr"
	// these two flags should be removed in the future
	RpcCorsDomainFlagName = "rpccorsdomain"
	RpcApiFlagName        = "rpcapi"
)
View Source
const (
	MaxPeersFlagName        = "maxpeers"
	MaxPendingPeersFlagName = "maxpendpeers"
	PortFlagName            = "port"
	BootnodesFlagName       = "bootnodes"
	ValidatorsFlagName      = "validators"
	NodeKeyFileFlagName     = "nodekey"
)
View Source
const (
	IdentityFlagName            = "identity"
	ProfileFlagName             = "profile"
	ProfileAddressFlagName      = "profileaddr"
	MetricGatewayFlagName       = "metricgateway"
	MetricExposeAddressFlagName = "metric_expose_addr"
)
View Source
const (
	LineNumberFlagName = "linenumber"
	VerbosityFlagName  = "verbosity"
)
View Source
const (
	FastSyncFlagName = "fast"
)

Variables

View Source
var AccountFlags = []cli.Flag{

	cli.StringFlag{
		Name:  PasswordFlagName,
		Usage: "Password file to use for non-interactive password input",
		Value: "",
	},
	cli.BoolFlag{
		Name:  LightKdfFlagName,
		Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength",
	},
	cli.StringFlag{
		Name:  UnlockFlagName,
		Usage: "Comma separated list of accounts to unlock",
		Value: "",
	},
}
View Source
var ChainFlags = []cli.Flag{
	cli.Uint64Flag{
		Name:  NetworkIDFlagName,
		Usage: "Network identifier (integer, mainnet=0,dev=1,testnet=2)",
	},
	cli.StringFlag{
		Name:  "account",
		Usage: "Public address for block mining rewards. Use the first account if none is provided.",
	},
	cli.BoolFlag{
		Name:  NoCompactionFlagName,
		Usage: "Disables db compaction after import",
	},
	cli.IntFlag{
		Name:  CacheFlagName,
		Usage: "Megabytes of memory allocated to internal caching",
		Value: 1024,
	},
	cli.IntFlag{
		Name:  CacheDatabaseFlagName,
		Usage: "Percentage of cache memory allowance to use for database io",
		Value: 75,
	},
	cli.IntFlag{
		Name:  CacheGCFlagName,
		Usage: "Percentage of cache memory allowance to use for trie pruning",
		Value: 25,
	},
	cli.IntFlag{
		Name:  MaxTxMapSizeFlagName,
		Usage: "Maximum number of pending transactions",
		Value: 1024,
	},
	cli.BoolFlag{
		Name:  FifoTxPoolQueue,
		Usage: "Use FIFO tx pool queue",
	},
}
View Source
var ConfigFileFlag = cli.StringFlag{
	Name:  "config",
	Usage: fmt.Sprintf("Path to TOML configuration file (default \"<datadir>/config.toml\")"),
}

this should be a global option

View Source
var GasFlags = []cli.Flag{
	cli.Int64Flag{
		Name:  "gasprice",
		Usage: "Gas Price, unit is Wei, default is suggested gas price from server",
	},
	cli.Int64Flag{
		Name:  "gaslimit",
		Usage: "Gas Limit, default 2000000",
		Value: 2000000,
	},
}
View Source
var GeneralFlags = []cli.Flag{
	cli.StringFlag{
		Name:  DataDirFlagName,
		Usage: "Data directory for the database and keystore",
		Value: node.DefaultDataDir(),
	},
	cli.StringFlag{
		Name:  LogFileFlagName,
		Usage: "Log file for the logger output",
		Value: "cpchain.log",
	},
	cli.StringFlag{
		Name:  RunModeFlagName,
		Usage: "Run mode for switch node configuration, eg:dev|testnet|mainnet",
	},
}
View Source
var LogFlags = []cli.Flag{
	cli.BoolFlag{
		Name:   LineNumberFlagName,
		Usage:  "Show filename and line number in log",
		EnvVar: "CPC_LINENUMBER",
	},
	cli.IntFlag{
		Name:   VerbosityFlagName,
		Value:  int(log.InfoLevel),
		Usage:  "Log Level Panic:0 Fatal:1 Error:2 Warn:3 Info:4 Debug:5",
		EnvVar: "CPC_VERBOSITY",
	},
}
View Source
var MinerFlags = []cli.Flag{
	cli.BoolFlag{
		Name:  MineFlagName,
		Usage: "Enable mining",
	},
	cli.BoolFlag{
		Name:  ValidatorFlagName,
		Usage: "Enable validator",
	},
}
View Source
var MiscFlags = []cli.Flag{}
View Source
var NodeFlags = []cli.Flag{
	cli.StringFlag{
		Name:  IdentityFlagName,
		Usage: "Customized node name",
	},
	cli.StringFlag{
		Name:  ProfileFlagName,
		Usage: "Profile the running cpchain instance, output to the specified dir path",
	},
	cli.StringFlag{
		Name:  ProfileAddressFlagName,
		Usage: "Profile http service address",
	},
	cli.StringFlag{
		Name:  MetricGatewayFlagName,
		Usage: "Metric Gateway Address",
		Value: "",
	},
	cli.StringFlag{
		Name:  MetricExposeAddressFlagName,
		Usage: "Metric Expose Address",
		Value: ":9100",
	},
}
View Source
var P2pFlags = []cli.Flag{
	cli.IntFlag{
		Name:  MaxPeersFlagName,
		Usage: "Maximum number of network peers (network disabled if set to 0)",
		Value: 100,
	},
	cli.IntFlag{
		Name:  MaxPendingPeersFlagName,
		Usage: "Maximum number of pending connection attempts (defaults used if set to 0)",
	},
	cli.IntFlag{
		Name:  PortFlagName,
		Usage: "Network listening port",
		Value: 30310,
	},
	cli.StringFlag{
		Name:  BootnodesFlagName,
		Usage: "Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)",
		Value: "",
	},
	cli.StringFlag{
		Name:  ValidatorsFlagName,
		Usage: "Comma separated enode URLs for validators",
		Value: "",
	},
	cli.StringFlag{
		Name:  NodeKeyFileFlagName,
		Usage: "P2P node key file",
	},
}

TODO @chengxin adjust the following {ac} p2p flags

View Source
var RPCFlags = []cli.Flag{

	cli.StringFlag{
		Name:  "rpc",
		Usage: "Set the APIs offered over the HTTP-RPC interface",
		Value: "http://127.0.0.1:8501",
	},
}

RPCFlags set the APIs offered over the HTTP-RPC interface

View Source
var RpcFlags = []cli.Flag{

	cli.StringFlag{
		Name:  RpcApiFlagName,
		Usage: "Set the APIs offered over the HTTP-RPC interface",
		Value: "",
	},
	cli.StringFlag{
		Name:  IpcAddrFlagName,
		Usage: "Local ipc path",
	},
	cli.StringFlag{
		Name:  RpcAddrFlagName,
		Usage: "RPC address whose format is <host:port>",
	},
	cli.StringFlag{
		Name:  RpcCorsDomainFlagName,
		Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
	},
}

TODO @sangh adjust these

View Source
var RunModeFlags = []cli.Flag{
	cli.StringFlag{
		Name:  RunModeFlagName,
		Usage: "Run mode for switch node configuration, eg:dev|testnet|mainnet|testmainnet",
		Value: configs.Mainnet.String(),
	},
}
View Source
var SyncFlags = []cli.Flag{
	cli.BoolFlag{
		Name:  FastSyncFlagName,
		Usage: "Enable fast sync",
	},
}

Functions

func GetByName

func GetByName(name string) cli.Flag

func Register

func Register(flags ...cli.Flag)

func Validator added in v0.3.1

func Validator(ctx *cli.Context) (string, string, string, error)

func WrapperFlags added in v0.3.1

func WrapperFlags(flags []cli.Flag) []cli.Flag

Types

This section is empty.

Jump to

Keyboard shortcuts

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