Browse Source

rpc: add application info to `status` call (#7701)

* rpc/coretypes: add `ApplicationInfo` to `ResultStatus`
* internal/rpc/core: return application version

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
pull/7712/head
mempirate 3 years ago
committed by GitHub
parent
commit
db3044ff3c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +8
    -1
      internal/rpc/core/status.go
  3. +5
    -0
      rpc/coretypes/responses.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -47,6 +47,7 @@ Special thanks to external contributors on this release:
### FEATURES
- [rpc] [\#7270](https://github.com/tendermint/tendermint/pull/7270) Add `header` and `header_by_hash` RPC Client queries. (@fedekunze)
- [rpc] [\#7701] Add `ApplicationInfo` to `status` rpc call which contains the application version. (@jonasbostoen)
- [cli] [#7033](https://github.com/tendermint/tendermint/pull/7033) Add a `rollback` command to rollback to the previous tendermint state in the event of non-determinstic app hash or reverting an upgrade.
- [mempool, rpc] \#7041 Add removeTx operation to the RPC layer. (@tychoish)
- [consensus] \#7354 add a new `synchrony` field to the `ConsensusParameter` struct for controlling the parameters of the proposer-based timestamp algorithm. (@williambanfield)


+ 8
- 1
internal/rpc/core/status.go View File

@ -3,6 +3,7 @@ package core
import (
"bytes"
"context"
"fmt"
"time"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
@ -59,8 +60,14 @@ func (env *Environment) Status(ctx context.Context) (*coretypes.ResultStatus, er
}
}
var applicationInfo coretypes.ApplicationInfo
if abciInfo, err := env.ABCIInfo(ctx); err == nil {
applicationInfo.Version = fmt.Sprint(abciInfo.Response.AppVersion)
}
result := &coretypes.ResultStatus{
NodeInfo: env.P2PTransport.NodeInfo(),
NodeInfo: env.P2PTransport.NodeInfo(),
ApplicationInfo: applicationInfo,
SyncInfo: coretypes.SyncInfo{
LatestBlockHash: latestBlockHash,
LatestAppHash: latestAppHash,


+ 5
- 0
rpc/coretypes/responses.go View File

@ -116,6 +116,10 @@ type SyncInfo struct {
BackFillBlocksTotal int64 `json:"backfill_blocks_total,string"`
}
type ApplicationInfo struct {
Version string `json:"version"`
}
// Info about the node's validator
type ValidatorInfo struct {
Address bytes.HexBytes
@ -155,6 +159,7 @@ func (v *ValidatorInfo) UnmarshalJSON(data []byte) error {
// Node Status
type ResultStatus struct {
NodeInfo types.NodeInfo `json:"node_info"`
ApplicationInfo ApplicationInfo `json:"application_info,omitempty"`
SyncInfo SyncInfo `json:"sync_info"`
ValidatorInfo ValidatorInfo `json:"validator_info"`
LightClientInfo types.LightClientInfo `json:"light_client_info,omitempty"`


Loading…
Cancel
Save