Skip to content

Commit

Permalink
Remove deprecation notice for --mainnet flag
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nkuba committed Jul 19, 2023
1 parent 08ee58c commit 35ee574
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
4 changes: 1 addition & 3 deletions cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 0 additions & 9 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/client-start-help
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 35ee574

Please sign in to comment.