2018-08-09 18:25:48 +00:00
|
|
|
// Package cmd defines the command line flags for the shared utlities.
|
2018-07-19 16:31:50 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/node"
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2018-07-21 17:51:18 +00:00
|
|
|
// VerbosityFlag defines the logrus configuration.
|
|
|
|
VerbosityFlag = cli.StringFlag{
|
|
|
|
Name: "verbosity",
|
|
|
|
Usage: "Logging verbosity (debug, info=default, warn, error, fatal, panic)",
|
|
|
|
Value: "info",
|
|
|
|
}
|
2018-07-19 16:31:50 +00:00
|
|
|
// IPCPathFlag defines the filename of a pipe within the datadir.
|
|
|
|
IPCPathFlag = DirectoryFlag{
|
|
|
|
Name: "ipcpath",
|
|
|
|
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)",
|
|
|
|
}
|
|
|
|
// DataDirFlag defines a path on disk.
|
|
|
|
DataDirFlag = DirectoryFlag{
|
|
|
|
Name: "datadir",
|
|
|
|
Usage: "Data directory for the databases and keystore",
|
|
|
|
Value: DirectoryString{node.DefaultDataDir()},
|
|
|
|
}
|
2018-07-29 01:18:56 +00:00
|
|
|
// NetworkIDFlag defines the specific network identifier.
|
|
|
|
NetworkIDFlag = cli.Uint64Flag{
|
2018-07-19 16:31:50 +00:00
|
|
|
Name: "networkid",
|
|
|
|
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
|
|
|
|
Value: 1,
|
|
|
|
}
|
|
|
|
// PasswordFileFlag defines the path to the user's account password file.
|
|
|
|
PasswordFileFlag = cli.StringFlag{
|
|
|
|
Name: "password",
|
|
|
|
Usage: "Password file to use for non-interactive password input",
|
|
|
|
Value: "",
|
|
|
|
}
|
2018-07-25 04:52:39 +00:00
|
|
|
// RPCProviderFlag defines a http endpoint flag to connect to mainchain.
|
|
|
|
RPCProviderFlag = cli.StringFlag{
|
|
|
|
Name: "rpc",
|
|
|
|
Usage: "HTTP-RPC server end point to use to connect to mainchain.",
|
|
|
|
Value: "http://localhost:8545/",
|
|
|
|
}
|
2018-09-20 11:46:35 +00:00
|
|
|
// EnableTracingFlag defines a flag to enable p2p message tracing.
|
|
|
|
EnableTracingFlag = cli.BoolFlag{
|
|
|
|
Name: "enable-tracing",
|
|
|
|
Usage: "Enable request tracing.",
|
|
|
|
}
|
2018-11-08 03:22:31 +00:00
|
|
|
// TracingEndpointFlag flag defines the http endpoint for serving traces to Jaeger.
|
2018-09-20 11:46:35 +00:00
|
|
|
TracingEndpointFlag = cli.StringFlag{
|
|
|
|
Name: "tracing-endpoint",
|
|
|
|
Usage: "Tracing endpoint defines where beacon chain traces are exposed to Jaeger.",
|
|
|
|
Value: "http://127.0.0.1:14268",
|
|
|
|
}
|
|
|
|
// TraceSampleFractionFlag defines a flag to indicate what fraction of p2p
|
|
|
|
// messages are sampled for tracing.
|
|
|
|
TraceSampleFractionFlag = cli.Float64Flag{
|
|
|
|
Name: "trace-sample-fraction",
|
|
|
|
Usage: "Indicate what fraction of p2p messages are sampled for tracing.",
|
|
|
|
Value: 0.20,
|
|
|
|
}
|
2018-11-15 12:54:45 +00:00
|
|
|
// DisableMonitoringFlag defines a flag to disable the metrics collection.
|
|
|
|
DisableMonitoringFlag = cli.BoolFlag{
|
|
|
|
Name: "disable-monitoring",
|
|
|
|
Usage: "Disable monitoring service.",
|
|
|
|
}
|
|
|
|
// MonitoringPortFlag defines the http port used to serve prometheus metrics.
|
|
|
|
MonitoringPortFlag = cli.Int64Flag{
|
|
|
|
Name: "monitoring-flag",
|
|
|
|
Usage: "Port used to listening and respond metrics for prometheus.",
|
|
|
|
Value: 8080,
|
|
|
|
}
|
2018-11-08 03:22:31 +00:00
|
|
|
// KeystoreDirectoryFlag defines a flag to indicate where the keystore of the user
|
|
|
|
// is located.
|
|
|
|
KeystoreDirectoryFlag = DirectoryFlag{
|
|
|
|
Name: "keystore-dir",
|
|
|
|
Usage: "Keystore directory indicates which directory the keystore is located.",
|
|
|
|
}
|
|
|
|
// KeystorePasswordFlag defines the password that will unlock the keystore file.
|
|
|
|
KeystorePasswordFlag = cli.StringFlag{
|
|
|
|
Name: "keystore-password",
|
|
|
|
Usage: "Keystore password is used to unlock the keystore so that the users decrypted keys can be used.",
|
|
|
|
}
|
2018-11-15 02:25:06 +00:00
|
|
|
// BootstrapNode tells the beacon node which bootstrap node to connect to
|
|
|
|
BootstrapNode = cli.StringFlag{
|
|
|
|
Name: "bootstrap-node",
|
|
|
|
Usage: "The address of bootstrap node. Beacon node will connect for peer discovery via DHT",
|
|
|
|
}
|
2018-07-19 16:31:50 +00:00
|
|
|
)
|