remove IsBackup to GetNodeMetadata API

pull/3814/head
Lutty 3 years ago committed by Leo Chen
parent faacc7c091
commit 14ddbd9574
  1. 1
      hmy/hmy.go
  2. 4
      rpc/blockchain.go
  3. 1
      rpc/common/types.go

@ -206,6 +206,7 @@ func (hmy *Harmony) GetNodeMetadata() commonRPC.NodeMetadata {
Role: cfg.Role().String(),
DNSZone: cfg.DNSZone,
Archival: cfg.GetArchival(),
IsBackup: hmy.NodeAPI.IsBackup(),
NodeBootTime: hmy.NodeAPI.GetNodeBootTime(),
PeerID: nodeconfig.GetPeerID(),
Consensus: consensusInternal,

@ -838,10 +838,6 @@ func isBlockGreaterThanLatest(hmy *hmy.Harmony, blockNum rpc.BlockNumber) bool {
return uint64(blockNum) > hmy.CurrentBlock().NumberU64()
}
func (s *PublicBlockchainService) GetCurrentNodeBackupState(ctx context.Context) (bool, error) {
return s.hmy.NodeAPI.IsBackup(), nil
}
func (s *PublicBlockchainService) SetNodeToBackupMode(ctx context.Context, isBackup bool) (bool, error) {
return s.hmy.NodeAPI.SetNodeBackupMode(isBackup), nil
}

@ -64,6 +64,7 @@ type NodeMetadata struct {
Role string `json:"role"`
DNSZone string `json:"dns-zone"`
Archival bool `json:"is-archival"`
IsBackup bool `json:"is-backup"`
NodeBootTime int64 `json:"node-unix-start-time"`
PeerID peer.ID `json:"peerid"`
Consensus ConsensusInternal `json:"consensus"`

Loading…
Cancel
Save