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/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
|
|
|
// DataDirFlag defines a path on disk.
|
|
|
|
DataDirFlag = DirectoryFlag{
|
|
|
|
Name: "datadir",
|
|
|
|
Usage: "Data directory for the databases and keystore",
|
2019-02-19 06:17:27 +00:00
|
|
|
Value: DirectoryString{DefaultDataDir()},
|
2018-07-19 16:31:50 +00:00
|
|
|
}
|
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.",
|
|
|
|
}
|
2019-05-11 21:43:55 +00:00
|
|
|
// TracingProcessNameFlag defines a flag to specify a process name.
|
|
|
|
TracingProcessNameFlag = cli.StringFlag{
|
|
|
|
Name: "tracing-process-name",
|
|
|
|
Usage: "The name to apply to tracing tag \"process_name\"",
|
|
|
|
}
|
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{
|
2018-11-25 16:55:02 +00:00
|
|
|
Name: "monitoring-port",
|
2018-11-15 12:54:45 +00:00
|
|
|
Usage: "Port used to listening and respond metrics for prometheus.",
|
|
|
|
Value: 8080,
|
|
|
|
}
|
2019-04-23 20:30:59 +00:00
|
|
|
// NoDiscovery specifies whether we are running a local network and have no need for connecting
|
|
|
|
// to the bootstrap nodes in the cloud
|
|
|
|
NoDiscovery = cli.BoolFlag{
|
|
|
|
Name: "no-discovery",
|
|
|
|
Usage: "Enable only local network p2p and do not connect to cloud bootstrap nodes.",
|
|
|
|
}
|
2019-05-11 22:02:58 +00:00
|
|
|
// StaticPeers specifies a set of peers to connect to explicitly.
|
|
|
|
StaticPeers = cli.StringSliceFlag{
|
|
|
|
Name: "peer",
|
|
|
|
Usage: "Connect with this peer. This flag may be used multiple times.",
|
|
|
|
}
|
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",
|
2019-04-23 20:30:59 +00:00
|
|
|
Value: "/ip4/35.224.249.2/tcp/30001/p2p/QmQEe7o6hKJdGdSkJRh7WJzS6xrex5f4w2SPR6oWbJNriw",
|
2018-11-15 02:25:06 +00:00
|
|
|
}
|
2018-11-25 16:55:02 +00:00
|
|
|
// RelayNode tells the beacon node which relay node to connect to.
|
|
|
|
RelayNode = cli.StringFlag{
|
|
|
|
Name: "relay-node",
|
|
|
|
Usage: "The address of relay node. The beacon node will connect to the " +
|
|
|
|
"relay node and advertise their address via the relay node to other peers",
|
2019-04-25 11:59:12 +00:00
|
|
|
Value: "",
|
2018-11-25 16:55:02 +00:00
|
|
|
}
|
2018-11-26 02:54:02 +00:00
|
|
|
// P2PPort defines the port to be used by libp2p.
|
|
|
|
P2PPort = cli.IntFlag{
|
|
|
|
Name: "p2p-port",
|
|
|
|
Usage: "The port used by libp2p.",
|
|
|
|
Value: 12000,
|
|
|
|
}
|
2019-05-06 17:33:19 +00:00
|
|
|
// P2PHost defines the host IP to be used by libp2p.
|
|
|
|
P2PHost = cli.StringFlag{
|
|
|
|
Name: "p2p-host-ip",
|
|
|
|
Usage: "The IP address advertised by libp2p. This may be used to advertise an external IP.",
|
|
|
|
Value: "",
|
|
|
|
}
|
2019-05-09 21:02:24 +00:00
|
|
|
// P2PMaxPeers defines a flag to specify the max number of peers in libp2p.
|
|
|
|
P2PMaxPeers = cli.Int64Flag{
|
|
|
|
Name: "p2p-max-peers",
|
|
|
|
Usage: "The max number of p2p peers to maintain.",
|
|
|
|
Value: 30,
|
|
|
|
}
|
2019-04-23 20:52:52 +00:00
|
|
|
// ClearDB tells the beacon node to remove any previously stored data at the data directory.
|
|
|
|
ClearDB = cli.BoolFlag{
|
2019-03-15 03:20:49 +00:00
|
|
|
Name: "clear-db",
|
|
|
|
Usage: "Clears any previously stored data at the data directory",
|
|
|
|
}
|
2019-05-14 00:43:04 +00:00
|
|
|
// LogFormat specifies the log output format.
|
|
|
|
LogFormat = cli.StringFlag{
|
|
|
|
Name: "log-format",
|
|
|
|
Usage: "Specify log formatting. Supports: text, json, fluentd.",
|
|
|
|
Value: "text",
|
|
|
|
}
|
2018-07-19 16:31:50 +00:00
|
|
|
)
|