HTTP REST updates

- Updated all requests with Dash examples
 - Updated all requests to add/remove fields to match Dash
This commit is contained in:
thephez 2017-12-06 17:29:20 -05:00
parent 6fd6f8b8ab
commit 7f27d1013b
11 changed files with 488 additions and 408 deletions

View file

@ -340,7 +340,7 @@ devsearches:
- 'ImportPubkey': "/en/developer-reference#importpubkey"
- 'ImportWallet': "/en/developer-reference#importwallet"
- 'InstantSendToAddress': "/en/developer-reference#instantsendtoaddress"
- 'Keepass': "/en/developer-reference#keepass"
- 'KeePass': "/en/developer-reference#keepass"
- 'KeypoolRefill': "/en/developer-reference#keypoolrefill"
- 'ListAccounts': "/en/developer-reference#listaccounts"
- 'ListAddressGroupings': "/en/developer-reference#listaddressgroupings"

View file

@ -6,17 +6,16 @@ http://opensource.org/licenses/MIT.
### HTTP REST
{% include helpers/subhead-links.md %}
<!-- __ -->
{% autocrossref %}
As of [version 0.10.0][bitcoin core 0.10.0], Bitcoin Core provides
an **unauthenticated** HTTP REST interface. The interface runs on the
same port as the JSON-RPC interface, by default port 8332 for mainnet and
port 18332 for testnet. It must be enabled by either starting Bitcoin
Dash Core provides an **unauthenticated** HTTP REST interface. The interface
runs on the same port as the JSON-RPC interface, by default port 9998 for
mainnet and port 19998 for testnet. It must be enabled by either starting Dash
Core with the `-rest` option or by specifying `rest=1` in the
configuration file. Make sure that the RPC interface is also activated.
Set `server=1` in `bitcoin.conf` or supply the `-server` argument when
starting Bitcoin Core. Starting Bitcoin Core with `bitcoind` automatically
Set `server=1` in `dash.conf` or supply the `-server` argument when
starting Dash Core. Starting Dash Core with `dashd` automatically
enables the RPC interface.
The interface is not intended for public access and is only accessible
@ -26,7 +25,7 @@ from localhost by default.
localhost, possibly allowing third parties to use cross-site scripting
attacks to download your transaction and block data, reducing your
privacy. If you have privacy concerns, you should not run a browser on
the same computer as a REST-enabled Bicoin Core node.
the same computer as a REST-enabled Dash Core node.
The interface uses standard [HTTP status
codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) and

View file

@ -6,7 +6,7 @@ http://opensource.org/licenses/MIT.
#### Quick Reference {#rest-quick-reference}
{% include helpers/subhead-links.md %}
<!-- __ -->
{% autocrossref %}
* [GET Block][rest get block] {{summary_restGetBlock}} {{UPDATED0_13_0}}

View file

@ -6,7 +6,7 @@ http://opensource.org/licenses/MIT.
##### GET Block/NoTxDetails
{% include helpers/subhead-links.md %}
<!-- __ -->
{% assign summary_restGetBlock-noTxDetails="gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions [GET block][rest get block] returns." %}
{% autocrossref %}
@ -57,11 +57,6 @@ GET /block/notxdetails/<hash>.<format>
p: "Required<br>(exactly 1)"
d: "The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"
- n: "→<br>`strippedsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of this block in serialized block format excluding witness data, counted in bytes"
- n: "→<br>`size`"
t: "number (int)"
p: "Required<br>(exactly 1)"
@ -72,21 +67,11 @@ GET /block/notxdetails/<hash>.<format>
p: "Required<br>(exactly 1)"
d: "The height of this block on its block chain"
- n: "→<br>`weight`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The block weight as defined in BIP 141"
- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"
- n: "→<br>`versionHex`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>This block's version number formatted in hexadecimal. See [BIP9 assignments][]"
- n: "→<br>`merkleroot`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
@ -144,57 +129,78 @@ GET /block/notxdetails/<hash>.<format>
{% enditemplate %}
*Examples from Bitcoin Core 0.10.0*
<!--
Segwit related fields not in Dash
- n: "→<br>`strippedsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of this block in serialized block format excluding witness data, counted in bytes"
- n: "→<br>`weight`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The block weight as defined in BIP 141"
- n: "→<br>`versionHex`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>This block's version number formatted in hexadecimal. See [BIP9 assignments]"
-->
*Examples from Dash Core 0.12.2*
Request a block in hex-encoded serialized block format:
{% highlight bash %}
curl http://localhost:8332/rest/block/notxdetails/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.hex
curl http://localhost:19998/rest/block/notxdetails/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.hex
{% endhighlight %}
Result (wrapped):
{% highlight bash %}
010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900\
00000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e8\
57233e0e61bc6649ffff001d01e3629901010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff0704ffff001d\
0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781\
e62294721166bf621e73a82cbf2342c858eeac00000000
0000002097e8135d73afa52145f6d0b4d0f957030cd598837ddc6750271fb109\
000000008478305a7abf2f7cb21a889fb68d53c3e51685349e18e1b104b5956c\
100bfea2c72d285a84030a1cd0041ed701010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff13037a94000e\
2f5032506f6f6c2d74444153482fffffffff06a1f9ef04000000001976a91414\
e3832cd7192ffb358a31d842636c4db8dfb1ac88ac6c357f3c000000001976a9\
149262f2289e1f021dca954d8cf07a7ad72c2cc24d88ac31f49e010000000019\
76a914d93f7ffa324b77d361e89a3c9c8df46ccdb4b39288ac40230e43000000\
001976a914c4541983721b26ada79770bf22de4885e19f566188ac0200000000\
0000004341047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9\
440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d72\
81bdc9430f35ac00000000000000002a6a28c855abe6461b1003ea36feb88a3b\
d50c5696e5784d11f8cd5e892978685de1d6000000000100000000000000
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/block/notxdetails/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.json
curl http://localhost:19998/rest/block/notxdetails/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"confirmations": 443375,
"strippedsize": 215,
"size": 215,
"weight": 860,
"height": 1,
"version": 1,
"versionHex": "00000001",
"merkleroot": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"hash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"confirmations":55,
"size":414,
"height":38010,
"version":536870912,
"merkleroot":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"tx":[
"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"
"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884"
],
"time": 1231469665,
"mediantime": 1231469665,
"nonce": 2573394689,
"bits": "1d00ffff",
"difficulty": 1,
"chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
"previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"nextblockhash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd"
"time":1512582599,
"mediantime":1512582025,
"nonce":3609068752,
"bits":"1c0a0384",
"difficulty":25.56450187425715,
"chainwork":"00000000000000000000000000000000000000000000000000092fc476457b68",
"previousblockhash":"0000000009b11f275067dc7d8398d50c0357f9d0b4d0f64521a5af735d13e897",
"nextblockhash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51"
}
{% endhighlight %}

View file

@ -6,7 +6,7 @@ http://opensource.org/licenses/MIT.
##### GET Block
{% include helpers/subhead-links.md %}
<!-- __ -->
{% assign summary_restGetBlock="gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block." %}
{% autocrossref %}
@ -60,21 +60,11 @@ GET /block/<hash>.<format>
p: "Required<br>(exactly 1)"
d: "The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"
- n: "→<br>`strippedsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of this block in serialized block format excluding witness data, counted in bytes"
- n: "→<br>`size`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of this block in serialized block format, counted in bytes"
- n: "→<br>`weight`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The block weight as defined in BIP 141"
- n: "→<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
@ -85,11 +75,6 @@ GET /block/<hash>.<format>
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"
- n: "→<br>`versionHex`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>This block's version number formatted in hexadecimal. See [BIP9 assignments]"
- n: "→<br>`merkleroot`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
@ -148,85 +133,171 @@ GET /block/<hash>.<format>
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
<!--
Segwit related fields not in Dash
- n: "→<br>`strippedsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of this block in serialized block format excluding witness data, counted in bytes"
- n: "→<br>`weight`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The block weight as defined in BIP 141"
- n: "→<br>`versionHex`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>This block's version number formatted in hexadecimal. See [BIP9 assignments]"
-->
*Examples from Dash Core 0.12.2*
Request a block in hex-encoded serialized block format:
{% highlight bash %}
curl http://localhost:8332/rest/block/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.hex
curl http://localhost:19998/rest/block/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.hex
{% endhighlight %}
Result (wrapped):
{% highlight bash %}
010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900\
00000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e8\
57233e0e61bc6649ffff001d01e3629901010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff0704ffff001d\
0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781\
e62294721166bf621e73a82cbf2342c858eeac00000000
0000002097e8135d73afa52145f6d0b4d0f957030cd598837ddc6750271fb109\
000000008478305a7abf2f7cb21a889fb68d53c3e51685349e18e1b104b5956c\
100bfea2c72d285a84030a1cd0041ed701010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff13037a94000e\
2f5032506f6f6c2d74444153482fffffffff06a1f9ef04000000001976a91414\
e3832cd7192ffb358a31d842636c4db8dfb1ac88ac6c357f3c000000001976a9\
149262f2289e1f021dca954d8cf07a7ad72c2cc24d88ac31f49e010000000019\
76a914d93f7ffa324b77d361e89a3c9c8df46ccdb4b39288ac40230e43000000\
001976a914c4541983721b26ada79770bf22de4885e19f566188ac0200000000\
0000004341047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9\
440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d72\
81bdc9430f35ac00000000000000002a6a28c855abe6461b1003ea36feb88a3b\
d50c5696e5784d11f8cd5e892978685de1d6000000000100000000000000
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/block/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.json
curl http://localhost:19998/rest/block/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"confirmations": 443372,
"strippedsize": 215,
"size": 215,
"weight": 860,
"height": 1,
"version": 1,
"versionHex": "00000001",
"merkleroot": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"hash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"confirmations":20,
"size":414,
"height":38010,
"version":536870912,
"merkleroot":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"tx":[
{
"txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"hash": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"size": 134,
"vsize": 134,
"txid":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"size":333,
"version":1,
"locktime":0,
"vin":[
{
"coinbase": "04ffff001d0104",
"coinbase":"037a94000e2f5032506f6f6c2d74444153482f",
"sequence":4294967295
}
],
"vout":[
{
"value": 50,
"value":0.82835873,
"valueSat":82835873,
"n":0,
"scriptPubKey":{
"asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
"hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
"asm":"OP_DUP OP_HASH160 14e3832cd7192ffb358a31d842636c4db8dfb1ac OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a91414e3832cd7192ffb358a31d842636c4db8dfb1ac88ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yNDtusuhm6otr3eeGh3SqdpNczV4aZSx1b"
]
}
},
{
"value":10.14969708,
"valueSat":1014969708,
"n":1,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 9262f2289e1f021dca954d8cf07a7ad72c2cc24d OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a9149262f2289e1f021dca954d8cf07a7ad72c2cc24d88ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yZfU36R8dhdnFaK3AwfnubrLXAG2G1WiVn"
]
}
},
{
"value":0.27194417,
"valueSat":27194417,
"n":2,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 d93f7ffa324b77d361e89a3c9c8df46ccdb4b392 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a914d93f7ffa324b77d361e89a3c9c8df46ccdb4b39288ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yg89Yt5Tjzs9nRpX3wJCuvr7KuQvgkvmeC"
]
}
},
{
"value":11.25000000,
"valueSat":1125000000,
"n":3,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 c4541983721b26ada79770bf22de4885e19f5661 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a914c4541983721b26ada79770bf22de4885e19f566188ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yeDY39aiqbBHbJft5F6rokR23EaZca6UTU"
]
}
},
{
"value":0.00000002,
"valueSat":2,
"n":4,
"scriptPubKey":{
"asm":"047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d7281bdc9430f35 OP_CHECKSIG",
"hex":"41047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d7281bdc9430f35ac",
"reqSigs":1,
"type":"pubkey",
"addresses":[
"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
"yb21342iADyqAotjwcn4imqjvAcdYhnzeH"
]
}
},
{
"value":0.00000000,
"valueSat":0,
"n":5,
"scriptPubKey":{
"asm":"OP_RETURN c855abe6461b1003ea36feb88a3bd50c5696e5784d11f8cd5e892978685de1d60000000001000000",
"hex":"6a28c855abe6461b1003ea36feb88a3bd50c5696e5784d11f8cd5e892978685de1d60000000001000000",
"type":"nulldata"
}
}
]
}
],
"time": 1231469665,
"mediantime": 1231469665,
"nonce": 2573394689,
"bits": "1d00ffff",
"difficulty": 1,
"chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
"previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"nextblockhash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd"
"time":1512582599,
"mediantime":1512582025,
"nonce":3609068752,
"bits":"1c0a0384",
"difficulty":25.56450187425715,
"chainwork":"00000000000000000000000000000000000000000000000000092fc476457b68",
"previousblockhash":"0000000009b11f275067dc7d8398d50c0357f9d0b4d0f64521a5af735d13e897",
"nextblockhash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51"
}
{% endhighlight %}

View file

@ -6,7 +6,7 @@ http://opensource.org/licenses/MIT.
##### GET ChainInfo
{% include helpers/subhead-links.md %}
<!-- __ -->
{% assign summary_restGetChainInfo="returns information about the current state of the block chain." %}
{% autocrossref %}
@ -77,7 +77,7 @@ GET /chaininfo.json
- n: "→<br>`pruneheight`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The lowest-height complete block stored if prunning is activated"
d: "The lowest-height complete block stored if pruning is activated"
- n: "→<br>`softforks`"
t: "array"
@ -156,7 +156,7 @@ GET /chaininfo.json
- n: "→ →<br>Name"
t: "string : object"
p: "Required<br>(2 or more)"
p: "Required<br>(1 or more)"
d: "A specific BIP9 softfork"
- n: "→ → →<br>`status`"
@ -164,6 +164,9 @@ GET /chaininfo.json
p: "Required<br>(exactly 1)"
d: "Set to one of the following reasons:<br>`defined` if voting hasn't started yet<br>`started` if the voting has started <br>`locked_in` if the voting was successful but the softfort hasn't been activated yet<br>`active` if the softfork was activated<br>`failed` if the softfork has not receieved enough votes"
{% enditemplate %}
<!-- Not included in Dash BIP9 details currently
- n: "→ → →<br>`bit`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
@ -178,68 +181,89 @@ GET /chaininfo.json
t: "numeric<br>(int)"
p: "Required<br>(exactly 1)"
d: "The Unix epoch time at which the deployment is considered failed if not yet locked in"
-->
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
*Examples from Dash Core 0.12.2*
Get blockchain info in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/chaininfo.json
curl http://localhost:19998/rest/chaininfo.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"chain": "main",
"blocks": 443372,
"headers": 443372,
"bestblockhash": "0000000000000000029a7ee8eb90c47cfcb3e3d877428ed85a3251719bf65ad7",
"difficulty": 286765766820.5504,
"mediantime": 1481671547,
"verificationprogress": 0.9999951668985226,
"chainwork": "000000000000000000000000000000000000000000330d0672c7d7f4f705b65c",
"chain":"test",
"blocks":38066,
"headers":38066,
"bestblockhash":"0000000006c6f812d4721c09b3a3ce6547d2291ff822ee39597515f75822ed3e",
"difficulty":18.8278810867833,
"mediantime":1512591324,
"verificationprogress":0.9999996159024219,
"chainwork":"00000000000000000000000000000000000000000000000000093549c2729cb1",
"pruned":false,
"softforks":[
{
"id":"bip34",
"version":2,
"enforce":{
"status":true,
"found":100,
"required":51,
"window":100
},
"reject":{
"status": true
"status":true,
"found":100,
"required":75,
"window":100
}
},
{
"id":"bip66",
"version":3,
"enforce":{
"status":true,
"found":100,
"required":51,
"window":100
},
"reject":{
"status": true
"status":true,
"found":100,
"required":75,
"window":100
}
},
{
"id":"bip65",
"version":4,
"enforce":{
"status":true,
"found":100,
"required":51,
"window":100
},
"reject":{
"status": true
"status":true,
"found":100,
"required":75,
"window":100
}
}
],
"bip9_softforks": {
"csv": {
"status": "active",
"startTime": 1462060800,
"timeout": 1493596800,
"since": 419328
"bip9_softforks":[
{
"id":"csv",
"status":"active"
},
"segwit": {
"status": "started",
"bit": 1,
"startTime": 1479168000,
"timeout": 1510704000,
"since": 439488
}
{
"id":"dip0001",
"status":"active"
}
]
}
{% endhighlight %}

View file

@ -8,7 +8,7 @@ http://opensource.org/licenses/MIT.
{% include helpers/subhead-links.md %}
{% assign summary_restGetGetUtxos="returns an UTXO set given a set of outpoints." %}
<!-- __ -->
{% autocrossref %}
The `GET getutxos` operation {{summary_restGetGetUtxos}}
@ -134,47 +134,47 @@ GET /getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
*Examples from Dash Core 0.12.2*
Request the UTXO set:
{% highlight bash %}
curl http://localhost:8332/rest/getutxos/checkmempool/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120-0.hex
curl http://localhost:19998/rest/getutxos/checkmempool/7b6caf68c33794b0bda65e63691739919f13156b57c7ec20a0b4de1f33c580bd-0.hex
{% endhighlight %}
Result (wrapped):
{% highlight bash %}
d0c306004f438cea9c68557da34e8e7823a963eb9350daa107ffd80100000000\
0000000001010101000000ffffff7fc8883303000000001976a9145f4865d186\
5127807f714b0ad1ddfae9870866d888ac
c39400005ac8db505390f3c77635132117a7fdf07b2eb45c3d9fe38535b77b05\
0000000001010101000000c394000050ae3b16000000001976a9146f4def95a3\
15e83bef5e1197ace4aa7ec55f2ecc88ac
{% endhighlight %}
Same request in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/getutxos/checkmempool/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120-0.json
curl http://localhost:19998/rest/getutxos/checkmempool/7b6caf68c33794b0bda65e63691739919f13156b57c7ec20a0b4de1f33c580bd-0.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"chainHeight": 443344,
"chaintipHash": "000000000000000001d8ff07a1da5093eb63a923788e4ea37d55689cea8c434f",
"chainHeight":38083,
"chaintipHash":"00000000057bb73585e39f3d5cb42e7bf0fda71721133576c7f3905350dbc85a",
"bitmap":"1",
"utxos":[
{
"txvers":1,
"height": 2147483647,
"value": 0.53709,
"height":38083,
"value":3.73010000,
"scriptPubKey":{
"asm": "OP_DUP OP_HASH160 5f4865d1865127807f714b0ad1ddfae9870866d8 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9145f4865d1865127807f714b0ad1ddfae9870866d888ac",
"asm":"OP_DUP OP_HASH160 6f4def95a315e83bef5e1197ace4aa7ec55f2ecc OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a9146f4def95a315e83bef5e1197ace4aa7ec55f2ecc88ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"19govWMzsRXqLUsUrHQKQ3DzekRxhsqwWH"
"yWTyDaMb1KZSRYwrq2DDW3Q4rKYuuPutDS"
]
}
}

View file

@ -8,7 +8,7 @@ http://opensource.org/licenses/MIT.
{% include helpers/subhead-links.md %}
{% assign summary_restGetHeaders="returns a specified amount of block headers in upward direction." %}
<!-- __ -->
{% autocrossref %}
The `GET headers` operation {{summary_restGetHeaders}}
@ -82,11 +82,6 @@ GET /headers/<count>/<hash>.<format>
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"
- n: "→→<br>`versionHex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>This block's version number formatted in hexadecimal. See [BIP9 assignments][]"
- n: "→→<br>`merkleroot`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
@ -134,28 +129,28 @@ GET /headers/<count>/<hash>.<format>
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
*Examples from Dash Core 0.12.2*
Request 5 block headers in hex-encoded serialized block format:
Request 2 block headers in hex-encoded serialized block format:
{% highlight bash %}
curl http://localhost:8332/rest/headers/5/000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a.hex
curl http://localhost:19998/rest/headers/2/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.hex
{% endhighlight %}
Result (wrapped):
{% highlight bash %}
040000004b9e8debb1bb9df8f85d0f64cf45d408f5f7fcf3293ec40400000000\
000000008c37685c878a66aa2709c3dc27a35020269ce1ce7ecb41dabe8f4e0c\
ca8fc508651b2b5776270618cb395012000000205aec8459769d5c6d5cc6b087\
065e0262465658f6fe8d53020000000000000000cb9a492474a4791b7f4dee49\
0b3d813b1eb192fb67109c0c99317101019f72a7cd1f2b57762706185c2921b4
0000002097e8135d73afa52145f6d0b4d0f957030cd598837ddc6750271fb109\
000000008478305a7abf2f7cb21a889fb68d53c3e51685349e18e1b104b5956c\
100bfea2c72d285a84030a1cd0041ed70000002051b45fe788d100ff8be0bc39\
e88b59829f01c17a82786bcf46bfcc000000000004dc24bddd15f790efcd7af3\
8d03f805cc1c74516888ccec8874db2ac8beb043092e285a999f091c5d6ec419
{% endhighlight %}
Get the same block headers in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/headers/5/000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a.json
curl http://localhost:19998/rest/headers/2/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.json
{% endhighlight %}
Result (whitespaced added):
@ -163,36 +158,34 @@ Result (whitespaced added):
{% highlight json %}
[
{
"hash": "000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a",
"confirmations": 33009,
"height": 410334,
"version": 4,
"versionHex": "00000004",
"merkleroot": "08c58fca0c4e8fbeda41cb7ecee19c262050a327dcc30927aa668a875c68378c",
"time": 1462442853,
"mediantime": 1462441310,
"nonce": 307247563,
"bits": "18062776",
"difficulty": 178659257772.5273,
"chainwork": "00000000000000000000000000000000000000000018562bc90589834ae929d0",
"previousblockhash": "000000000000000004c43e29f3fcf7f508d445cf640f5df8f89dbbb1eb8d9e4b",
"nextblockhash": "000000000000000000f198b9f92bc29fa294be4bb777e61fdd56aac07f174553"
"hash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"confirmations":80,
"height":38010,
"version":536870912,
"merkleroot":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"time":1512582599,
"mediantime":1512582025,
"nonce":3609068752,
"bits":"1c0a0384",
"difficulty":25.56450187425715,
"chainwork":"00000000000000000000000000000000000000000000000000092fc476457b68",
"previousblockhash":"0000000009b11f275067dc7d8398d50c0357f9d0b4d0f64521a5af735d13e897",
"nextblockhash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51"
},
{
"hash": "000000000000000000f198b9f92bc29fa294be4bb777e61fdd56aac07f174553",
"confirmations": 33008,
"height": 410335,
"hash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51",
"confirmations":79,
"height":38011,
"version":536870912,
"versionHex": "20000000",
"merkleroot": "a7729f01017131990c9c1067fb92b11e3b813d0b49ee4d7f1b79a47424499acb",
"time": 1462443981,
"mediantime": 1462441496,
"nonce": 3022072156,
"bits": "18062776",
"difficulty": 178659257772.5273,
"chainwork": "000000000000000000000000000000000000000000185655621b104558a77160",
"previousblockhash": "000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a",
"nextblockhash": "0000000000000000005b3caade164fcc5f3f00fd99ddbdb47ee66ea4bbe9387a"
"merkleroot":"43b0bec82adb7488eccc886851741ccc05f8038df37acdef90f715ddbd24dc04",
"time":1512582665,
"mediantime":1512582146,
"nonce":432303709,
"bits":"1c099f99",
"difficulty":26.60134045579303,
"chainwork":"00000000000000000000000000000000000000000000000000092fdf1051882b",
"previousblockhash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"nextblockhash":"0000000008de9da638149042323fc05ded619a922ff1fac6e66f66fc773bd716"
}
]
{% endhighlight %}

View file

@ -8,7 +8,7 @@ http://opensource.org/licenses/MIT.
{% include helpers/subhead-links.md %}
{% assign summary_restGetMemPool-contents="returns all transaction in the memory pool with detailed information." %}
<!-- __ -->
{% autocrossref %}
The `GET mempool/contents` operation {{summary_restGetMemPool-contents}} Supports only `json` as output format.
@ -84,6 +84,19 @@ GET /mempool/contents.json
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.12.0*<br><br>The modified fees (see `modifiedfee` above) of in-mempool descendants (including this one)"
- n: "→ →<br>`depends`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions). Those transactions must be part of a block before this transaction can be added to a block, although all transactions may be included in the same block. The array may be empty"
- n: "→ → →<br>Depends TXID"
t: "string"
p: "Optional (0 or more)"
d: "The TXIDs of any unconfirmed transactions this transaction depends upon, encoded as hex in RPC byte order"
{% enditemplate %}
<!-- Not present in Dash
- n: "→ →<br>`ancestorcount`"
t: "number (int)"
p: "Required<br>(exactly 1)"
@ -98,63 +111,33 @@ GET /mempool/contents.json
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The modified fees (see `modifiedfee` above) of in-mempool ancestors (including this one)"
-->
- n: "→ →<br>`depends`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions). Those transactions must be part of a block before this transaction can be added to a block, although all transactions may be included in the same block. The array may be empty"
- n: "→ → →<br>Depends TXID"
t: "string"
p: "Optional (0 or more)"
d: "The TXIDs of any unconfirmed transactions this transaction depends upon, encoded as hex in RPC byte order"
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
*Examples from Dash Core 0.12.2*
Get all transactions in the memory pool in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/mempool/contents.json
curl http://localhost:19998/rest/mempool/contents.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873": {
"size": 485,
"fee": 0.00009700,
"modifiedfee": 0.00009700,
"time": 1479423635,
"height": 439431,
"startingpriority": 15327081.81818182,
"currentpriority": 21536936.36363636,
"b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32":{
"size":225,
"fee":0.00010000,
"modifiedfee":0.00010000,
"time":1512596309,
"height":38094,
"startingpriority":1934576927.410256,
"currentpriority":1934576927.410256,
"descendantcount":1,
"descendantsize": 485,
"descendantfees": 9700,
"ancestorcount": 1,
"ancestorsize": 485,
"ancestorfees": 9700,
"depends": [
]
},
"094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4": {
"size": 554,
"fee": 0.00005540,
"modifiedfee": 0.00005540,
"time": 1479423327,
"height": 439430,
"startingpriority": 85074.91071428571,
"currentpriority": 3497174.4375,
"descendantcount": 1,
"descendantsize": 554,
"descendantfees": 5540,
"ancestorcount": 1,
"ancestorsize": 554,
"ancestorfees": 5540,
"descendantsize":225,
"descendantfees":10000,
"depends":[
]
}
}

View file

@ -8,7 +8,7 @@ http://opensource.org/licenses/MIT.
{% include helpers/subhead-links.md %}
{% assign summary_restGetMemPool-info="returns information about the node's current transaction memory pool." %}
<!-- __ -->
{% autocrossref %}
The `GET mempool/info` operation {{summary_restGetMemPool-info}} Supports only `json` as output format.
@ -56,25 +56,24 @@ GET /mempool/info.json
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
*Examples from Dash Core 0.12.2*
Get memory pool info in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/mempool/info.json
curl http://localhost:19998/rest/mempool/info.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"size": 989,
"bytes": 736919,
"usage": 1970496,
"size":1,
"bytes":1256,
"usage":3376,
"maxmempool":300000000,
"mempoolminfee": 0
"mempoolminfee":0.00000000
}
{% endhighlight %}
*See also*

View file

@ -7,8 +7,8 @@ http://opensource.org/licenses/MIT.
##### GET Tx
{% include helpers/subhead-links.md %}
{% assign summary_restGetTx="gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Bitcoin Core only stores complete transaction data for UTXOs and your own transactions, so this method may fail on historic transactions unless you use the non-default `txindex=1` in your Bitcoin Core startup settings." %}
{% assign summary_restGetTx="gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Dash Core only stores complete transaction data for UTXOs and your own transactions, so this method may fail on historic transactions unless you use the non-default `txindex=1` in your Dash Core startup settings." %}
<!-- __ -->
{% autocrossref %}
The `GET tx` operation {{summary_restGetTx}}
@ -58,6 +58,11 @@ GET /tx/<txid>.<format>
p: "Optional<br>(0 or 1)"
d: "If the transaction has been included in a block on the local best block chain, this is the hash of that block encoded as hex in RPC byte order"
- n: "→<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of this block on its block chain"
- n: "→<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
@ -75,86 +80,86 @@ GET /tx/<txid>.<format>
{% enditemplate %}
*Examples from Bitcoin Core 0.13.1*
*Examples from Dash Core 0.12.2*
Request a transaction in hex-encoded serialized transaction format:
{% highlight bash %}
curl http://localhost:8332/rest/tx/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120.hex
curl http://localhost:19998/rest/tx/b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32.hex
{% endhighlight %}
Result (wrapped):
{% highlight text %}
0100000001bf33f5e034d1774f4019c03e119f4fa9e421339271f7476e5e34ff\
72839ebc16000000006b483045022100dab0ade70063cbc5ad44664b707391f8\
ffe6e406b1bab43abfb547d701694d98022067580db89b81c69ba83487ea0a1b\
cb6a325d2903b726980865210d2127de09710121023ee7a6437e9ad2957cd032\
38b9668c15cb1dc6ac9c9d142f829168e1a3e4a9c4feffffff02c88833030000\
00001976a9145f4865d1865127807f714b0ad1ddfae9870866d888ac102697eb\
000000001976a91479e19d5c1cbc1c18f59c57d37ca403f3bcdaa73f88acd0c3\
0600
0100000001c91d4bb14e061f8f6b775ca8e62ec8a66739b375f169bce1964cee\
a2368197e5000000006a473044022050644e406be3e463d94868c617309dc021\
174551dbb340665f48119e110a72b2022022f3cc93deeb4c44ce70bebe8e7f0f\
69c462f120eb64b47eeb77f0a62e9bd361012102f542dde7c155717ac8df05d0\
fc8f65e2ecc078ecad42b23462f27832b441ffa5feffffff0200e1f505000000\
001976a91443d11ad5889532f22f069b18b24489b1f94f253188ac7dbafa0800\
0000001976a914bb900427682b8f7cae6779fb955a610ff71d68c888acce940000
{% endhighlight %}
Get the same transaction in JSON:
{% highlight bash %}
curl http://localhost:8332/rest/tx/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120.json
curl http://localhost:19998/rest/tx/b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32.json
{% endhighlight %}
Result (whitespaced added):
{% highlight json %}
{
"txid": "42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120",
"hash": "42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120",
"size": 226,
"vsize": 226,
"txid":"b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32",
"size":225,
"version":1,
"locktime": 443344,
"locktime":38094,
"vin":[
{
"txid": "16bc9e8372ff345e6e47f771923321e4a94f9f113ec019404f77d134e0f533bf",
"txid":"e5978136a2ee4c96e1bc69f175b33967a6c82ee6a85c776b8f1f064eb14b1dc9",
"vout":0,
"scriptSig":{
"asm": "3045022100dab0ade70063cbc5ad44664b707391f8ffe6e406b1bab43abfb547d701694d98022067580db89b81c69ba83487ea0a1bcb6a325d2903b726980865210d2127de0971[ALL] 023ee7a6437e9ad2957cd03238b9668c15cb1dc6ac9c9d142f829168e1a3e4a9c4",
"hex": "483045022100dab0ade70063cbc5ad44664b707391f8ffe6e406b1bab43abfb547d701694d98022067580db89b81c69ba83487ea0a1bcb6a325d2903b726980865210d2127de09710121023ee7a6437e9ad2957cd03238b9668c15cb1dc6ac9c9d142f829168e1a3e4a9c4"
"asm":"3044022050644e406be3e463d94868c617309dc021174551dbb340665f48119e110a72b2022022f3cc93deeb4c44ce70bebe8e7f0f69c462f120eb64b47eeb77f0a62e9bd361[ALL] 02f542dde7c155717ac8df05d0fc8f65e2ecc078ecad42b23462f27832b441ffa5",
"hex":"473044022050644e406be3e463d94868c617309dc021174551dbb340665f48119e110a72b2022022f3cc93deeb4c44ce70bebe8e7f0f69c462f120eb64b47eeb77f0a62e9bd361012102f542dde7c155717ac8df05d0fc8f65e2ecc078ecad42b23462f27832b441ffa5"
},
"sequence":4294967294
}
],
"vout":[
{
"value": 0.53709,
"value":1.00000000,
"valueSat":100000000,
"n":0,
"scriptPubKey":{
"asm": "OP_DUP OP_HASH160 5f4865d1865127807f714b0ad1ddfae9870866d8 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9145f4865d1865127807f714b0ad1ddfae9870866d888ac",
"asm":"OP_DUP OP_HASH160 43d11ad5889532f22f069b18b24489b1f94f2531 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a91443d11ad5889532f22f069b18b24489b1f94f253188ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"19govWMzsRXqLUsUrHQKQ3DzekRxhsqwWH"
"ySW2cuvm2wJ4EU5KzX4waYfFPV3xQni6Nm"
]
}
},
{
"value": 39.5255144,
"value":1.50649469,
"valueSat":150649469,
"n":1,
"scriptPubKey":{
"asm": "OP_DUP OP_HASH160 79e19d5c1cbc1c18f59c57d37ca403f3bcdaa73f OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91479e19d5c1cbc1c18f59c57d37ca403f3bcdaa73f88ac",
"asm":"OP_DUP OP_HASH160 bb900427682b8f7cae6779fb955a610ff71d68c8 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a914bb900427682b8f7cae6779fb955a610ff71d68c888ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"1C7T3CJ6MEYf1YCYYPfN6zuGirqZcD3wuE"
"ydRBjVr78ejCqXuGs2wbtYoFpGbDkqV8V4"
]
}
}
],
"blockhash": "0000000000000000023da07114323ad9676896f354951e6b563d143428b69c03",
"confirmations": 28,
"time": 1481662934,
"blocktime": 1481662934
"blockhash":"0000000003b6a57e3614176e5b93caf9498009853e06d16028ebffeb361afda5",
"height":38095,
"confirmations":9,
"time":1512596315,
"blocktime":1512596315
}
{% endhighlight %}