diff --git a/cmd/root.go b/cmd/root.go index d396a598..6e50a0db 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -58,6 +58,7 @@ var ( inMemoryMode bool tableSize int64 requestUUID string + statusPort uint // Config is the populated *configuration.Configuration from // the configurationFile. If none is provided, this is set @@ -288,6 +289,13 @@ default values.`, "requestUUID configures the requestUUID in logs, which aims to enable search logs by requestUUID", ) + checkDataCmd.Flags().UintVar( + &statusPort, + "status-port", + 0, + "status-port configures the status query port, this will override the status_port", + ) + rootCmd.AddCommand(checkDataCmd) checkConstructionCmd.Flags().StringVar( &asserterConfigurationFile, @@ -324,6 +332,13 @@ default values.`, "requestUUID configures the requestUUID in logs, which aims to enable search logs by requestUUID", ) + checkConstructionCmd.Flags().UintVar( + &statusPort, + "status-port", + 0, + "status-port configures the status query port, this will override the status_port", + ) + rootCmd.AddCommand(checkConstructionCmd) // View Commands @@ -419,6 +434,13 @@ func initConfig() { if len(requestUUID) != 0 { Config.RequestUUID = requestUUID } + + if statusPort > 0 { + Config.Data.StatusPort = statusPort + if Config.Construction != nil { + Config.Construction.StatusPort = statusPort + } + } } func ensureDataDirectoryExists() { diff --git a/configuration/configuration.go b/configuration/configuration.go index e3200e37..0e4fd965 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -57,8 +57,7 @@ func DefaultPerfConfiguration() *CheckPerfConfiguration { } // DefaultConfiguration returns a *Configuration with the -// EthereumNetwork, DefaultURL, DefaultTimeout, -// DefaultConstructionConfiguration and DefaultDataConfiguration. +// EthereumNetwork, DefaultURL, DefaultTimeout, and DefaultDataConfiguration. func DefaultConfiguration() *Configuration { return &Configuration{ Network: EthereumNetwork,