tendermint/spm

allow NewRootCmd to receive an option to set Viper Prefix

Closed this issue · 4 comments

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("")

YES, VERY.

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?

Ofc, let's do it! 🎊

Opened #23