allow NewRootCmd to receive an option to set Viper Prefix
Closed this issue · 4 comments
jhernandezb commented
Currently the viper prefix is used for environment variables, this is useful if you need to deal with different networks for example
GAIA_NODE=http://gaia:26657
STARGAZE_NODE=http://stargaze:26657
This will require a small change in WithViper
to accept an option
initClientCtx := client.Context{}.
WithCodec(encodingConfig.Marshaler).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
WithTxConfig(encodingConfig.TxConfig).
WithLegacyAmino(encodingConfig.Amino).
WithInput(os.Stdin).
WithAccountRetriever(types.AccountRetriever{}).
WithBroadcastMode(flags.BroadcastBlock).
WithHomeDir(defaultNodeHome).
WithViper("")
faddat commented
YES, VERY.
Pantani commented
Nice idea!
We can add the WithEnvPrefix
option with a vanilla implementation instead of adding viper only to do this. What do you think @ilgooz, @lubtd, @ivanovpetr, and @fadeev?
ilgooz commented
Ofc, let's do it! 🎊
jhernandezb commented
Opened #23