aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-05-18 15:55:03 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-05-18 16:52:01 +0200
commitb44800277277903e11d5382c8406be128a67db46 (patch)
treeb13a44ae7ac643a87e9780c999bc2496179085b6 /doc
parent26e08a16a6fb64b535d10f5d459183092deefa50 (diff)
[Docs] fix and improve REST documentation
- fix bad formatting of getutxos - added getztxos example - fix different command syntax
Diffstat (limited to 'doc')
-rw-r--r--doc/REST-interface.md36
1 files changed, 31 insertions, 5 deletions
diff --git a/doc/REST-interface.md b/doc/REST-interface.md
index 11af040ad2..0b718d664e 100644
--- a/doc/REST-interface.md
+++ b/doc/REST-interface.md
@@ -7,7 +7,7 @@ Supported API
-------------
####Transactions
-`GET /rest/tx/TX-HASH.{bin|hex|json}`
+`GET /rest/tx/<TX-HASH>.<bin|hex|json>`
Given a transaction hash,
Returns a transaction, in binary, hex-encoded binary or JSON formats.
@@ -15,8 +15,8 @@ Returns a transaction, in binary, hex-encoded binary or JSON formats.
For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option.
####Blocks
-`GET /rest/block/BLOCK-HASH.{bin|hex|json}`
-`GET /rest/block/notxdetails/BLOCK-HASH.{bin|hex|json}`
+`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
+`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
Given a block hash,
Returns a block, in binary, hex-encoded binary or JSON formats.
@@ -46,12 +46,38 @@ Only supports JSON as output format.
* verificationprogress : (numeric) estimate of verification progress [0..1]
* chainwork : (string) total amount of work in active chain, in hexadecimal
-`GET /rest/getutxos`
+####Query UTXO set
+`GET /rest/getutxos.<bin|hex|json>`
-The getutxo command allows querying of the UTXO set given a set of of outpoints.
+The getutxo command allows querying of the UTXO set given a set of outpoints.
See BIP64 for input and output serialisation:
https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki
+Example:
+```
+$ 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"
+}
+```
Risks
-------------