has parts of @mikehearn #4351
- allows querying the utxos over REST
- same binary input and outputs as mentioned in Bip64
- input format = output format
- various rpc/rest regtests
has parts of @mikehearn #4351
if someone could first review the tests unter qa/pull-tester/rpc-tests would help...
Not meant for 0.10
+1 on the feature
A bit disappointing to render things twice, once in binary and once in JSON.
A bit disappointing to render things twice, once in binary and once in JSON.
The rendering is done in 3 lines (bin) and 14 lines (JSON) of code. Not so painful. But yes. Supporting 3 output formats can be exhausting in future.
I've also thought about that. Dropping binary would be a bad idea because of the JSON bandwith and parsing overhead. Dropping JSON would also be strange. Because a bin only REST API would be against modern REST architectures.
Only dropping hex would make sense for me, but handling hex is easy because of the bin support.
My username is mikehearn not mhearn.
@mikehearn Sorry for that. Just changed it.
utACK
rebased
@jonasschnelli can you please add some description of this API to https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md
@paveljanik i just added a basic documentation. Will extend the documentation if there are enough ACKs.
ACK
Sample calls:
# main
$ curl --data '{}' localhost:8332/rest/getutxos/.json 2>/dev/null | json_pp
{
"chaintipHash" : "000000000000000008596bd7ca15fb534a119cd5d219508df39d95e2272c6b4e",
"chainHeight" : 346243,
"utxos" : [],
"bitmap" : ""
}
# test
$ curl --data '{"checkmempool":false,"outpoints":[{"txid":"b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75","n":0}]}' localhost:18332/rest/getutxos/.json 2>/dev/null | json_pp
{
"chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
"chainHeight" : 325347,
"utxos" : [],
"bitmap" : "0"
}
$ curl --data '{"checkmempool":true,"outpoints":[{"txid":"b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75","n":0}]}' localhost:18332/rest/getutxos/.json 2>/dev/null | json_pp
{
"chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
"chainHeight" : 325347,
"utxos" : [
{
"scriptPubKey" : {
"addresses" : [
"mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD"
],
"type" : "pubkeyhash",
"hex" : "76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac",
"reqSigs" : 1,
"asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG"
},
"value" : 8.8687,
"height" : 2147483647,
"txvers" : 1
}
],
"bitmap" : "1"
}
$
has parts of @mhearn #4351
* allows querying the utxos over REST
* same binary input and outputs as mentioned in Bip64
* input format = output format
* various rpc/rest regtests
Updated. Fixed setgenerate/generate issues after #5957