Skip to content
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

rpc: Add PoWHash to getblockverbose result. #3154

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Jul 18, 2023

This adds a PoWHash field to the RPC server's getblock (verbose) and getblockheader (verbose) responses.

pre-DCP0011

$ ./dcrctl --testnet getblock 000000b396bfeaa6ae6fa9e3cee441d7215191630bdaa9b979a872985caed727
{
  "hash": "000000b396bfeaa6ae6fa9e3cee441d7215191630bdaa9b979a872985caed727",
  "powhash": "000000b396bfeaa6ae6fa9e3cee441d7215191630bdaa9b979a872985caed727",
  "confirmations": 1408,
  "size": 4491,
  "height": 1170047,
  "version": 11,
...

post-DCP0011

$ ./dcrctl --testnet getblock c7da7b548a2a9463dc97adb48433c4ffff18c3873f7e2ae99338a990dae039f0
{
  "hash": "c7da7b548a2a9463dc97adb48433c4ffff18c3873f7e2ae99338a990dae039f0",
  "powhash": "000000ce3005dbe95398f16f682438e298ff6301cc691e5df58839bd90351e33",
  "confirmations": 1407,
  "size": 4327,
  "height": 1170048,
  "version": 11,

@chappjc
Copy link
Member Author

chappjc commented Jul 18, 2023

Oh, the help. Will update. But concept ACK or no?

@jrick
Copy link
Member

jrick commented Jul 18, 2023

looks reasonable to me

@chappjc
Copy link
Member Author

chappjc commented Jul 18, 2023

Also for getblockheader (verbose=true) to match.

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. It looks good overall. I identified a few nits inline.

Also, please add another commit after the main rpc: Add ... commit that updates the JSON-RPC API docs to match the new reality:

docs: Update JSON-RPC API for powhash.

internal/rpcserver/rpcserverhelp.go Outdated Show resolved Hide resolved
internal/rpcserver/rpcserverhelp.go Outdated Show resolved Hide resolved
rpc/jsonrpc/types/chainsvrresults.go Show resolved Hide resolved
@davecgh davecgh changed the title rpc: add PoWHash to getblockverbose result rpc: Add PoWHash to getblockverbose result. Jul 18, 2023
@davecgh davecgh added this to the 1.9.0 milestone Jul 18, 2023
@davecgh davecgh added the rpc server api change Issues and/or pull requests that involve a new RPC server version or breaking to change to the API. label Jul 18, 2023
@davecgh davecgh merged commit b103569 into decred:master Jul 19, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rpc server api change Issues and/or pull requests that involve a new RPC server version or breaking to change to the API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants