mirror of
https://github.com/seigler/dash-docs
synced 2025-07-28 02:06:13 +00:00
Dev ref conversion (#2)
Developer reference/guide updates to this point * Update some reference documents - Adjust ref_intro to reference Dash - Start updating p2p network ref - Adjust some items in references.md to point to Dash URLs * Update P2P networking protocol versions and message headers sections Update subheading-links Update more items in references.md * Update inventories to include Dash specific items - Update references.md with them also Update disclaimer (Bitcoin -> Dash) * Remove reference to bitcoin mailing list from ref_intro * Add Spork/GetSporks message details Add placeholders for Dash specific messages - Added subsections for InstantSend, PrivateSend, Masternodes, and Governance * Some Bitcoin->Dash conversions - Update title / section name for Dev Doc/Dev Reference - Updated favicon * Updates for the Data Network section of P2P reference * Added Alert message details from Bitcoin back and removed feefilter * More updates for Control Messages section of P2P network - Bitcoin->Dash reference changes - Reject and Version message updates * InstantSend subsection of P2P reference detail - Added ix, txlvote message details and associated references * Governance subsection (P2P) - Start adding govobj, govobjvote details - Add spork references * Missed spork xref in previous * Governance (P2P) updates - Add details to govobjvote and govsync * Governance object P2P messages - Add additional description/details * PrivateSend P2P messages - Added details for dsa, dsc, dsf, dsi, dsq, dss, dssu, and dstx messages - Added references also - Hexdump examples for all but dsi and dss * PrivateSend P2P minor updates * Masternode P2P messages - Add descriptions - Add hexdump details * Masternode P2P messages (dseg, mnb, mnget, mnp, mnv, mnw, mnwb, ssc) - Add reference/crossref entries - Add message structure * P2P messages - minor formatting and corrections * Block chain reference - Version info updates * Update Block Chain reference (Headers) - Update version details - Update block reward info * Update Transactions reference - Add some Dash specific updates * Minor Transactions reference change * RPC reference updates * RPC reference updates - Added/removed commands to match available Dash commands * Core API updates * Renamed devdocs/bitcoin-core to dash-core - Updated developer-reference.md to point at new location * Update filename to use dash-core instead of bitcoin-core * Add Dash-specific GetAddressBalance RPC command and associated updates Update RPC quick reference list * Added cross reference/reference placeholders for remaining GetAddress... RPC commands Added RPC template placeholder files for remaining GetAddress... commands * Scripts for environment setup and frequently used builds * Add details for GetAddressDeltas/Mempool RPCs Update path in Makefile bitcoin-core -> dash-core * Add GetAddressTxids/Utxos details Update minor formatting, etc. for GetAddressBalance/Deltas/Mempool Changed reference to Dash Core and updated denominations for Dash * Misc minor cleanup * Work on updating existing Block Chain RPCs - GetBestBlockHash, GetBlock, GetBlockChainInfo, GetBlockCount, GetBlockHash * Continue updating existing Block Chain RPCs - GetBlockHeader, GetChainTips, GetDifficulty, GetMemPoolInfo, GetRawMemPool * Update RPCs quick-ref - Added descriptions for Dash - Updated description for Bitcoin related items for clarity * Comment out content of non-implemented Block chain RPCs (GetMemPoolAncestors, GetMemPoolDescendants, GetMemPoolEntry, PreciousBlock, PruneBlockChain) * Continue updating existing Block Chain RPCs - GetTxOut, GetTxOutProof, GetTxOutSetInfo, VerifyChain, VerifyTxOutProof Update previous block hash type to indicate X11 instead of double SHA256 * Add script to create basic RPC md file Set up empty GetBlockHashes/Headers and GetSpentInfo RPCs * Add GetBlockhashes details Minor correction in Empty RPC generation script * Add GetBlockHeaders details Minor formatting updates * Update Address Index related RPCs to indicate the necessity of enabling addressindex to use them * Actual details of GetBlockHeaders * Add details for GetSpentInfo * Update existing Control RPCs (GetInfo, Help, Stop) * Add Debug RPC * Expand empty RPC generation script to add example section and fix format * Added empty RPC files and cross-ref details for all Dash RPCs * Add details for some Dash RPCs - GetGovernanceInfo, GetPoolInfo, GetSuperblockBudget * Add details for MasternodeList RPC (Dash section) * Add details for MnSync RPC (Dash section) * Dash RPC updates - Add Result section to MasternodeList - Formatting updates to MnSync * Expand script to add placeholders for parameters/resuls/example * Add details for PrivateSend RPC (Dash section) * Update Generating RPCs - Added details back for GetGenerate/SetGenerate which were deprecated in Bitcoin * Formatting and example updates * Add result detail and example to GetBlockTemplate * Update existing Mining RPCs - GetMiningInfo, GetNetworkHashPs, PrioritiseTransaction, SubmitBlock * Minor formatting updates * Update most existing Network RPCs - AddNode, ClearBanned, DisconnectNode, GetAddedNodeInfo, GetConnectionCount, GetNetTotals,GetNetworkInfo, GetPeerInfo, ListBanned, Ping, SetBan - Added some norefs as needed (Network RPCs only) * Misc cleanup * SetNetworkActive (Network RPC) * Misc updates - Change logo - Disable some headers (alert, donation) - Disable footer * Governance updates - Add description of govsync to P2P guide - Updates to P2P reference * Governance - Add governance message SVG image - Typo fixes * Dseg updates - Added clarifying details regarding how to request single/all nodes - Ban warning * Minor governance updates * Governance updates / MN sync - Correct some reference links - Add MN sync info to guide - Update dseg, mnget, ssc, and govsync messages to include more detail * Governance updates - Guide updated to show both stages of govsync - Reference - Correcte ssc typo and add sync item detail - Update govobjvote to include detail about propagation - Update govsync details * Governance updates - More clarification on govsync (guide and reference) * Raw Transaction RPC - Previously uncommitted CreateRawTransaction update * Dash RPC (Gobject) - Add details for count and get sub-commands Also added description for govobj types * P2P messages - Spork updated to include verification details and a hexdump Minor typo / note updates * P2P Message - mnv - Draft details regarding use and operation * P2P message (mnv) - Additional detail updates based on info from Udjin Minor update to mnp * Guide - Masternode payment - Add section and start putting in details * P2P Messages - deprecated - Move deprecated messages to their own group * Misc minor non-content updates
This commit is contained in:
parent
17c265f5fd
commit
703c54ffbc
183 changed files with 9570 additions and 1373 deletions
35
_includes/devdoc/dash-core/rest/intro.md
Normal file
35
_includes/devdoc/dash-core/rest/intro.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/intro.md" %}
|
||||
|
||||
### 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
|
||||
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
|
||||
enables the RPC interface.
|
||||
|
||||
The interface is not intended for public access and is only accessible
|
||||
from localhost by default.
|
||||
|
||||
{{WARNING}} A web browser can access a HTTP REST interface running on
|
||||
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 interface uses standard [HTTP status
|
||||
codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) and
|
||||
returns a plain-text description of errors for debugging.
|
||||
|
||||
{% endautocrossref %}
|
21
_includes/devdoc/dash-core/rest/quick-reference.md
Normal file
21
_includes/devdoc/dash-core/rest/quick-reference.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/quick-reference.md" %}
|
||||
|
||||
#### Quick Reference {#rest-quick-reference}
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
* [GET Block][rest get block] {{summary_restGetBlock}} {{UPDATED0_13_0}}
|
||||
* [GET Block/NoTxDetails][rest get block-notxdetails] {{summary_restGetBlock-noTxDetails}} {{UPDATED0_13_0}}
|
||||
* [GET ChainInfo][rest get chaininfo] {{summary_restGetChainInfo}} {{NEW0_11_0}}, {{UPDATED0_12_0}}
|
||||
* [GET GetUtxos][rest get getutxos] {{summary_restGetGetUtxos}} {{NEW0_11_0}}
|
||||
* [GET Headers][rest get headers] {{summary_restGetHeaders}} {{NEW0_11_0}}, {{UPDATED0_13_0}}
|
||||
* [GET MemPool/Contents][rest get mempool-contents] {{summary_restGetMemPool-contents}} {{NEW0_12_0}}
|
||||
* [GET MemPool/Info][rest get mempool-info] {{summary_restGetMemPool-info}} {{NEW0_12_0}}
|
||||
* [GET Tx][rest get tx] {{summary_restGetTx}} {{UPDATED0_13_0}}
|
||||
|
||||
{% endautocrossref %}
|
|
@ -0,0 +1,208 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_block-notxdetails.md" %}
|
||||
|
||||
##### 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 %}
|
||||
|
||||
The `GET block<!--noref-->/notxdetails` operation {{summary_restGetBlock-noTxDetails}}
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /block/notxdetails/<hash>.<format>
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameter #1---the header hash of the block to retrieve*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Header Hash"
|
||||
t: "path (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the block to get, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---the output format*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Format"
|
||||
t: "suffix"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Response as JSON*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Result"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An object containing the requested block"
|
||||
|
||||
- n: "→<br>`hash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1"
|
||||
|
||||
- n: "→<br>`confirmations`"
|
||||
t: "number (int)"
|
||||
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>`height`"
|
||||
t: "number (int)"
|
||||
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)"
|
||||
d: "The merkle root for this block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→<br>`tx`"
|
||||
t: "array"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"
|
||||
|
||||
- n: "→ →<br>TXID"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(1 or more)"
|
||||
d: "The TXID of a transaction in this block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→<br>`time`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the *time* field in the block header, indicating approximately when the block was created"
|
||||
|
||||
- n: "→<br>`mediantime`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113"
|
||||
|
||||
- n: "→<br>`nonce`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The nonce which was successful at turning this particular block into one that could be added to the best block chain"
|
||||
|
||||
- n: "→<br>`bits`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass"
|
||||
|
||||
- n: "→<br>`difficulty`"
|
||||
t: "number (real)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"
|
||||
|
||||
- n: "→<br>`chainwork`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"
|
||||
|
||||
- n: "→<br>`previousblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the previous block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→<br>`nextblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.10.0*
|
||||
|
||||
Request a block in hex-encoded serialized block format:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/block/notxdetails/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.hex
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight bash %}
|
||||
010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900\
|
||||
00000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e8\
|
||||
57233e0e61bc6649ffff001d01e3629901010000000100000000000000000000\
|
||||
00000000000000000000000000000000000000000000ffffffff0704ffff001d\
|
||||
0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
|
||||
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781\
|
||||
e62294721166bf621e73a82cbf2342c858eeac00000000
|
||||
|
||||
{% endhighlight %}
|
||||
|
||||
Get the same block in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/block/notxdetails/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.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",
|
||||
"tx": [
|
||||
"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"
|
||||
],
|
||||
"time": 1231469665,
|
||||
"mediantime": 1231469665,
|
||||
"nonce": 2573394689,
|
||||
"bits": "1d00ffff",
|
||||
"difficulty": 1,
|
||||
"chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
|
||||
"previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
|
||||
"nextblockhash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd"
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GET Block][rest get block]: {{summary_restGetBlock}}
|
||||
* [GetBlock][rpc getblock] RPC: {{summary_getBlock}}
|
||||
* [GetBlockHash][rpc getblockhash] RPC: {{summary_getBlockHash}}
|
||||
* [GetBestBlockHash][rpc getbestblockhash] RPC: {{summary_getBestBlockHash}}
|
||||
|
||||
{% endautocrossref %}
|
240
_includes/devdoc/dash-core/rest/requests/get_block.md
Normal file
240
_includes/devdoc/dash-core/rest/requests/get_block.md
Normal file
|
@ -0,0 +1,240 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_block.md" %}
|
||||
|
||||
##### 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 %}
|
||||
|
||||
The `GET block` operation {{summary_restGetBlock}}
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /block/<hash>.<format>
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameter #1---the header hash of the block to retrieve*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Header Hash"
|
||||
t: "path (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the block to get, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---the output format*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Format"
|
||||
t: "suffix"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Response as JSON*
|
||||
|
||||
{% assign DEPTH="→ →" %}
|
||||
{% include helpers/vars.md %}
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Result"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An object containing the requested block"
|
||||
|
||||
- n: "→<br>`hash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1"
|
||||
|
||||
- n: "→<br>`confirmations`"
|
||||
t: "number (int)"
|
||||
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)"
|
||||
d: "The height of this block on its block chain"
|
||||
|
||||
- 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)"
|
||||
d: "The merkle root for this block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→<br>`tx`"
|
||||
t: "array"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"
|
||||
|
||||
- n: "→ →<br>Transaction"
|
||||
t: "object"
|
||||
p: "Required<br>(1 or more)"
|
||||
d: "An object describing a particular transaction within this block"
|
||||
|
||||
{{INCLUDE_DECODE_RAW_TRANSACTION}}
|
||||
- n: "→<br>`time`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the *time* field in the block header, indicating approximately when the block was created"
|
||||
|
||||
- n: "→<br>`mediantime`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113"
|
||||
|
||||
- n: "→<br>`nonce`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The nonce which was successful at turning this particular block into one that could be added to the best block chain"
|
||||
|
||||
- n: "→<br>`bits`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass"
|
||||
|
||||
- n: "→<br>`difficulty`"
|
||||
t: "number (real)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"
|
||||
|
||||
- n: "→<br>`chainwork`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"
|
||||
|
||||
- n: "→<br>`previousblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the previous block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→<br>`nextblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.13.1*
|
||||
|
||||
Request a block in hex-encoded serialized block format:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/block/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.hex
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight bash %}
|
||||
010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900\
|
||||
00000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e8\
|
||||
57233e0e61bc6649ffff001d01e3629901010000000100000000000000000000\
|
||||
00000000000000000000000000000000000000000000ffffffff0704ffff001d\
|
||||
0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
|
||||
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781\
|
||||
e62294721166bf621e73a82cbf2342c858eeac00000000
|
||||
|
||||
{% endhighlight %}
|
||||
|
||||
Get the same block in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/block/00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048.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",
|
||||
"tx": [
|
||||
{
|
||||
"txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
|
||||
"hash": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
|
||||
"size": 134,
|
||||
"vsize": 134,
|
||||
"version": 1,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
"coinbase": "04ffff001d0104",
|
||||
"sequence": 4294967295
|
||||
}
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 50,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
|
||||
"hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkey",
|
||||
"addresses": [
|
||||
"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"time": 1231469665,
|
||||
"mediantime": 1231469665,
|
||||
"nonce": 2573394689,
|
||||
"bits": "1d00ffff",
|
||||
"difficulty": 1,
|
||||
"chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
|
||||
"previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
|
||||
"nextblockhash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd"
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GET Block/NoTxDetails][rest get block-notxdetails] {{summary_restGetBlock-noTxDetails}}
|
||||
* [GetBestBlockHash][rpc getbestblockhash] RPC: {{summary_getBestBlockHash}}
|
||||
* [GetBlock][rpc getblock] RPC: {{summary_getBlock}}
|
||||
* [GetBlockHash][rpc getblockhash] RPC: {{summary_getBlockHash}}
|
||||
|
||||
{% endautocrossref %}
|
250
_includes/devdoc/dash-core/rest/requests/get_chaininfo.md
Normal file
250
_includes/devdoc/dash-core/rest/requests/get_chaininfo.md
Normal file
|
@ -0,0 +1,250 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_chaininfo.md" %}
|
||||
|
||||
##### GET ChainInfo
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% assign summary_restGetChainInfo="returns information about the current state of the block chain." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
The `GET chaininfo` operation {{summary_restGetChainInfo}} Supports only `json` as output format.
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /chaininfo.json
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameters: none*
|
||||
|
||||
*Response as JSON*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`result`"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Information about the current state of the local block chain"
|
||||
|
||||
- n: "→<br>`chain`"
|
||||
t: "string"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The name of the block chain. One of `main` for mainnet, `test` for testnet, or `regtest`<!--noref--> for regtest"
|
||||
|
||||
- n: "→<br>`blocks`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of validated blocks in the local best block chain. For a new node with just the hardcoded genesis block, this will be 0"
|
||||
|
||||
- n: "→<br>`headers`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of validated headers in the local best headers chain. For a new node with just the hardcoded genesis block, this will be zero. This number may be higher than the number of *blocks*"
|
||||
|
||||
- n: "→<br>`bestblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the highest validated block in the best block chain, encoded as hex in RPC byte order. This is identical to the string returned by the `getbestblockhash` RPC"
|
||||
|
||||
- n: "→<br>`difficulty`"
|
||||
t: "number (real)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The difficulty of the highest-height block in the best block chain"
|
||||
|
||||
- n: "→<br>`mediantime`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113"
|
||||
|
||||
- n: "→<br>`verificationprogress`"
|
||||
t: "number (real)"
|
||||
p: "Required (exactly 1)"
|
||||
d: "Estimate of what percentage of the block chain transactions have been verified so far, starting at 0.0 and increasing to 1.0 for fully verified. May slightly exceed 1.0 when fully synced to account for transactions in the memory pool which have been verified before being included in a block"
|
||||
|
||||
- n: "→<br>`chainwork`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated number of block header hashes checked from the genesis block to this block, encoded as big-endian hex"
|
||||
|
||||
- n: "→<br>`pruned`"
|
||||
t: "bool"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Indicates if the blocks are subject to pruning"
|
||||
|
||||
- n: "→<br>`pruneheight`"
|
||||
t: "number (int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The lowest-height complete block stored if prunning is activated"
|
||||
|
||||
- n: "→<br>`softforks`"
|
||||
t: "array"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>An array of objects each describing a current or previous soft fork"
|
||||
|
||||
- n: "→ →<br>Softfork"
|
||||
t: "object"
|
||||
p: "Required<br>(3 or more)"
|
||||
d: "A specific softfork"
|
||||
|
||||
- n: "→ → →<br>`id`"
|
||||
t: "string"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The name of the softfork"
|
||||
|
||||
- n: "→ → →<br>`version`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block version used for the softfork"
|
||||
|
||||
- n: "→ → →<br>`enforce`"
|
||||
t: "string : object"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The progress toward enforcing the softfork rules for new-version blocks"
|
||||
|
||||
- n: "→ → → →<br>`status`"
|
||||
t: "bool"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Indicates if the threshold was reached"
|
||||
|
||||
- n: "→ → → →<br>`found`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Number of blocks that support the softfork"
|
||||
|
||||
- n: "→ → → →<br>`required`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Number of blocks that are required to reach the threshold"
|
||||
|
||||
- n: "→ → → →<br>`window`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The maximum size of examined window of recent blocks"
|
||||
|
||||
- n: "→ → →<br>`reject`"
|
||||
t: "object"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The progress toward enforcing the softfork rules for new-version blocks"
|
||||
|
||||
- n: "→ → → →<br>`status`"
|
||||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Indicates if the threshold was reached"
|
||||
|
||||
- n: "→ → → →<br>`found`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Number of blocks that support the softfork"
|
||||
|
||||
- n: "→ → → →<br>`required`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Number of blocks that are required to reach the threshold"
|
||||
|
||||
- n: "→ → → →<br>`window`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The maximum size of examined window of recent blocks"
|
||||
|
||||
- n: "→<br>`bip9_softforks`"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.1*<br><br>The status of BIP9 softforks in progress"
|
||||
|
||||
- n: "→ →<br>Name"
|
||||
t: "string : object"
|
||||
p: "Required<br>(2 or more)"
|
||||
d: "A specific BIP9 softfork"
|
||||
|
||||
- n: "→ → →<br>`status`"
|
||||
t: "string"
|
||||
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"
|
||||
|
||||
- n: "→ → →<br>`bit`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The bit (0-28) in the block version field used to signal this softfork. Field is only shown when status is `started`"
|
||||
|
||||
- n: "→ → →<br>`startTime`"
|
||||
t: "numeric<br>(int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The Unix epoch time when the softfork voting begins"
|
||||
|
||||
- n: "→ → →<br>`timeout`"
|
||||
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*
|
||||
|
||||
Get blockchain info in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/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",
|
||||
"pruned": false,
|
||||
"softforks": [
|
||||
{
|
||||
"id": "bip34",
|
||||
"version": 2,
|
||||
"reject": {
|
||||
"status": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bip66",
|
||||
"version": 3,
|
||||
"reject": {
|
||||
"status": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bip65",
|
||||
"version": 4,
|
||||
"reject": {
|
||||
"status": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"bip9_softforks": {
|
||||
"csv": {
|
||||
"status": "active",
|
||||
"startTime": 1462060800,
|
||||
"timeout": 1493596800,
|
||||
"since": 419328
|
||||
},
|
||||
"segwit": {
|
||||
"status": "started",
|
||||
"bit": 1,
|
||||
"startTime": 1479168000,
|
||||
"timeout": 1510704000,
|
||||
"since": 439488
|
||||
}
|
||||
}
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GetBlockChainInfo][rpc getblockchaininfo] RPC: {{summary_getBlockChainInfo}}
|
||||
|
||||
{% endautocrossref %}
|
189
_includes/devdoc/dash-core/rest/requests/get_getutxos.md
Normal file
189
_includes/devdoc/dash-core/rest/requests/get_getutxos.md
Normal file
|
@ -0,0 +1,189 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_getutxos.md" %}
|
||||
|
||||
##### GET GetUtxos
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% assign summary_restGetGetUtxos="returns an UTXO set given a set of outpoints." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
The `GET getutxos` operation {{summary_restGetGetUtxos}}
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameter #1---Include memory pool transactions*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Check mempool "
|
||||
t: "string"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Set to `checkmempool` to include transactions that are currently in the memory pool to the calculation"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---List of Outpoints*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Outpoint"
|
||||
t: "vector"
|
||||
p: "Required<br>(1 or more)"
|
||||
d: "The list of outpoints to be queried. Each outpoint is the TXID of the transaction, encoded as hex in RPC byte order with an additional `-n` parameter for the output index (vout) number, with the index starting from 0"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #3---the output format*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Format"
|
||||
t: "suffix"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Response as JSON*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`result`"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The requested UTXO set"
|
||||
|
||||
- n: "→→<br>`chainHeight`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The height of the chain at the moment the result was calculated"
|
||||
|
||||
- n: "→<br>`chaintipHash`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block hash of the top of the chain at the moment the result was calculated"
|
||||
|
||||
- n: "→<br>`bitmap`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Whether each requested output was found in the UTXO set or not. A `1` is returned for those that were found and a `0` is returned for those that were not found. Results are returned in the same order as outpoints were requested in the input parameters"
|
||||
|
||||
- n: "→<br>`utxos`"
|
||||
t: "array"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An array of objects each describing an outpoint that is unspent"
|
||||
|
||||
- n: "→→`Unspent Outpoint`"
|
||||
t: "object"
|
||||
p: "Optional<br>(0 or more)"
|
||||
d: "A UTXO match based on the query"
|
||||
|
||||
- n: "→→→<br>`txvers`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The version number of the transaction the UTXO was found in"
|
||||
|
||||
- n: "→<br>`height`"
|
||||
t: "number (int)"
|
||||
p: "Required (exactly 1)"
|
||||
d: "The height of the block containing the defining transaction, or 0x7FFFFFFF if the tx is in the mempool"
|
||||
|
||||
- n: "→ → →<br>`value`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the transaction"
|
||||
|
||||
- n: "→ → →<br>`scriptPubKey`"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An object describing the pubkey script"
|
||||
|
||||
- n: "→ → → →<br>`asm`"
|
||||
t: "string"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The pubkey script in decoded form with non-data-pushing opcodes listed"
|
||||
|
||||
- n: "→ → → →<br>`hex`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The pubkey script encoded as hex"
|
||||
|
||||
- n: "→ → → →<br>`reqSigs`"
|
||||
t: "number (int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below)"
|
||||
|
||||
- n: "→ → → →<br>`type`"
|
||||
t: "string"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The type of script. This will be one of the following:<br>• `pubkey` for a P2PK script<br>• `pubkeyhash` for a P2PKH script<br>• `scripthash` for a P2SH script<br>• `multisig` for a bare multisig script<br>• `nulldata` for nulldata scripts<br>• `nonstandard` for unknown scripts"
|
||||
|
||||
- n: "→ → → →<br>`addresses`"
|
||||
t: "string : array"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Array of P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types"
|
||||
|
||||
- n: "→ → → → →<br>Address"
|
||||
t: "string"
|
||||
p: "Required<br>(1 or more)"
|
||||
d: "A P2PKH or P2SH address"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.13.1*
|
||||
|
||||
Request the UTXO set:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/getutxos/checkmempool/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120-0.hex
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight bash %}
|
||||
d0c306004f438cea9c68557da34e8e7823a963eb9350daa107ffd80100000000\
|
||||
0000000001010101000000ffffff7fc8883303000000001976a9145f4865d186\
|
||||
5127807f714b0ad1ddfae9870866d888ac
|
||||
{% endhighlight %}
|
||||
|
||||
Same request in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/getutxos/checkmempool/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120-0.json
|
||||
{% endhighlight %}
|
||||
|
||||
Result (whitespaced added):
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"chainHeight": 443344,
|
||||
"chaintipHash": "000000000000000001d8ff07a1da5093eb63a923788e4ea37d55689cea8c434f",
|
||||
"bitmap": "1",
|
||||
"utxos": [
|
||||
{
|
||||
"txvers": 1,
|
||||
"height": 2147483647,
|
||||
"value": 0.53709,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 5f4865d1865127807f714b0ad1ddfae9870866d8 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a9145f4865d1865127807f714b0ad1ddfae9870866d888ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"19govWMzsRXqLUsUrHQKQ3DzekRxhsqwWH"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GetTxOutSetInfo][rpc gettxoutsetinfo] RPC: {{summary_getTxOutSetInfo}}
|
||||
|
||||
{% endautocrossref %}
|
207
_includes/devdoc/dash-core/rest/requests/get_headers.md
Normal file
207
_includes/devdoc/dash-core/rest/requests/get_headers.md
Normal file
|
@ -0,0 +1,207 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_headers.md" %}
|
||||
|
||||
##### GET Headers
|
||||
{% 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}}
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /headers/<count>/<hash>.<format>
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameter #1---the amount of block headers to retrieve*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Amount"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The amount of block headers in upward direction to return (including the start header hash)"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---the header hash of the block to retrieve*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Header Hash"
|
||||
t: "path (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the block to get, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #3---the output format*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Format"
|
||||
t: "suffix"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Response as JSON*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Result"
|
||||
t: "array"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An array containing the requested block headers"
|
||||
|
||||
- n: "→<br>Block Header"
|
||||
t: "object"
|
||||
p: "Required<br>(1 or more)"
|
||||
d: "An object containing a block header. The amount of the objects is the same as the amount provided in parameter #1 "
|
||||
|
||||
- n: "→→<br>`hash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #2"
|
||||
|
||||
- n: "→→<br>`confirmations`"
|
||||
t: "number (int)"
|
||||
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>`height`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The height of this block on its block chain"
|
||||
|
||||
- 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: "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)"
|
||||
d: "The merkle root for this block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→→<br>`time`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the *time* field in the block header, indicating approximately when the block was created"
|
||||
|
||||
- n: "→→<br>`mediantime`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113"
|
||||
|
||||
- n: "→→<br>`nonce`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The nonce which was successful at turning this particular block into one that could be added to the best block chain"
|
||||
|
||||
- n: "→→<br>`bits`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass"
|
||||
|
||||
- n: "→→<br>`difficulty`"
|
||||
t: "number (real)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"
|
||||
|
||||
- n: "→→<br>`chainwork`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"
|
||||
|
||||
- n: "→→<br>`previousblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The hash of the header of the previous block, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→→<br>`nextblockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.13.1*
|
||||
|
||||
Request 5 block headers in hex-encoded serialized block format:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/headers/5/000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a.hex
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight bash %}
|
||||
040000004b9e8debb1bb9df8f85d0f64cf45d408f5f7fcf3293ec40400000000\
|
||||
000000008c37685c878a66aa2709c3dc27a35020269ce1ce7ecb41dabe8f4e0c\
|
||||
ca8fc508651b2b5776270618cb395012000000205aec8459769d5c6d5cc6b087\
|
||||
065e0262465658f6fe8d53020000000000000000cb9a492474a4791b7f4dee49\
|
||||
0b3d813b1eb192fb67109c0c99317101019f72a7cd1f2b57762706185c2921b4
|
||||
{% endhighlight %}
|
||||
|
||||
Get the same block headers in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/headers/5/000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a.json
|
||||
{% endhighlight %}
|
||||
|
||||
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": "000000000000000000f198b9f92bc29fa294be4bb777e61fdd56aac07f174553",
|
||||
"confirmations": 33008,
|
||||
"height": 410335,
|
||||
"version": 536870912,
|
||||
"versionHex": "20000000",
|
||||
"merkleroot": "a7729f01017131990c9c1067fb92b11e3b813d0b49ee4d7f1b79a47424499acb",
|
||||
"time": 1462443981,
|
||||
"mediantime": 1462441496,
|
||||
"nonce": 3022072156,
|
||||
"bits": "18062776",
|
||||
"difficulty": 178659257772.5273,
|
||||
"chainwork": "000000000000000000000000000000000000000000185655621b104558a77160",
|
||||
"previousblockhash": "000000000000000002538dfef658564662025e0687b0c65c6d5c9d765984ec5a",
|
||||
"nextblockhash": "0000000000000000005b3caade164fcc5f3f00fd99ddbdb47ee66ea4bbe9387a"
|
||||
}
|
||||
]
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GET Block/NoTxDetails][rest get block-notxdetails] {{summary_restGetBlock-noTxDetails}}
|
||||
* [GetBlock][rpc getblock] RPC: {{summary_getBlock}}
|
||||
* [GetBlockHash][rpc getblockhash] RPC: {{summary_getBlockHash}}
|
||||
* [GetBlockHeader][rpc getblockheader] RPC: {{summary_getBlockHeader}}
|
||||
|
||||
{% endautocrossref %}
|
169
_includes/devdoc/dash-core/rest/requests/get_mempool-contents.md
Normal file
169
_includes/devdoc/dash-core/rest/requests/get_mempool-contents.md
Normal file
|
@ -0,0 +1,169 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_mempool-contents.md" %}
|
||||
|
||||
##### GET MemPool/Contents
|
||||
{% 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.
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /mempool/contents.json
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameters: none*
|
||||
|
||||
*Result as JSON*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`result`"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "A object containing transactions currently in the memory pool. May be empty"
|
||||
|
||||
- n: "→<br>TXID"
|
||||
t: "string : object"
|
||||
p: "Optional<br>(0 or more)"
|
||||
d: "The TXID of a transaction in the memory pool, encoded as hex in RPC byte order"
|
||||
|
||||
- n: "→ →<br>`size`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The size of the serialized transaction in bytes"
|
||||
|
||||
- n: "→ →<br>`fee`"
|
||||
t: "number (bitcoins)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The transaction fee paid by the transaction in decimal bitcoins"
|
||||
|
||||
- n: "→ →<br>`modifiedfee`"
|
||||
t: "number (bitcoins)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The transaction fee with fee deltas used for mining priority in decimal bitcoins"
|
||||
|
||||
- n: "→ →<br>`time`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The time the transaction entered the memory pool, Unix epoch time format"
|
||||
|
||||
- n: "→ →<br>`height`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block height when the transaction entered the memory pool"
|
||||
|
||||
- n: "→ →<br>`startingpriority`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The priority of the transaction when it first entered the memory pool"
|
||||
|
||||
- n: "→ →<br>`currentpriority`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The current priority of the transaction"
|
||||
|
||||
- n: "→ →<br>`descendantcount`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The number of in-mempool descendant transactions (including this one)"
|
||||
|
||||
- n: "→ →<br>`descendantsize`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The size of in-mempool descendants (including this one)"
|
||||
|
||||
- n: "→ →<br>`descendantfees`"
|
||||
t: "number (int)"
|
||||
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>`ancestorcount`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.13.0*<br><br>The number of in-mempool ancestor transactions (including this one)"
|
||||
|
||||
- n: "→ →<br>`ancestorsize`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of in-mempool ancestors (including this one)"
|
||||
|
||||
- n: "→ →<br>`ancestorfees`"
|
||||
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*
|
||||
|
||||
Get all transactions in the memory pool in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/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,
|
||||
"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,
|
||||
"depends": [
|
||||
]
|
||||
}
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GET MemPool/Info][rest get mempool-info]: {{summary_restGetMemPool-info}}
|
||||
* [GetMemPoolInfo][rpc getmempoolinfo] RPC: {{summary_getMemPoolInfo}}
|
||||
* [GetRawMemPool][rpc getrawmempool] RPC: {{summary_getRawMemPool}}
|
||||
|
||||
{% endautocrossref %}
|
85
_includes/devdoc/dash-core/rest/requests/get_mempool-info.md
Normal file
85
_includes/devdoc/dash-core/rest/requests/get_mempool-info.md
Normal file
|
@ -0,0 +1,85 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_mempool-info.md" %}
|
||||
|
||||
##### GET MemPool/Info
|
||||
{% 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.
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /mempool/info.json
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameters: none*
|
||||
|
||||
*Result as JSON*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`result`"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "A object containing information about the memory pool"
|
||||
|
||||
- n: "→<br>`size`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of transactions currently in the memory pool"
|
||||
|
||||
- n: "→<br>`bytes`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The total number of bytes in the transactions in the memory pool"
|
||||
|
||||
- n: "→<br>`usage`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.11.0*<br><br>Total memory usage for the mempool in bytes"
|
||||
|
||||
- n: "→<br>`maxmempool`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>Maximum memory usage for the mempool in bytes"
|
||||
|
||||
- n: "→<br>`mempoolminfee`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "*Added in Bitcoin Core 0.12.0*<br><br>The lowest fee per kilobyte paid by any transaction in the memory pool"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.13.1*
|
||||
|
||||
Get memory pool info in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/mempool/info.json
|
||||
{% endhighlight %}
|
||||
|
||||
Result (whitespaced added):
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"size": 989,
|
||||
"bytes": 736919,
|
||||
"usage": 1970496,
|
||||
"maxmempool": 300000000,
|
||||
"mempoolminfee": 0
|
||||
}
|
||||
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GET MemPool/Contents][rest get mempool-contents]: {{summary_restGetMemPool-contents}}
|
||||
* [GetMemPoolInfo][rpc getmempoolinfo] RPC: {{summary_getMemPoolInfo}}
|
||||
|
||||
{% endautocrossref %}
|
166
_includes/devdoc/dash-core/rest/requests/get_tx.md
Normal file
166
_includes/devdoc/dash-core/rest/requests/get_tx.md
Normal file
|
@ -0,0 +1,166 @@
|
|||
{% comment %}
|
||||
This file is licensed under the MIT License (MIT) available on
|
||||
http://opensource.org/licenses/MIT.
|
||||
{% endcomment %}
|
||||
{% assign filename="_includes/devdoc/dash-core/rest/requests/get_tx.md" %}
|
||||
|
||||
##### 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." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
The `GET tx` operation {{summary_restGetTx}}
|
||||
|
||||
{{reindexNote}}
|
||||
|
||||
*Request*
|
||||
|
||||
{% highlight text %}
|
||||
GET /tx/<txid>.<format>
|
||||
{% endhighlight %}
|
||||
|
||||
*Parameter #1---the TXID of the transaction to retrieve*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "TXID"
|
||||
t: "path (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The TXID of the transaction to get, encoded as hex in RPC byte order"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---the output format*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Format"
|
||||
t: "suffix"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to `.json` for decoded transaction contents in JSON, or `.bin` or `hex` for a serialized transaction in binary or hex"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Response as JSON*
|
||||
|
||||
{% assign DEPTH="" %}
|
||||
{% include helpers/vars.md %}
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Result"
|
||||
t: "object"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "An object describing the request transaction"
|
||||
|
||||
{{INCLUDE_DECODE_RAW_TRANSACTION}}
|
||||
- n: "→<br>`blockhash`"
|
||||
t: "string (hex)"
|
||||
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>`confirmations`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "If the transaction has been included in a block on the local best block chain, this is how many confirmations it has. Otherwise, this is `0`"
|
||||
|
||||
- n: "→<br>`time`"
|
||||
t: "number (int)"
|
||||
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 block header time of that block (may be in the future)"
|
||||
|
||||
- n: "→<br>`blocktime`"
|
||||
t: "number (int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "This field is currently identical to the time field described above"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.13.1*
|
||||
|
||||
Request a transaction in hex-encoded serialized transaction format:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/tx/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120.hex
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight text %}
|
||||
0100000001bf33f5e034d1774f4019c03e119f4fa9e421339271f7476e5e34ff\
|
||||
72839ebc16000000006b483045022100dab0ade70063cbc5ad44664b707391f8\
|
||||
ffe6e406b1bab43abfb547d701694d98022067580db89b81c69ba83487ea0a1b\
|
||||
cb6a325d2903b726980865210d2127de09710121023ee7a6437e9ad2957cd032\
|
||||
38b9668c15cb1dc6ac9c9d142f829168e1a3e4a9c4feffffff02c88833030000\
|
||||
00001976a9145f4865d1865127807f714b0ad1ddfae9870866d888ac102697eb\
|
||||
000000001976a91479e19d5c1cbc1c18f59c57d37ca403f3bcdaa73f88acd0c3\
|
||||
0600
|
||||
{% endhighlight %}
|
||||
|
||||
Get the same transaction in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
curl http://localhost:8332/rest/tx/42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120.json
|
||||
{% endhighlight %}
|
||||
|
||||
Result (whitespaced added):
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"txid": "42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120",
|
||||
"hash": "42f9df54a39026ccb54362141c41713968f19e1f14949ab6609b03ffa4b7f120",
|
||||
"size": 226,
|
||||
"vsize": 226,
|
||||
"version": 1,
|
||||
"locktime": 443344,
|
||||
"vin": [
|
||||
{
|
||||
"txid": "16bc9e8372ff345e6e47f771923321e4a94f9f113ec019404f77d134e0f533bf",
|
||||
"vout": 0,
|
||||
"scriptSig": {
|
||||
"asm": "3045022100dab0ade70063cbc5ad44664b707391f8ffe6e406b1bab43abfb547d701694d98022067580db89b81c69ba83487ea0a1bcb6a325d2903b726980865210d2127de0971[ALL] 023ee7a6437e9ad2957cd03238b9668c15cb1dc6ac9c9d142f829168e1a3e4a9c4",
|
||||
"hex": "483045022100dab0ade70063cbc5ad44664b707391f8ffe6e406b1bab43abfb547d701694d98022067580db89b81c69ba83487ea0a1bcb6a325d2903b726980865210d2127de09710121023ee7a6437e9ad2957cd03238b9668c15cb1dc6ac9c9d142f829168e1a3e4a9c4"
|
||||
},
|
||||
"sequence": 4294967294
|
||||
}
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.53709,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 5f4865d1865127807f714b0ad1ddfae9870866d8 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a9145f4865d1865127807f714b0ad1ddfae9870866d888ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"19govWMzsRXqLUsUrHQKQ3DzekRxhsqwWH"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"value": 39.5255144,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 79e19d5c1cbc1c18f59c57d37ca403f3bcdaa73f OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a91479e19d5c1cbc1c18f59c57d37ca403f3bcdaa73f88ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"1C7T3CJ6MEYf1YCYYPfN6zuGirqZcD3wuE"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"blockhash": "0000000000000000023da07114323ad9676896f354951e6b563d143428b69c03",
|
||||
"confirmations": 28,
|
||||
"time": 1481662934,
|
||||
"blocktime": 1481662934
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GetRawTransaction][rpc getrawtransaction] RPC: {{summary_getRawTransaction}}
|
||||
* [GetTransaction][rpc gettransaction] RPC: {{summary_getTransaction}}
|
||||
|
||||
{% endautocrossref %}
|
Loading…
Add table
Add a link
Reference in a new issue