|
|
@ -19,11 +19,15 @@ func parseFlags(config cfg.Config, args []string) { |
|
|
|
logLevel string |
|
|
|
proxyApp string |
|
|
|
tmspTransport string |
|
|
|
|
|
|
|
pex bool |
|
|
|
) |
|
|
|
|
|
|
|
// Declare flags
|
|
|
|
var flags = flag.NewFlagSet("main", flag.ExitOnError) |
|
|
|
flags.BoolVar(&printHelp, "help", false, "Print this help message.") |
|
|
|
|
|
|
|
// configuration options
|
|
|
|
flags.StringVar(&moniker, "moniker", config.GetString("moniker"), "Node Name") |
|
|
|
flags.StringVar(&nodeLaddr, "node_laddr", config.GetString("node_laddr"), "Node listen address. (0.0.0.0:0 means any interface, any port)") |
|
|
|
flags.StringVar(&seeds, "seeds", config.GetString("seeds"), "Comma delimited host:port seed nodes") |
|
|
@ -34,6 +38,10 @@ func parseFlags(config cfg.Config, args []string) { |
|
|
|
flags.StringVar(&proxyApp, "proxy_app", config.GetString("proxy_app"), |
|
|
|
"Proxy app address, or 'nilapp' or 'dummy' for local testing.") |
|
|
|
flags.StringVar(&tmspTransport, "tmsp", config.GetString("tmsp"), "Specify tmsp transport (socket | grpc)") |
|
|
|
|
|
|
|
// feature flags
|
|
|
|
flags.BoolVar(&pex, "pex", config.GetBool("pex_reactor"), "Enable Peer-Exchange (dev feature)") |
|
|
|
|
|
|
|
flags.Parse(args) |
|
|
|
if printHelp { |
|
|
|
flags.PrintDefaults() |
|
|
@ -50,4 +58,6 @@ func parseFlags(config cfg.Config, args []string) { |
|
|
|
config.Set("log_level", logLevel) |
|
|
|
config.Set("proxy_app", proxyApp) |
|
|
|
config.Set("tmsp", tmspTransport) |
|
|
|
|
|
|
|
config.Set("pex_reactor", pex) |
|
|
|
} |