From 35ee574ea5ca886d4019bb7db34b57ccb69de46e Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 19 Jul 2023 15:11:37 +0200 Subject: [PATCH 1/2] Remove deprecation notice for --mainnet flag We planned to remove the `--mainnet` flag, as it seemed unnecessary, as the client running without any network flag runs for mainnet by default. But from infrastructure adminstrator perspective the flag may be actually usefull when running the application on multiple environments. It's much easier to maintain a common template where the administrator will have to change value of the flag rather than set the flag for some environments and remove it for mainnet. --- cmd/flags.go | 4 +--- config/config.go | 9 --------- docs/resources/client-start-help | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cmd/flags.go b/cmd/flags.go index ee7f95ffeb..4cece39117 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -77,12 +77,10 @@ func initGlobalConfigFlags(cmd *cobra.Command, configFilePath *string) { // start command to run the client against test networks. Only one flag // from this set is allowed. func initGlobalNetworkFlags(cmd *cobra.Command) { - // TODO: Remove the mainnet flag. - // DEPRECATED cmd.PersistentFlags().Bool( network.Mainnet.String(), false, - "Mainnet network (DEPRECATED)", + "Mainnet network", ) cmd.PersistentFlags().Bool( diff --git a/config/config.go b/config/config.go index 910e5c48ee..cc008478ef 100644 --- a/config/config.go +++ b/config/config.go @@ -119,15 +119,6 @@ func (c *Config) ReadConfig(configFilePath string, flagSet *pflag.FlagSet, categ if err != nil { return fmt.Errorf("unable to resolve networks: [%w]", err) } - - // TODO: Remove the mainnet flag. - // DEPRECATED - if isMainnet, err := flagSet.GetBool(network.Mainnet.String()); err == nil && isMainnet { - logger.Warnf( - "--%s flag is deprecated, to run the client against the mainnet don't provide any network flag", - network.Mainnet.String(), - ) - } } // Read configuration from a file if the config file path is set. diff --git a/docs/resources/client-start-help b/docs/resources/client-start-help index f0e5338d60..09bc3386aa 100644 --- a/docs/resources/client-start-help +++ b/docs/resources/client-start-help @@ -44,7 +44,7 @@ Flags: Global Flags: -c, --config string Path to the configuration file. Supported formats: TOML, YAML, JSON. --developer Developer network - --mainnet Mainnet network (DEPRECATED) + --mainnet Mainnet network --testnet Testnet network Environment variables: From ca8bdb802d7f2e04ddafa1047de60d28b6776dea Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Tue, 12 Sep 2023 16:49:57 +0200 Subject: [PATCH 2/2] Remove TODO about removing mainnet flag --- cmd/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/flags.go b/cmd/flags.go index 4cece39117..6add3cd7e0 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -96,7 +96,7 @@ func initGlobalNetworkFlags(cmd *cobra.Command) { ) cmd.MarkFlagsMutuallyExclusive( - network.Mainnet.String(), // TODO: Remove the mainnet flag. + network.Mainnet.String(), network.Testnet.String(), network.Developer.String(), )