-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rpcserver] Implement getblockchaininfo RPC. #1475
Comments
Does |
It indicates the latter. IBD is really more of a "catchup" mode as opposed to necessarily really being the first sync. |
@dnldd Is implementing this. |
In regards to showing the status of the DCPs, I suspect the following will do: {
...,
"deployments": {
"sdiffalgorithm": {
"status": "active",
"since": <blockheight of the first block to which the status applies>,
"starttime": ...,
"expiretime": ...,
},
"maxblocksize": {
....,
},
"anotherdeployment": {
...,
},
},
} However, the exact fields will probably change depending on the status, such as if it's in progress, versus rejected, versus not started, etc. |
I hope you guys don't plan to do away with the previous height implementation that returned the latest best block to be sync'd by dcrd. This new height implementation and the previous implementation are equally important but for different use case scenarios. |
The height provided by this call will be sourced from the best chain state, that's not changing. |
The existing RPCs |
@dmigwi which method are you referring to? The peer heights from getpeerinfo? |
|
Not to worry. That's probably one of the most widely used RPCs, period. |
Sample response from simnet tests.
|
In order to provide additional details about the current state of the blockchain, a new RPC named
getblockchaininfo
should be implemented.The command for this RPC is already defined along with its result, however, it is not implemented in the dcrd RPC server and the current results don't contain all of the information pertinent to Decred.
The result struct should be modified to add the following fields:
initialblockdownload
(bool
) - Best guess as to whether the initial block download process is underwaychainwork
(string
) - Hexadecimal value that represents the total work in the current best chainmaxblocksize
(uint32
) - The maximum allowed block sizeThere should probably also be some additional information regarding the state of the various DCPs, but the best way to present that information needs to be thought through.
It should also be noted that the
verificationprogress
field currently has no code to determine it, so a best guess will need to be determined in the RPC server for now. In the future, this can be significantly improved through modification to theblockchain
module, but that is beyond the scope of this issue.Don't forget when working on this the JSON-RPC API documentation and RPC server help needs to be updated accordingly as well as bumping the RPC server version and potentially the
dcrjson
module version depending on what other changes have happened since the last module release.The text was updated successfully, but these errors were encountered: