[REST] getutxos REST command (based on Bip64) #5420

pull jonasschnelli wants to merge 2 commits into bitcoin:master from jonasschnelli:rest-getutxos changing 5 files +414 −26
  1. jonasschnelli commented at 5:26 PM on December 3, 2014: contributor

    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
  2. jonasschnelli commented at 5:28 PM on December 3, 2014: contributor

    if someone could first review the tests unter qa/pull-tester/rpc-tests would help...

  3. jonasschnelli commented at 5:28 PM on December 3, 2014: contributor

    Not meant for 0.10

  4. jonasschnelli force-pushed on Dec 3, 2014
  5. jonasschnelli force-pushed on Dec 3, 2014
  6. jgarzik commented at 5:56 PM on December 3, 2014: contributor

    +1 on the feature

    A bit disappointing to render things twice, once in binary and once in JSON.

  7. jonasschnelli commented at 8:21 PM on December 3, 2014: contributor

    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.

  8. laanwj added the label RPC on Dec 5, 2014
  9. mikehearn commented at 10:45 PM on December 16, 2014: contributor

    My username is mikehearn not mhearn.

  10. jonasschnelli commented at 8:04 AM on December 17, 2014: contributor

    @mikehearn Sorry for that. Just changed it.

  11. laanwj commented at 12:07 PM on February 19, 2015: member

    utACK

  12. jonasschnelli force-pushed on Mar 4, 2015
  13. jonasschnelli force-pushed on Mar 4, 2015
  14. jonasschnelli commented at 12:17 PM on March 4, 2015: contributor

    rebased

  15. paveljanik commented at 3:54 PM on March 4, 2015: contributor
  16. jonasschnelli commented at 5:10 AM on March 5, 2015: contributor

    @paveljanik i just added a basic documentation. Will extend the documentation if there are enough ACKs.

  17. paveljanik commented at 7:45 AM on March 5, 2015: contributor

    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"
    }
    $ 
    
  18. [REST] getutxos REST command (based on Bip64)
    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
    97ee866549
  19. [QA] rest.py RPC test: change setgenerate() to generate() 6b4feb89a8
  20. jonasschnelli force-pushed on Apr 21, 2015
  21. jonasschnelli commented at 6:44 PM on April 21, 2015: contributor

    Updated. Fixed setgenerate/generate issues after #5957

  22. laanwj merged this on May 6, 2015
  23. laanwj closed this on May 6, 2015

  24. laanwj referenced this in commit 1fd2d39529 on May 6, 2015
  25. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me