Skip to content

Commit

Permalink
cmd: add gateway flag
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Sep 19, 2023
1 parent 5451d61 commit e3b3478
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cmd/benchyd/consts_default.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build !testnet

package main

const (
defaultGatewayAddr = ":9981"
)
7 changes: 7 additions & 0 deletions cmd/benchyd/consts_testnet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build testnet

package main

const (
defaultGatewayAddr = ":9881"
)
4 changes: 3 additions & 1 deletion cmd/benchyd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (
dir string
bootstrapPeers bool
apiAddr string
gatewayAddr string
logLevel string
)

Expand Down Expand Up @@ -69,6 +70,7 @@ func main() {

flag.StringVar(&dir, "dir", ".", "data directory")
flag.StringVar(&apiAddr, "api.addr", ":8484", "api address")
flag.StringVar(&gatewayAddr, "rpc", defaultGatewayAddr, "gateway address")
flag.StringVar(&logLevel, "log.level", "info", "log level")
flag.BoolVar(&bootstrapPeers, "bootstrap", false, "bootstrap peers")
flag.Parse()
Expand Down Expand Up @@ -142,7 +144,7 @@ func main() {
os.Exit(1)
}()

g, err := gateway.NewCustomGateway(":9981", bootstrapPeers, false, filepath.Join(dir, "gateway"), modules.ProdDependencies)
g, err := gateway.NewCustomGateway(gatewayAddr, bootstrapPeers, false, filepath.Join(dir, "gateway"), modules.ProdDependencies)
if err != nil {
log.Fatal("failed to create gateway", zap.Error(err))
}
Expand Down

0 comments on commit e3b3478

Please sign in to comment.