[rpc] added current block number in utility metadata

pull/3667/head
Jacky Wang 4 years ago
parent 343dbe89b3
commit 6705e233ee
No known key found for this signature in database
GPG Key ID: 1085CE5F4FF5842C
  1. 1
      hmy/hmy.go
  2. 1
      rpc/common/types.go

@ -197,6 +197,7 @@ func (hmy *Harmony) GetNodeMetadata() commonRPC.NodeMetadata {
ChainConfig: *hmy.ChainConfig(),
IsLeader: hmy.IsLeader(),
ShardID: hmy.ShardID,
CurrentBlockNum: header.Number().Uint64(),
CurrentEpoch: header.Epoch().Uint64(),
BlocksPerEpoch: blockEpoch,
Role: cfg.Role().String(),

@ -55,6 +55,7 @@ type NodeMetadata struct {
ChainConfig params.ChainConfig `json:"chain-config"`
IsLeader bool `json:"is-leader"`
ShardID uint32 `json:"shard-id"`
CurrentBlockNum uint64 `json:"current-number"`
CurrentEpoch uint64 `json:"current-epoch"`
BlocksPerEpoch *uint64 `json:"blocks-per-epoch,omitempty"`
Role string `json:"role"`

Loading…
Cancel
Save