[rpc] Expose nodes role into Metadata RPC (#2052)

pull/2060/head
Edgar Aroutiounian 5 years ago committed by Leo Chen
parent b216666de1
commit cf7d737c88
  1. 2
      internal/hmyapi/harmony.go

@ -53,6 +53,7 @@ type NodeMetadata struct {
ChainID string `json:"chainid"`
IsLeader bool `json:"is-leader"`
ShardID uint32 `json:"shard-id"`
Role string `json:"role"`
}
// GetNodeMetadata produces a NodeMetadata record, data is from the answering RPC node
@ -65,6 +66,7 @@ func (s *PublicHarmonyAPI) GetNodeMetadata() NodeMetadata {
s.b.ChainConfig().ChainID.String(),
s.b.IsLeader(),
s.b.GetShardID(),
cfg.Role().String(),
}
}

Loading…
Cancel
Save