From e72989304176cac9175b243867a694293ecc3c82 Mon Sep 17 00:00:00 2001 From: Michael de Hoog Date: Wed, 25 Sep 2024 19:42:20 -1000 Subject: [PATCH] Cleanup flags --- op-batcher/batcher/batch_submitter.go | 6 +++--- op-batcher/flags/flags.go | 21 +++------------------ 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/op-batcher/batcher/batch_submitter.go b/op-batcher/batcher/batch_submitter.go index 8fdf881..651025e 100644 --- a/op-batcher/batcher/batch_submitter.go +++ b/op-batcher/batcher/batch_submitter.go @@ -5,12 +5,12 @@ import ( "fmt" "github.com/ethereum-optimism/optimism/op-batcher/batcher" - "github.com/urfave/cli/v2" - "github.com/ethereum-optimism/optimism/op-batcher/flags" opservice "github.com/ethereum-optimism/optimism/op-service" "github.com/ethereum-optimism/optimism/op-service/cliapp" oplog "github.com/ethereum-optimism/optimism/op-service/log" + thisflags "github.com/mdehoog/op-nitro/op-batcher/flags" + "github.com/urfave/cli/v2" ) // Main is the entrypoint into the Batch Submitter. @@ -27,7 +27,7 @@ func Main(version string) cliapp.LifecycleAction { l := oplog.NewLogger(oplog.AppOut(cliCtx), cfg.LogConfig) oplog.SetGlobalLogHandler(l.Handler()) - opservice.ValidateEnvVars(flags.EnvVarPrefix, flags.Flags, l) + opservice.ValidateEnvVars(flags.EnvVarPrefix, thisflags.Flags, l) l.Info("Initializing Batch Submitter") return BatcherServiceFromCLIConfig(cliCtx.Context, version, cfg, l) diff --git a/op-batcher/flags/flags.go b/op-batcher/flags/flags.go index 2a051fd..9bb0db7 100644 --- a/op-batcher/flags/flags.go +++ b/op-batcher/flags/flags.go @@ -6,32 +6,17 @@ import ( "github.com/urfave/cli/v2" ) -const EnvVarPrefix = "OP_BATCHER" - -func prefixEnvVars(name string) []string { - return opservice.PrefixEnvVar(EnvVarPrefix, name) +func prefixEnvVar(name string) []string { + return opservice.PrefixEnvVar(flags.EnvVarPrefix, name) } var ( - // Required flags - //EnclaveRpcFlag = &cli.StringFlag{ - // Name: "enclave-rpc", - // Usage: "HTTP provider URL for the enclave service", - // EnvVars: prefixEnvVars("ENCLAVE_RPC"), - // Required: true, - //} DAURLFlag = &cli.StringFlag{ Name: "da-url", Usage: "URL for the Data Availability uploads", - EnvVars: prefixEnvVars("DA_URL"), + EnvVars: prefixEnvVar("DA_URL"), Required: true, } - //OutputOracleAddressFlag = &cli.StringFlag{ - // Name: "output-oracle-address", - // Usage: "Address of the output oracle contract", - // EnvVars: prefixEnvVars("OUTPUT_ORACLE_ADDRESS"), - // Required: true, - //} ) var requiredFlags = []cli.Flag{