Skip to content

Commit

Permalink
Minor param related fixes (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
stana-miric authored Jun 9, 2023
1 parent 67d4970 commit 5011dd2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions command/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ func GetCommand() *cobra.Command {
Run: runCommand,
}

helper.RegisterGRPCAddressFlag(genesisCmd)

setFlags(genesisCmd)
setLegacyFlags(genesisCmd)

Expand Down
2 changes: 1 addition & 1 deletion command/genesis/polybft_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func (p *genesisParams) getValidatorAccounts(
for i, val := range p.validators {
parts := strings.Split(val, ":")
if len(parts) != 3 {
return nil, fmt.Errorf("expected 4 parts provided in the following format "+
return nil, fmt.Errorf("expected 3 parts provided in the following format "+
"<P2P multi address:ECDSA address:public BLS key>, but got %d part(s)",
len(parts))
}
Expand Down
1 change: 1 addition & 0 deletions command/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Config struct {
JSONRPCBatchRequestLimit uint64 `json:"json_rpc_batch_request_limit" yaml:"json_rpc_batch_request_limit"`
JSONRPCBlockRangeLimit uint64 `json:"json_rpc_block_range_limit" yaml:"json_rpc_block_range_limit"`
JSONLogFormat bool `json:"json_log_format" yaml:"json_log_format"`
CorsAllowedOrigins []string `json:"cors_allowed_origins" yaml:"cors_allowed_origins"`

Relayer bool `json:"relayer" yaml:"relayer"`
NumBlockConfirmations uint64 `json:"num_block_confirmations" yaml:"num_block_confirmations"`
Expand Down
4 changes: 1 addition & 3 deletions command/server/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ type serverParams struct {
devInterval uint64
isDevMode bool

corsAllowedOrigins []string

ibftBaseTimeoutLegacy uint64

genesisConfig *chain.Chain
Expand Down Expand Up @@ -151,7 +149,7 @@ func (p *serverParams) generateConfig() *server.Config {
Chain: p.genesisConfig,
JSONRPC: &server.JSONRPC{
JSONRPCAddr: p.jsonRPCAddress,
AccessControlAllowOrigin: p.corsAllowedOrigins,
AccessControlAllowOrigin: p.rawConfig.CorsAllowedOrigins,
BatchLengthLimit: p.rawConfig.JSONRPCBatchRequestLimit,
BlockRangeLimit: p.rawConfig.JSONRPCBlockRangeLimit,
},
Expand Down
4 changes: 2 additions & 2 deletions command/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func setFlags(cmd *cobra.Command) {
&params.configPath,
configFlag,
"",
"the path to the CLI config. Supports .json and .hcl",
"the path to the CLI config. Supports .json, .hcl, .yaml, .yml",
)

cmd.Flags().StringVar(
Expand Down Expand Up @@ -186,7 +186,7 @@ func setFlags(cmd *cobra.Command) {
)

cmd.Flags().StringArrayVar(
&params.corsAllowedOrigins,
&params.rawConfig.CorsAllowedOrigins,
corsOriginFlag,
defaultConfig.Headers.AccessControlAllowOrigins,
"the CORS header indicating whether any JSON-RPC response can be shared with the specified origin",
Expand Down

0 comments on commit 5011dd2

Please sign in to comment.