diff --git a/PENDING.md b/PENDING.md index 490fd171fa9..89537e412bd 100644 --- a/PENDING.md +++ b/PENDING.md @@ -19,6 +19,7 @@ BREAKING CHANGES * https://github.com/cosmos/cosmos-sdk/issues/2838 - Move store keys to constants * [\#3162](https://github.com/cosmos/cosmos-sdk/issues/3162) The `--gas` flag now takes `auto` instead of `simulate` in order to trigger a simulation of the tx before the actual execution. + * [\#3285](https://github.com/cosmos/cosmos-sdk/pull/3285) New `gaiad tendermint version` to print libs versions * SDK diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 9d835171159..e2c57b761e2 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -11,6 +11,7 @@ import ( tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" "github.com/tendermint/tendermint/p2p" pvm "github.com/tendermint/tendermint/privval" + tversion "github.com/tendermint/tendermint/version" "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" @@ -89,6 +90,26 @@ func ShowAddressCmd(ctx *Context) *cobra.Command { return cmd } +// VersionCmd prints tendermint and ABCI version numbers. +func VersionCmd(ctx *Context) *cobra.Command { + cmd := &cobra.Command{ + Use: "version", + Short: "Print tendermint libraries' version", + Long: `Print Tendermint's and ABCI's version numbers +against which this app has been compiled. +`, + RunE: func(cmd *cobra.Command, args []string) error { + + fmt.Printf(`tendermint: %s +ABCI: %s +`, tversion.Version, tversion.ABCIVersion) + + return nil + }, + } + return cmd +} + func printlnJSON(v interface{}) error { cdc := codec.New() codec.RegisterCrypto(cdc) diff --git a/server/util.go b/server/util.go index dec3a6d4aa1..5092cab9ad8 100644 --- a/server/util.go +++ b/server/util.go @@ -142,6 +142,7 @@ func AddCommands( ShowNodeIDCmd(ctx), ShowValidatorCmd(ctx), ShowAddressCmd(ctx), + VersionCmd(ctx), ) rootCmd.AddCommand(