Skip to content

Commit

Permalink
fix: remove listen flag default value
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Dec 7, 2023
1 parent d0bc86d commit 174f049
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func main() {
&cli.StringFlag{
Name: "listen",
Usage: "listen address for the service",
Value: "0.0.0.0:1234",
},
&cli.StringFlag{
Name: "repo",
Expand Down
6 changes: 3 additions & 3 deletions cmd/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.opencensus.io/plugin/ochttp"
)

func serveRPC(ctx context.Context, cfg *config.Config, listen string, jwt jwtclient.IJwtAuthClient, full api.FullNode, localApi local_api.LocalAPI, stop dix.StopFunc, maxRequestSize int64) error {
func serveRPC(ctx context.Context, cfg *config.Config, jwt jwtclient.IJwtAuthClient, full api.FullNode, localApi local_api.LocalAPI, stop dix.StopFunc, maxRequestSize int64) error {
serverOptions := []jsonrpc.ServerOption{}
if maxRequestSize > 0 {
serverOptions = append(serverOptions, jsonrpc.WithMaxRequestSize(maxRequestSize))
Expand Down Expand Up @@ -96,7 +96,7 @@ func serveRPC(ctx context.Context, cfg *config.Config, listen string, jwt jwtcli
}

server := http.Server{
Addr: listen,
Addr: cfg.API.ListenAddress,
Handler: allHandler,
BaseContext: func(net.Listener) context.Context {
return ctx
Expand Down Expand Up @@ -126,7 +126,7 @@ func serveRPC(ctx context.Context, cfg *config.Config, listen string, jwt jwtcli

signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGINT)

log.Infow("start http server", "addr", listen)
log.Infow("start http server", "addr", cfg.API.ListenAddress)
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
return err
}
Expand Down
1 change: 0 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ var runCmd = &cli.Command{
return serveRPC(
appCtx,
cfg,
cctx.String("listen"),
localJwt,
full,
localApi,
Expand Down

0 comments on commit 174f049

Please sign in to comment.