Skip to content

Commit

Permalink
Cleanup flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Sep 26, 2024
1 parent b600aaa commit e729893
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
6 changes: 3 additions & 3 deletions op-batcher/batcher/batch_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
21 changes: 3 additions & 18 deletions op-batcher/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit e729893

Please sign in to comment.