Skip to content

Commit

Permalink
Fix grpc and jsonprc bindings when set from config file (#448)
Browse files Browse the repository at this point in the history
* Fix grpc / jsonprc config file bindings
  • Loading branch information
ZeljkoBenovic authored Mar 12, 2022
1 parent dde9073 commit 083d493
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions command/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ func setDevFlags(cmd *cobra.Command) {
}

func runPreRun(cmd *cobra.Command, _ []string) error {
// Set the grpc and json ip:port bindings
// The config file will have presedence over --flag
params.setRawGRPCAddress(helper.GetGRPCAddress(cmd))
params.setRawJSONRPCAddress(helper.GetJSONRPCAddress(cmd))

// Check if the config file has been specified
// Config file settings will override JSON-RPC and GRPC address values
if isConfigFileSpecified(cmd) {
if err := params.initConfigFromFile(); err != nil {
return err
Expand All @@ -218,9 +224,6 @@ func runPreRun(cmd *cobra.Command, _ []string) error {
return err
}

params.setRawGRPCAddress(helper.GetGRPCAddress(cmd))
params.setRawJSONRPCAddress(helper.GetJSONRPCAddress(cmd))

if err := params.initRawParams(); err != nil {
return err
}
Expand Down

0 comments on commit 083d493

Please sign in to comment.