Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

feat: restructure core status response #107

Merged
merged 8 commits into from
Mar 18, 2021
Merged

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Mar 9, 2021

Issue being fixed or feature implemented

This pull request implements a new structure for core getStatus response.

What was done?

  • fea!t: restructured core status response

How Has This Been Tested?

  • embedded tests

Breaking Changes

  • structure of getStatus has changed to the below format :
version: {
      protocol: networkInfo.protocolversion (uint32),
      software: networkInfo.version (uint32),
      agent: networkInfo.subversion (str),
}
time: {
   now: Date.now() (uint32)
   offset: networkInfo.timeoffset (int32),
   median: blockchainInfo.mediantime (uint32),
}
status: enum: not started, syncing, ready (chain.isSynced && masternode.isSynced),
syncProgress:  blockchainInfo.verificationprogress (double),
chain: {
   name: blockchainInfo.chain (str),
   blocksCount: blockchainInfo.blocks (uint32),
   headersCount: blockchainInfo.headers (uint32),
   bestBlockHash: blockchainInfo.bestblockhash (binary),
   difficulty: blockchainInfo.difficulty (double),
   chainWork: blockchainInfo.chainwork (binary),
   isSynced:  mnsync status.isBlockchainSynced (bool),
   syncProgress:  blockchainInfo.verificationprogress (double),
}
masternode: {
   state: "masternode status".state (enum),
   proTxHash: "masternode status".proTxHash (binary),
   posePenalty: "masternode status".dmnState.PoSePenalty (unit32)
   isSynced: mnsync status.isSynced (boolean),
   syncProgress:  mnsync status.AssetId (double)
}
network: {
   peersCount: networkInfo.connections  (unit32),
   fee: {
      relay: networkInfo.relayfee (double)
      incremental: networkInfo.incrementalfee (double)
   }
} 

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@Alex-Werner Alex-Werner added this to the v0.19 milestone Mar 11, 2021
@Alex-Werner Alex-Werner marked this pull request as ready for review March 12, 2021 12:29
We should not nest struct into message and keep fee on top level
protos/core/v0/core.proto Outdated Show resolved Hide resolved
@Alex-Werner Alex-Werner merged commit af592ea into master Mar 18, 2021
@Alex-Werner Alex-Werner deleted the remove-unnecessary-status branch March 18, 2021 01:46
@Alex-Werner Alex-Werner restored the remove-unnecessary-status branch March 18, 2021 01:52
Alex-Werner added a commit that referenced this pull request Mar 18, 2021
Alex-Werner added a commit that referenced this pull request Mar 18, 2021
* feat: restructure core status response

* feat: restructure core status response

* feat: restructure core status response

* feat: added Masternode and renamed masternode.status to .state

* chore: build

* feat: restructure core status response

* fix: network not defined

We should not nest struct into message and keep fee on top level

* feat: rename fee to networkfee

Co-authored-by: Alex Werner <[email protected]>
Alex-Werner added a commit that referenced this pull request Mar 18, 2021
@shumkov shumkov deleted the remove-unnecessary-status branch May 3, 2021 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants