From 0d75a3d3bb87389c999233d91999f92b2a082177 Mon Sep 17 00:00:00 2001 From: mariko Date: Tue, 9 Feb 2021 19:49:33 +0900 Subject: [PATCH 1/2] feat: add flag for the private key selection --- server/tm_cmds.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 323e181d6d..1b5f187163 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -5,6 +5,7 @@ package server import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/spf13/viper" yaml "gopkg.in/yaml.v2" @@ -145,7 +146,7 @@ func printlnJSON(v interface{}) error { // UnsafeResetAllCmd - extension of the tendermint command, resets initialization func UnsafeResetAllCmd(ctx *Context) *cobra.Command { - return &cobra.Command{ + cmd := cobra.Command{ Use: "unsafe-reset-all", Short: "Resets the blockchain database, removes address book files, and resets priv_validator.json to the genesis state", RunE: func(cmd *cobra.Command, args []string) error { @@ -155,4 +156,9 @@ func UnsafeResetAllCmd(ctx *Context) *cobra.Command { return nil }, } + cmd.Flags().String(flags.FlagPrivKeyType, flags.DefaultPrivKeyType, "specify validator's private key type (ed25519|composite). \n"+ + "set this to priv_key.type in priv_validator_key.json; default `ed25519`") + + return &cmd + } From ca36e95875ddecc08a5c9fc3a4f38b19a551a1f9 Mon Sep 17 00:00:00 2001 From: mariko Date: Wed, 10 Feb 2021 11:54:38 +0900 Subject: [PATCH 2/2] style: move import line `client/flags` to the lin below other tendermint imports. --- server/tm_cmds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 1b5f187163..a2a6e6cb6a 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -5,7 +5,6 @@ package server import ( "fmt" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/spf13/viper" yaml "gopkg.in/yaml.v2" @@ -16,6 +15,7 @@ import ( pvm "github.com/tendermint/tendermint/privval" tversion "github.com/tendermint/tendermint/version" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" )