Skip to content

Commit

Permalink
Merge pull request #6157 from ethereum-optimism/jg/remove_required_flags
Browse files Browse the repository at this point in the history
op-node: Remove RPC flags from the required flag list
  • Loading branch information
OptimismBot authored Jun 29, 2023
2 parents ef6fd95 + 5f03195 commit c0d2442
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions op-node/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ var (
Usage: fmt.Sprintf("Predefined network selection. Available networks: %s", strings.Join(chaincfg.AvailableNetworks(), ", ")),
EnvVars: prefixEnvVars("NETWORK"),
}
/* Optional Flags */
RPCListenAddr = &cli.StringFlag{
Name: "rpc.addr",
Usage: "RPC listening address",
EnvVars: prefixEnvVars("RPC_ADDR"),
Value: "127.0.0.1",
}
RPCListenPort = &cli.IntFlag{
Name: "rpc.port",
Usage: "RPC listening port",
EnvVars: prefixEnvVars("RPC_PORT"),
Value: 9545, // Note: op-service/rpc/cli.go uses 8545 as the default.
}

/* Optional Flags */
RPCEnableAdmin = &cli.BoolFlag{
Name: "rpc.enable-admin",
Usage: "Enable the admin API (experimental)",
Expand Down Expand Up @@ -153,7 +154,7 @@ var (
MetricsAddrFlag = &cli.StringFlag{
Name: "metrics.addr",
Usage: "Metrics listening address",
Value: "0.0.0.0",
Value: "0.0.0.0", // TODO(CLI-4159): Switch to 127.0.0.1
EnvVars: prefixEnvVars("METRICS_ADDR"),
}
MetricsPortFlag = &cli.IntFlag{
Expand All @@ -170,7 +171,7 @@ var (
PprofAddrFlag = &cli.StringFlag{
Name: "pprof.addr",
Usage: "pprof listening address",
Value: "0.0.0.0",
Value: "0.0.0.0", // TODO(CLI-4159): Switch to 127.0.0.1
EnvVars: prefixEnvVars("PPROF_ADDR"),
}
PprofPortFlag = &cli.IntFlag{
Expand Down Expand Up @@ -218,11 +219,11 @@ var (
var requiredFlags = []cli.Flag{
L1NodeAddr,
L2EngineAddr,
RPCListenAddr,
RPCListenPort,
}

var optionalFlags = []cli.Flag{
RPCListenAddr,
RPCListenPort,
RollupConfig,
Network,
L1TrustRPC,
Expand Down
2 changes: 1 addition & 1 deletion op-service/metrics/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func CLIFlags(envPrefix string) []cli.Flag {
&cli.StringFlag{
Name: ListenAddrFlagName,
Usage: "Metrics listening address",
Value: "0.0.0.0",
Value: "0.0.0.0", // TODO(CLI-4159): Switch to 127.0.0.1
EnvVars: opservice.PrefixEnvVar(envPrefix, "METRICS_ADDR"),
},
&cli.IntFlag{
Expand Down
2 changes: 1 addition & 1 deletion op-service/pprof/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func CLIFlags(envPrefix string) []cli.Flag {
&cli.StringFlag{
Name: ListenAddrFlagName,
Usage: "pprof listening address",
Value: "0.0.0.0",
Value: "0.0.0.0", // TODO(CLI-4159): Switch to 127.0.0.1
EnvVars: opservice.PrefixEnvVar(envPrefix, "PPROF_ADDR"),
},
&cli.IntFlag{
Expand Down
2 changes: 1 addition & 1 deletion op-service/rpc/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func CLIFlags(envPrefix string) []cli.Flag {
&cli.StringFlag{
Name: ListenAddrFlagName,
Usage: "rpc listening address",
Value: "0.0.0.0",
Value: "0.0.0.0", // TODO(CLI-4159): Switch to 127.0.0.1
EnvVars: opservice.PrefixEnvVar(envPrefix, "RPC_ADDR"),
},
&cli.IntFlag{
Expand Down

0 comments on commit c0d2442

Please sign in to comment.