mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-04 04:04:00 +00:00
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user