diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b5c3169f71..98eb4007ecd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* (cli) [\#11548](https://github.com/cosmos/cosmos-sdk/pull/11548) Add Tendermint's `inspect` command to the `tendermint` sub-command. * (tx) [#\11533](https://github.com/cosmos/cosmos-sdk/pull/11533) Register [`EIP191`](https://eips.ethereum.org/EIPS/eip-191) as an available `SignMode` for chains to use. * (x/genutil) [\#11500](https://github.com/cosmos/cosmos-sdk/pull/11500) Fix GenTx validation and adjust error messages * [\#11430](https://github.com/cosmos/cosmos-sdk/pull/11430) Introduce a new `grpc-only` flag, such that when enabled, will start the node in a query-only mode. Note, gRPC MUST be enabled with this flag. diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 8ffe250ed2a0..1f9840c10356 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/spf13/cobra" - tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" pvm "github.com/tendermint/tendermint/privval" tversion "github.com/tendermint/tendermint/version" "sigs.k8s.io/yaml" @@ -29,6 +29,7 @@ func ShowNodeIDCmd() *cobra.Command { if err != nil { return err } + fmt.Println(nodeKey) return nil }, @@ -48,19 +49,23 @@ func ShowValidatorCmd() *cobra.Command { if err != nil { return err } + pk, err := privValidator.GetPubKey(cmd.Context()) if err != nil { return err } + sdkPK, err := cryptocodec.FromTmPubKeyInterface(pk) if err != nil { return err } + clientCtx := client.GetClientContextFromCmd(cmd) bz, err := clientCtx.Codec.MarshalInterfaceJSON(sdkPK) if err != nil { return err } + fmt.Println(string(bz)) return nil }, @@ -82,6 +87,7 @@ func ShowAddressCmd() *cobra.Command { if err != nil { return err } + valConsAddr := (sdk.ConsAddress)(privValidator.GetAddress()) fmt.Println(valConsAddr.String()) return nil @@ -96,9 +102,7 @@ func VersionCmd() *cobra.Command { return &cobra.Command{ Use: "version", Short: "Print tendermint libraries' version", - Long: `Print protocols' and libraries' version numbers -against which this app has been compiled. -`, + Long: "Print protocols' and libraries' version numbers against which this app has been compiled.", RunE: func(cmd *cobra.Command, args []string) error { bs, err := yaml.Marshal(&struct { Tendermint string @@ -130,8 +134,13 @@ func UnsafeResetAllCmd() *cobra.Command { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config - tcmd.ResetAll(cfg.DBDir(), cfg.P2P.AddrBookFile(), cfg.PrivValidator.KeyFile(), cfg.PrivValidator.StateFile(), serverCtx.Logger) - return nil + return tmcmd.ResetAll( + cfg.DBDir(), + cfg.P2P.AddrBookFile(), + cfg.PrivValidator.KeyFile(), + cfg.PrivValidator.StateFile(), + serverCtx.Logger, + ) }, } } diff --git a/server/util.go b/server/util.go index ffd0e9b512e1..2cace4b22355 100644 --- a/server/util.go +++ b/server/util.go @@ -20,6 +20,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" + tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" tmcfg "github.com/tendermint/tendermint/config" tmlog "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" @@ -271,7 +272,9 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type ShowValidatorCmd(), ShowAddressCmd(), VersionCmd(), + tmcmd.InspectCmd, ) + startCmd := StartCmd(appCreator, defaultNodeHome) addStartFlags(startCmd)