Support min fees in a localnet and fix gaiad config (#3172)
This commit is contained in:
committed by
Jack Zampolin
parent
abbd2d4dd3
commit
8211c025da
@@ -21,13 +21,13 @@ var configTemplate *template.Template
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
tmpl := template.New("cosmosConfigFileTemplate")
|
||||
tmpl := template.New("gaiaConfigFileTemplate")
|
||||
if configTemplate, err = tmpl.Parse(defaultConfigTemplate); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// ParseConfig retrieves the default environment configuration for Cosmos.
|
||||
// ParseConfig retrieves the default environment configuration for Gaia.
|
||||
func ParseConfig() (*Config, error) {
|
||||
conf := DefaultConfig()
|
||||
err := viper.Unmarshal(conf)
|
||||
|
||||
+7
-10
@@ -103,18 +103,15 @@ func interceptLoadConfig() (conf *cfg.Config, err error) {
|
||||
conf, err = tcmd.ParseConfig() // NOTE: ParseConfig() creates dir/files as necessary.
|
||||
}
|
||||
|
||||
cosmosConfigFilePath := filepath.Join(rootDir, "config/gaiad.toml")
|
||||
viper.SetConfigName("cosmos")
|
||||
_ = viper.MergeInConfig()
|
||||
var cosmosConf *config.Config
|
||||
if _, err := os.Stat(cosmosConfigFilePath); os.IsNotExist(err) {
|
||||
cosmosConf, _ := config.ParseConfig()
|
||||
config.WriteConfigFile(cosmosConfigFilePath, cosmosConf)
|
||||
// create a default gaia config file if it does not exist
|
||||
gaiaConfigFilePath := filepath.Join(rootDir, "config/gaiad.toml")
|
||||
if _, err := os.Stat(gaiaConfigFilePath); os.IsNotExist(err) {
|
||||
gaiaConf, _ := config.ParseConfig()
|
||||
config.WriteConfigFile(gaiaConfigFilePath, gaiaConf)
|
||||
}
|
||||
|
||||
if cosmosConf == nil {
|
||||
_, err = config.ParseConfig()
|
||||
}
|
||||
viper.SetConfigName("gaiad")
|
||||
err = viper.MergeInConfig()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user