Skip to content

Commit

Permalink
Include Block and P2P protocols versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia committed Jan 14, 2019
1 parent ee9dd22 commit 145fe81
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions server/tm_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

const (
versionString = `Tendermint: %s
ABCI: %s
BlockProtocol: %d
P2PProtocol: %d
`
)

// ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout
func ShowNodeIDCmd(ctx *Context) *cobra.Command {
return &cobra.Command{
Expand Down Expand Up @@ -95,14 +103,13 @@ 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
Long: `Print protocols' and libraries' 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)
fmt.Printf(versionString, tversion.Version, tversion.ABCIVersion,
tversion.BlockProtocol.Uint64(), tversion.P2PProtocol.Uint64())

return nil
},
Expand Down

0 comments on commit 145fe81

Please sign in to comment.