diff --git a/cmd/tendermint/commands/gen_validator.go b/cmd/tendermint/commands/gen_validator.go index be6508991..ece3c72a6 100644 --- a/cmd/tendermint/commands/gen_validator.go +++ b/cmd/tendermint/commands/gen_validator.go @@ -16,8 +16,13 @@ var GenValidatorCmd = &cobra.Command{ Run: genValidator, } +func init() { + GenValidatorCmd.Flags().String("priv_key_type", config.PrivKeyType, + "Specify validator's private key type (ed25519 | composite)") +} + func genValidator(cmd *cobra.Command, args []string) { - pv, _ := privval.GenFilePV("", "", privval.PrivKeyTypeEd25519) + pv, _ := privval.GenFilePV("", "", config.PrivKeyType) jsbz, err := cdc.MarshalJSON(pv) if err != nil { panic(err) diff --git a/cmd/tendermint/commands/reset_priv_validator.go b/cmd/tendermint/commands/reset_priv_validator.go index db7dbeaf6..5633ff23f 100644 --- a/cmd/tendermint/commands/reset_priv_validator.go +++ b/cmd/tendermint/commands/reset_priv_validator.go @@ -22,6 +22,10 @@ var keepAddrBook bool func init() { ResetAllCmd.Flags().BoolVar(&keepAddrBook, "keep-addr-book", false, "Keep the address book intact") + ResetAllCmd.Flags().String("priv_key_type", config.PrivKeyType, + "Specify validator's private key type (ed25519 | composite)") + ResetPrivValidatorCmd.Flags().String("priv_key_type", config.PrivKeyType, + "Specify validator's private key type (ed25519 | composite)") } // ResetPrivValidatorCmd resets the private validator files. @@ -35,7 +39,7 @@ var ResetPrivValidatorCmd = &cobra.Command{ // it's only suitable for testnets. func resetAll(cmd *cobra.Command, args []string) { ResetAll(config.DBDir(), config.P2P.AddrBookFile(), config.PrivValidatorKeyFile(), - config.PrivValidatorKeyType(), config.PrivValidatorStateFile(), logger) + config.PrivValidatorStateFile(), config.PrivValidatorKeyType(), logger) } // XXX: this is totally unsafe.