diff --git a/cmd/benchyd/consts_default.go b/cmd/benchyd/consts_default.go new file mode 100644 index 0000000..07675b5 --- /dev/null +++ b/cmd/benchyd/consts_default.go @@ -0,0 +1,7 @@ +//go:build !testnet + +package main + +const ( + defaultGatewayAddr = ":9981" +) diff --git a/cmd/benchyd/consts_testnet.go b/cmd/benchyd/consts_testnet.go new file mode 100644 index 0000000..9578a94 --- /dev/null +++ b/cmd/benchyd/consts_testnet.go @@ -0,0 +1,7 @@ +//go:build testnet + +package main + +const ( + defaultGatewayAddr = ":9881" +) diff --git a/cmd/benchyd/main.go b/cmd/benchyd/main.go index 500e6c4..8dbac49 100644 --- a/cmd/benchyd/main.go +++ b/cmd/benchyd/main.go @@ -34,6 +34,7 @@ var ( dir string bootstrapPeers bool apiAddr string + gatewayAddr string logLevel string ) @@ -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() @@ -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)) }