diff --git a/CHANGELOG.md b/CHANGELOG.md index 97881d5f66..448d79dbe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ BUG FIXES * \#1630 - redelegation nolonger removes tokens from the delegator liquid account * [keys] \#1629 - updating password no longer asks for a new password when the first entered password was incorrect * [lcd] importing an account would create a random account +* [server] 'gaiad init' command family now writes provided name as the moniker in `config.toml` ## 0.20.0 diff --git a/server/init.go b/server/init.go index ef78081868..7cf857c208 100644 --- a/server/init.go +++ b/server/init.go @@ -149,6 +149,11 @@ func gentxWithConfig(cdc *wire.Codec, appInit AppInit, config *cfg.Config, genTx return } + // Write updated config with moniker + config.Moniker = genTxConfig.Name + configFilePath := filepath.Join(config.RootDir, "config", "config.toml") + cfg.WriteConfigFile(configFilePath, config) + return } @@ -240,6 +245,11 @@ func initWithConfig(cdc *wire.Codec, appInit AppInit, config *cfg.Config, initCo viper.GetBool(FlagOWK), "127.0.0.1", } + + // Write updated config with moniker + config.Moniker = genTxConfig.Name + configFilePath := filepath.Join(config.RootDir, "config", "config.toml") + cfg.WriteConfigFile(configFilePath, config) appGenTx, am, validator, err := appInit.AppGenTx(cdc, pubKey, genTxConfig) appMessage = am if err != nil {