[REST] JSON support for /rest/headers #5486

Merged
merged 1 commit into from Jul 10, 2015

Conversation

Projects
None yet
5 participants
@jonasschnelli
Member

jonasschnelli commented Dec 16, 2014

also includes REST documentation update for /rest/headers

@laanwj laanwj added the REST label Jan 8, 2015

@fanquake

This comment has been minimized.

Show comment
Hide comment
@fanquake

fanquake Mar 26, 2015

Member

Needs rebase

Member

fanquake commented Mar 26, 2015

Needs rebase

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Mar 26, 2015

Member

Rebased.
I still think it would make sense to merge this. At least it would add documentation for rest/getheaders (which currently is missing). I could also try to split of the documentation change for separate pull-in.
The JSON support for getheaders would round off/complete the json/bin/hex output support.

Member

jonasschnelli commented Mar 26, 2015

Rebased.
I still think it would make sense to merge this. At least it would add documentation for rest/getheaders (which currently is missing). I could also try to split of the documentation change for separate pull-in.
The JSON support for getheaders would round off/complete the json/bin/hex output support.

@jgarzik

This comment has been minimized.

Show comment
Hide comment
@jgarzik

jgarzik Mar 26, 2015

Contributor

Code appears correct... I just wonder who would use JSON header queries.

Contributor

jgarzik commented Mar 26, 2015

Code appears correct... I just wonder who would use JSON header queries.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Mar 26, 2015

Member

@jgarzik couldn't we ask the same for json blocks? I just think we should have consistent output support over all rest calls.

Member

jonasschnelli commented Mar 26, 2015

@jgarzik couldn't we ask the same for json blocks? I just think we should have consistent output support over all rest calls.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Mar 26, 2015

Member

Well at least blocks contain transactions. None of the information in headers is that useful in itself, and don't you get a similar view with /rest/block/notxdetails/?

Member

laanwj commented Mar 26, 2015

Well at least blocks contain transactions. None of the information in headers is that useful in itself, and don't you get a similar view with /rest/block/notxdetails/?

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Mar 26, 2015

Member

IMO JSON output support is for users who don't like to deserialize data. /rest/block/notxdetails/ does not allow one to retrieve multiple blocks/headers at one time. Thats why there is a /rest/getheaders call. It looks somehow bad if we have only one rest call without JSON support and users there need to deserialize data (which mean the need a library or have to learn more about the protocol).

Member

jonasschnelli commented Mar 26, 2015

IMO JSON output support is for users who don't like to deserialize data. /rest/block/notxdetails/ does not allow one to retrieve multiple blocks/headers at one time. Thats why there is a /rest/getheaders call. It looks somehow bad if we have only one rest call without JSON support and users there need to deserialize data (which mean the need a library or have to learn more about the protocol).

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Mar 26, 2015

Member

Yes, I understand the purpose but I'm with @jgarzik in wondering why anyone would use this, as the header has very little informational value outside its (hashable, unmalleable) binary representation. But I'm not strongly against it either it's not a lot of code. And there's something to be said for consistency.

Member

laanwj commented Mar 26, 2015

Yes, I understand the purpose but I'm with @jgarzik in wondering why anyone would use this, as the header has very little informational value outside its (hashable, unmalleable) binary representation. But I'm not strongly against it either it's not a lot of code. And there's something to be said for consistency.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Mar 27, 2015

Member

utACK

Member

laanwj commented Mar 27, 2015

utACK

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Apr 16, 2015

Contributor

ACK (I was about to add the missing /rest/headers documentation ;-)

Contributor

paveljanik commented Apr 16, 2015

ACK (I was about to add the missing /rest/headers documentation ;-)

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Apr 16, 2015

Member

Yes. This PR also includes the missing docs for already merged rest headers call (it's a separate commit).

Member

jonasschnelli commented Apr 16, 2015

Yes. This PR also includes the missing docs for already merged rest headers call (it's a separate commit).

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jul 2, 2015

Member

After #6247 this can use the existing BlockHeaderToJSON (see my comment about overlap there)

Member

laanwj commented Jul 2, 2015

After #6247 this can use the existing BlockHeaderToJSON (see my comment about overlap there)

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jul 2, 2015

Member

Rebased and make use of the UniValue blockheaderToJSON(const CBlockIndex* blockindex) from #6247.

Member

jonasschnelli commented Jul 2, 2015

Rebased and make use of the UniValue blockheaderToJSON(const CBlockIndex* blockindex) from #6247.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jul 10, 2015

Member

ACK

Member

laanwj commented Jul 10, 2015

ACK

@laanwj laanwj merged commit c45c7ea into bitcoin:master Jul 10, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Jul 10, 2015

Merge pull request #5486
c45c7ea [REST] add JSON support for /rest/headers/ (Jonas Schnelli)

@str4d str4d referenced this pull request in zcash/zcash Feb 15, 2017

Merged

Bitcoin 0.12 RPC PRs 1 #2100

@dagurval dagurval referenced this pull request in bitcoinxt/bitcoinxt Mar 18, 2017

Merged

rpc: Accept strings in AmountFromValue #191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment