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:
thephez 2017-10-25 09:17:55 -04:00 committed by GitHub
parent 17c265f5fd
commit 703c54ffbc
183 changed files with 9570 additions and 1373 deletions

View file

@ -0,0 +1,94 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/api-intro.md" %}
## Dash Core APIs
{% include helpers/subhead-links.md %}
### Hash Byte Order
{% include helpers/subhead-links.md %}
{% autocrossref %}
Dash Core RPCs accept and return the byte-wise reverse of computed
SHA-256 hash values. For example, the Unix `sha256sum` command displays the
SHA256(SHA256()) hash of mainnet block 300,000's header as:
> /bin/echo -n '020000007ef055e1674d2e6551dba41cd214debbee34aeb544c7ec670000000000000000d3998963f80c5bab43fe8c26228e98d030edf4dcbe48a666f5c39e2d7a885c9102c86d536c890019593a470d' | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b
5472ac8b1187bfcf91d6d218bbda1eb2405d7c55f1f8cc820000000000000000
The result above is also how the hash appears in the
previous-header-hash part of block 300,001's header:
<pre>02000000<b>5472ac8b1187bfcf91d6d218bbda1eb2405d7c55f1f8cc82000\
0000000000000</b>ab0aaa377ca3f49b1545e2ae6b0667a08f42e72d8c24ae\
237140e28f14f3bb7c6bcc6d536c890019edd83ccf</pre>
However, Dash Core's RPCs use the byte-wise reverse for hashes, so if you
want to get information about block 675,776 using the `getblock` RPC,
you need to reverse the requested hash:
<!--> bitcoin-cli getblock \
000000000000000082ccf8f1557c5d40b21edabb18d2d691cfbf87118bac7254
-->
> dash-cli getblock \
000000000000327a66cd1011b2d1defd1417b7d9e39b439e8e67ba996ee92602
(Note: hex representation uses two characters to display each byte of
data, which is why the reversed string looks somewhat mangled.)
The rationale for the reversal is unknown, but it likely stems from
Dash Core's use of hashes (which are byte arrays in C++) as integers
for the purpose of determining whether the hash is below the network
target. Whatever the reason for reversing header hashes, the reversal
also extends to other hashes used in RPCs, such as TXIDs and merkle
roots.
As header hashes and TXIDs are widely used as global identifiers in
other Dash software, this reversal of hashes has become the standard
way to refer to certain objects. The table below should make clear where
each byte order is used.
|---------------+---------------------|-----------------|
| Data | Internal Byte Order | RPC Byte Order |
|---------------|---------------------|-----------------|
| Example: SHA256(SHA256(0x00)) | Hash: 1406...539a | Hash: 9a53...0614 |
|---------------|---------------------|-----------------|
| Header Hashes: SHA256(SHA256(block header)) | Used when constructing block headers | Used by RPCs such as `getblock`; widely used in block explorers |
|---------------|---------------------|-----------------|
| Merkle Roots: SHA256(SHA256(TXIDs and merkle rows)) | Used when constructing block headers | Returned by RPCs such as `getblock` |
|---------------|---------------------|-----------------|
| TXIDs: SHA256(SHA256(transaction)) | Used in transaction inputs | Used by RPCs such as `gettransaction` and transaction data parts of `getblock`; widely used in wallet programs |
|---------------|---------------------|-----------------|
| P2PKH Hashes: RIPEMD160(SHA256(pubkey)) | Used in both addresses and pubkey scripts | **N/A:** RPCs use addresses which use internal byte order |
|---------------|---------------------|-----------------|
| P2SH Hashes: RIPEMD160(SHA256(redeem script)) | Used in both addresses and pubkey scripts | **N/A:** RPCs use addresses which use internal byte order |
|---------------|---------------------|-----------------|
Note: RPCs which return raw results, such as `getrawtransaction` or the
raw mode of `getblock`, always display hashes as they appear in blocks
(internal byte order).
The code below may help you check byte order by generating hashes
from raw hex.
{% endautocrossref %}
{% highlight python %}
#!/usr/bin/env python
from sys import byteorder
from hashlib import sha256
## You can put in $data an 80-byte block header to get its header hash,
## or a raw transaction to get its txid
data = "00".decode("hex")
hash = sha256(sha256(data).digest()).digest()
print "Warning: this code only tested on a little-endian x86_64 arch"
print
print "System byte order:", byteorder
print "Internal-Byte-Order Hash: ", hash.encode('hex_codec')
print "RPC-Byte-Order Hash: ", hash[::-1].encode('hex_codec')
{% endhighlight %}

View 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 %}

View 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 %}

View file

@ -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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View 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 %}

View file

@ -0,0 +1,227 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/intro.md" %}
### Remote Procedure Calls (RPCs)
{% include helpers/subhead-links.md %}
{% autocrossref %}
Dash Core provides a remote procedure call (RPC) interface for various
administrative tasks, wallet operations, and queries about network and block
chain data.
If you start Dash Core using `dash-qt`, the RPC interface is disabled by
default. To enable it, set `server=1` in `dash.conf` or supply the `-server`
argument when invoking the program. If you start Dash Core using `dashd`,
the RPC interface is enabled by default.
The interface requires the user to provide a password for authenticating RPC
requests. This password can be set either using the `rpcpassword` property in
`dash.conf` or by supplying the `-rpcpassword` program argument. Optionally a
username can be set using the `rpcuser` configuration value. See the [Examples
Page][devexamples] for more information about setting Dash Core configuration
values.
Open-source client libraries for the RPC interface are readily available in most
modern programming languages, so you probably don't need to write your own from
scratch. Dash Core also ships with its own compiled C++ RPC client,
`dash-cli`, located in the `bin` directory alongside `dashd` and
`dash-qt`. The `dash-cli` program can be used as a command-line interface
(CLI) to Dash Core or for making RPC calls from applications written in
languages lacking a suitable native client. The remainder of this section
describes the Dash Core RPC protocol in detail.
The Dash Core RPC service listens for HTTP `POST` requests on port 9998 in
mainnet mode, 19998 in testnet, or 18332 in regtest mode. The port number can be changed
by setting `rpcport` in `dash.conf`. By default the RPC service binds to your
server's [localhost][Localhost] loopback
network<!--noref--> interface so it's not accessible from other servers.
Authentication is implemented using [HTTP basic
authentication][HTTP basic authentication]. RPC
HTTP requests must include a `Content-Type` header set to `text/plain` and a
`Content-Length` header set to the size of the request body.
The format of the request body and response data is based on [version 1.0 of the
JSON-RPC specification][JSON-RPC version 1.0]. Specifically,
the HTTP `POST` data of a request must be a JSON object with the following
format:
| Name | Type | Presence | Description
|----------------------|-----------------|-----------------------------|----------------
| Request | object | Required<br>(exactly 1) | The JSON-RPC<!--noref--> request object
| → <br>`jsonrpc` | number (real) | Optional<br>(0 or 1) | Version indicator for the JSON-RPC<!--noref--> request. Currently ignored by Dash Core.
| → <br>`id` | string | Optional<br>(0 or 1) | An arbitrary string that will be returned with the response. May be omitted or set to an empty string ("")
| → <br>`method` | string | Required<br>(exactly 1) | The RPC method name (e.g. `getblock`). See the RPC section for a list of available methods.
| → <br>`params` | array | Optional<br>(0 or 1) | An array containing positional parameter values for the RPC. May be an empty array or omitted for RPC calls that don't have any required parameters.
| → → <br>Parameter | *any* | Optional<br>(0 or more) | A parameter. May be any JSON type allowed by the particular RPC method
{:.ntpd}
In the table above and in other tables describing RPC input<!--noref--> and
output<!--noref-->, we use the following conventions
* "→" indicates an argument that is the child of a JSON array or JSON object.
For example, "→ → Parameter" above means Parameter is the child of the
`params` array which itself is a child of the Request object.
* Plain-text names like "Request" are unnamed in the actual JSON object
* Code-style names like `params` are literal strings that appear in the JSON
object.
* "Type" is the JSON data type and the specific Dash Core type.
* "Presence" indicates whether or not a field must be present within its
containing array or object. Note that an optional object may still have
required children.
The HTTP response data for a RPC request is a JSON object with the following
format:
| Name | Type | Presence | Description
|----------------------|-----------------|-----------------------------|----------------
| Response | object | Required<br>(exactly 1) | The JSON-RPC<!--noref--> response object.
| → <br>`result` | *any* | Required<br>(exactly 1) | The RPC output<!--noref--> whose type varies by call. Has value `null` if an error occurred.
| → <br>`error` | null/object | Required<br>(exactly 1) | An object describing the error if one occurred, otherwise `null`.
| → → <br>`code` | number (int) | Required<br>(exactly 1) | The error code returned by the RPC function call. See [rpcprotocol.h][] for a full list of error codes and their meanings.
| → → <br>`message` | string | Required<br>(exactly 1) | A text description of the error. May be an empty string ("").
| → <br>`id` | string | Required<br>(exactly 1) | The value of `id` provided with the request. Has value `null` if the `id` field was omitted in the request.
{:.ntpd}
As an example, here is the JSON-RPC<!--noref--> request object for the hash of
the genesis block:
{% highlight json %}
{
"method": "getblockhash",
"params": [0],
"id": "foo"
}
{% endhighlight %}
The command to send this request using `dash-cli` is:
{% highlight bash %}
dash-cli getblockhash 0
{% endhighlight %}
Alternatively, we could `POST` this request using the cURL command-line program
as follows:
{% highlight bash %}
curl --user 'my_username:my_secret_password' --data-binary '''
{
"method": "getblockhash",
"params": [0],
"id": "foo"
}''' \
--header 'Content-Type: text/plain;' localhost:9998
{% endhighlight %}
The HTTP response data for this request would be:
{% highlight json %}
{
"result": "00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6",
"error": null,
"id": "foo"
}
{% endhighlight %}
Note: In order to minimize its size, the raw JSON response from Dash Core
doesn't include any extraneous whitespace characters. Here we've added
whitespace to make the object more readable. Speaking of which, `dash-cli`
also transforms the raw response to make it more human-readable. It:
- Adds whitespace indentation to JSON objects
- Expands escaped newline characters ("\n") into actual newlines
- Returns only the value of the `result` field if there's no error
- Strips the outer double-quotes around `result`s of type string
- Returns only the `error` field if there's an error
Continuing with the example above, the output<!--noref--> from the `dash-cli`
command would be simply:
{% highlight text %}
00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6
{% endhighlight %}
If there's an error processing a request, Dash Core sets the `result` field
to `null` and provides information about the error in the `error` field. For
example, a request for the block hash at block height -1 would be met with the
following response (again, whitespace added for clarity):
{% highlight json %}
{
"result": null,
"error": {
"code": -8,
"message": "Block height out of range"
},
"id": "foo"
}
{% endhighlight %}
If `dash-cli` encounters an error, it exits with a non-zero status code and
outputs<!--noref--> the `error` field as text to the process's standard error
stream:
{% highlight text %}
error code: -8
error message:
Block height out of range
{% endhighlight %}
The RPC interface supports request
batching as described in [version 2.0 of the JSON-RPC
specification][JSON-RPC request batching]. To initiate multiple
RPC requests within a single HTTP request, a client can `POST` a JSON array
filled with Request objects. The HTTP response data is then a JSON array filled
with the corresponding Response objects. Depending on your usage pattern,
request batching may provide significant performance gains. The `dash-cli`
RPC client does not support batch requests.
{% highlight bash %}
curl --user 'my_username:my_secret_password' --data-binary '''
[
{
"method": "getblockhash",
"params": [0],
"id": "foo"
},
{
"method": "getblockhash",
"params": [1],
"id": "foo2"
}
]''' \
--header 'Content-Type: text/plain;' localhost:9998
{% endhighlight %}
To keep this documentation compact and readable, the examples for each of the
available RPC calls will be given as `dash-cli` commands:
{% highlight text %}
dash-cli [options] <method name> <param1> <param2> ...
{% endhighlight %}
This translates into an JSON-RPC<!--noref--> Request object of the form:
{% highlight json %}
{
"method": "<method name>",
"params": [ "<param1>", "<param2>", "..." ],
"id": "foo"
}
{% endhighlight %}
[{{WARNING}}][proper money handling]{:#term-proper-money-handling}{:.term} if you write
programs using the JSON-RPC interface, you must ensure they handle high-precision
real numbers correctly. See the [Proper Money Handling][wiki proper money handling]
Bitcoin Wiki article for details and example code.
{% endautocrossref %}

View file

@ -0,0 +1,307 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/quick-reference.md" %}
#### Quick Reference {#rpc-quick-reference}
{% include helpers/subhead-links.md %}
{% comment %}
Styling notes: use highly-visible style for upcoming changes (not yet
released) and changes made in the last 6 months. Use less-visible
style for changes made up to two years ago. Don't point out
changes made more than two years ago.
Use v0.n.n in abbreviation title to prevent autocrossrefing.
{% endcomment %}
<!-- Dash - Not Implemented -->
{% assign DASH_NOT_IMPLEMENTED='**<abbr title="Not Implemented in Dash">Not Implemented</abbr>**' %}
<!-- Dash Core 0.12.1.0 Feb 2017 -->
{% assign DASH_NEW0_12_1='*<abbr title="New in Dash Core v0.12.1">New in Dash Core 0.12.1</abbr>*' %}
{% assign DASH_UPDATED0_12_1='**<abbr title="Updated in Dash Core v0.12.1">Updated in Dash Core 0.12.1</abbr>**' %}
<!-- Deprecated -->
{% assign DEPRECATED='**<abbr title="Deprecated; will be removed in a future version of Bitcoin Core">Deprecated</abbr>**' %}
<!-- Bitcoin Core 0.14.1 April 2017 -->
{% assign UPDATED0_14_0='**<abbr title="Updated in Bitcoin Core v0.14.1">Updated in Bitcoin Core 0.14.1</abbr>**' %}
<!-- Bitcoin Core 0.14.0 March 2017 -->
{% assign NEW0_14_0='**<abbr title="New in Bitcoin Core v0.14.0">New in Bitcoin Core 0.14.0</abbr>**' %}
{% assign UPDATED0_14_0='**<abbr title="Updated in Bitcoin Core v0.14.0">Updated in Bitcoin Core 0.14.0</abbr>**' %}
<!-- Bitcoin Core 0.13.1 September 2016 -->
{% assign UPDATED0_13_1='*<abbr title="Updated in Bitcoin Core v0.13.1">Updated in Bitcoin Core 0.13.1</abbr>*' %}
<!-- Bitcoin Core 0.13.0 August 2016 -->
{% assign NEW0_13_0='*<abbr title="New in Bitcoin Core v0.13.0">New in Bitcoin Core 0.13.0</abbr>*' %}
{% assign UPDATED0_13_0='*<abbr title="Updated in Bitcoin Core v0.13.0">Updated in Bitcoin Core 0.13.0</abbr>*' %}
<!-- Bitcoin Core 0.12.1 April 2016 -->
{% assign UPDATED0_12_1='*<abbr title="Updated in Bitcoin Core v0.12.1">Updated in Bitcoin Core 0.12.1</abbr>*' %}
<!-- Bitcoin Core 0.12.0 February 2016 -->
{% assign NEW0_12_0='*<abbr title="New in Bitcoin Core v0.12.0">New in Bitcoin Core 0.12.0</abbr>*' %}
{% assign UPDATED0_12_0='*<abbr title="Updated in Bitcoin Core v0.12.0">Updated in Bitcoin Core 0.12.0</abbr>*' %}
<!-- Bitcoin Core 0.11.0 July 2015 -->
{% assign NEW0_11_0='*<abbr title="New in Bitcoin Core v0.11.0">New in Bitcoin Core 0.11.0</abbr>*' %}
<!-- the summaries used below are defined in the files for the
particular RPC and aggregated into this helper file by the makefile
function manual-update-summaries-file. For example, to edit the
summary for GetBestBlockHash, edit
_includes/rpc/getbestblockhash.md and run `make manual-update-summaries`. -->
{% include helpers/summaries.md %}
#### Addressindex RPCs
These RPCs are all Dash-specific and not found in Bitcoin Core
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetAddressBalance][rpc getaddressbalance]: {{summary_getAddressBalance}}
* [GetAddressDeltas][rpc getaddressdeltas]: {{summary_getAddressDeltas}}
* [GetAddressMempool][rpc getaddressmempool]: {{summary_getAddressMempool}}
* [GetAddressTxids][rpc getaddresstxids]: {{summary_getAddressTxids}}
* [GetAddressUtxos][rpc getaddressutxos]: {{summary_getAddressUtxos}}
{% endautocrossref %}
#### Block Chain RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
* [GetBlock][rpc getblock]: {{summary_getBlock}} {{UPDATED0_13_0}}
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{UPDATED0_12_1}}
* [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}} {{DASH_NEW0_12_1}}
* [GetBlockHeader][rpc getblockheader]: {{summary_getBlockHeader}} {{NEW0_12_0}}
* [GetBlockHeaders][rpc getblockheaders]: {{summary_getBlockHeaders}} {{DASH_NEW0_12_1}}
* [GetChainTips][rpc getchaintips]: {{summary_getChainTips}} {{DASH_UPDATED0_12_1}}
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficulty}}
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{UPDATED0_12_0}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}} {{UPDATED0_13_0}}
* [GetSpentInfo][rpc getspentinfo]: {{summary_getSpentInfo}} {{DASH_NEW0_12_1}}
* [GetTxOut][rpc gettxout]: {{summary_getTxOut}}
* [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
* [VerifyChain][rpc verifychain]: {{summary_verifyChain}}
* [VerifyTxOutProof][rpc verifytxoutproof]: {{summary_verifyTxOutProof}} {{NEW0_11_0}}
{% endautocrossref %}
**Not implemented in Dash**
{% autocrossref %}
* {{DASH_NOT_IMPLEMENTED}} [GetMemPoolAncestors][rpc getmempoolancestors]: {{summary_getMemPoolAncestors}} {{NEW0_13_0}}
* {{DASH_NOT_IMPLEMENTED}} [GetMemPoolDescendants][rpc getmempooldescendants]: {{summary_getMemPoolDescendants}} {{NEW0_13_0}}
* {{DASH_NOT_IMPLEMENTED}} [GetMemPoolEntry][rpc getmempoolentry]: {{summary_getMemPoolEntry}} {{NEW0_13_0}}
* {{DASH_NOT_IMPLEMENTED}} [PreciousBlock][rpc preciousblock]: {{summary_preciousBlock}} {{NEW0_14_0}}
* {{DASH_NOT_IMPLEMENTED}} [PruneBlockChain][rpc pruneblockchain]: {{summary_pruneBlockChain}} {{NEW0_14_0}}
{% endautocrossref %}
#### Control RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [Debug][rpc debug]: {{summary_debug}}
* [GetInfo][rpc getinfo]: {{summary_getInfo}} {{DEPRECATED}}
* [Help][rpc help]: {{summary_help}}
* [Stop][rpc stop]: {{summary_stop}}
{% endautocrossref %}
#### Dash RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetGovernanceInfo][rpc getgovernanceinfo]: {{summary_getGovernanceInfo}}
* [GetPoolInfo][rpc getpoolinfo]: {{summary_getPoolInfo}}
* [GetSuperblockBudget][rpc getsuperblockbudget]: {{summary_getSuperblockBudget}}
* [GObject][rpc gobject]: {{summary_gObject}}
* [Masternode][rpc masternode]: {{summary_masternode}}
* [MasternodeBroadcast][rpc masternodebroadcast]: {{summary_masternodeBroadcast}}
* [MasternodeList][rpc masternodelist]: {{summary_masternodeList}}
* [MnSync][rpc mnsync]: {{summary_mnSync}}
* [PrivateSend][rpc privatesend]: {{summary_privateSend}}
* [Spork][rpc spork]: {{summary_spork-rpc}}
* [VoteRaw][rpc voteraw]: {{summary_voteRaw}}
{% endautocrossref %}
#### Generating RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [Generate][rpc generate]: {{summary_generate}} {{NEW0_11_0}}, {{UPDATED0_13_0}}
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
* {{DASH_NOT_IMPLEMENTED}} [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}} {{NEW0_13_0}}
{% endautocrossref %}
#### Mining RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}} {{UPDATED0_14_0}}
* [GetNetworkHashPS][rpc getnetworkhashps]: {{summary_getNetworkHashPS}}
* [PrioritiseTransaction][rpc prioritisetransaction]: {{summary_prioritiseTransaction}}
* [SubmitBlock][rpc submitblock]: {{summary_submitBlock}}
{% endautocrossref %}
#### Network RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [AddNode][rpc addnode]: {{summary_addNode}} {{UPDATED0_14_0}}
* [ClearBanned][rpc clearbanned]: {{summary_clearBanned}} {{NEW0_12_0}}
* [DisconnectNode][rpc disconnectnode]: {{summary_disconnectNode}} {{NEW0_12_0}} {{UPDATED0_14_1}}
* [GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}} {{UPDATED0_14_0}}
* [GetConnectionCount][rpc getconnectioncount]: {{summary_getConnectionCount}}
* [GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}} {{UPDATED0_12_0}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}} {{UPDATED0_13_0}}
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}} {{UPDATED0_13_0}}
* [ListBanned][rpc listbanned]: {{summary_listBanned}} {{NEW0_12_0}}
* [Ping][rpc ping]: {{summary_ping-rpc}}
* [SetBan][rpc setban]: {{summary_setBan}} {{NEW0_12_0}}
* [SetNetworkActive][rpc setnetworkactive]: {{summary_setNetworkActive}} {{NEW0_14_0}}
{% endautocrossref %}
#### Raw Transaction RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}} {{UPDATED0_14_1}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}} {{UPDATED0_13_0}}
* [DecodeScript][rpc decodescript]: {{summary_decodeScript}}
* [FundRawTransaction][rpc fundrawtransaction]: {{summary_fundRawTransaction}} {{NEW0_12_0}}, {{UPDATED0_14_0}}
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}} {{UPDATED0_14_0}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}
{% endautocrossref %}
#### Utility RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [CreateMultiSig][rpc createmultisig]: {{summary_createMultiSig}}
* [EstimateFee][rpc estimatefee]: {{summary_estimateFee}}
* [EstimatePriority][rpc estimatepriority]: {{summary_estimatePriority}}
* [EstimateSmartFee][rpc estimatesmartfee]: {{summary_estimateSmartFee}} {{DEPRECATED}}
* [EstimateSmartPriority][rpc estimatesmartpriority]: {{summary_estimateSmartPriority}} {{DEPRECATED}}
* [ValidateAddress][rpc validateaddress]: {{summary_validateAddress}} {{UPDATED0_13_0}}
* [VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}}
* {{DASH_NOT_IMPLEMENTED}} [GetMemoryInfo][rpc getmemoryinfo]: {{summary_getMemoryInfo}} {{NEW_14_0}}
{% endautocrossref %}
#### Wallet RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
**Note:** the wallet RPCs are only available if Dash Core was built
with [wallet support][]{:#term-wallet-support}{:.term}, which is the
default.
* [AbandonTransaction][rpc abandontransaction]: {{summary_abandonTransaction}} {{NEW0_12_0}}
* [AddMultiSigAddress][rpc addmultisigaddress]: {{summary_addMultiSigAddress}}
* [BackupWallet][rpc backupwallet]: {{summary_backupWallet}}
* [DumpHDInfo][rpc dumphdinfo]: {{summary_dumpHdInfo}}
* [DumpPrivKey][rpc dumpprivkey]: {{summary_dumpPrivKey}}
* [DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}}
* [EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}}
* [GetAccount][rpc getaccount]: {{summary_getAccount}}
* [GetAccountAddress][rpc getaccountaddress]: {{summary_getAccountAddress}} {{DEPRECATED}}
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}} {{DEPRECATED}}
* [GetBalance][rpc getbalance]: {{summary_getBalance}}
* [GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}
* [GetRawChangeAddress][rpc getrawchangeaddress]: {{summary_getRawChangeAddress}}
* [GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}} {{DEPRECATED}}
* [GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}} {{UPDATED0_12_0}}
* [GetUnconfirmedBalance][rpc getunconfirmedbalance]: {{summary_getUnconfirmedBalance}}
* [GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}}
* [ImportAddress][rpc importaddress]: {{summary_importAddress}}
* [ImportElectrumWallet][rpc importelecturmwallet]: {{summary_importElectrumWallet}} {{DASH_NEW0_12_1}}
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [ImportPubKey][rpc importpubkey]: {{summary_importPubKey}}
* [ImportWallet][rpc importwallet]: {{summary_importWallet}}
* [InstantSendToAddress][rpc instantsendtoaddress]: {{summary_instantSendToAddress}}
* [Keepass][rpc keepass]: {{summary_keepass}}
* [KeyPoolRefill][rpc keypoolrefill]: {{summary_keyPoolRefill}}
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}} {{DEPRECATED}}
* [ListAddressGroupings][rpc listaddressgroupings]: {{summary_listAddressGroupings}}
* [ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}}
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}} {{DEPRECATED}}
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}}
* [ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}}
* [ListTransactions][rpc listtransactions]: {{summary_listTransactions}} {{UPDATED0_12_1}}
* [ListUnspent][rpc listunspent]: {{summary_listUnspent}} {{UPDATED0_13_0}}
* [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}}
* [Move][rpc move]: {{summary_move}} {{DEPRECATED}}
* [SendFrom][rpc sendfrom]: {{summary_sendFrom}} {{DEPRECATED}}
* [SendMany][rpc sendmany]: {{summary_sendMany}}
* [SendToAddress][rpc sendtoaddress]: {{summary_sendToAddress}}
* [SetAccount][rpc setaccount]: {{summary_setAccount}} {{DEPRECATED}}
* [SetTxFee][rpc settxfee]: {{summary_setTxFee}}
* [SignMessage][rpc signmessage]: {{summary_signMessage}}
* [WalletLock][rpc walletlock]: {{summary_walletLock}}
* [WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}
* [WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}
* {{DASH_NOT_IMPLEMENTED}} [AddWitnessAddress][rpc addwitnessaddress]: {{summary_addWitnessAddress}} {{NEW0_13_0}}
* {{DASH_NOT_IMPLEMENTED}} [BumpFee][rpc bumpfee]: {{summary_bumpFee}} {{NEW0_14_0}}
* {{DASH_NOT_IMPLEMENTED}} [ImportMulti][rpc importmulti]: {{summary_importMulti}} {{NEW0_14_0}}
* {{DASH_NOT_IMPLEMENTED}} [ImportPrunedFunds][rpc importprunedfunds]: {{summary_importPrunedFunds}} {{NEW0_13_0}}
* {{DASH_NOT_IMPLEMENTED}} [RemovePrunedFunds][rpc removeprunedfunds]: {{summary_removePrunedFunds}} {{NEW0_13_0}}
* {{DASH_NOT_IMPLEMENTED}} [SignMessageWithPrivKey][rpc signmessagewithprivkey]: {{summary_signMessageWithPrivKey}} {{NEW0_13_0}}
{% endautocrossref %}
#### Removed RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetHashesPerSec][rpc gethashespersec]: {{summary_getHashesPerSec}}
* [GetWork][rpc getwork]: {{summary_getWork}}
<!-- Still in Dash
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
-->
{% endautocrossref %}

View file

@ -0,0 +1,52 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/abandontransaction.md" %}
##### AbandonTransaction
{% include helpers/subhead-links.md %}
{% assign summary_abandonTransaction="marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent." %}
{% autocrossref %}
*Added in Bitcoin Core 0.12.0*
The `abandontransaction` RPC {{summary_abandonTransaction}}
*Parameter #1---a transaction identifier (TXID)*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction that you want to abandon. The TXID must be encoded as hex in RPC byte order"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "JSON `null` when the transaction and all descendants were abandoned"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
Abandons the transaction on your node.
{% highlight bash %}
bitcoin-cli abandontransaction fa3970c341c9f5de6ab13f128cbfec58d732e736a505fe32137ad551c799ecc4
{% endhighlight %}
Result (no output from `bitcoin-cli` because result is set to `null`).
*See also*
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,95 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/addmultisigaddress.md" %}
##### AddMultiSigAddress
{% include helpers/subhead-links.md %}
{% assign summary_addMultiSigAddress="adds a P2SH multisig address to the wallet." %}
{% autocrossref %}
*Requires wallet support.*
The `addmultisigaddress` RPC {{summary_addMultiSigAddress}}
*Parameter #1---the number of signatures required*
{% itemplate ntpd1 %}
- n: "Required"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The minimum (*m*) number of signatures required to spend this m-of-n multisig script"
{% enditemplate %}
*Parameter #2---the full public keys, or addresses for known public keys*
{% itemplate ntpd1 %}
- n: "Keys Or Addresses"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of strings with each string being a public key or address"
- n: "→<br>Key Or Address"
t: "string"
p: "Required<br>(1 or more)"
d: "A public key against which signatures will be checked. Alternatively, this may be a P2PKH address belonging to the wallet---the corresponding public key will be substituted. There must be at least as many keys as specified by the Required parameter, and there may be more keys"
{% enditemplate %}
*Parameter #3---the account name*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The account name in which the address should be stored. Default is the default account, \"\" (an empty string)"
{% enditemplate %}
*Result---a P2SH address printed and stored in the wallet*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The P2SH multisig address. The address will also be added to the wallet, and outputs paying that address will be tracked by the wallet"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Adding a 2-of-3 P2SH multisig address to the "test account" by mixing
two P2PKH addresses and one full public key:
{% highlight bash %}
bitcoin-cli -testnet addmultisigaddress \
2 \
'''
[
"mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ",
"02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f",
"mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG"
]
''' \
'test account'
{% endhighlight %}
Result:
{% highlight text %}
2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq
{% endhighlight %}
(New P2SH multisig address also stored in wallet.)
*See also*
* [CreateMultiSig][rpc createmultisig]: {{summary_createMultiSig}}
* [DecodeScript][rpc decodescript]: {{summary_decodeScript}}
* [Pay-To-Script-Hash (P2SH)][/en/glossary/p2sh-address]
{% endautocrossref %}

View file

@ -0,0 +1,60 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/addnode.md" %}
##### AddNode
{% include helpers/subhead-links.md %}
{% assign summary_addNode="attempts to add or remove a node from the addnode list, or to try a connection to a node once." %}
{% autocrossref %}
The `addnode` RPC {{summary_addNode}}
*Parameter #1---hostname/IP address and port of node to add or remove*
{% itemplate ntpd1 %}
- n: "`node`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The node to add as a string in the form of `<IP address>:<port>`."
{% enditemplate %}
*Parameter #2---whether to add or remove the node, or to try only once to connect*
{% itemplate ntpd1 %}
- n: "`command`"
t: "string"
p: "Required<br>(exactly 1)"
d: "What to do with the IP address above. Options are:<br>`add` to add a node to the addnode list. Up to 8 nodes can be added additional to the default 8 nodes. Not limited by `-maxconnections`<br>`remove` to remove a node from the list. If currently connected, this will disconnect immediately<br>`onetry` to immediately attempt connection to the node even if the outgoing connection slots are full; this will only attempt the connection once"
{% enditemplate %}
*Result---`null` plus error on failed remove*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always JSON `null` whether the node was added, removed, tried-and-connected, or tried-and-not-connected. The JSON-RPC error field will be set only if you try adding a node that was already added or removing a node that is not on the addnodes list"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Try connecting to the following node.
{% highlight bash %}
dash-cli -testnet addnode 192.0.2.113:19999 onetry
{% endhighlight %}
Result (no output from `dash-cli` because result is set to `null`).
*See also*
* [GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,60 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/addwitnessaddress.md" %}
##### AddWitnessAddress
{% include helpers/subhead-links.md %}
{% assign summary_addWitnessAddress="adds a witness address for a script (with pubkey or redeem script known)." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
*Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.*
The `addwitnessaddress` RPC {{summary_addWitnessAddress}}
*Parameter #1---the witness address*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "A witness address that gets added to a script. Needs to be in the wallet and uncompressed"
{% enditemplate %}
*Result---the witness script*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The value of the new address (P2SH of witness script)"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli addwitnessaddress 1BRo7qrYHMPrzdBDzfjmzteBdYAyTMXW75
{% endhighlight %}
Result:
The RPC is disabled by default on mainnet as long as Segregated Witness has not been activated.
`-walletprematurewitness` enables the RPC.
{% highlight text %}
3LfAujMsBHgQKoxLn59dVbeYPmfUrHSAQb
{% endhighlight %}
*See also*
* [BIP-141 - Segregated Witness](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki)
* [BIP-142 - Address Format for Segregated Witness](https://github.com/bitcoin/bips/blob/master/bip-0142.mediawiki)
{% endautocrossref %}

View file

@ -0,0 +1,49 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/backupwallet.md" %}
##### BackupWallet
{% include helpers/subhead-links.md %}
{% assign summary_backupWallet="safely copies `wallet.dat`<!--noref--> to the specified file, which can be a directory or a path with filename." %}
{% autocrossref %}
*Requires wallet support.*
The `backupwallet` RPC {{summary_backupWallet}}
*Parameter #1---destination directory or filename*
{% itemplate ntpd1 %}
- n: "Destination"
t: "string"
p: "Required<br>(exactly 1)"
d: "A filename or directory name. If a filename, it will be created or overwritten. If a directory name, the file `wallet.dat`<!--noref--> will be created or overwritten within that directory"
{% enditemplate %}
*Result---`null` or error*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always `null` whether success or failure. The JSON-RPC error and message fields will be set if a failure occurred"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet backupwallet /tmp/backup.dat
{% endhighlight %}
*See also*
* [DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}}
* [ImportWallet][rpc importwallet]: {{summary_importWallet}}
{% endautocrossref %}

View file

@ -0,0 +1,116 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/bumpfee.md" %}
##### BumpFee
{% include helpers/subhead-links.md %}
{% assign summary_bumpFee="replaces an unconfirmed wallet transaction that signaled RBF with a new transaction that pays a higher fee." %}
{% autocrossref %}
*Added in Bitcoin Core 0.14.0*
*Requires wallet support. Wallet must be unlocked.*
The `bumpfee` RPC {{summary_bumpFee}} The increased fee is deducted from the change output. The command fails if the change output is too small to increase the fee or
if the wallet or mempool contains a transaction that spends one of the transaction's outputs. The `-walletrbf` option needs to be enabled (default is `false`).
*Parameter #1---The TXID of the transaction*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The id of the transaction"
{% enditemplate %}
*Parameter #2---Additional options*
{% itemplate ntpd1 %}
- n: "Options"
t: "Object"
p: "Optional<br>(0 or 1)"
d: "Additional options"
- n: "→ <br>`confTarget`"
t: "numeric (int)"
p: "Optional<br>(0 or 1)"
d: "The confirmation target in blocks. Based on this value the new fee will be calculated using the same code as the `estimatefee` RPC. If not set, the default target of ´6´ blocks will be used"
- n: "→ <br>`totalFee`"
t: "numeric (satoshis)"
p: "Optional<br>(0 or 1)"
d: "The total fee to pay in satoshis (not the feerate). The actual fee can be higher in rare cases if the change output is close to the dust limit"
- n: "→ <br>`replaceable`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Whether the new transaction should still be BIP 125 replaceable. Even if set to `false` the transaction may still be replacable, for example if it has unconfirmed ancestors which are replaceable. The default is `true`"
{% enditemplate %}
*Result---information about the new transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object including information about the new transaction"
- n: "→ <br>`txid`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The id of the new transaction"
- n: "→ <br>`origfee`"
t: "numeric (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The fee of the replaced transaction"
- n: "→ <br>`fee`"
t: "numeric (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The fee of the new transaction"
- n: "→ <br>`errors`"
t: "array"
p: "Required<br>(exactly 1)"
d: "Errors encountered during processing (may be empty)"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli -testnet bumpfee d4a33e0cabaz723149e1fcab4e033a40173\
88a644c65370e3cb06ba2f0e13975\
'{
"totalFee": 4000,
"replaceable": false
}'
{% endhighlight %}
Result:
{% highlight json %}
{
"txid": "37a55ce49636977k79bcb04ee1143573b570b1743e09660e79e7ec3320968ca54",
"origfee": 0.00002450,
"fee": 0.00004000,
"errors": ""
}
{% endhighlight %}
*See also*
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}}
* [FundRawTransaction][rpc fundrawtransaction]: {{summary_fundRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
* [Serialized Transaction Format][raw transaction format]
{% endautocrossref %}

View file

@ -0,0 +1,45 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/clearbanned.md" %}
##### ClearBanned
{% include helpers/subhead-links.md %}
{% assign summary_clearBanned="clears list of banned nodes." %}
{% autocrossref %}
*Added in Bitcoin Core 0.12.0*
The `clearbanned` RPC {{summary_clearBanned}}
*Parameters: none*
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "JSON `null` when the list was cleared"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Clears the ban list.
{% highlight bash %}
dash-cli clearbanned
{% endhighlight %}
Result (no output from `dash-cli` because result is set to `null`).
*See also*
* [ListBanned][rpc listbanned]: {{summary_listBanned}}
* [SetBan][rpc setban]: {{summary_setBan}}
{% endautocrossref %}

View file

@ -0,0 +1,91 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/createmultisig.md" %}
##### CreateMultiSig
{% include helpers/subhead-links.md %}
{% assign summary_createMultiSig="creates a P2SH multi-signature address." %}
{% autocrossref %}
The `createmultisig` RPC {{summary_createMultiSig}}
*Parameter #1---the number of signatures required*
{% itemplate ntpd1 %}
- n: "Required"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The minimum (*m*) number of signatures required to spend this m-of-n multisig script"
{% enditemplate %}
*Parameter #2---the full public keys, or addresses for known public keys*
{% itemplate ntpd1 %}
- n: "Keys Or Addresses"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of strings with each string being a public key or address"
- n: "→<br>Key Or Address"
t: "string"
p: "Required<br>(1 or more)"
d: "A public key against which signatures will be checked. If wallet support is enabled, this may be a P2PKH address belonging to the wallet---the corresponding public key will be substituted. There must be at least as many keys as specified by the Required parameter, and there may be more keys"
{% enditemplate %}
*Result---P2SH address and hex-encoded redeem script*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object describing the multisig address"
- n: "→<br>`address`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The P2SH address for this multisig redeem script"
- n: "→<br>`redeemScript`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The multisig redeem script encoded as hex"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Creating a 2-of-3 P2SH multisig address by mixing two P2PKH addresses and
one full public key:
{% highlight bash %}
bitcoin-cli -testnet createmultisig 2 '''
[
"mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ",
"02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f",
"mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG"
]
'''
{% endhighlight %}
Result:
{%highlight json %}
{
"address" : "2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq",
"redeemScript" : "522103ede722780d27b05f0b1169efc90fa15a601a32fc6c3295114500c586831b6aaf2102ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f21022d609d2f0d359e5bc0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d553ae"
}
{% endhighlight %}
*See also*
* [AddMultiSigAddress][rpc addmultisigaddress]: {{summary_addMultiSigAddress}}
* [DecodeScript][rpc decodescript]: {{summary_decodeScript}}
* [Pay-To-Script-Hash (P2SH)][/en/glossary/p2sh-address]
{% endautocrossref %}

View file

@ -0,0 +1,111 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/createrawtransaction.md" %}
##### CreateRawTransaction
{% include helpers/subhead-links.md %}
{% assign summary_createRawTransaction="creates an unsigned serialized transaction that spends a previous output to a new output with a P2PKH or P2SH address. The transaction is not stored in the wallet or transmitted to the network." %}
{% autocrossref %}
The `createrawtransaction` RPC {{summary_createRawTransaction}}
*Parameter #1---Inputs*
{% itemplate ntpd1 %}
- n: "Transactions"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects, each one to be used as an input to the transaction"
- n: "→ Input"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular input"
- n: "→ →<br>`txid`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the outpoint to be spent encoded as hex in RPC byte order"
- n: "→ →<br>`vout`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The output index number (vout) of the outpoint to be spent; the first output in a transaction is index `0`"
- n: "→ →<br>`Sequence`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "NOT IMPLEMENTED IN DASH.<br><br>The sequence number to use for the input"
{% enditemplate %}
*Parameter #2---P2PKH or P2SH addresses and amounts*
{% itemplate ntpd1 %}
- n: "Outputs"
t: "object"
p: "Required<br>(exactly 1)"
d: "The addresses and amounts to pay"
- n: "→<br>Address/Amount"
t: "string : number (Dash)"
p: "Required<br>(1 or more)"
d: "A key/value pair with the address to pay as a string (key) and the amount to pay that address (value) in Dash"
{% enditemplate %}
*Parameter #3---locktime*
{% itemplate ntpd1 %}
- n: "Locktime"
t: "numeric (int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.12.0*<br><br>Indicates the earliest time a transaction can be added to the block chain"
{% enditemplate %}
*Result---the unsigned raw transaction in hex*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(Exactly 1)"
d: "The resulting unsigned raw transaction in serialized transaction format encoded as hex. If the transaction couldn't be generated, this will be set to JSON `null` and the JSON-RPC error field may contain an error message"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet createrawtransaction '''
[
{
"txid": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f",
"vout" : 0
}
]''' \
'{"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 800, "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh":77.78}' '1024'
{% endhighlight %}
Result (wrapped):
{% highlight text %}
01000000010fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c48778a4fa6bd93fc8f6\
0000000000ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3\
cfc9f32ef388ac80dc9acf010000001976a914811eacc14db8ebb5b64486dc43400c0226b4\
28a488ac00040000
{% endhighlight %}
*See also*
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
* [Serialized Transaction Format][raw transaction format]
{% endautocrossref %}

View file

@ -0,0 +1,40 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/debug.md" %}
##### Debug
{% include helpers/subhead-links.md %}
{% assign summary_debug="changes the debug category from the console." %}
{% autocrossref %}
The `debug` RPC {{summary_debug}}
*Parameter #1---debug category*
{% itemplate ntpd1 %}
- n: "Debug category"
t: "string"
p: "Required<br>(1 or more)"
d: "The debug category to activate. Use a comma to specify multiple categories. Categories will be one of the following:<br>`0` - Disables all categories <br>`1` - Enables all categories <br>`addrman` <br>`alert` <br>`bench` <br>`coindb` <br>`db` <br>`lock` <br>`rand` <br>`rpc` <br>`selectcoins` <br>`mempool` <br>`mempoolrej` <br>`net` <br>`proxy` <br>`prune` <br>`http` <br>`libevent` <br>`tor` <br>`zmq` <br>`dash` <br>`privatesend` <br>`instantsend` <br>`masternode` <br>`spork` <br>`keepass` <br>`mnpayments` <br>`gobject` <br>"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet debug "net,mempool"
{% endhighlight %}
Result:
{% highlight text %}
Debug mode: net,mempool
{% endhighlight %}
*See also: none*
{% endautocrossref %}

View file

@ -0,0 +1,97 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/decoderawtransaction.md" %}
##### DecodeRawTransaction
{% include helpers/subhead-links.md %}
{% assign summary_decodeRawTransaction="decodes a serialized transaction hex string into a JSON object describing the transaction." %}
{% autocrossref %}
The `decoderawtransaction` RPC {{summary_decodeRawTransaction}}
*Parameter #1---serialized transaction in hex*
{% itemplate ntpd1 %}
- n: "Serialized Transaction"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The transaction to decode in serialized transaction format"
{% enditemplate %}
*Result---the decoded transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object describing the decoded transaction, or JSON `null` if the transaction could not be decoded"
{{INCLUDE_DECODE_RAW_TRANSACTION}}
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
Decode a signed one-input, three-output transaction:
{% highlight bash %}
bitcoin-cli decoderawtransaction 0100000001bafe2175b9d7b3041ebac\
529056b393cf2997f7964485aa382ffa449ffdac02a000000008a47304402201\
3d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00\
220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39\
e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815\
b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08\
ffb10d4b8ffffffff01b0a86a00000000001976a91401b81d5fa1e55e069e3cc\
2db9c19e2e80358f30688ac00000000
{% endhighlight %}
Result:
{% highlight json %}
{
"txid": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"hash": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"size": 223,
"vsize": 223,
"version": 1,
"locktime": 0,
"vin": [
{
"txid": "2ac0daff49a4ff82a35a4864797f99f23c396b0529c5ba1e04b3d7b97521feba",
"vout": 0,
"scriptSig": {
"asm": "3044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
"hex": "473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.06990000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 01b81d5fa1e55e069e3cc2db9c19e2e80358f306 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"1A6Ei5cRfDJ8jjhwxfzLJph8B9ZEthR9Z"
]
}
}
]
}
{% endhighlight %}
*See also*
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,98 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/decodescript.md" %}
##### DecodeScript
{% include helpers/subhead-links.md %}
{% assign summary_decodeScript="decodes a hex-encoded P2SH redeem script." %}
{% autocrossref %}
The `decodescript` RPC {{summary_decodeScript}}
*Parameter #1---a hex-encoded redeem script*
{% itemplate ntpd1 %}
- n: "Redeem Script"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The redeem script to decode as a hex-encoded serialized script"
{% enditemplate %}
*Result---the decoded script*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object describing the decoded script, or JSON `null` if the script could not be decoded"
- n: "→<br>`asm`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The redeem script in decoded form with non-data-pushing opcodes listed. May be empty"
- 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 inside P2SH<br>`pubkeyhash` for a P2PKH script inside P2SH<br>`multisig` for a multisig script inside P2SH<br>`nonstandard` for unknown scripts"
- n: "→<br>`reqSigs`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of signatures required; this is always `1` for P2PK or P2PKH within P2SH. It may be greater than 1 for P2SH multisig. This value will not be returned for `nonstandard` script types (see the `type` key above)"
- n: "→<br>`addresses`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "A P2PKH addresses used in this script, or the computed P2PKH addresses of any pubkeys in this script. This array will not be returned for `nonstandard` script types"
- n: "→ →<br>Address"
t: "string"
p: "Required<br>(1 or more)"
d: "A P2PKH address"
- n: "→<br>`p2sh`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The P2SH address of this redeem script"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
A 2-of-3 P2SH multisig pubkey script:
{% highlight bash %}
bitcoin-cli -testnet decodescript 522103ede722780d27b05f0b1169ef\
c90fa15a601a32fc6c3295114500c586831b6aaf2102ecd2d250a76d204011de\
6bc365a56033b9b3a149f679bc17205555d3c2b2854f21022d609d2f0d359e5b\
c0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d553ae
{% endhighlight %}
Result:
{% highlight json %}
{
"asm" : "2 03ede722780d27b05f0b1169efc90fa15a601a32fc6c3295114500c586831b6aaf 02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f 022d609d2f0d359e5bc0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d5 3 OP_CHECKMULTISIG",
"reqSigs" : 2,
"type" : "multisig",
"addresses" : [
"mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ",
"mo1vzGwCzWqteip29vGWWW6MsEBREuzW94",
"mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG"
],
"p2sh" : "2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq"
}
{% endhighlight %}
*See also*
* [CreateMultiSig][rpc createmultisig]: {{summary_createMultiSig}}
* [Pay-To-Script-Hash (P2SH)][/en/glossary/p2sh-address]
{% endautocrossref %}

View file

@ -0,0 +1,53 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/disconnectnode.md" %}
##### DisconnectNode
{% include helpers/subhead-links.md %}
{% assign summary_disconnectNode="immediately disconnects from a specified node." %}
{% autocrossref %}
*Added in Bitcoin Core 0.12.0*
The `disconnectnode` RPC {{summary_disconnectNode}}
*Parameter #1---hostname/IP address and port of node to disconnect*
{% itemplate ntpd1 %}
- n: "`node`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The node you want to disconnect from as a string in the form of `<IP address>:<port>`.<br><br>*Updated in Bitcoin Core 0.14.1*"
{% enditemplate %}
*Result---`null` on success or error on failed disconnect*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "JSON `null` when the node was disconnected"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Disconnects following node from your node.
{% highlight bash %}
dash-cli -testnet disconnectnode 192.0.2.113:19999
{% endhighlight %}
Result (no output from `dash-cli` because result is set to `null`).
*See also*
* [AddNode][rpc addnode]: {{summary_addNode}}
* [GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,56 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/dumpprivkey.md" %}
##### DumpPrivKey
{% include helpers/subhead-links.md %}
{% assign summary_dumpPrivKey="returns the wallet-import-format (WIP) private key corresponding to an address. (But does not remove it from the wallet.)" %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an
unencrypted wallet.*
The `dumpprivkey` RPC {{summary_dumpPrivKey}}
*Parameter #1---the address corresponding to the private key to get*
{% itemplate ntpd1 %}
- n: "P2PKH Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The P2PKH address corresponding to the private key you want returned. Must be the address corresponding to a private key in this wallet"
{% enditemplate %}
*Result---the private key*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The private key encoded as base58check using wallet import format"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet dumpprivkey moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7
{% endhighlight %}
Result:
{% highlight text %}
cTVNtBK7mBi2yc9syEnwbiUpnpGJKohDWzXMeF4tGKAQ7wvomr95
{% endhighlight %}
*See also*
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}}
{% endautocrossref %}

View file

@ -0,0 +1,68 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/dumpwallet.md" %}
##### DumpWallet
{% include helpers/subhead-links.md %}
{% assign summary_dumpWallet="creates or overwrites a file with all wallet keys in a human-readable format." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an unencrypted
wallet.*
The `dumpwallet` RPC {{summary_dumpWallet}}
*Parameter #1---a filename*
{% itemplate ntpd1 %}
- n: "Filename"
t: "string"
p: "Required<br>(exactly 1)"
d: "The file in which the wallet dump will be placed. May be prefaced by an absolute file path. An existing file with that name will be overwritten"
{% enditemplate %}
*Result---`null` or error*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always `null` whether success or failure. The JSON-RPC error and message fields will be set if a failure occurred"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Create a wallet dump and then print its first 10 lines.
{% highlight bash %}
bitcoin-cli -testnet dumpwallet /tmp/dump.txt
head /tmp/dump.txt
{% endhighlight %}
Results (only showing the first 10 lines):
{% highlight bash %}
# Wallet dump created by Bitcoin v0.9.1.0-g026a939-beta (Tue, 8 Apr 2014 12:04:06 +0200)
# * Created on 2014-04-29T20:46:09Z
# * Best block at time of backup was 227221 (0000000026ede4c10594af8087748507fb06dcd30b8f4f48b9cc463cabc9d767),
# mined on 2014-04-29T21:15:07Z
cTtefiUaLfXuyBXJBBywSdg8soTEkBNh9yTi1KgoHxUYxt1xZ2aA 2014-02-05T15:44:03Z label=test1 # addr=mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck
cQNY9v93Gyt8KmwygFR59bDhVs3aRDkuT8pKaCBpop82TZ8ND1tH 2014-02-05T16:58:41Z reserve=1 # addr=mp4MmhTp3au21HPRz5waf6YohGumuNnsqT
cNTEPzZH9mjquFFADXe5S3BweNiHLUKD6PvEKEsHApqjX4ZddeU6 2014-02-05T16:58:41Z reserve=1 # addr=n3pdvsxveMBkktjsGJixfSbxacRUwJ9jQW
cTVNtBK7mBi2yc9syEnwbiUpnpGJKohDWzXMeF4tGKAQ7wvomr95 2014-02-05T16:58:41Z change=1 # addr=moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7
cNCD679B4xi17jb4XeLpbRbZCbYUugptD7dCtUTfSU4KPuK2DyKT 2014-02-05T16:58:41Z reserve=1 # addr=mq8fzjxxVbAKxUGPwaSSo3C4WaUxdzfw3C
{% endhighlight %}
*See also*
* [BackupWallet][rpc backupwallet]: {{summary_backupWallet}}
* [ImportWallet][rpc importwallet]: {{summary_importWallet}}
{% endautocrossref %}

View file

@ -0,0 +1,64 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/encryptwallet.md" %}
##### EncryptWallet
{% include helpers/subhead-links.md %}
{% assign summary_encryptWallet="encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys." %}
{% autocrossref %}
*Requires wallet support.*
The `encryptwallet` RPC {{summary_encryptWallet}}
{{WARNING}} if using this RPC on the command line, remember
that your shell probably saves your command lines (including the value
of the passphrase parameter). In addition, there is no RPC to completely
disable encryption. If you want to return to an unencrypted wallet, you
must create a new wallet and restore your data from a backup made with
the `dumpwallet` RPC.
*Parameter #1---a passphrase*
{% itemplate ntpd1 %}
- n: "Passphrase"
t: "string"
p: "Required<br>(exactly 1)"
d: "The passphrase to use for the encrypted wallet. Must be at least one character"
{% enditemplate %}
*Result---a notice (with program shutdown)*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "A notice that the server is stopping and that you need to make a new backup. The wallet is now encrypted"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet encryptwallet "test"
{% endhighlight %}
Result:
{% highlight text %}
wallet encrypted; Bitcoin server stopping, restart to run with encrypted
wallet. The keypool has been flushed, you need to make a new backup.
{% endhighlight %}
*See also*
* [WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}
* [WalletLock][rpc walletlock]: {{summary_walletLock}}
* [WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}
{% endautocrossref %}

View file

@ -0,0 +1,64 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/estimatefee.md" %}
##### EstimateFee
{% include helpers/subhead-links.md %}
{% assign summary_estimateFee="estimates the transaction fee per kilobyte that needs to be paid for a transaction to be included within a certain number of blocks." %}
{% autocrossref %}
The `estimatefee` RPC {{summary_estimateFee}}
*Parameter #1---how many blocks the transaction may wait before being included*
{% itemplate ntpd1 %}
- n: "Blocks"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block. Has to be between 2 and 25 blocks"
{% enditemplate %}
*Result---the fee the transaction needs to pay per kilobyte*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The estimated fee the transaction should pay in order to be included within the specified number of blocks. If the node doesn't have enough information to make an estimate, the value `-1` will be returned"
{% enditemplate %}
*Examples from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli estimatefee 6
{% endhighlight %}
Result:
{% highlight json %}
0.00162556
{% endhighlight %}
Requesting data the node can't calculate (out of range):
{% highlight bash %}
bitcoin-cli estimatefee 100
{% endhighlight %}
Result:
{% highlight json %}
-1
{% endhighlight %}
*See also*
* [SetTxFee][rpc settxfee]: {{summary_setTxFee}}
{% endautocrossref %}

View file

@ -0,0 +1,70 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/estimatepriority.md" %}
##### EstimatePriority
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_estimatePriority="estimates the priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction." %}
*Added in Bitcoin Core 0.10.0.*
The `estimatepriority` RPC {{summary_estimatePriority}} This should not to be confused with the `prioritisetransaction` RPC which will remain supported for adding fee deltas to transactions.
{{WARNING}} `estimatepriority` has been [removed](https://github.com/bitcoin/bitcoin/commit/fe282acd7604b5265762b24e531bdf1ebb1f009b) and will no longer be available in the next major release (planned for Bitcoin Core 0.15.0). Use the RPC listed in the "See Also" subsection below instead.
Transaction priority is relative to a transaction's byte size.
*Parameter #1---how many blocks the transaction may wait before being included as a free high-priority transaction*
{% itemplate ntpd1 %}
- n: "Blocks"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block based purely on its priority"
{% enditemplate %}
*Result---the priority a transaction needs*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The estimated priority the transaction should have in order to be included within the specified number of blocks. If the node doesn't have enough information to make an estimate, the value `-1` will be returned"
{% enditemplate %}
*Examples from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli estimatepriority 6
{% endhighlight %}
Result:
{% highlight json %}
718158904.10958910
{% endhighlight %}
Requesting data the node can't calculate yet:
{% highlight bash %}
bitcoin-cli estimatepriority 100
{% endhighlight %}
Result:
{% highlight json %}
-1.00000000
{% endhighlight %}
*See also*
* [EstimateFee][rpc estimatefee]: {{summary_estimateFee}}
{% endautocrossref %}

View file

@ -0,0 +1,142 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/fundrawtransaction.md" %}
##### FundRawTransaction
{% include helpers/subhead-links.md %}
{% assign summary_fundRawTransaction="adds inputs to a transaction until it has enough in value to meet its out value." %}
{% autocrossref %}
*Requires wallet support.*
The `fundrawtransaction` RPC {{summary_fundRawTransaction}} This will not modify existing inputs, and will add one change output to the outputs.
Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that.
All existing inputs must have their previous output transaction be in the wallet.
*Parameter #1---The hex string of the raw transaction*
{% itemplate ntpd1 %}
- n: "Hexstring"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hex string of the raw transaction"
{% enditemplate %}
*Parameter #2---Additional options*
{% itemplate ntpd1 %}
- n: "Options"
t: "Object"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>Additional options"
- n: "→ <br>`changeAddress`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The bitcoin address to receive the change. If not set, the address is chosen from address pool"
- n: "→ <br>`changePosition`"
t: "nummeric (int)"
p: "Optional<br>(0 or 1)"
d: "The index of the change output. If not set, the change position is randomly chosen"
- n: "→ <br>`includeWatching`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Inputs from watch-only addresses are also considered. The default is `false`"
- n: "→ <br>`lockUnspent`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "The selected outputs are locked after running the rpc call. The default is `false`"
- n: "→ <br>`reserveChangeKey`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.14.0*<br><br>Reserves the change output key from the keypool. The default is `true`. Before 0.14.0, the used keypool key was never marked as change-address key and directly returned to the keypool (leading to address reuse)."
- n: "→ <br>`feeRate`"
t: "numeric (bitcoins)"
p: "Optional<br>(0 or 1)"
d: "The specific feerate you are willing to pay(BTC per KB). If not set, the wallet determines the fee"
- n: "→ <br>`subtractFeeFromOutputs`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "A json array of integers. The fee will be equally deducted from the amount of each specified output. The outputs are specified by their zero-based index, before any change output is added."
- n: "→ →<br>Output index"
t: numeric (int)
p: Optional<br>(0 or more)
d: "A output index number (vout) from which the fee should be subtracted.
If multiple vouts are provided, the total fee will be divided by the
numer of vouts listed and each vout will have that amount subtracted
from it"
{% enditemplate %}
*Result---information about the created transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object including information about the created transaction"
- n: "→ <br>hex"
t: "string (hex)"
p: "Required<br>(Exactly 1)"
d: "The resulting unsigned raw transaction in serialized transaction format encoded as hex"
- n: "→ <br>fee"
t: "numeric (bitcoins)"
p: "Required<br>(Exactly 1)"
d: "Fee in BTC the resulting transaction pays"
- n: "→ <br>changepos"
t: "numeric (int)"
p: "Required<br>(Exactly 1)"
d: "The position of the added change output, or `-1` if no change output was added"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli -testnet fundrawtransaction 01000000011da9283b4ddf8d\
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffff\
ffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a51\
59f58488ac00000000
'{
"changeAddress": "15gJiApWFGTN2iTteQwQbqasdT6dwGWwv6",
"changePosition" : 1,
"includeWatching" : false,
"lockUnspents" : true,
"feeRate" : 0.0001
}'
{% endhighlight %}
Result:
{% highlight text %}
{
"hex": "01000000011da9283b4ddf8d89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffffffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000",
"fee": 0.0000245,
"changepos": 2
}
{% endhighlight %}
*See also*
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
* [Serialized Transaction Format][raw transaction format]
{% endautocrossref %}

View file

@ -0,0 +1,67 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/generate.md" %}
##### Generate
{% include helpers/subhead-links.md %}
{% assign summary_generate="mines blocks immediately (before the RPC call returns)." %}
{% autocrossref %}
*Requires wallet support. Can only be used on the regtest network.*
The `generate` RPC {{summary_generate}}
*Parameter #1---the number of blocks to generate*
{% itemplate ntpd1 %}
- n: "`numblocks`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of blocks to generate. The RPC call will not return until all blocks have been generated."
{% enditemplate %}
*Result---the generated block header hashes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing the block header hashes of the generated blocks (may be empty if used with `generate 0`)"
- n: "→<br>Header Hashes"
t: "string (hex)"
p: "Required<br>(1 or more)"
d: "The hashes of the headers of the blocks generated in regtest mode, as hex in RPC byte order"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Using regtest mode, generate 2 blocks:
{% highlight bash %}
dash-cli -regtest generate 2
{% endhighlight %}
Result:
{% highlight json %}
[
"55a4c47da8151c0823eec22c41ebc6d690a0288302179625bae9eb6f36808266",
"3f07b9aa4e3bcd5518610945c4a6b32699acac71b1762605ff79ba553111fc79"
]
{% endhighlight %}
*See also*
* [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
{% endautocrossref %}

View file

@ -0,0 +1,93 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/generatetoaddress.md" %}
##### GenerateToAddress
{% include helpers/subhead-links.md %}
{% assign summary_generateToAddress="mines blocks immediately to a specified address." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
**_Not implemented in Dash Core (as of 0.12.2)_**
{% comment %}
*Requires wallet support.*
The `generatetoaddress` RPC {{summary_generateToAddress}}
*Parameter #1---the number of blocks to generate*
{% itemplate ntpd1 %}
- n: "Blocks"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of blocks to generate. The RPC call will not return until all blocks have been generated or the maxium number of iterations has been reached"
{% enditemplate %}
*Parameter #2---a transaction identifier (TXID)*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The address to send the newly generated Bitcoin to"
{% enditemplate %}
*Parameter #3---the maximum number of iterations to try*
{% itemplate ntpd1 %}
- n: "Maxtries"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The maximum number of iterations that are tried to create the requested number of blocks. Default is `1000000`"
{% enditemplate %}
*Result---the generated block header hashes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing the block header hashes of the generated blocks (may be empty if used with `generate 0`)"
- n: "→<br>Header Hashes"
t: "string (hex)"
p: "Required<br>(1 or more)"
d: "The hashes of the headers of the blocks generated, as hex in RPC byte order"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
Using regtest mode, generate 2 blocks with maximal 500000 iterations:
{% highlight bash %}
bitcoin-cli -regtest generatetoaddress 2 "1BRo7qrYHMPrzdBDzfjmzt\
eBdYAyTMXW75" 500000
{% endhighlight %}
Result:
{% highlight json %}
[
"36252b5852a5921bdfca8701f936b39edeb1f8c39fffe73b0d8437921401f9af",
"5f2956817db1e386759aa5794285977c70596b39ea093b9eab0aa4ba8cd50c06"
]
{% endhighlight %}
*See also*
* [Generate][rpc generate]: {{summary_generate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
{% endcomment %}
{% endautocrossref %}

View file

@ -0,0 +1,54 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaccount.md" %}
##### GetAccount
{% include helpers/subhead-links.md %}
{% assign summary_getAccount="returns the name of the account associated with the given address." %}
{% autocrossref %}
*Requires wallet support.*
The `getaccount` RPC {{summary_getAccount}}
*Parameter #1---a Bitcoin address*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "A P2PKH or P2SH Bitcoin address belonging either to a specific account or the default account (\"\")"
{% enditemplate %}
*Result---an account name*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of an account, or an empty string (\"\", the default account)"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getaccount mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN
{% endhighlight %}
Result:
{% highlight text %}
doc test
{% endhighlight %}
*See also*
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
{% endautocrossref %}

View file

@ -0,0 +1,61 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaccountaddress.md" %}
##### GetAccountAddress
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getAccountAddress="returns the current Bitcoin address for receiving payments to this account. If the account doesn't exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address." %}
*Requires wallet support.*
The `getaccountaddress` RPC {{summary_getAccountAddress}}
{{WARNING}} `getaccountaddress` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---an account name*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of an account. Use an empty string (\"\") for the default account. If the account doesn't exist, it will be created"
{% enditemplate %}
*Result---a bitcoin address*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "An address, belonging to the account specified, which has not yet received any payments"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Get an address for the default account:
{% highlight bash %}
bitcoin-cli -testnet getaccountaddress ""
{% endhighlight %}
Result:
{% highlight text %}
msQyFNYHkFUo4PG3puJBbpesvRCyRQax7r
{% endhighlight %}
*See also*
* [GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}
* [GetRawChangeAddress][rpc getrawchangeaddress]: {{summary_getRawChangeAddress}}
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
{% endautocrossref %}

View file

@ -0,0 +1,109 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddednodeinfo.md" %}
##### GetAddedNodeInfo
{% include helpers/subhead-links.md %}
{% assign summary_getAddedNodeInfo="returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the `addnode` RPC will have their information displayed." %}
{% autocrossref %}
The `getaddednodeinfo` RPC {{summary_getAddedNodeInfo}}
*Parameter #1---whether to display connection information*
{% itemplate ntpd1 %}
- n: "Dummy"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Kept for historical purposes but ignored<br><br>*Removed in Bitcoin Core 0.14.0*"
{% enditemplate %}
*Parameter #2---what node to display information about*
{% itemplate ntpd1 %}
- n: "`node`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The node to get information about in the same `<IP address>:<port>` format as the `addnode` RPC. If this parameter is not provided, information about all added nodes will be returned"
{% enditemplate %}
*Result---a list of added nodes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing objects describing each added node. If no added nodes are present, the array will be empty. Nodes added with `onetry` will not be returned"
- n: "→<br>Added Node<!--noref-->"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object containing details about a single added node"
- n: "→ →<br>`addednode`"
t: "string"
p: "Required<br>(exactly 1)"
d: "An added node in the same `<IP address>:<port>` format as used in the `addnode` RPC."
- n: "→ →<br>`connected`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "This will be set to `true` if the node is currently connected and `false` if it is not"
- n: "→ →<br>`addresses`"
t: "array"
p: "Requred<br>(exactly 1)"
d: "This will be an array of addresses<!--noref--> belonging to the added node"
- n: "→ → →<br>Address<!--noref-->"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing one of this node's addresses<!--noref-->"
- n: "→ → → →<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "An IP address and port number of the node. If the node was added using a DNS address, this will be the resolved IP address"
- n: "→ → → →<br>`connected`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Whether or not the local node is connected to this addnode using this IP address. Valid values are:<br>`false` for not connected<br>`inbound` if the addnode connected to us<br>`outbound` if we connected to the addnode"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli getaddednodeinfo true
{% endhighlight %}
Result (real hostname and IP address replaced with [RFC5737][] reserved address):
{% highlight json %}
[
{
"addednode": "192.0.2.113:19999",
"connected": true,
"addresses": [
{
"address": "192.0.2.113:19999",
"connected": "outbound"
}
]
}
]
{% endhighlight %}
*See also*
* [AddNode][rpc addnode]: {{summary_addNode}}
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,75 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddressbalance.md" %}
##### GetAddressBalance
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getAddressBalance="returns the balance for address(es)." %}
*Requires wallet support and `-addressindex` Dash Core command-line/configuration-file parameter to be enabled.*
The `getaddressbalance` RPC {{summary_getAddressBalance}}
*Parameter #1---an array of addresses*
{% itemplate ntpd1 %}
- n: "`addresses`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An array of P2PKH or P2SH Dash address(es)"
- n: "→Address"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "The base58check encoded address"
{% enditemplate %}
*Result---the current balance in duffs and the total number of duffs received (including change)*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object listing the current balance and total amount received (including change), or an error if any address is invalid"
- n: "→<br>`balance`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The current balance in duffs"
- n: "→<br>`received`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The total number of duffs received (including change)"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the balance for an address:
{% highlight bash %}
dash-cli getaddressbalance '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"]}'
{% endhighlight %}
Result:
{% highlight json %}
{
"balance": 0,
"received": 10000100
}
{% endhighlight %}
*See also*
* [GetBalance][rpc getbalance]: {{summary_getBalance}}
* [GetUnconfirmedBalance][rpc getunconfirmedbalance]: {{summary_getUnconfirmedBalance}}
{% endautocrossref %}

View file

@ -0,0 +1,124 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddressdeltas.md" %}
##### GetAddressDeltas
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getAddressDeltas="returns all changes for an address." %}
*Requires wallet support and `-addressindex` Dash Core command-line/configuration-file parameter to be enabled.*
The `getaddressdeltas` RPC {{summary_getAddressDeltas}}
*Parameter #1---an array of addresses*
{% itemplate ntpd1 %}
- n: "`addresses`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An array of P2PKH or P2SH Dash address(es)"
- n: "→Address"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "The base58check encoded address"
{% enditemplate %}
*Parameter #2---the start block height*
{% itemplate ntpd1 %}
- n: "`start`"
t: "number (int)"
p: "Optional<br>(exactly 1)"
d: "The start block height"
{% enditemplate %}
*Parameter #3---the end block height*
{% itemplate ntpd1 %}
- n: "`end`"
t: "number (int)"
p: "Optional<br>(exactly 1)"
d: "The end block height"
{% enditemplate %}
*Result---information about all changes for the address(es)*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of JSON objects, with each object describing a transaction involving one of the requested addresses"
- n: "→<br>Delta"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular address delta"
- n: "→→<br>`satoshis`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The difference of duffs"
- n: "→→<br>`txid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The related txid"
- n: "→→<br>`blockindex`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The related input or output index"
- n: "→→<br>`height`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The block height"
- n: "→→<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The base58check encoded address"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the deltas for an address:
{% highlight bash %}
dash-cli getaddressdeltas '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"], "start":5000, "end":7500}'
{% endhighlight %}
Result:
{% highlight json %}
[
{
"satoshis": 10000100,
"txid": "1fe86e463a9394d4ccd9a5ff1c6b483c95b4350ffdb055b55dc3615111e977de",
"index": 18,
"blockindex": 1,
"height": 6708,
"address": "yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"
},
{
"satoshis": -10000100,
"txid": "6cb4379eec45cd3bb08b8f4c3a101b8cd89795e24f2cb8288a9941a85fb114cf",
"index": 0,
"blockindex": 1,
"height": 7217,
"address": "yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"
}
]
{% endhighlight %}
{% endautocrossref %}

View file

@ -0,0 +1,69 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddressesbyaccount.md" %}
##### GetAddressesByAccount
{% include helpers/subhead-links.md %}
{% assign summary_getAddressesByAccount="returns a list of every address assigned to a particular account." %}
{% autocrossref %}
*Requires wallet support.*
The `getaddressesbyaccount` RPC {{summary_getAddressesByAccount}}
{{WARNING}} `getaddressesbyaccount` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---the account name*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account containing the addresses to get. To get addresses from the default account, pass an empty string (\"\")"
{% enditemplate %}
*Result---a list of addresses*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing all addresses belonging to the specified account. If the account has no addresses, the array will be empty"
- n: "Address"
t: "string (base58)"
p: "Optional<br>(1 or more)"
d: "A P2PKH or P2SH address belonging to the account"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Get the addresses assigned to the account "doc test":
{% highlight bash %}
bitcoin-cli -testnet getaddressesbyaccount "doc test"
{% endhighlight %}
Result:
{% highlight json %}
[
"mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN",
"mft61jjkmiEJwJ7Zw3r1h344D6aL1xwhma",
"mmXgiR6KAhZCyQ8ndr2BCfEq1wNG2UnyG6"
]
{% endhighlight %}
*See also*
* [GetAccount][rpc getaccount]: {{summary_getAccount}}
* [GetBalance][rpc getbalance]: {{summary_getBalance}}
{% endautocrossref %}

View file

@ -0,0 +1,96 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddressmempool.md" %}
##### GetAddressMempool
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getAddressMempool="returns all mempool deltas for an address." %}
*Requires wallet support and `-addressindex` Dash Core command-line/configuration-file parameter to be enabled.*
The `getaddressmempool` RPC {{summary_getAddressMempool}}
*Parameter #1---an array of addresses*
{% itemplate ntpd1 %}
- n: "`addresses`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An array of P2PKH or P2SH Dash address(es)"
- n: "→Address"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "The base58check encoded address"
{% enditemplate %}
*Result---information about mempool deltas for the address(es)*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of JSON objects, with each object describing a transaction involving one of the requested addresses"
- n: "→Mempool Deltas"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular mempool address delta"
- n: "→→<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The base58check encoded address"
- n: "→→<br>`txid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The related txid"
- n: "→→<br>`index`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The related input or output index"
- n: "→→<br>`satoshis`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The difference of duffs"
- n: "→→<br>`timestamp`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The time the transaction entered the mempool (seconds)"
- n: "→→<br>`prevtxid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The previous txid (if spending)"
- n: "→→<br>`prevout`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The previous transaction output index (if spending)"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the deltas for an address:
{% highlight bash %}
dash-cli getaddressmempool '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"]}'
{% endhighlight %}
Result:
{% highlight text %}
Example result needed
{% endhighlight %}
{% endautocrossref %}

View 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/rpcs/rpcs/getaddresstxids.md" %}
##### GetAddressTxids
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getAddressTxids="returns the txids for an address(es)." %}
*Requires wallet support and `-addressindex` Dash Core command-line/configuration-file parameter to be enabled.*
The `getaddresstxids` RPC {{summary_getAddressTxids}}
*Parameter #1---an array of addresses*
{% itemplate ntpd1 %}
- n: "`addresses`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An array of P2PKH or P2SH Dash address(es)"
- n: "→Address"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "The base58check encoded address"
{% enditemplate %}
*Parameter #2---the start block height*
{% itemplate ntpd1 %}
- n: "`start`"
t: "number (int)"
p: "Optional<br>(exactly 1)"
d: "The start block height"
{% enditemplate %}
*Parameter #3---the end block height*
{% itemplate ntpd1 %}
- n: "`end`"
t: "number (int)"
p: "Optional<br>(exactly 1)"
d: "The end block height"
{% enditemplate %}
*Result---information about txids for the address(es)*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of txids related to the requested address(es)"
- n: "→<br>TXID"
t: "string"
p: "Required<br>(1 or more)"
d: "The transaction id"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the deltas for an address:
{% highlight bash %}
dash-cli getaddresstxids '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"], "start":5000, "end":7500}'
{% endhighlight %}
Result:
{% highlight json %}
[
"1fe86e463a9394d4ccd9a5ff1c6b483c95b4350ffdb055b55dc3615111e977de",
"6cb4379eec45cd3bb08b8f4c3a101b8cd89795e24f2cb8288a9941a85fb114cf"
]
{% endhighlight %}
{% endautocrossref %}

View file

@ -0,0 +1,100 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddressutxos.md" %}
##### GetAddressUtxos
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_getAddressUtxos="returns all unspent outputs for an address." %}
*Requires wallet support and `-addressindex` Dash Core command-line/configuration-file parameter to be enabled.*
The `getaddressutxos` RPC {{summary_getAddressUtxos}}
*Parameter #1---an array of addresses*
{% itemplate ntpd1 %}
- n: "`addresses`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An array of P2PKH or P2SH Dash address(es)"
- n: "→Address"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "The base58check encoded address"
{% enditemplate %}
*Result---information about unspent outputs for the address(es)*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of JSON objects, with each object describing a transaction involving one of the requested addresses"
- n: "→Unspent outputs"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular unspent output for the requested address(es)"
- n: "→→<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The base58check encoded address"
- n: "→→<br>`txid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The output txid"
- n: "→→<br>`outputIndex`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The output index"
- n: "→→<br>`script`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The script hex encoded"
- n: "→→<br>`satoshis`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The number of duffs of the output"
- n: "→→<br>`height`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The block height"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the unspent outputs for an address:
{% highlight bash %}
dash-cli getaddressutxos '{"addresses": ["yLeC3F9UxJmFaRaf5yzH7FDc7RdvBasi84"]}'
{% endhighlight %}
Result:
{% highlight json %}
[
{
"address": "yLeC3F9UxJmFaRaf5yzH7FDc7RdvBasi84",
"txid": "ef7bcd083db8c9551ca295698c3b7a6811288fae9944018d2a660a0f939bdb35",
"outputIndex": 0,
"script": "76a914038b8a73338c8f9c22024338198d63ff7c4cb4c088ac",
"satoshis": 1000010000,
"height": 7683
}
]
{% endhighlight %}
{% endautocrossref %}

View file

@ -0,0 +1,68 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getbalance.md" %}
##### GetBalance
{% include helpers/subhead-links.md %}
{% assign summary_getBalance="gets the balance in decimal bitcoins across all accounts or for a particular account." %}
{% autocrossref %}
*Requires wallet support.*
The `getbalance` RPC {{summary_getBalance}}
*Parameter #1---an account name*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The name of an account to get the balance for. An empty string (\"\") is the default account. The string `*` will get the balance for all accounts (this is the default behavior)"
{% enditemplate %}
*Parameter #2---the minimum number of confirmations*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Parameter #3---whether to include watch-only addresses*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Result---the balance in bitcoins*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The balance of the account (or all accounts) in bitcoins"
{% enditemplate %}
*Examples from Bitcoin Core 0.10.0*
Get the balance for the "test1" account, including transactions with
at least one confirmation and those spent to watch-only addresses in
that account.
{% highlight bash %}
bitcoin-cli -testnet getbalance "test1" 1 true
{% endhighlight %}
Result:
{% highlight json %}
1.99900000
{% endhighlight %}
*See also*
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}}
* [GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}}
* [GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}
{% endautocrossref %}

View file

@ -0,0 +1,45 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getbestblockhash.md" %}
##### GetBestBlockHash
{% include helpers/subhead-links.md %}
{% assign summary_getBestBlockHash="returns the header hash of the most recent block on the best block chain." %}
{% autocrossref %}
The `getbestblockhash` RPC {{summary_getBestBlockHash}}
*Parameters: none*
*Result---hash of the tip from the best block chain*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the block header from the most recent block on the best block chain, encoded as hex in RPC byte order"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getbestblockhash
{% endhighlight %}
Result:
{% highlight text %}
00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,200 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblock.md" %}
##### GetBlock
{% include helpers/subhead-links.md %}
{% assign summary_getBlock="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 `getblock` RPC {{summary_getBlock}}
*Parameter #1---header hash*
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "string (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---whether to get JSON or hex output*
{% itemplate ntpd1 %}
- n: "Format"
t: "boolean"
p: "Optional<br>(true or false)"
d: "Set to `false` to get the block in serialized block format; set to `true` (the default) to get the decoded block as a JSON object"
{% enditemplate %}
*Result (if format was `false`)---a serialized block*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (hex)/null"
p: "Required<br>(exactly 1)"
d: "The requested block as a serialized block, encoded as hex, or JSON `null` if an error occurred"
{% enditemplate %}
*Result (if format was `true` or omitted)---a JSON block*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "An object containing the requested block, or JSON `null` if an error occurred"
- 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>`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>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"
- 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 the TXIDs of 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 block time in Unix epoch time"
- 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: "Optional<br>(0 or 1)"
d: "The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block"
- 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 %}
*Example from Dash Core 0.12.2*
Get a block in raw hex:
{% highlight bash %}
dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84 \
false
{% endhighlight %}
Result (wrapped):
{% highlight text %}
0100002011f5719a0a0c4881ff98b4a68c1c828dc3b10f5b51033f5f93d48dbf\
000000004b8e38f197d6ee878e160d2bae3ce05ab898a6252458ec67ce770140\
260397c4dd2ed659a1dd001d00636b5601010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff4b02041204dd\
2ed65908fabe6d6d7445746d63506b62572d2d35584853467a765a6748696972\
30657a3a6f6d656e010000000000000017fffff9020000000d2f6e6f64655374\
726174756d2f00000000058028bb13010000001976a914bad55652dffb1af943\
41015c94feea79793442fd88ac40e553b1020000001976a9142b7856de53d4c1\
823090c98f8ad79862842c09b588ac4094dd89000000001976a914c2c29ebc78\
7954ef99d01c5f79115abf7012fb8e88ac4094dd89000000001976a914d7b47d\
4b40a23c389f5a17754d7f60f511c7d0ec88ac4094dd89000000001976a914dc\
3e0793134b081145ec0c67a9c72a7b297df27c88ac00000000
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84
{% endhighlight %}
Result:
{% highlight json %}
{
"hash": "0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84",
"confirmations": 3,
"size": 377,
"height": 4612,
"version": 536870913,
"merkleroot": "c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b",
"tx": [
"c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"
],
"time": 1507208925,
"mediantime": 1507208645,
"nonce": 1449878272,
"bits": "1d00dda1",
"difficulty": 1.155066358813473,
"chainwork": "000000000000000000000000000000000000000000000000000001c3e86f0f04",
"previousblockhash": "00000000bf8dd4935f3f03515b0fb1c38d821c8ca6b498ff81480c0a9a71f511",
"nextblockhash": "0000000028817c7fce55d802f3647640600535a983d00e16076f284ec6cb001b"
}
{% endhighlight %}
*See also*
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,257 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md" %}
##### GetBlockChainInfo
{% include helpers/subhead-links.md %}
{% assign summary_getBlockChainInfo="provides information about the current state of the block chain." %}
{% autocrossref %}
The `getblockchaininfo` RPC {{summary_getBlockChainInfo}}
*Parameters: none*
*Result---A JSON object providing information about the block chain*
{% 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<br>(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: "*Added in Bitcoin Core 0.11.0*<br><br>Indicates if the blocks are subject to pruning"
- n: "→<br>`pruneheight`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.11.0*<br><br>The lowest-height complete block stored if pruning 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`"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getblockchaininfo
{% endhighlight %}
Result:
{% highlight json %}
{
"chain": "test",
"blocks": 4622,
"headers": 4622,
"bestblockhash": "000000007f4141e557309da09911b1c3c65b8e9eed3f5e940f7083aec8999ac7",
"difficulty": 1.380236305048335,
"mediantime": 1507209819,
"verificationprogress": 0.9999053826626874,
"chainwork": "000000000000000000000000000000000000000000000000000001d17aeaf58b",
"pruned": false,
"softforks": [
{
"id": "bip34",
"version": 2,
"enforce": {
"status": true,
"found": 100,
"required": 51,
"window": 100
},
"reject": {
"status": true,
"found": 100,
"required": 75,
"window": 100
}
},
{
"id": "bip66",
"version": 3,
"enforce": {
"status": true,
"found": 100,
"required": 51,
"window": 100
},
"reject": {
"status": true,
"found": 100,
"required": 75,
"window": 100
}
},
{
"id": "bip65",
"version": 4,
"enforce": {
"status": true,
"found": 100,
"required": 51,
"window": 100
},
"reject": {
"status": true,
"found": 100,
"required": 75,
"window": 100
}
}
],
"bip9_softforks": [
{
"id": "csv",
"status": "started"
},
{
"id": "dip0001",
"status": "started"
}
]
}
{% endhighlight %}
*See also*
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
* [GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,45 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockcount.md" %}
##### GetBlockCount
{% include helpers/subhead-links.md %}
{% assign summary_getBlockCount="returns the number of blocks in the local best block chain." %}
{% autocrossref %}
The `getblockcount` RPC {{summary_getBlockCount}}
*Parameters: none*
*Result---the number of blocks in the local best block chain*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of blocks in the local best block chain. For a new node with only the hardcoded genesis block, this number will be 0"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getblockcount
{% endhighlight %}
Result:
{% highlight text %}
4627
{% endhighlight %}
*See also*
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBlock][rpc getblock]: {{summary_getBlock}}
{% endautocrossref %}

View file

@ -0,0 +1,53 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockhash.md" %}
##### GetBlockHash
{% include helpers/subhead-links.md %}
{% assign summary_getBlockHash="returns the header hash of a block at the given height in the local best block chain." %}
{% autocrossref %}
The `getblockhash` RPC {{summary_getBlockHash}}
*Parameter---a block height*
{% itemplate ntpd1 %}
- n: "Block Height"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of the block whose header hash should be returned. The height of the hardcoded genesis block is 0"
{% enditemplate %}
*Result---the block header hash*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (hex)/null"
p: "Required<br>(exactly 1)"
d: "The hash of the block at the requested height, encoded as hex in RPC byte order, or JSON `null` if an error occurred"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getblockhash 4000
{% endhighlight %}
Result:
{% highlight text %}
00000ce22113f3eb8636e225d6a1691e132fdd587aed993e1bc9b07a0235eea4
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,78 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockhashes.md" %}
##### GetBlockHashes
{% include helpers/subhead-links.md %}
{% assign summary_getBlockHashes="returns array of hashes of blocks within the timestamp range provided (requires `timestampindex` to be enabled)." %}
{% autocrossref %}
*Added in Dash Core 0.12.1*
The `getblockhashes` RPC {{summary_getBlockHashes}}
*Parameter #1---high block timestamp*
{% itemplate ntpd1 %}
- n: "Block Timestamp"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block timestamp for the newest block hash that should be returned."
{% enditemplate %}
*Parameter #2---low block timestamp*
{% itemplate ntpd1 %}
- n: "Block Timestamp"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block timestamp for the oldest block hash that should be returned."
{% enditemplate %}
*Result---the block header hashes in the give time range*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "The hashes of the blocks in the requested time range"
- n: "→<br>`hash`"
t: "string (hex)"
p: "Required<br>(1 or more)"
d: "The hash of a block in the chain, encoded as hex in RPC byte order"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getblockhashes 1507555793 1507554793
{% endhighlight %}
Result:
{% highlight json %}
[
"0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89",
"000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8",
"000000004bbb3828db1c4d4491760336cec215087819ab656336f30d4095e3d2",
"00000000ad2df2149aca2261a9a87c41e139dfe8f73d91db7ec0c1837fee21a0",
"0000000074068a9e3a271d165da3deb28bc3f8c751dde97f460d8078d92a9d06"
]
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,190 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockheader.md" %}
##### GetBlockHeader
{% include helpers/subhead-links.md %}
{% assign summary_getBlockHeader="gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header." %}
{% autocrossref %}
*Added in Bitcoin Core 0.12.0*
The `getblockheader` RPC {{summary_getBlockHeader}}
*Parameter #1---header hash*
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the block header to get, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---JSON or hex output*
{% itemplate ntpd1 %}
- n: "Format"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `false` to get the block header in serialized block format; set to `true` (the default) to get the decoded block header as a JSON object"
{% enditemplate %}
*Result (if format was `false`)---a serialized block header*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (hex)/null"
p: "Required<br>(exactly 1)"
d: "The requested block header as a serialized block, encoded as hex, or JSON `null` if an error occurred"
{% enditemplate %}
*Result (if format was `true` or omitted)---a JSON block header*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "An object containing the requested block, or JSON `null` if an error occurred"
- 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>`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>`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 time of the block"
- n: "→<br>`mediantime`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The computed median time of the previous 11 blocks. 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: "Optional<br>(0 or 1)"
d: "The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block"
- 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 %}
*Changes from Bitcoin - Following items not present in Dash result*
{% itemplate ntpd1 %}
- n: "→<br>`versionHex`"
t: "number (hex)"
p: "Required<br>(exactly 1)"
d: "This block's hex version number. See [block version numbers][section block versions]"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get a block header in raw hex:
{% highlight bash %}
dash-cli -testnet getblockheader \
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078 \
false
{% endhighlight %}
Result (wrapped):
{% highlight text %}
01000020f61396cfd2747e94cfa088fe1f7875d8171accc22d6e5616edca0cb8\
00000000c31eb96ee1d9e78d61a601371a348c19e4e59698d0ff7869334b72cb\
7ffb76893b41d6593016011d09b2aa3c
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
dash-cli -testnet getblockheader \
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078
{% endhighlight %}
Result:
{% highlight json %}
{
"hash": "00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078",
"confirmations": 7,
"height": 4635,
"version": 536870913,
"merkleroot": "8976fb7fcb724b336978ffd09896e5e4198c341a3701a6618de7d9e16eb91ec3",
"time": 1507213627,
"mediantime": 1507213022,
"nonce": 1017819657,
"bits": "1d011630",
"difficulty": 0.920228600314536,
"chainwork": "000000000000000000000000000000000000000000000000000001e06428c09a",
"previousblockhash": "00000000b80ccaed16566e2dc2cc1a17d875781ffe88a0cf947e74d2cf9613f6",
"nextblockhash": "000000003b1aa290db62ae7cfb4dbb67c8e1402a40ef387587f930b8ec3b45db"
}
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}}
* [GetBlockHeaders][rpc getblockheaders]: {{summary_getBlockHeaders}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,219 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockheaders.md" %}
##### GetBlockHeaders
{% include helpers/subhead-links.md %}
{% assign summary_getBlockHeaders="returns an array of items with information about the requested number of blockheaders starting from the requested hash." %}
{% autocrossref %}
*Added in Dash Core 0.12.1*
The `getblockheaders` RPC {{summary_getBlockHeaders}}
*Parameter #1---header hash*
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the block header to get, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---number of headers to return*
{% itemplate ntpd1 %}
- n: "Count"
t: "number"
p: "Optional<br>(exactly 1)"
d: "The number of block headers to get"
{% enditemplate %}
*Parameter #3---JSON or hex output*
{% itemplate ntpd1 %}
- n: "Verbose"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `false` to get the block headers in serialized block format; set to `true` (the default) to get the decoded block headers as a JSON object"
{% enditemplate %}
*Result (if format was `false`)---a serialized block header*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "The requested block header(s) as a serialized block"
- n: "→<br>`header`"
t: "string (hex)"
p: "Required<br>(1 or more)"
d: "The block header encoded as hex in RPC byte order"
{% enditemplate %}
*Result (if format was `true` or omitted)---a JSON block header*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects each containing a block header, or JSON `null` if an error occurred"
- n: "→<br>Block Header"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "An object containing a block header"
- 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>`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>`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 time of the block"
- n: "→ →<br>`mediantime`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The computed median time of the previous 11 blocks. 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: "Optional<br>(0 or 1)"
d: "The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block"
- 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 %}
*Example from Dash Core 0.12.2*
Get two block headers in raw hex:
{% highlight bash %}
dash-cli -testnet getblockheaders \
0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89 \
2 false
{% endhighlight %}
Result (wrapped):
{% highlight text %}
[
"010000207216dc7b7c898ba3fc0b39d1fd16756b97b1e07e3eb5c64d1510a64b0000000\
0bb64e58a0be4276bf3e9c366bba960953ef9e47a8f62342476be56a5dfa7a2670276db\
59eae1001d0735577e",
"01000020894bfce6e49bd50015de7fe934a3cdabbec238c2cdd56bbc6f6ca1100000000\
0edb2a018d535de70b0622a3303dc329dcb315e7507d074c0c641501c58d88aa08576db\
59c5db001d03cf8986"
]
{% endhighlight %}
Get the same two block headers in JSON:
{% highlight bash %}
dash-cli -testnet getblockheader \
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078 \
2 true
{% endhighlight %}
Result:
{% highlight json %}
[
{
"hash": "0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89",
"confirmations": 20,
"height": 6802,
"version": 536870913,
"merkleroot": "67a2a7dfa556be762434628f7ae4f93e9560a9bb66c3e9f36b27e40b8ae564bb",
"time": 1507554818,
"mediantime": 1507554058,
"nonce": 2119644423,
"bits": "1d00e1ea",
"difficulty": 1.1331569664903,
"chainwork": "0000000000000000000000000000000000000000000000000000092c7b511197",
"previousblockhash": "000000004ba610154dc6b53e7ee0b1976b7516fdd1390bfca38b897c7bdc1672",
"nextblockhash": "000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8"
},
{
"hash": "000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8",
"confirmations": 19,
"height": 6803,
"version": 536870913,
"merkleroot": "a08ad8581c5041c6c074d007755e31cb9d32dc03332a62b070de35d518a0b2ed",
"time": 1507554949,
"mediantime": 1507554181,
"nonce": 2257178371,
"bits": "1d00dbc5",
"difficulty": 1.164838875953147,
"chainwork": "0000000000000000000000000000000000000000000000000000092da5851d38",
"previousblockhash": "0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89",
"nextblockhash": "000000004bbb3828db1c4d4491760336cec215087819ab656336f30d4095e3d2"
}
]
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}}
* [GetBlockHeader][rpc getblockheader]: {{summary_getBlockHeader}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,361 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblocktemplate.md" %}
##### GetBlockTemplate
{% include helpers/subhead-links.md %}
{% assign summary_getBlockTemplate="gets a block template or proposal for use with mining software." %}
{% autocrossref %}
The `getblocktemplate` RPC {{summary_getBlockTemplate}} For more
information, please see the following resources:
* [Bitcoin Wiki GetBlockTemplate][wiki getblocktemplate]
* [BIP22][]
* [BIP23][]
*Parameter #1---a JSON request object*
{% itemplate ntpd1 %}
- n: "Request"
t: "object"
p: "Optional<br>(exactly 1)"
d: "A JSON request object"
- n: "→<br>`mode`"
t: "string"
p: "Optional<br>(exactly 1)"
d: "This must be set to \"template\" or omitted"
- n: "→<br>`capabilities`"
t: "array (string)"
p: "Optional<br>(0 or more)"
d: "A list of strings"
- n: "→ →<br>Capability"
t: "string"
p: "Optional<br>(exactly 1)"
d: "Client side supported feature, `longpoll`, `coinbasetxn`, `coinbasevalue`, `proposal`, `serverlist`, `workid`"
{% enditemplate %}
*Result---block template*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "A object containing a block template"
- n: "→<br>`capabilities`"
t: "array (string)"
p: "Required<br>(1 or more)"
d: "The client side supported features"
- n: "→ →<br>Capability"
t: "string"
p: "Optional<br>(0 or more)"
d: "A client side supported feature"
- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block version"
- n: "→<br>`rules`"
t: "array (string)"
p: "Required<br>(1 or more)"
d: "The specific block rules that are to be enforced"
- n: "→ →<br>Block Rule"
t: "string"
p: "Optional<br>(0 or more)"
d: "A specific block rule to be enforced"
- n: "→<br>`vbavailable`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Contains the set of pending, supported versionbit (BIP 9) softfork deployments"
- n: "→ →<br>Bit Number"
t: "number"
p: "Required<br>(0 or more)"
d: "The bit number the named softfork rule"
- n: "→<br>`vbrequired`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The bit mask of versionbits the server requires set in submissions"
- n: "→<br>`previousblockhash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of current highest block"
- n: "→<br>`transactions`"
t: "array (objects)"
p: "Optional<br>(0 or more)"
d: "Non-coinbase transactions to be included in the next block"
- n: "→ →<br>Transaction"
t: "object"
p: "Optional (0 or more)"
d: "Non-coinbase transaction"
- n: "→ → →<br>`data`"
t: "string (hex)"
p: "Optional (0 or more)"
d: "Transaction data encoded in hex (byte-for-byte)"
- n: "→ → →<br>`hash`"
t: "string (hex)"
p: "Optional (0 or more)"
d: "The hash/id encoded in little-endian hex"
- n: "→ → →<br>`depends`"
t: "array (numbers)"
p: "Required<br>(0 or more)"
d: "An array holding TXIDs of unconfirmed transactions this TX depends upon (parent transactions)."
- n: "→ → → →<br>Transaction number"
t: "number"
p: "Optional<br>(1 or more)"
d: "Transactions before this one (by 1-based index in `transactions` list) that must be present in the final block if this one is"
- n: "→ → →<br>`fee`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The difference in value between transaction inputs and outputs (in duffs). For coinbase transactions, this is a negative number of the total collected block fees (ie., not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one"
- n: "→ → →<br>`sigops`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Total SigOps. If not present, the count is unknown (clients MUST NOT assume there aren't any)"
- n: "→ → →<br>`required`"
t: "boolean"
p: "Optional<br>(exactly 1)"
d: "If provided and true, this transaction must be in the final block"
- n: "→<br>`coinbaseaux`"
t: "object"
p: "Required<br>(exactly 1)"
d: "A object containing data that should be included in the coinbase scriptSig content"
- n: "→ →<br>Flags"
t: "string"
p: "Required<br>(0 or more)"
d: ""
- n: "→<br>`coinbasevalue`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)"
- n: "→<br>`coinbasetxn`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information for the coinbase transaction)"
- n: "→<br>`target`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The hash target"
- n: "→<br>`mintime`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The minimum timestamp appropriate for next block time in seconds since epoch"
- n: "→<br>`mutable`"
t: "array (string)"
p: "Required<br>(exactly 1)"
d: "The list of ways the block template may be changed"
- n: "→ →<br>Value"
t: "string"
p: "Required<br>(0 or more)"
d: "A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'"
- n: "→<br>`noncerange`"
t: "string"
p: "Required<br>(exactly 1)"
d: "A range of valid nonces"
- n: "→<br>`sigoplimit`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The limit of sigops in blocks"
- n: "→<br>`sizelimit`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The limit of block size"
- n: "→<br>`curtime`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The current timestamp in seconds since epoch"
- n: "→<br>`bits`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The compressed target of next block"
- n: "→<br>`height`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The height of the next block"
- n: "→<br>`masternode`"
t: "object"
p: "Required<br>(exactly 1)"
d: "The masternode payee that must be included in the next block"
- n: "→ →<br>`payee`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Payee address"
- n: "→ →<br>`script`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Payee scriptPubKey"
- n: "→ →<br>`amount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Required amount to pay"
- n: "→<br>`masternode_payments_started`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "True if masternode payments started"
- n: "→<br>`masternode_payments_enforced`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "True if masternode payments enforced"
- n: "→<br>`superblock`"
t: "array (objects)"
p: "Required<br>(0 or more)"
d: "The superblock payees that must be included in the next block"
- n: "→ →<br>Superblock Payee"
t: "object"
p: "Optional (0 or more)"
d: "Object containing a superblock payee's information"
- n: "→ → →<br>`payee`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Payee address"
- n: "→ → →<br>`script`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Payee scriptPubKey"
- n: "→ → →<br>`amount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Required amount to pay"
- n: "→<br>`superblocks_started`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "True if superblock payments started"
- n: "→<br>`superblocks_enabled`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "True if superblock payments enabled"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getblocktemplate
{% endhighlight %}
Result:
{% highlight json %}
{
"capabilities": [
"proposal"
],
"version": 536870913,
"rules": [
"dip0001"
],
"vbavailable": {
"csv": 0
},
"vbrequired": 0,
"previousblockhash": "000000003d5c325259275fbf51a5dd623a13aade887cf83e5fdc3b\
11898a71ce",
"transactions": [
{
"data": "01000000013e9e7e2116d8546a54d8531092d50e2da705a6f229f91a6d129f\
3f3e529d2bdb010000006a473044022044569ec727012e06bd4fa853fdcb2d\
c268f193ca00b68649f3dee0c0ca3207ff02206dc8656025c2f503e58779e6\
8a14ed18a7134f2c7d2c4235269bd70a3d6d5bd301210226d4ce54b37c1886\
92844201edbfb19e37cdbe7138a133b92b7d3d43ec157da6feffffff02a00b\
d100000000001976a914d7b47d4b40a23c389f5a17754d7f60f511c7d0ec88\
ac43321005140000001976a914616fdfd6eae0548f0b0f51bef165974abc10\
511688ac1e1f0000",
"hash": "9fd01aafcb4c59741ddfef41da2ec0eb3e1cc5b740150320b29534abdcd67e77",
"depends": [
],
"fee": 226,
"sigops": 2
}
],
"coinbaseaux": {
"flags": ""
},
"coinbasevalue": 13230000226,
"longpollid": "000000003d5c325259275fbf51a5dd623a13aade887cf83e5fdc3b11898a\
71ce316",
"target": "00000001231e0000000000000000000000000000000000000000000000000000",
"mintime": 1507737402,
"mutable": [
"time",
"transactions",
"prevblock"
],
"noncerange": "00000000ffffffff",
"sigoplimit": 40000,
"sizelimit": 2000000,
"curtime": 1507738818,
"bits": "1d01231e",
"height": 7967,
"masternode": {
"payee": "yaJc6tADbEjxQBAC69ugWNoTFpzxqkcgWd",
"script": "76a914996911b133d83de25d1f169c7046d74b728a757b88ac",
"amount": 6615000108
},
"masternode_payments_started": true,
"masternode_payments_enforced": true,
"superblock": [
],
"superblocks_started": true,
"superblocks_enabled": true
}
{% endhighlight %}
*See also*
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [SubmitBlock][rpc submitblock]: {{summary_submitBlock}}
* [PrioritiseTransaction][rpc prioritisetransaction]: {{summary_prioritiseTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,88 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getchaintips.md" %}
##### GetChainTips
{% include helpers/subhead-links.md %}
{% assign summary_getChainTips="returns information about the highest-height block (tip) of each local block chain." %}
{% autocrossref %}
The `getchaintips` RPC {{summary_getChainTips}}
*Parameters: none*
*Result---an array of block chain tips*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of JSON objects, with each object describing a chain tip. At least one tip---the local best block chain---will always be present"
- n: "→<br>Tip"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular chain tip. The first object will always describe the active chain (the local best block chain)"
- n: "→ →<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of the highest block in the chain. A new node with only the genesis block will have a single tip with height of 0"
- n: "→ →<br>`hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the highest block in the chain, encoded as hex in RPC byte order"
- n: "→<br>`difficulty`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The difficulty of the highest-height block in the best block chain (Added in Dash Core 0.12.1)"
- 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 (Added in Dash Core 0.12.1)"
- n: "→ →<br>`branchlen`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of blocks that are on this chain but not on the main chain. For the local best block chain, this will be `0`; for all other chains, it will be at least `1`"
- n: "→ →<br>`status`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The status of this chain. Valid values are:<br>`active` for the local best block chain<br>`invalid` for a chain that contains one or more invalid blocks<br>`headers-only`<!--noref--> for a chain with valid headers whose corresponding blocks both haven't been validated and aren't stored locally<br>`valid-headers` for a chain with valid headers whose corresponding blocks are stored locally, but which haven't been fully validated<br>`valid-fork` for a chain which is fully validated but which isn't part of the local best block chain (it was probably the local best block chain at some point)<br>`unknown` for a chain whose reason for not being the active chain is unknown"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getchaintips
{% endhighlight %}
{% highlight json %}
[
{
"height": 4655,
"hash": "00000000629c276241d9526d85297f2675d6edebcc7fd0c39e8f4263d729b8c1",
"difficulty": 0.9622782802772231,
"chainwork": "000000000000000000000000000000000000000000000000000001f1e286e12a",
"branchlen": 0,
"status": "active"
}
]
{% endhighlight %}
*See also*
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,46 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getconnectioncount.md" %}
##### GetConnectionCount
{% include helpers/subhead-links.md %}
{% assign summary_getConnectionCount="returns the number of connections to other nodes." %}
{% autocrossref %}
The `getconnectioncount` RPC {{summary_getConnectionCount}}
*Parameters: none*
*Result---the number of connections to other nodes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of connections to other nodes (both inbound and outbound)"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getconnectioncount
{% endhighlight bash %}
Result:
{% highlight json %}
14
{% endhighlight %}
*See also*
* [GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}}
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,45 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getdifficulty.md" %}
##### GetDifficulty
{% include helpers/subhead-links.md %}
{% assign summary_getDifficulty="returns the proof-of-work difficulty as a multiple of the minimum difficulty." %}
{% autocrossref %}
The `getdifficulty` RPC {{summary_getDifficulty}}
*Parameters: none*
*Result---the current difficulty*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The difficulty of creating a block with the same target threshold (nBits) as the highest-height block in the local best block chain. The number is a a multiple of the minimum difficulty"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getdifficulty
{% endhighlight %}
Result:
{% highlight text %}
1.069156225528583
{% endhighlight %}
*See also*
* [GetNetworkHashPS][rpc getnetworkhashps]: {{summary_getNetworkHashPS}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,51 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getgenerate.md" %}
##### GetGenerate
{% include helpers/subhead-links.md %}
{% assign summary_getGenerate="returns if the server is set to generate coins or not." %}
{% autocrossref %}
*Requires wallet support.*
*Removed in Bitcoin Core 0.13.0.*
The `getgenerate` RPC {{summary_getGenerate}}
*Parameters: none*
*Result---whether the server is set to generate blocks*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the server is set to generate blocks; set to `false` if it is not"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -regtest getgenerate
{% endhighlight %}
Result:
{% highlight json %}
false
{% endhighlight %}
*See also*
* [Generate][rpc generate]: {{summary_generate}}
* [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
{% endautocrossref %}

View file

@ -0,0 +1,80 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getgovernanceinfo.md" %}
##### GetGovernanceInfo
{% include helpers/subhead-links.md %}
{% assign summary_getGovernanceInfo="returns an object containing governance parameters." %}
{% autocrossref %}
The `getgovernanceinfo` RPC {{summary_getGovernanceInfo}}
*Parameters: none*
*Result---information about the governance system*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about the governance system"
- n: "→<br>`governanceminquorum`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The absolute minimum number of votes needed to trigger a governance action"
- n: "→<br>`masternodewatchdogmaxseconds`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Sentinel watchdog expiration time in seconds"
- n: "→<br>`proposalfee`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The collateral transaction fee which must be paid to create a proposal in Dash"
- n: "→<br>`superblockcycle`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of blocks between superblocks"
- n: "→<br>`lastsuperblock`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block number of the last superblock"
- n: "→<br>`nextsuperblock`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block number of the next superblock"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getgovernanceinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"governanceminquorum": 1,
"masternodewatchdogmaxseconds": 7200,
"proposalfee": 5.00000000,
"superblockcycle": 24,
"lastsuperblock": 7368,
"nextsuperblock": 7392
}
{% endhighlight %}
*See also:*
* [GObject][rpc gobject]: {{summary_gObject}}
{% endautocrossref %}

View file

@ -0,0 +1,24 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/gethashespersec.md" %}
##### GetHashesPerSec
{% include helpers/subhead-links.md %}
{% assign summary_getHashesPerSec="was removed in Bitcoin Core 0.11.0." %}
{% autocrossref %}
*Requires wallet support.*
The `gethashespersec` RPC {{summary_getHashesPerSec}} If you have an older
version of Bitcoin Core, use `help gethashespersec` to get help.
*See also*
* [Generate][rpc generate]: {{summary_generate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,154 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getinfo.md" %}
##### GetInfo
{% include helpers/subhead-links.md %}
{% assign summary_getInfo="prints various information about the node and the network." %}
{% autocrossref %}
The `getinfo` RPC {{summary_getInfo}}
{{WARNING}} `getinfo` will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameters: none*
*Result---information about the node and network*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about this node and the network"
- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "This node's version of Bitcoin Core in its internal integer format. For example, Dash Core 0.12.2 has the integer version number 120200"
- n: "→<br>`protocolversion`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The protocol version number used by this node. See the [protocol versions section][section protocol versions] for more information"
- n: "→<br>`walletversion`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The version number of the wallet. Only returned if wallet support is enabled"
- n: "→<br>`balance`"
t: "number (duffs)"
p: "Optional<br>(0 or 1)"
d: "The total balance of the wallet in duffs. Only returned if wallet support is enabled"
- n: "→<br>`privatesend_balance`"
t: "number (duffs)"
p: "Optional<br>(0 or 1)"
d: "The PrivateSend balance of the wallet in duffs. Only returned if wallet support is enabled (Added in Dash Core 0.11.0)"
- n: "→<br>`blocks`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of blocks in the local best block chain. A new node with only the hardcoded genesis block will return `0`"
- n: "→<br>`timeoffset`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The offset of the node's clock from the computer's clock (both in UTC) in seconds. The offset may be up to 4200 seconds (70 minutes)"
- n: "→<br>`connections`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of open connections (both outgoing and incoming) between this node and other nodes"
- n: "→<br>`proxy`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The hostname/IP address and port number of the proxy, if set, or an empty string if unset"
- n: "→<br>`difficulty`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The difficulty of the highest-height block in the local best block chain"
- n: "→<br>`testnet`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if this node is on testnet; set to `false` if this node is on mainnet or a regtest"
- n: "→<br>`keypoololdest`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The date as Unix epoch time when the oldest key in the wallet key pool was created; useful for only scanning blocks created since this date for transactions. Only returned if wallet support is enabled"
- n: "→<br>`keypoolsize`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of keys in the wallet keypool. Only returned if wallet support is enabled"
- n: "→<br>`unlocked_until`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The Unix epoch time when the wallet will automatically re-lock. Only displayed if wallet encryption is enabled. Set to `0` if wallet is currently locked"
- n: "→<br>`paytxfee`"
t: "number (duffs)"
p: "Optional<br>(0 or 1)"
d: "The minimum fee to pay per kilobyte of transaction; may be `0`. Only returned if wallet support is enabled"
- n: "→<br>`relayfee`"
t: "number (duffs)"
p: "Required<br>(exactly 1)"
d: "The minimum fee a low-priority transaction must pay in order for this node to accept it into its memory pool"
- n: "→<br>`errors`"
t: "string"
p: "Required<br>(exactly 1)"
d: "A plain-text description of any errors this node has encountered or detected. If there are no errors, an empty string will be returned. This is not related to the JSON-RPC `error` field"
{% enditemplate %}
*Example from Dash Core 0.12.2 with wallet support enabled*
{% highlight bash %}
dash-cli -testnet getinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"version": 120200,
"protocolversion": 70208,
"walletversion": 61000,
"balance": 0.00000000,
"privatesend_balance": 0.00000000,
"blocks": 0,
"timeoffset": 0,
"connections": 0,
"proxy": "",
"difficulty": 0.000244140625,
"testnet": true,
"keypoololdest": 1507579068,
"keypoolsize": 617,
"unlocked_until": 0,
"paytxfee": 0.00000000,
"relayfee": 0.00010000,
"errors": ""
}
{% endhighlight %}
*See also*
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}}
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
* [GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,91 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getmemoryinfo.md" %}
##### GetMemoryInfo
{% include helpers/subhead-links.md %}
{% assign summary_getMemoryInfo="returns information about memory usage." %}
{% autocrossref %}
*Added in Bitcoin Core 0.14.0*
The `getmemoryinfo` RPC {{summary_getMemoryInfo}}
*Parameters: none*
*Result---information about memory usage*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object containing information about memory usage"
- n: "→<br>`locked`"
t: "string : object"
p: "Required<br>(exactly 1)"
d: "An object containing information about locked memory manager"
- n: "→→<br>`used`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Number of bytes used"
- n: "→→<br>`free`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Number of bytes available in current arenas"
- n: "→→<br>`total`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Total number of bytes managed"
- n: "→→<br>`locked`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Amount of bytes that succeeded locking"
- n: "→→<br>`chunks_used`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Number allocated chunks"
- n: "→→<br>`chunks_free`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Number unused chunks"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli getmemoryinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"locked": {
"used": 0,
"free": 65536,
"total": 65536,
"locked": 65536,
"chunks_used": 0,
"chunks_free": 1
}
}
{% endhighlight %}
*See also*
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,219 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getmempoolancestors.md" %}
##### GetMemPoolAncestors
{% include helpers/subhead-links.md %}
{% assign summary_getMemPoolAncestors="returns all in-mempool ancestors for a transaction in the mempool." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
**_Not implemented in Dash Core (as of 0.12.2)_**
{% comment %}
The `getmempoolancestors` RPC {{summary_getMemPoolAncestors}}
*Parameter #1---a transaction identifier (TXID)*
{% itemplate ntpd1 %}
- n: "Address"
t: "string"
p: "Required<br>(exactly 1)"
d: "The address whose transactions should be tallied"
{% enditemplate %}
*Parameter #2---desired output format*
{% itemplate ntpd1 %}
- n: "Format"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to get json objects describing each transaction in the memory pool; set to `false` (the default) to only get an array of TXIDs"
{% enditemplate %}
*Result---list of ancestor transactions*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool"
- n: "→<br>TXID"
t: "string"
p: "Optional<br>(0 or more)"
d: "The TXID of a transaction in the memory pool, encoded as hex in RPC byte order"
{% enditemplate %}
*Result (format: `true`)---a JSON object describing each transaction*
{% 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: "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: "The number of in-mempool descendant transactions (including this one)"
- n: "→ →<br>`descendantsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of in-mempool descendants (including this one)"
- n: "→ →<br>`descendantfees`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "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: "The number of in-mempool ancestor transactions (including this one)"
- n: "→ →<br>`ancestorsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of in-mempool ancestors (including this one)"
- n: "→ →<br>`ancestorfees`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "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*
The default (`false`):
{% highlight bash %}
bitcoin-cli getmempoolancestors 52273e0ce6cf3452932cfbc1c517c0ce\
1af1d255fda67a6e3bd63ba1d908c8c2
{% endhighlight %}
Result:
{% highlight json %}
[
"b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873",
"094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4"
]
{% endhighlight %}
Verbose output (`true`):
{% highlight bash %}
bitcoin-cli getmempoolancestors 52273e0ce6cf3452932cfbc1c517c0ce\
1af1d255fda67a6e3bd63ba1d908c8c2 true
{% endhighlight %}
Result:
{% 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*
* [GetMemPoolDescendants][rpc getmempooldescendants]: {{summary_getMemPoolDescendants}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
{% endcomment %}
{% endautocrossref %}

View file

@ -0,0 +1,220 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getmempooldescendants.md" %}
##### GetMemPoolDescendants
{% include helpers/subhead-links.md %}
{% assign summary_getMemPoolDescendants="returns all in-mempool descendants for a transaction in the mempool." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
**_Not implemented in Dash Core (as of 0.12.2)_**
{% comment %}
The `getmempooldescendants` RPC {{summary_getMemPoolDescendants}}
*Parameter #1---a transaction identifier (TXID)*
{% itemplate ntpd1 %}
- n: "Address"
t: "string"
p: "Required<br>(exactly 1)"
d: "The address whose transactions should be tallied"
{% enditemplate %}
*Parameter #2---desired output format*
{% itemplate ntpd1 %}
- n: "Format"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to get json objects describing each transaction in the memory pool; set to `false` (the default) to only get an array of TXIDs"
{% enditemplate %}
*Result---list of descendant transactions*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool"
- n: "→<br>TXID"
t: "string"
p: "Optional<br>(0 or more)"
d: "The TXID of a transaction in the memory pool, encoded as hex in RPC byte order"
{% enditemplate %}
*Result (format: `true`)---a JSON object describing each transaction*
{% 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: "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: "The number of in-mempool descendant transactions (including this one)"
- n: "→ →<br>`descendantsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of in-mempool descendants (including this one)"
- n: "→ →<br>`descendantfees`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "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: "The number of in-mempool ancestor transactions (including this one)"
- n: "→ →<br>`ancestorsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of in-mempool ancestors (including this one)"
- n: "→ →<br>`ancestorfees`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "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*
The default (`false`):
{% highlight bash %}
bitcoin-cli getmempooldescendants 52273e0ce6cf3452932cfbc1c517c0\
ce1af1d255fda67a6e3bd63ba1d908c8c2
{% endhighlight %}
Result:
{% highlight json %}
[
"b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873",
"094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4"
]
{% endhighlight %}
Verbose output (`true`):
{% highlight bash %}
bitcoin-cli getmempooldescendants 52273e0ce6cf3452932cfbc1c517c0\
ce1af1d255fda67a6e3bd63ba1d908c8c2 true
{% endhighlight %}
Result:
{% 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*
* [GetMemPoolAncestors][rpc getmempoolancestors]: {{summary_getMemPoolAncestors}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
{% endcomment %}
{% endautocrossref %}

View file

@ -0,0 +1,154 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getmempoolentry.md" %}
##### GetMemPoolEntry
{% include helpers/subhead-links.md %}
{% assign summary_getMemPoolEntry="returns mempool data for given transaction (must be in mempool)." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
**_Not implemented in Dash Core (as of 0.12.2)_**
{% comment %}
The `getmempoolentry` RPC {{summary_getMemPoolEntry}}
*Parameter #1---a transaction identifier (TXID)*
{% itemplate ntpd1 %}
- n: "Address"
t: "string"
p: "Required<br>(exactly 1)"
d: "The address whose transactions should be tallied"
{% enditemplate %}
*Result ---a JSON object describing the transaction*
{% 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>`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: "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: "The number of in-mempool descendant transactions (including this one)"
- n: "→<br>`descendantsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of in-mempool descendants (including this one)"
- n: "→<br>`descendantfees`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "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: "The number of in-mempool ancestor transactions (including this one)"
- n: "→<br>`ancestorsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of in-mempool ancestors (including this one)"
- n: "→<br>`ancestorfees`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "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*
{% highlight bash %}
bitcoin-cli getmempoolentry 52273e0ce6cf3452932cfbc1c517c0ce1af1\
d255fda67a6e3bd63ba1d908c8c2
{% endhighlight %}
Result:
{% highlight json %}
{
"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": [
]
}
{% endhighlight %}
*See also*
* [GetMemPoolAncestors][rpc getmempoolancestors]: {{summary_getMemPoolAncestors}}
* [GetMemPoolDescendants][rpc getmempooldescendants]: {{summary_getMemPoolDescendants}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
{% endcomment %}
{% endautocrossref %}

View file

@ -0,0 +1,77 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getmempoolinfo.md" %}
##### GetMemPoolInfo
{% include helpers/subhead-links.md %}
{% assign summary_getMemPoolInfo="returns information about the node's current transaction memory pool." %}
{% autocrossref %}
The `getmempoolinfo` RPC {{summary_getMemPoolInfo}}
*Parameters: none*
*Result---information about the transaction memory pool*
{% 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 %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getmempoolinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"size": 1,
"bytes": 3471,
"usage": 8544,
"maxmempool": 300000000,
"mempoolminfee": 0.00000000
}
{% endhighlight %}
*See also*
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,114 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getmininginfo.md" %}
##### GetMiningInfo
{% include helpers/subhead-links.md %}
{% assign summary_getMiningInfo="returns various mining-related information." %}
{% autocrossref %}
The `getmininginfo` RPC {{summary_getMiningInfo}}
*Parameters: none*
*Result---various mining-related information*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Various mining-related information"
- n: "→<br>`blocks`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of the highest block on the local best block chain"
- n: "→<br>`currentblocksize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "If generation was enabled since the last time this node was restarted, this is the size in bytes of the last block built by this node for header hash checking. Otherwise, the value `0`"
- n: "→<br>`currentblocktx`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "If generation was enabled since the last time this node was restarted, this is the number of transactions in the last block built by this node for header hash checking. Otherwise, this is the value `0`"
- n: "→<br>`difficulty`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "If generation was enabled since the last time this node was restarted, this is the difficulty of the highest-height block in the local best block chain. Otherwise, this is the value `0`"
- n: "→<br>`errors`"
t: "string"
p: "Required<br>(exactly 1)"
d: "A plain-text description of any errors this node has encountered or detected. If there are no errors, an empty string will be returned. This is not related to the JSON-RPC `error` field"
- n: "→<br>`genproclimit`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The processor limit for generation (-1 if no generation - see getgenerate or setgenerate calls).<br><br>*Removed in Bitcoin Core 0.13.0*"
- n: "→<br>`networkhashps`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "An estimate of the number of hashes per second the network is generating to maintain the current difficulty. See the `getnetworkhashps` RPC for configurable access to this data"
- n: "→<br>`pooledtx`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of transactions in the memory pool"
- n: "→<br>`testnet`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if this node is running on testnet. Set to `false` if this node is on mainnet or a regtest<br><br>*Removed in Bitcoin Core 0.14.0*"
- n: "→<br>`chain`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Set to `main` for mainnet, `test` for testnet, and `regtest` for regtest"
- n: "→<br>`generate`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if generation is currently enabled; set to `false` if generation is currently disabled. Only returned if the node has wallet support enabled<br><br>*Removed in Bitcoin Core 0.13.0*"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli getmininginfo
{% endhighlight %}
Result:
{% highlight json %}
{
"blocks": 8036,
"currentblocksize": 0,
"currentblocktx": 0,
"difficulty": 0.8239043524175907,
"errors": "",
"genproclimit": 1,
"networkhashps": 22234635.4469006,
"pooledtx": 3,
"testnet": true,
"chain": "test",
"generate": false
}
{% endhighlight %}
*See also*
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [Generate][rpc generate]: {{summary_generate}}
{% endautocrossref %}

View file

@ -0,0 +1,107 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getnettotals.md" %}
##### GetNetTotals
{% include helpers/subhead-links.md %}
{% assign summary_getNetTotals="returns information about network traffic, including bytes in, bytes out, and the current time." %}
{% autocrossref %}
The `getnettotals` RPC {{summary_getNetTotals}}
*Parameters: none*
*Result---the current bytes in, bytes out, and current time*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object containing information about the node's network totals"
- n: "→<br>`totalbytesrecv`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of bytes received since the node was last restarted"
- n: "→<br>`totalbytessent`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of bytes sent since the node was last restarted"
- n: "→<br>`timemillis`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Unix epoch time in milliseconds according to the operating system's clock (not the node adjusted time)"
- n: "→<br>`uploadtarget`"
t: "string : <br>object"
p: "Required<br>(exactly 1)"
d: "The upload traget information"
- n: "→ →<br>`timeframe`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Length of the measuring timeframe in seconds (currently set to `24` hours)"
- n: "→ →<br>`target`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The maximum allowed outbound traffic in bytes (default is `0`). Can be changed with `-maxuploadtarget`"
- n: "→ →<br>`target_reached`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Indicates if the target<!--noref--> is reached. If the target<!--noref--> is reached the node won't serve SPV and historical block requests anymore"
- n: "→ →<br>`serve_historical_blocks`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Indicates if historical blocks are served"
- n: "→ →<br>`bytes_left_in_cycle`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Amount of bytes left in current time cycle. `0` is displayed if no upload target<!--noref--> is set"
- n: "→ →<br>`time_left_in_cycle`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Seconds left in current time cycle. `0` is displayed if no upload target<!--noref--> is set"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli getnettotals
{% endhighlight %}
Result:
{% highlight json %}
{
"totalbytesrecv": 4661588,
"totalbytessent": 2899423,
"timemillis": 1507815162756,
"uploadtarget": {
"timeframe": 86400,
"target": 0,
"target_reached": false,
"serve_historical_blocks": true,
"bytes_left_in_cycle": 0,
"time_left_in_cycle": 0
}
}
{% endhighlight %}
*See also*
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,66 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getnetworkhashps.md" %}
##### GetNetworkHashPS
{% include helpers/subhead-links.md %}
{% assign summary_getNetworkHashPS="returns the estimated network hashes per second based on the last n blocks." %}
{% autocrossref %}
The `getnetworkhashps` RPC {{summary_getNetworkHashPS}}
*Parameter #1---number of blocks to average*
{% itemplate ntpd1 %}
- n: "`blocks`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of blocks to average together for calculating the estimated hashes per second. Default is `120`. Use `-1` to average all blocks produced since the last difficulty change"
{% enditemplate %}
*Parameter #2---block height*
{% itemplate ntpd1 %}
- n: "`height`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The height of the last block to use for calculating the average. Defaults to `-1` for the highest-height block on the local best block chain. If the specified height is higher than the highest block on the local best block chain, it will be interpreted the same as `-1`"
{% enditemplate %}
*Result---estimated hashes per second*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The estimated number of hashes per second based on the parameters provided. May be 0 (for Height=`0`, the genesis block) or a negative value if the highest-height block averaged has a block header time earlier than the lowest-height block averaged"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the average hashes per second for all the blocks since the last
difficulty change before block 6000.
{% highlight bash %}
dash-cli -testnet getnetworkhashps -1 6000
{% endhighlight %}
Result:
{% highlight json %}
22214011.90821117
{% endhighlight %}
*See also*
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficulty}}
* [GetBlock][rpc getblock]: {{summary_getBlock}}
{% endautocrossref %}

View file

@ -0,0 +1,192 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getnetworkinfo.md" %}
##### GetNetworkInfo
{% include helpers/subhead-links.md %}
{% assign summary_getNetworkInfo="returns information about the node's connection to the network." %}
{% autocrossref %}
The `getnetworkinfo` RPC {{summary_getNetworkInfo}}
*Parameters: none*
*Result---information about the node's connection to the network*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about this node's connection to the network"
- n: "→<br>`version`"
t: "number"
p: "Required<br>(exactly 1)"
d: "This node's version of Dash Core in its internal integer format. For example, Dash Core 0.12.2 has the integer version number 120200"
- n: "→<br>`subversion`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The user agent this node sends in its `version` message"
- n: "→<br>`protocolversion`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The protocol version number used by this node. See the [protocol versions section][section protocol versions] for more information"
- n: "→<br>`localservices`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The services supported by this node as advertised in its `version` message"
- n: "→<br>`localrelay`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The services supported by this node as advertised in its `version` message"
- n: "→<br>`timeoffset`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The offset of the node's clock from the computer's clock (both in UTC) in seconds. The offset may be up to 4200 seconds (70 minutes)"
- n: "→<br>`connections`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of open connections (both outgoing and incoming) between this node and other nodes"
- n: "→<br>`networks`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array with three objects: one describing the IPv4 connection, one describing the IPv6 connection, and one describing the Tor hidden service (onion) connection"
- n: "→ →<br>Network<!--noref-->"
t: "object"
p: "Optional<br>(0 to 3)"
d: "An object describing a network<!--noref-->. If the network<!--noref--> is unroutable, it will not be returned"
- n: "→ → →<br>`name`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the network<!--noref-->. Either `ipv4`, `ipv6`, or `onion`"
- n: "→ → →<br>`limited`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if only connections to this network<!--noref--> are allowed according to the `-onlynet` Dash Core command-line/configuration-file parameter. Otherwise set to `false`"
- n: "→ → →<br>`reachable`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if connections can be made to or from this network<!--noref-->. Otherwise set to `false`"
- n: "→ → →<br>`proxy`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The hostname and port of any proxy being used for this network<!--noref-->. If a proxy is not in use, an empty string"
- n: "→ → →<br>`proxy_randomize_credentials`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.11.0*<br><br>Set to `true` if randomized credentials are set for this proxy. Otherwise set to `false`"
- n: "→<br>`relayfee`"
t: "number (Dash)"
p: "Required<br>(exactly 1)"
d: "The minimum relay fee for non-free transactions in order for this node to accept it into its memory pool"
- n: "→<br>`localaddresses`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects each describing the local addresses<!--noref--> this node believes it listens on"
- n: "→ →<br>Address<!--noref-->"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing a particular address<!--noref--> this node believes it listens on"
- n: "→ → →<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "An IP address or .onion address<!--noref--> this node believes it listens on. This may be manually configured, auto detected, or based on `version` messages this node received from its peers"
- n: "→ → →<br>`port`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The port number this node believes it listens on for the associated `address`. This may be manually configured, auto detected, or based on `version` messages this node received from its peers"
- n: "→ → →<br>`score`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of incoming connections during the uptime of this node that have used this `address` in their `version` message"
- n: "→<br>`warnings`"
t: "string"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.11.0*<br><br>A plain-text description of any network warnings. If there are no warnings, an empty string will be returned. "
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli getnetworkinfo
{% endhighlight %}
Result (actual addresses<!--noref--> have been replaced with [RFC5737][] reserved addresses<!--noref-->):
{% highlight json %}
{
"version": 120200,
"subversion": "/Dash Core:0.12.2/",
"protocolversion": 70208,
"localservices": "0000000000000005",
"localrelay": true,
"timeoffset": 0,
"networkactive": true,
"connections": 9,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "onion",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
}
],
"relayfee": 0.00001000,
"localaddresses": [
{
"address": "192.0.2.113",
"port": 19999,
"score": 4
}
],
"warnings": ""
}
{% endhighlight %}
*See also*
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}}
* [GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}}
{% endautocrossref %}

View file

@ -0,0 +1,58 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getnewaddress.md" %}
##### GetNewAddress
{% include helpers/subhead-links.md %}
{% assign summary_getNewAddress="returns a new Bitcoin address for receiving payments. If an account is specified, payments received with the address will be credited to that account." %}
{% autocrossref %}
*Requires wallet support.*
The `getnewaddress` RPC {{summary_getNewAddress}}
*Parameter #1---an account name*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The name of the account to put the address in. The default is the default account, an empty string (\"\")"
{% enditemplate %}
*Result---a bitcoin address never previously returned*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "A P2PKH address which has not previously been returned by this RPC. The address will be marked as a receiving address in the wallet. The address may already have been part of the keypool, so other RPCs such as the `dumpwallet` RPC may have disclosed it previously. If the wallet is unlocked, its keypool will also be filled to its max (by default, 100 unused keys). If the wallet is locked and its keypool is empty, this RPC will fail"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Create a new address in the "doc test" account:
{% highlight bash %}
bitcoin-cli -testnet getnewaddress "doc test"
{% endhighlight %}
Result:
{% highlight text %}
mft61jjkmiEJwJ7Zw3r1h344D6aL1xwhma
{% endhighlight %}
*See also*
* [GetAccountAddress][rpc getaccountaddress]: {{summary_getAccountAddress}}
* [GetRawChangeAddress][rpc getrawchangeaddress]: {{summary_getRawChangeAddress}}
* [GetBalance][rpc getbalance]: {{summary_getBalance}}
{% endautocrossref %}

View file

@ -0,0 +1,256 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getpeerinfo.md" %}
##### GetPeerInfo
{% include helpers/subhead-links.md %}
{% assign summary_getPeerInfo="returns data about each connected network node." %}
{% autocrossref %}
The `getpeerinfo` RPC {{summary_getPeerInfo}}
*Parameters: none*
*Result---information about each currently-connected network node*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects each describing one connected node. If there are no connections, the array will be empty"
- n: "→<br>Node<!--noref-->"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing a particular connected node"
- n: "→ →<br>`id`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The node's index number in the local node address<!--noref--> database"
- n: "→ →<br>`addr`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The IP address and port number used for the connection to the remote node"
- n: "→ →<br>`addrlocal`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "Our IP address and port number according to the remote node. May be incorrect due to error or lying. Most SPV nodes set this to `127.0.0.1:9999`"
- n: "→ →<br>`services`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The services advertised by the remote node in its `version` message"
- n: "→ →<br>`lastsend`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The Unix epoch time when we last successfully sent data to the TCP socket for this node"
- n: "→ →<br>`lastrecv`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The Unix epoch time when we last received data from this node"
- n: "→ →<br>`bytessent`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of bytes we've sent to this node"
- n: "→ →<br>`bytesrecv`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of bytes we've received from this node"
- n: "→ →<br>`conntime`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The Unix epoch time when we connected to this node"
- n: "→ →<br>`timeoffset`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.12.0*<br><br>The time offset in seconds"
- n: "→ →<br>`pingtime`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The number of seconds this node took to respond to our last P2P `ping` message"
- n: "→ →<br>`minping`"
t: "number (real)"
p: "Optional<br>(0 or 1)"
d: "*Updated in Bitcoin Core 0.13.0*<br><br>The minimum observed ping time (if any at all)"
- n: "→ →<br>`pingwait`"
t: "number (real)"
p: "Optional<br>(0 or 1)"
d: "The number of seconds we've been waiting for this node to respond to a P2P `ping` message. Only shown if there's an outstanding `ping` message"
- n: "→ →<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The protocol version number used by this node. See the [protocol versions section][section protocol versions] for more information"
- n: "→ →<br>`subver`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The user agent this node sends in its `version` message. This string will have been sanitized to prevent corrupting the JSON results. May be an empty string"
- n: "→ →<br>`inbound`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if this node connected to us (inbound); set to `false` if we connected to this node (outbound)"
- n: "→ →<br>`startingheight`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of the remote node's block chain when it connected to us as reported in its `version` message"
- n: "→ →<br>`banscore`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The ban score we've assigned the node based on any misbehavior it's made. By default, Dash Core disconnects when the ban score reaches `100`"
- n: "→ →<br>`synced_headers`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The highest-height header we have in common with this node based the last P2P `headers` message it sent us. If a `headers` message has not been received, this will be set to `-1`"
- n: "→ →<br>`synced_blocks`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The highest-height block we have in common with this node based on P2P `inv` messages this node sent us. If no block `inv` messages have been received from this node, this will be set to `-1`"
- n: "→ →<br>`inflight`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of blocks which have been requested from this peer. May be empty"
- n: "→ → →<br>Blocks<!--noref-->"
t: "number (int)"
p: "Optional<br>(0 or more)"
d: "The height of a block being requested from the remote peer"
- n: "→ →<br>`whitelisted`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the remote peer has been whitelisted; otherwise, set to `false`. Whitelisted peers will not be banned if their ban score exceeds the maximum (100 by default). By default, peers connecting from localhost are whitelisted"
- n: "→ →<br>`bytessent_per_msg`"
t: "string : <br>object"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>Information about total sent bytes aggregated by message type"
- n: "→ → →<br>Message Type"
t: "number (int)"
p: "Required<br>(1 or more)"
d: "Total sent bytes aggregated by message type. One field for every used message type"
- n: "→ →<br>`bytesrecv_per_msg`"
t: "string : <br>object"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>Information about total received bytes aggregated by message type"
- n: "→ → →<br>Message Type"
t: "number (int)"
p: "Required<br>(1 or more)"
d: "Total received bytes aggregated by message type. One field for every used message type"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli getpeerinfo
{% endhighlight %}
Result (edited to show only a single entry, with IP addresses changed to
[RFC5737][] reserved IP addresses):
{% highlight json %}
[
{
"id": 3,
"addr": "192.0.2.113:19999",
"addrlocal": "127.0.0.1:56332",
"services": "0000000000000005",
"relaytxes": true,
"lastsend": 1507818327,
"lastrecv": 1507818327,
"bytessent": 844135,
"bytesrecv": 887651,
"conntime": 1507808575,
"timeoffset": 0,
"pingtime": 0.189852,
"minping": 0.187152,
"version": 70208,
"subver": "/Dash Core:0.12.2/",
"inbound": false,
"startingheight": 8416,
"banscore": 0,
"synced_headers": 8474,
"synced_blocks": 8474,
"inflight": [
],
"whitelisted": false,
"bytessent_per_msg": {
"addr": 165,
"dseg": 65,
"dsq": 33984,
"getaddr": 24,
"getdata": 73261,
"getheaders": 861,
"getsporks": 48,
"govobj": 20244,
"govobjvote": 22196,
"govsync": 545682,
"headers": 106,
"inv": 139035,
"mnget": 28,
"notfound": 1220,
"ping": 2624,
"pong": 2624,
"sendheaders": 24,
"ssc": 1792,
"verack": 24,
"version": 128
},
"bytesrecv_per_msg": {
"addr": 4365,
"block": 22307,
"dsq": 33984,
"getdata": 10417,
"getheaders": 861,
"govobjvote": 179,
"govsync": 4620,
"headers": 6254,
"inv": 130964,
"mnp": 352,
"mnw": 600208,
"notfound": 31192,
"ping": 2624,
"pong": 2624,
"sendheaders": 24,
"spork": 2860,
"ssc": 33664,
"verack": 24,
"version": 128
}
},
]
{% endhighlight %}
*See also*
* [GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}}
* [GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,120 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getpoolinfo.md" %}
##### GetPoolInfo
{% include helpers/subhead-links.md %}
{% assign summary_getPoolInfo="returns an object containing mixing pool related information." %}
{% autocrossref %}
The `getpoolinfo` RPC {{summary_getPoolInfo}}
*Parameters: none*
*Result---information about the mixing pool*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about the mixing pool"
- n: "→<br>`state`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Mixing pool state. Will be one of the following:<br>`IDLE` <br>`QUEUE` <br>`ACCEPTING_ENTRIES` <br>`SIGNING` <br>`ERROR` <br>`SUCCESS` <br>`UNKNOWN` <br>"
- n: "→<br>`mixing_mode`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Mixing mode - will be one of the following:<br>`normal` <br>`multi-session` <br> "
- n: "→<br>`queue`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "Queue size"
- n: "→<br>`entries`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of entries"
- n: "→<br>`status`"
t: "string"
p: "Required<br>(exactly 1)"
d: "A more detailed description of the current state"
- n: "→<br>`outpoint`"
t: "string (hex)"
p: "Optional<br>(exactly 1)"
d: "Previous output"
- n: "→<br>`addr`"
t: "string"
p: "Optional<br>(exactly 1)"
d: "Address"
- n: "→<br>`keys_left`"
t: "number (int)"
p: "Optional<br>(exactly 1)"
d: "The number of keys left in the local wallet"
- n: "→<br>`warnings`"
t: "number (int)"
p: "Optional<br>(exactly 1)"
d: "Warnings related to local wallet"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getpoolinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"state": "IDLE",
"mixing_mode": "normal",
"queue": 0,
"entries": 0,
"status": "PrivateSend is idle.",
"keys_left": 617,
"warnings": ""
}
{% endhighlight %}
{% highlight json %}
{
"state": "QUEUE",
"mixing_mode": "normal",
"queue": 1,
"entries": 0,
"status": "Submitted to masternode, waiting in queue .",
"outpoint": "e3a6b7878a7e9413898bb379b323c521676f9d460db17ec3bf42d9ac0c9a432f-1",
"addr": "217.182.229.146:19999",
"keys_left": 571,
"warnings": ""
}
{% endhighlight %}
{% highlight json %}
{
"state": "ERROR",
"mixing_mode": "normal",
"queue": 0,
"entries": 0,
"status": "PrivateSend request incomplete: Session timed out. Will retry...",
"keys_left": 571,
"warnings": ""
}
{% endhighlight %}
*See also:*
{% endautocrossref %}

View file

@ -0,0 +1,47 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getrawchangeaddress.md" %}
##### GetRawChangeAddress
{% include helpers/subhead-links.md %}
{% assign summary_getRawChangeAddress="returns a new Bitcoin address for receiving change. This is for use with raw transactions, not normal use." %}
{% autocrossref %}
*Requires wallet support.*
The `getrawchangeaddress` RPC {{summary_getRawChangeAddress}}
*Parameters: none*
*Result---a P2PKH address which can be used in raw transactions*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "A P2PKH address which has not previously been returned by this RPC. The address will be removed from the keypool but not marked as a receiving address, so RPCs such as the `dumpwallet` RPC will show it as a change address. The address may already have been part of the keypool, so other RPCs such as the `dumpwallet` RPC may have disclosed it previously. If the wallet is unlocked, its keypool will also be filled to its max (by default, 100 unused keys). If the wallet is locked and its keypool is empty, this RPC will fail"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getrawchangeaddress
{% endhighlight %}
Result:
{% highlight text %}
mnycUc8FRjJodfKhaj9QBZs2PwxxYoWqaK
{% endhighlight %}
*See also*
* [GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}
* [GetAccountAddress][rpc getaccountaddress]: {{summary_getAccountAddress}}
{% endautocrossref %}

View file

@ -0,0 +1,185 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getrawmempool.md" %}
##### GetRawMemPool
{% include helpers/subhead-links.md %}
{% assign summary_getRawMemPool="returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object." %}
{% autocrossref %}
The `getrawmempool` RPC {{summary_getRawMemPool}}
*Parameter---desired output format*
{% itemplate ntpd1 %}
- n: "Format"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to get verbose output describing each transaction in the memory pool; set to `false` (the default) to only get an array of TXIDs for transactions in the memory pool"
{% enditemplate %}
*Result (format `false`)---an array of TXIDs*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool"
- n: "→<br>TXID"
t: "string"
p: "Optional<br>(0 or more)"
d: "The TXID of a transaction in the memory pool, encoded as hex in RPC byte order"
{% enditemplate %}
*Result (format: `true`)---a JSON object describing each transaction*
{% 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: "amount (Dash)"
p: "Required<br>(exactly 1)"
d: "The transaction fee paid by the transaction in decimal Dash"
- n: "→ →<br>`modifiedfee`"
t: "amount (Dash)"
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 Dash"
- 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>`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 %}
*Changes from Bitcoin - Following items not present in Dash result*
{% itemplate ntpd1 %}
- n: "→ TXID→<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: "→ TXID→<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: "→ TXID→<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)"
{% enditemplate %}
*Examples from Dash Core 0.12.2*
The default (`false`):
{% highlight bash %}
dash-cli getrawmempool
{% endhighlight %}
Result:
{% highlight json %}
[
"9dc994e03e387ff2d2709fbe86edede9f3d7aaddea7f75694495e415561b22fe"
]
{% endhighlight %}
Verbose output (`true`):
{% highlight bash %}
dash-cli getrawmempool true
{% endhighlight %}
Result:
{% highlight json %}
{
"286b3ec21e6ce5463fc712c98d86e02353525e09452113836651f3f91e562354": {
"size": 225,
"fee": 0.00000225,
"modifiedfee": 0.00000225,
"time": 1507735322,
"height": 7940,
"startingpriority": 0,
"currentpriority": 0,
"descendantcount": 4,
"descendantsize": 901,
"descendantfees": 902,
"depends": [
"2aacf53e0e15d3b4d778837792c7b6bd298edd3c41a0608586bdec41adcfe7c4"
]
}
}
{% endhighlight %}
*See also*
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
* [GetMemPoolEntry][rpc getmempoolentry]: {{summary_getMemPoolEntry}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,170 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getrawtransaction.md" %}
##### GetRawTransaction
{% include helpers/subhead-links.md %}
{% assign summary_getRawTransaction="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 the RPC may fail on historic transactions unless you use the non-default `txindex=1` in your Bitcoin Core startup settings." %}
{% autocrossref %}
The `getrawtransaction` RPC {{summary_getRawTransaction}}
{{reindexNote}}
*Parameter #1---the TXID of the transaction to get*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction to get, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---whether to get the serialized or decoded transaction*
{% itemplate ntpd1 %}
- n: "Format"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "*Updated in Bitcoin Core 0.14.0*<br><br>Set to `false` (the default) to return the serialized transaction as hex. Set to `true` to return a decoded transaction. Before 0.14.0, use `0` and `1`, respectively"
{% enditemplate %}
*Result (if transaction not found)---`null`*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If the transaction wasn't found, the result will be JSON `null`. This can occur because the transaction doesn't exist in the block chain or memory pool, or because it isn't part of the transaction index. See the Bitcoin Core `-help` entry for `-txindex`"
{% enditemplate %}
*Result (if verbose=`false`)---the serialized transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "If the transaction was found, this will be the serialized transaction encoded as hex"
{% enditemplate %}
*Result (if verbose=`true`)---the decoded transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "If the transaction was found, this will be an object describing it"
- n: "{{DEPTH}} →<br>`hex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The serialized, hex-encoded data for the provided `txid`"
{{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.14.1*
A transaction in serialized transaction format:
{% highlight bash %}
bitcoin-cli getrawtransaction \
52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46
{% endhighlight %}
Result (wrapped):
{% highlight text %}
0100000001bafe2175b9d7b3041ebac529056b393cf2997f7964485aa382ffa4\
49ffdac02a000000008a473044022013d212c22f0b46bb33106d148493b9a972\
3adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45\
c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295\
ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc\
0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01b0a86a00000000\
001976a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac00000000
{% endhighlight %}
Get the same transaction in JSON:
{% highlight bash %}
bitcoin-cli getrawtransaction \
ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e \
true
{% endhighlight %}
Result:
{% highlight json %}
{
"hex": "0100000001bafe2175b9d7b3041ebac529056b393cf2997f7964485aa382ffa449ffdac02a000000008a473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01b0a86a00000000001976a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac00000000",
"txid": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"hash": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"size": 223,
"vsize": 223,
"version": 1,
"locktime": 0,
"vin": [
{
"txid": "2ac0daff49a4ff82a35a4864797f99f23c396b0529c5ba1e04b3d7b97521feba",
"vout": 0,
"scriptSig": {
"asm": "3044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
"hex": "473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.06990000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 01b81d5fa1e55e069e3cc2db9c19e2e80358f306 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"1A6Ei5cRfDJ8jjhwxfzLJph8B9ZEthR9Z"
]
}
}
],
"blockhash": "0000000000000000015955e197fc362502a32f76290e5b5e5be822f9f161b3f3",
"confirmations": 374,
"time": 1483591778,
"blocktime": 1483591778
}
{% endhighlight %}
*See also*
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,66 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getreceivedbyaccount.md" %}
##### GetReceivedByAccount
{% include helpers/subhead-links.md %}
{% assign summary_getReceivedByAccount="returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions." %}
{% autocrossref %}
*Requires wallet support.*
The `getreceivedbyaccount` RPC {{summary_getReceivedByAccount}}
{{WARNING}} `getreceivedbyaccount` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---the account name*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account containing the addresses to get. For the default account, use an empty string (\"\")"
{% enditemplate %}
*Parameter #2---the minimum number of confirmations*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Result---the number of bitcoins received*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The number of bitcoins received by the account. May be `0`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Get the bitcoins received by the "doc test" account with six or more
confirmations:
{% highlight bash %}
bitcoin-cli -testnet getreceivedbyaccount "doc test" 6
{% endhighlight %}
Result:
{% highlight json %}
0.30000000
{% endhighlight %}
*See also*
* [GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}}
{% endautocrossref %}

View file

@ -0,0 +1,63 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getreceivedbyaddress.md" %}
##### GetReceivedByAddress
{% include helpers/subhead-links.md %}
{% assign summary_getReceivedByAddress="returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions." %}
{% autocrossref %}
*Requires wallet support.*
The `getreceivedbyaddress` RPC {{summary_getReceivedByAddress}}
*Parameter #1---the address*
{% itemplate ntpd1 %}
- n: "Address"
t: "string"
p: "Required<br>(exactly 1)"
d: "The address whose transactions should be tallied"
{% enditemplate %}
*Parameter #2---the minimum number of confirmations*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Result---the number of bitcoins received*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The number of bitcoins received by the address, excluding coinbase transactions. May be `0`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Get the bitcoins received for a particular address, only counting
transactions with six or more confirmations:
{% highlight bash %}
bitcoin-cli -testnet getreceivedbyaddress mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN 6
{% endhighlight %}
Result:
{% highlight json %}
0.30000000
{% endhighlight %}
*See also*
* [GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}}
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}}
{% endautocrossref %}

View file

@ -0,0 +1,82 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getspentinfo.md" %}
##### GetSpentInfo
{% include helpers/subhead-links.md %}
{% assign summary_getSpentInfo="returns the txid and index where an output is spent (requires `spentindex` to be enabled)." %}
{% autocrossref %}
*Added in Dash Core 0.12.1*
The `getspentinfo` RPC {{summary_getSpentInfo}}
*Parameter #1---the TXID of the output*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction containing the relevant output, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---the start block height*
{% itemplate ntpd1 %}
- n: "Index"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block height to begin looking in"
{% enditemplate %}
*Result---the TXID and spending input index*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "Information about the spent output. If output wasn't found or if an error occurred, this will be JSON `null`"
- n: "→<br>`txid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The output txid"
- n: "→<br>`index`"
t: "number"
p: "Required<br>(exactly 1)"
d: "The spending input index"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the txid and index where an output is spent:
{% highlight bash %}
dash-cli getspentinfo \
'''
{
"txid": "0456aaf51a8df21dd47c2a06ede046a5bf7403bcb95d14d1d71b178c189fb933", \
"index": 0
}
{% endhighlight %}
Result:
{% highlight json %}
{
"txid": "14e874421350840e9d43965967c5a989e7d41ad361ef37484ee67d01d433ecfa",
"index": 1,
"height": 7742
}
{% endhighlight %}
*See also: none*
{% endautocrossref %}

View file

@ -0,0 +1,51 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getsuperblockbudget.md" %}
##### GetSuperblockBudget
{% include helpers/subhead-links.md %}
{% assign summary_getSuperblockBudget="returns the absolute maximum sum of superblock payments allowed." %}
{% autocrossref %}
The `getsuperblockbudget` RPC {{summary_getSuperblockBudget}}
*Parameter #1---block index*
{% itemplate ntpd1 %}
- n: "index"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The superblock index"
{% enditemplate %}
*Result---maximum sum of superblock payments*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The absolute maximum sum of superblock payments allowed, in DASH"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet getsuperblockbudget 7392
{% endhighlight %}
Result:
{% highlight text %}
367.20
{% endhighlight %}
*See also:*
* [GetGovernanceInfo][rpc getgovernanceinfo]: {{summary_getGovernanceInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,154 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/gettransaction.md" %}
##### GetTransaction
{% include helpers/subhead-links.md %}
{% assign summary_getTransaction="gets detailed information about an in-wallet transaction." %}
{% autocrossref %}
*Requires wallet support.*
The `gettransaction` RPC {{summary_getTransaction}}
*Parameter #1---a transaction identifier (TXID)*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction to get details about. The TXID must be encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---whether to include watch-only addresses in details and calculations*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Result---a description of the transaction*
{% assign DEPTH="→ " %}
{% include helpers/vars.md %}
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object describing how the transaction affects the wallet"
- n: "→<br>`amount`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "A positive number of bitcoins if this transaction increased the total wallet balance; a negative number of bitcoins if this transaction decreased the total wallet balance, or `0` if the transaction had no net effect on wallet balance"
- n: "→<br>`fee`"
t: "number (bitcoins)"
p: "Optional<br>(0 or 1)"
d: "If an outgoing transaction, this is the fee paid by the transaction reported as negative bitcoins"
{{INCLUDE_F_LIST_TRANSACTIONS_F_FULL}}
- n: "→<br>`details`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing one object for each input or output in the transaction which affected the wallet"
- n: "→ → <br>`involvesWatchonly`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if the input or output involves a watch-only address. Otherwise not returned"
- n: "→ →<br>`account`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The account which the payment was credited to or debited from. May be an empty string (\"\") for the default account"
- n: "→ →<br>`address`"
t: "string (base58)"
p: "Optional<br>(0 or 1)"
d: "If an output, the address paid (may be someone else's address not belonging to this wallet). If an input, the address paid in the previous output. May be empty if the address is unknown, such as when paying to a non-standard pubkey script"
- n: "→ →<br>`category`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Set to one of the following values:<br>`send` if sending payment<br>`receive` if this wallet received payment in a regular transaction<br>`generate` if a matured and spendable coinbase<br>`immature` if a coinbase that is not spendable yet<br>`orphan` if a coinbase from a block that's not in the local best block chain"
- n: "→ →<br>`amount`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "A negative bitcoin amount if sending payment; a positive bitcoin amount if receiving payment (including coinbases)"
- n: "→ →<br>`vout`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "For an output, the output index (vout) for this output in this transaction. For an input, the output index for the output being spent in its transaction. Because inputs list the output indexes from previous transactions, more than one entry in the details array may have the same output index"
- n: "→ →<br>`fee`"
t: "number (bitcoins)"
p: "Optional<br>(0 or 1)"
d: "If sending payment, the fee paid as a negative bitcoins value. May be `0`. Not returned if receiving payment"
- n: "→ →<br>`abandoned`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.12.1*<br><br>Indicates if a transaction is was abandoned:<br>`true` if it was abandoned (inputs are respendable)<br>`false` if it was not abandoned<br>Only returned by *send* category payments"
- n: "→<br>`hex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The transaction in serialized transaction format"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli -testnet gettransaction \
5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589
{% endhighlight %}
Result:
{% highlight json %}
{
"amount" : 0.00000000,
"fee" : 0.00000000,
"confirmations" : 106670,
"blockhash" : "000000008b630b3aae99b6fe215548168bed92167c47a2f7ad4df41e571bcb51",
"blockindex" : 1,
"blocktime" : 1396321351,
"txid" : "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"walletconflicts" : [
],
"time" : 1396321351,
"timereceived" : 1418924711,
"bip125-replaceable" : "no",
"details" : [
{
"account" : "",
"address" : "mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN",
"category" : "send",
"amount" : -0.10000000,
"vout" : 0,
"fee" : 0.00000000
},
{
"account" : "doc test",
"address" : "mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN",
"category" : "receive",
"amount" : 0.10000000,
"vout" : 0
}
],
"hex" : "0100000001cde58f2e37d000eabbb60d9cf0b79ddf67cede6dba58732539983fa341dd5e6c010000006a47304402201feaf12908260f666ab369bb8753cdc12f78d0c8bdfdef997da17acff502d321022049ba0b80945a7192e631c03bafd5c6dc3c7cb35ac5c1c0ffb9e22fec86dd311c01210321eeeb46fd878ce8e62d5e0f408a0eab41d7c3a7872dc836ce360439536e423dffffffff0180969800000000001976a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac00000000"
}
{% endhighlight %}
*See also*
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,155 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/gettxout.md" %}
##### GetTxOut
{% include helpers/subhead-links.md %}
{% assign summary_getTxOut="returns details about a transaction output. Only unspent transaction outputs (UTXOs) are guaranteed to be available." %}
{% autocrossref %}
The `gettxout` RPC {{summary_getTxOut}}
*Parameter #1---the TXID of the output to get*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction containing the output to get, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---the output index number (vout) of the output to get*
{% itemplate ntpd1 %}
- n: "Vout"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The output index number (vout) of the output within the transaction; the first output in a transaction is vout 0"
{% enditemplate %}
*Parameter #3---whether to display unconfirmed outputs from the memory pool*
{% itemplate ntpd1 %}
- n: "Unconfirmed"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to display unconfirmed outputs from the memory pool; set to `false` (the default) to only display outputs from confirmed transactions"
{% enditemplate %}
*Result---a description of the output*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "Information about the output. If output wasn't found or if an error occurred, this will be JSON `null`"
- n: "→<br>`bestblock`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the header of the block on the local best block chain which includes this transaction. The hash will encoded as hex in RPC byte order. If the transaction is not part of a block, the string will be empty"
- n: "→<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations received for the transaction containing this output or `0` if the transaction hasn't been confirmed yet"
- n: "→<br>`value`"
t: "number (Dash)"
p: "Required<br>(exactly 1)"
d: "The amount of Dash spent to this output. May be `0`"
- n: "→<br>`scriptPubKey`"
t: "string : object"
p: "Optional<br>(0 or 1)"
d: "An object with information about the pubkey script. This may be `null` if there was no 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: "The 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"
- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The transaction version number of the transaction containing the pubkey script"
- n: "→<br>`coinbase`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the transaction output belonged to a coinbase transaction; set to `false` for all other transactions. Coinbase transactions need to have 101 confirmations before their outputs can be spent"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the UTXO from the following transaction from the first output index ("0"),
searching the memory pool if necessary.
{% highlight bash %}
dash-cli -testnet gettxout \
e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f \
0 true
{% endhighlight %}
Result:
{% highlight json %}
{
"bestblock": "000000005651f6d7859793dee07d476a2f2a7338e66bbb41caf4b544c5b0318d",
"confirmations": 2,
"value": 25.00000000,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 b66266c5017a759817f3bb99e8d9124bf5bb2e74 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914b66266c5017a759817f3bb99e8d9124bf5bb2e7488ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"ycwoiAibTjpwnoCZSX7S4kiB2H8wULw9qo"
]
},
"version": 1,
"coinbase": false
}
{% endhighlight %}
*See also*
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}}
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,86 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/gettxoutproof.md" %}
##### GetTxOutProof
{% include helpers/subhead-links.md %}
{% assign summary_getTxOutProof="returns a hex-encoded proof that one or more specified transactions were included in a block." %}
{% autocrossref %}
The `gettxoutproof` RPC {{summary_getTxOutProof}}
NOTE: By default this function only works when there is an
unspent output in the UTXO set for this transaction. To make it always work,
you need to maintain a transaction index, using the `-txindex` command line option, or
specify the block in which the transaction is included in manually (by block header hash).
*Parameter #1---the transaction hashes to prove*
{% itemplate ntpd1 %}
- n: "TXIDs"
t: "array"
p: "Required<br>(exactly 1)"
d: "A JSON array of txids to filter"
- n: "→<br>`txid`"
t: "string"
p: "Required<br>(1 or more)"
d: "TXIDs of the transactions to generate proof for. All transactions must be in the same block"
{% enditemplate %}
*Parameter #2---the block to look for txids in*
{% itemplate ntpd1 %}
- n: "Header hash"
t: "string"
p: "Optional<br>(0 or 1)"
d: "If specified, looks for txid in the block with this hash"
{% enditemplate %}
*Result---serialized, hex-encoded data for the proof*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "A string that is a serialized, hex-encoded data for the proof"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Get the hex-encoded proof that "txid" was included in block 000000012d774f3c7668f32bc448efeb93b317f312dd863679de3a007d47817f:
{% highlight bash %}
dash-cli gettxoutproof \
'''
[
"e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f"
]
''' \
'000000012d774f3c7668f32bc448efeb93b317f312dd863679de3a007d47817f'
{% endhighlight %}
Result (wrapped):
{% highlight text %}
01000020ed72cc6a7294782a7711d8fa7ef74716ef062dc50bb0820f7eec923801000000\
aa5d17c5128043803b67c7ab03e4d3ffbc9604b54f877f1c5cf9ed3adeaa19b2cd7ed659\
f838011d10a70a480200000002033c89c2baecba9fc983c85dcf365c2d9cc93aca1dee2e\
5ac18124464056542e8faab0c579e651e9438c2904df5a498bc37a37acd528a251386fde\
f0476ba0e00105
{% endhighlight %}
*See also*
* [VerifyTxOutProof][rpc verifytxoutproof]: {{summary_verifyTxOutProof}}
* [`merkleblock` message][merkleblock message]: A description of the
format used for the proof.
{% endautocrossref %}

View file

@ -0,0 +1,88 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/gettxoutsetinfo.md" %}
##### GetTxOutSetInfo
{% include helpers/subhead-links.md %}
{% assign summary_getTxOutSetInfo="returns statistics about the confirmed unspent transaction output (UTXO) set. Note that this call may take some time and that it only counts outputs from confirmed transactions---it does not count outputs from the memory pool." %}
{% autocrossref %}
The `gettxoutsetinfo` RPC {{summary_getTxOutSetInfo}}
*Parameters: none*
*Result---statistics about the UTXO set*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about the UTXO set"
- n: "→<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of the local best block chain. A new node with only the hardcoded genesis block will have a height of 0"
- n: "→<br>`bestblock`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the header of the highest block on the local best block chain, encoded as hex in RPC byte order"
- n: "→<br>`transactions`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of transactions with unspent outputs"
- n: "→<br>`txouts`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of unspent transaction outputs"
- n: "→<br>`bytes_serialized`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of the serialized UTXO set in bytes; not counting overhead, this is the size of the `chainstate` directory in the Bitcoin Core configuration directory"
- n: "→<br>`hash_serialized`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "A SHA256(SHA256()) hash of the serialized UTXO set; useful for comparing two nodes to see if they have the same set (they should, if they always used the same serialization format and currently have the same best block). The hash is encoded as hex in RPC byte order"
- n: "→<br>`total_amount`"
t: "number (Dash)"
p: "Required<br>(exactly 1)"
d: "The total amount of Dash in the UTXO set"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet gettxoutsetinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"height": 4755,
"bestblock": "0000000025da0abc9e9937f1c65b3f544a57bb7e8817422f7ff2a89ff32696f4",
"transactions": 4748,
"txouts": 10602,
"bytes_serialized": 463925,
"hash_serialized": "fce0776d7961b409c4d8a46363c8d049879321861f7f40db97b0432e59532320",
"total_amount": 2243585.70000000
}
{% endhighlight %}
*See also*
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}}
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,46 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getunconfirmedbalance.md" %}
##### GetUnconfirmedBalance
{% include helpers/subhead-links.md %}
{% assign summary_getUnconfirmedBalance="returns the wallet's total unconfirmed balance." %}
{% autocrossref %}
*Requires wallet support.*
The `getunconfirmedbalance` RPC {{summary_getUnconfirmedBalance}}
*Parameters: none*
*Result---the balance of unconfirmed transactions paying this wallet*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The total number of bitcoins paid to this wallet in unconfirmed transactions"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getunconfirmedbalance
{% endhighlight %}
Result (no unconfirmed incoming payments):
{% highlight json %}
0.00000000
{% endhighlight %}
*See also*
* [GetBalance][rpc getbalance]: {{summary_getBalance}}
{% endautocrossref %}

View file

@ -0,0 +1,83 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getwalletinfo.md" %}
##### GetWalletInfo
{% include helpers/subhead-links.md %}
{% assign summary_getWalletInfo="provides information about the wallet." %}
{% autocrossref %}
*Requires wallet support.*
The `getwalletinfo` RPC {{summary_getWalletInfo}}
*Parameters: none*
*Result---information about the wallet*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object describing the wallet"
- n: "→<br>`walletversion`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The version number of the wallet"
- n: "→<br>`balance`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The balance of the wallet. The same as returned by the `getbalance` RPC with default parameters"
- n: "→<br>`txcount`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The total number of transactions in the wallet (both spends and receives)"
- n: "→<br>`keypoololdest`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The date as Unix epoch time when the oldest key in the wallet key pool was created; useful for only scanning blocks created since this date for transactions"
- n: "→<br>`keypoolsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of keys in the wallet keypool"
- n: "→<br>`unlocked_until`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Only returned if the wallet was encrypted with the `encryptwallet` RPC. A Unix epoch date when the wallet will be locked, or `0` if the wallet is currently locked"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getwalletinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"walletversion" : 60000,
"balance" : 1.45060000,
"txcount" : 17,
"keypoololdest" : 1398809500,
"keypoolsize" : 196,
"unlocked_until" : 0
}
{% endhighlight %}
*See also*
* [ListTransactions][rpc listtransactions]: {{summary_listTransactions}}
{% endautocrossref %}

View file

@ -0,0 +1,22 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getwork.md" %}
##### GetWork
{% include helpers/subhead-links.md %}
{% assign summary_getWork="was removed in Bitcoin Core 0.10.0." %}
{% autocrossref %}
The `getwork` RPC {{summary_getWork}} If you have an older
version of Bitcoin Core, use `help getwork` to get help.
*See also*
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [SubmitBlock][rpc submitblock]: {{summary_submitBlock}}
{% endautocrossref %}

View file

@ -0,0 +1,314 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/gobject.md" %}
##### GObject
{% include helpers/subhead-links.md %}
{% assign summary_gObject="provides a set of commands for managing governance objects and displaying information about them." %}
{% autocrossref %}
The `gobject` RPC {{summary_gObject}}
###### GObject Check
###### GObject Prepare
###### GObject Submit
###### GObject Deserialize
###### GObject Count
The `gobject count` RPC returns the count of governance objects and votes.
*Parameters: none*
*Result---count of governance objects and votes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The count of governance objects and votes"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet gobject count
{% endhighlight %}
Result (wrapped):
{% highlight text %}
Governance Objects: 177 (Proposals: 177, Triggers: 0, Watchdogs: 0/0, \
Other: 0; Erased: 5), Votes: 9680
{% endhighlight %}
###### GObject Get
The `gobject get` RPC returns a governance object by hash.
*Parameter #1---object hash*
{% itemplate ntpd1 %}
- n: "`governance-hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of a governance object"
{% enditemplate %}
*Result---governance object details*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about the governance object"
- n: "→<br>`DataHex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "Governance object info as hex string"
- n: "→<br>`DataString`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Governance object info as string"
- n: "→<br>`Hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "Hash of this governance object"
- n: "→<br>`CollateralHash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "Hash of the collateral payment transaction"
- n: "→<br>`ObjectType`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Object types:<br>`1` - Unknown<br>`2` - Proposal<br>`3` - Trigger<br>`4` - Watchdog"
- n: "→<br>`CreationTime`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Object creation time as Unix epoch time"
- n: "→<br>`FundingResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Funding vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`ValidResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Object validity vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`DeleteResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Delete vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`EndorsedResult`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Endorsed vote details"
- n: "→ →<br>`AbsoluteYesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes minus number of `No` votes"
- n: "→ →<br>`YesCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Yes` votes"
- n: "→ →<br>`NoCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `No` votes"
- n: "→ →<br>`AbstainCount`"
t: "number"
p: "Required<br>(exactly 1)"
d: "Number of `Abstain` votes"
- n: "→<br>`fLocalValidity`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Valid by the blockchain"
- n: "→<br>`IsValidReason`"
t: "string"
p: "Required<br>(exactly 1)"
d: "`fLocalValidity` error result. Empty if no error returned."
- n: "→<br>`fCachedValid`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc)"
- n: "→<br>`fCachedFunding`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached for this object to be funded (doesn't mean it will be for sure though)"
- n: "→<br>`fCachedDelete`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached saying this object should be deleted from the system entirely"
- n: "→<br>`fCachedEndorsed`"
t: "boolean"
p: "Required<br>(exactly 1)"
d: "Minimum network support has been reached flagging this object as endorsed"
{% enditemplate %}
*Example from Dash Core 0.12.2*
{% highlight bash %}
dash-cli -testnet gobject get \
42253a7bec554b97a65d2889e6cb9a1cf308b3d47a778c704bf9cdc1fe1bf6ff
{% endhighlight %}
Result (wrapped):
{% highlight json %}
{
"DataHex": "5b5b2270726f706f73616c222c7b22656e645f65706f6368223a2231353037343339353130222c226e616d65223a227465737470726f706f73616c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a3031323334353637383931353037323530343338222c227061796d656e745f61646472657373223a22795668577955345933756456784d5234464b3333556741534a41436831436835516a222c227061796d656e745f616d6f756e74223a2232222c2273746172745f65706f6368223a2231353037323530343338222c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472616c2e6f72672f702f746573745f70726f706f73616c5f31353037323530343338227d5d5d",
"DataString": "[[\"proposal\",{\"end_epoch\":\"1507439510\",\"name\":\"testproposal_-_abcdefghijklmnopqrstuvwxyz01234567891507250438\",\"payment_address\":\"yVhWyU4Y3udVxMR4FK33UgASJACh1Ch5Qj\",\"payment_amount\":\"2\",\"start_epoch\":\"1507250438\",\"type\":1,\"url\":\"https://www.dashcentral.org/p/test_proposal_1507250438\"}]]",
"Hash": "42253a7bec554b97a65d2889e6cb9a1cf308b3d47a778c704bf9cdc1fe1bf6ff",
"CollateralHash": "cb09bd0310c0a67cde9387ad4d8908a7ad9f5d89c5afd58e9332b8bd26a646c7",
"ObjectType": 1,
"CreationTime": 1507246694,
"FundingResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"ValidResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"DeleteResult": {
"AbsoluteYesCount": 31,
"YesCount": 31,
"NoCount": 0,
"AbstainCount": 0
},
"EndorsedResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"fLocalValidity": true,
"IsValidReason": "",
"fCachedValid": true,
"fCachedFunding": false,
"fCachedDelete": false,
"fCachedEndorsed": false
}
{% endhighlight %}
###### GObject Getvotes
###### GObject Getcurrentvotes
###### GObject List
###### GObject Diff
###### GObject Vote-alias
###### GObject Vote-conf
###### GObject Vote-many
{% highlight bash %}
dash-cli -testnet gobject
{% endhighlight %}
Result:
{% highlight json %}
*INSERT RESULTS HERE*
{% endhighlight %}
*See also:*
{% endautocrossref %}

View file

@ -0,0 +1,63 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/help.md" %}
##### Help
{% include helpers/subhead-links.md %}
{% assign summary_help="lists all available public RPC commands, or gets help for the specified RPC. Commands which are unavailable will not be listed, such as wallet RPCs if wallet support is disabled." %}
{% autocrossref %}
The `help` RPC {{summary_help}}
*Parameter---the name of the RPC to get help for*
{% itemplate ntpd1 %}
- n: "RPC"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The name of the RPC to get help for. If omitted, Dash Core 0.10x will display an alphabetical list of commands; Dash Core 0.11.0 will display a categorized list of commands"
{% enditemplate %}
*Result---a list of RPCs or detailed help for a specific RPC*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The help text for the specified RPC or the list of commands. The `dash-cli` command will parse this text and format it as human-readable text"
{% enditemplate %}
*Example from Dash Core 0.12.2*
Command to get help about the `help` RPC:
{% highlight bash %}
dash-cli -testnet help help
{% endhighlight %}
Result:
{% highlight text %}
help ( "command" )
List all commands, or get help for a specified command.
Arguments:
1. "command" (string, optional) The command to get help on
Result:
"text" (string) The help text
{% endhighlight %}
*See also*
* The [RPC Quick Reference][section RPC quick reference]
{% endautocrossref %}

View file

@ -0,0 +1,89 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/importaddress.md" %}
##### ImportAddress
{% include helpers/subhead-links.md %}
{% assign summary_importAddress="adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs." %}
{% autocrossref %}
*Requires wallet support.*
The `importaddress` RPC {{summary_importAddress}}
*Parameter #1---the address or pubkey script to watch*
{% itemplate ntpd1 %}
- n: "Address or Script"
t: "string (base58 or hex)"
p: "Required<br>(exactly 1)"
d: "Either a P2PKH or P2SH address encoded in base58check, or a pubkey script encoded as hex"
{% enditemplate %}
*Parameter #2---The account into which to place the address or pubkey script*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "An account name into which the address should be placed. Default is the default account, an empty string(\"\")"
{% enditemplate %}
*Parameter #3---whether to rescan the block chain*
{% itemplate ntpd1 %}
- n: "Rescan"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transaction affecting the newly-added address or pubkey script). Set to `false` to not rescan the block database (rescanning can be performed at any time by restarting Bitcoin Core with the `-rescan` command-line argument). Rescanning may take several minutes."
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If the address or pubkey script is added to the wallet (or is already part of the wallet), JSON `null` will be returned"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Add an address, rescanning the local block database for any transactions
matching it.
{% highlight bash %}
bitcoin-cli -testnet importaddress \
muhtvdmsnbQEPFuEmxcChX58fGvXaaUoVt "watch-only test" true
{% endhighlight %}
Result:
(No output<!--noref-->; success.)
Show that the address has been added:
{% highlight bash %}
bitcoin-cli -testnet getaccount muhtvdmsnbQEPFuEmxcChX58fGvXaaUoVt
{% endhighlight %}
Result:
{% highlight text %}
watch-only test
{% endhighlight %}
*See also*
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}}
{% endautocrossref %}

View file

@ -0,0 +1,173 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/importmulti.md" %}
##### ImportMulti
{% include helpers/subhead-links.md %}
{% assign summary_importMulti="imports addresses or scripts (with private keys, public keys, or P2SH redeem scripts) and optionally performs the minimum necessary rescan for all imports." %}
{% autocrossref %}
*Added in Bitcoin Core 0.14.0*
*Requires wallet support. Wallet must be unlocked.*
The `importmulti` RPC {{summary_importMulti}}
*Parameter #1---the addresses/scripts to import*
{% itemplate ntpd1 %}
- n: "Imports"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of JSON objects, each one being an address or script to be imported"
- n: "→ Import"
t: "object"
p: "Required<br>(1 or more)"
d: "A JSON object describing a particular import"
- n: "→ →<br>`scriptPubKey`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The script (string) to be imported. Must have either this field or `address` below"
- n: "→ →<br>`address`"
t: "string (base58)"
p: "Optional<br>(0 or 1)"
d: "The P2PKH or P2SH address to be imported. Must have either this field or `scriptPubKey` above"
- n: "→ →<br>`timestamp`"
t: "number (int) / string"
p: "Required<br>(exactly 1)"
d: "The creation time of the key in Unix epoch time or the string “now” to substitute the current synced block chain time. The timestamp of the oldest key will determine how far back block chain rescans need to begin. Specify `now` to bypass scanning for keys which are known to never have been used. Specify `0` to scan the entire block chain. Blocks up to 2 hours before the earliest key creation time will be scanned"
- n: "→ →<br>`redeemscript`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A redeem script. Only allowed if either the `address` field is a P2SH address or the `scriptPubKey` field is a P2SH scriptPubKey"
- n: "→ →<br>`pubkeys`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "Array of strings giving pubkeys that must occur in the scriptPubKey or redeemscript"
- n: "→ →<br>`keys`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "Array of strings giving private keys whose corresponding public keys must occur in the scriptPubKey or redeemscript"
- n: "→ →<br>`internal`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Stating whether matching outputs should be treated as change rather than incoming payments. The default is `false`"
- n: "→ →<br>`watchonly`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Stating whether matching outputs should be considered watched even when they're not spendable. This is only allowed if keys are empty. The default is `false`"
- n: "→ →<br>`label`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "Label to assign to the address, only allowed with `internal` set to `false`. The default is an empty string (“”)"
{% enditemplate %}
*Parameter #2---options regarding the import*
{% itemplate ntpd1 %}
- n: "Option"
t: "object"
p: "Optional<br>(0 or 1)"
d: "JSON object with options regarding the import"
- n: "→ <br>`rescan`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` (the default) to rescan the entire local block chain for transactions affecting any imported address or script. Set to `false` to not rescan after the import. Rescanning may take a considerable amount of time and may require re-downloading blocks if using block chain pruning"
{% enditemplate %}
*Result---execution result*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of JSON objects, with each object describing the execution result of each import"
- n: "→ Result"
t: "object"
p: "Required<br>(1 or more)"
d: "A JSON object describing the execution result of an imported address or script"
- n: "→ → <br>`success`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Displays `true` if the import has been successful or `false` if it failed"
- n: "→ → <br>`error`"
t: "string : object"
p: "Optional<br>(0 or 1)"
d: "A JSON object containing details about the error. Only displayed if the import fails"
- n: "→ → → <br>`code`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The error code"
- n: "→ → → <br>`message`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The error message"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
Import the address 1NL9w5fP9kX2D9ToNZPxaiwFJCngNYEYJo (giving it a label and scanning the entire block chain) and the scriptPubKey 76a9149e857da0a5b397559c78c98c9d3f7f655d19c68688ac (giving a specific timestamp and label):
{% highlight bash %}
bitcoin-cli importmulti '
[
{
"scriptPubKey" : { "address": "1NL9w5fP9kX2D9ToNZPxaiwFJCngNYEYJo" },
"timestamp" : 0,
"label" : "Personal"
},
{
"scriptPubKey" : "76a9149e857da0a5b397559c78c98c9d3f7f655d19c68688ac",
"timestamp" : 1493912405,
"label" : "TestFailure"
}
]' '{ "rescan": true }'
{% endhighlight %}
Result (scriptPubKey import failed because `internal` was not set to `true`):
{% highlight json %}
[
{
"success": true
},
{
"success": false,
"error": {
"code": -8,
"message": "Internal must be set for hex scriptPubKey"
}
}
]
{% endhighlight %}
*See also*
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [ImportAddress][rpc importaddress]: {{summary_importAddress}}
* [ImportWallet][rpc importwallet]: {{summary_importWallet}}
{% endautocrossref %}

View file

@ -0,0 +1,79 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/importprivkey.md" %}
##### ImportPrivKey
{% include helpers/subhead-links.md %}
{% assign summary_importPrivKey="adds a private key to your wallet. The key should be formatted in the wallet import format created by the `dumpprivkey` RPC." %}
{% autocrossref %}
*Requires wallet support. Wallet must be unlocked.*
The `importprivkey` RPC {{summary_importPrivKey}}
*Parameter #1---the private key to import*
{% itemplate ntpd1 %}
- n: "Private Key"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The private key to import into the wallet encoded in base58check using wallet import format (WIF)"
{% enditemplate %}
*Parameter #2---the account into which the key should be placed*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The name of an account to which transactions involving the key should be assigned. The default is the default account, an empty string (\"\")"
{% enditemplate %}
*Parameter #3---whether to rescan the block chain*
{% itemplate ntpd1 %}
- n: "Rescan"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transaction affecting the newly-added address for this private key). Set to `false` to not rescan the block database (rescanning can be performed at any time by restarting Bitcoin Core with the `-rescan` command-line argument). Rescanning may take several minutes. Notes: if the address for this key is already in the wallet, the block database will not be rescanned even if this parameter is set"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If the private key is added to the wallet (or is already part of the wallet), JSON `null` will be returned"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Import the private key for the address
mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe, giving it a label and scanning the
entire block chain:
{% highlight bash %}
bitcoin-cli -testnet importprivkey \
cU8Q2jGeX3GNKNa5etiC8mgEgFSeVUTRQfWE2ZCzszyqYNK4Mepy \
"test label" \
true
{% endhighlight %}
(Success: no result displayed.)
*See also*
* [DumpPrivKey][rpc dumpprivkey]: {{summary_dumpPrivKey}}
* [ImportAddress][rpc importaddress]: {{summary_importAddress}}
* [ImportWallet][rpc importwallet]: {{summary_importWallet}}
{% endautocrossref %}

View file

@ -0,0 +1,65 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/importprunedfunds.md" %}
##### ImportPrunedFunds
{% include helpers/subhead-links.md %}
{% assign summary_importPrunedFunds="imports funds without the need of a rescan. Meant for use with pruned wallets." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
*Requires wallet support.*
The `importprunedfunds` RPC {{summary_importPrunedFunds}} Corresponding address or script must previously be included in wallet.
The end-user is responsible to import additional transactions that subsequently spend the imported
outputs or rescan after the point in the blockchain the transaction is included.
*Parameter #1---the raw transaction to import*
{% itemplate ntpd1 %}
- n: "Raw Transaction"
t: "string<br>(hex)"
p: "Required<br>(exactly 1)"
d: "A raw transaction in hex funding an already-existing address in wallet"
{% enditemplate %}
*Parameter #2---the tx out proof that cointains the transaction*
{% itemplate ntpd1 %}
- n: "TX Out Proof"
t: "string<br>(hex)"
p: "Required<br>(exactly 1)"
d: "The hex output from gettxoutproof that contains the transaction"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If the funds are added to wallet, JSON `null` will be returned"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli importprunedfunds "txhex" "txoutproof"
{% endhighlight %}
(Success: no result displayed.)
*See also*
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [RemovePrunedFunds][rpc removeprunedfunds]: {{summary_removePrunedFunds}}
{% endautocrossref %}

View file

@ -0,0 +1,54 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/importwallet.md" %}
##### ImportWallet
{% include helpers/subhead-links.md %}
{% assign summary_importWallet="imports private keys from a file in wallet dump file format (see the `dumpwallet` RPC). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an
unencrypted wallet.*
The `importwallet` RPC {{summary_importWallet}}
*Parameter #1---the file to import*
{% itemplate ntpd1 %}
- n: "Filename"
t: "string"
p: "Required<br>(exactly 1)"
d: "The file to import. The path is relative to Bitcoin Core's working directory"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If all the keys in the file are added to the wallet (or are already part of the wallet), JSON `null` will be returned"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Import the file shown in the example subsection of the `dumpwallet` RPC.
{% highlight bash %}
bitcoin-cli -testnet importwallet /tmp/dump.txt
{% endhighlight %}
(Success: no result displayed.)
*See also*
* [DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}}
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
{% endautocrossref %}

View file

@ -0,0 +1,55 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/keypoolrefill.md" %}
##### KeyPoolRefill
{% include helpers/subhead-links.md %}
{% assign summary_keyPoolRefill="fills the cache of unused pre-generated keys (the keypool)." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an unencrypted
wallet.*
The `keypoolrefill` RPC {{summary_keyPoolRefill}}
*Parameter #1---the new keypool size*
{% itemplate ntpd1 %}
- n: "Key Pool Size"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The new size of the keypool; if the number of keys in the keypool is less than this number, new keys will be generated. Default is `100`. The value `0` also equals the default. The value specified is for this call only---the default keypool size is not changed"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If the keypool is successfully filled, JSON `null` will be returned"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Generate one extra key than the default:
{% highlight bash %}
bitcoin-cli -testnet keypoolrefill 101
{% endhighlight %}
(No result shown: success.)
*See also*
* [GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}
* [GetAccountAddress][rpc getaccountaddress]: {{summary_getAccountAddress}}
* [GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,76 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/listaccounts.md" %}
##### ListAccounts
{% include helpers/subhead-links.md %}
{% assign summary_listAccounts="lists accounts and their balances." %}
{% autocrossref %}
*Requires wallet support.*
The `listaccounts` RPC {{summary_listAccounts}}
{{WARNING}} `listaccounts` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---the minimum number of confirmations a transaction must have*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Parameter #2---whether to include watch-only addresses in results*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Result---a list of accounts and their balances*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "A JSON array containing key/value pairs with account names and values. Must include, at the very least, the default account (\"\")"
- n: "→<br>Account : Balance"
t: "string : number (bitcoins)"
p: "Required<br>(1 or more)"
d: "The name of an account as a string paired with the balance of the account as a number of bitcoins. The number of bitcoins may be negative if the account has spent more bitcoins than it received. Accounts with zero balances and zero transactions will be displayed"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Display account balances with one confirmation and watch-only addresses
included.
{% highlight bash %}
bitcoin-cli -testnet listaccounts 1 true
{% endhighlight %}
Result:
{% highlight json %}
{
"" : -2.73928803,
"Refund from example.com" : 0.00000000,
"doc test" : -498.45900000,
"someone else's address" : 0.00000000,
"someone else's address2" : 0.00050000,
"test" : 499.97975293,
"test account" : 0.00000000,
"test label" : 0.48961280,
"test1" : 1.99900000
}
{% endhighlight %}
*See also*
* [GetAccount][rpc getaccount]: {{summary_getAccount}}
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}}
{% endautocrossref %}

View file

@ -0,0 +1,84 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/listaddressgroupings.md" %}
##### ListAddressGroupings
{% include helpers/subhead-links.md %}
{% assign summary_listAddressGroupings="lists groups of addresses that may have had their common ownership made public by common use as inputs in the same transaction or from being used as change from a previous transaction." %}
{% autocrossref %}
*Requires wallet support.*
The `listaddressgroupings` RPC {{summary_listAddressGroupings}}
*Parameters: none*
*Result---an array of arrays describing the groupings*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing the groupings. May be empty"
- n: "→<br>Groupings"
t: "array"
p: "Optional<br>(0 or more)"
d: "An array containing arrays of addresses which can be associated with each other"
- n: "→ →<br>Address Details"
t: "array"
p: "Required<br>(1 or more)"
d: "An array containing information about a particular address"
- n: "→ → →<br>Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The address in base58check format"
- n: "→ → →<br>Balance"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The current spendable balance of the address, not counting unconfirmed transactions"
- n: "→ → →<br>Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The account the address belongs to, if any. This field will not be returned for change addresses. The default account is an empty string (\"\")"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet listaddressgroupings
{% endhighlight %}
Result (edited to only the first two results):
{% highlight json %}
[
[
[
"mgKgzJ7HR64CrB3zm1B4FUUCLtaSqUKfDb",
0.00000000
],
[
"mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck",
0.00000000,
"test1"
]
]
]
{% endhighlight %}
*See also*
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,87 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/listbanned.md" %}
##### ListBanned
{% include helpers/subhead-links.md %}
{% assign summary_listBanned="lists all banned IPs/Subnets." %}
{% autocrossref %}
*Added in Bitcoin Core 0.12.0*
The `listbanned` RPC {{summary_listBanned}}
*Parameters: none*
*Result---information about each banned IP/Subnet*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An array of objects each describing one entry. If there are no entries in the ban list, the array will be empty"
- n: "→<br>Node<!--noref-->"
t: "object"
p: "Optional<br>(0 or more)"
d: "A ban list entry"
- n: "→ →<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The IP/Subnet of the entry"
- n: "→ →<br>`banned_until`"
t: "number<br>(int)"
p: "Required<br>(exactly 1)"
d: "The Unix epoch time when the entry was added to the ban list"
- n: "→ →<br>`ban_created`"
t: "number<br>(int)"
p: "Required<br>(exactly 1)"
d: "The Unix epoch time until the IP/Subnet is banned"
- n: "→ →<br>`ban_reason`"
t: "string"
p: "Required<br>(exactly 1)"
d: "Set to one of the following reasons:<br>`node<!--noref--> misbehaving` if the node was banned by the client because of DoS violations<br>`manually added` if the node was manually banned by the user"
{% enditemplate %}
*Examples from Dash Core 0.12.2*
The default (`false`):
{% highlight bash %}
dash-cli listbanned
{% endhighlight %}
Result:
{% highlight json %}
[
{
"address": "192.0.2.201/32",
"banned_until": 1507906175,
"ban_created": 1507819775,
"ban_reason": "node misbehaving"
},
{
"address": "192.0.2.101/32",
"banned_until": 1507906199,
"ban_created": 1507819799,
"ban_reason": "manually added"
}
]
{% endhighlight %}
*See also*
* [SetBan][rpc setban]: {{summary_setBan}}
* [ClearBanned][rpc clearbanned]: {{summary_clearBanned}}
{% endautocrossref %}

View file

@ -0,0 +1,66 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/listlockunspent.md" %}
##### ListLockUnspent
{% include helpers/subhead-links.md %}
{% assign summary_listLockUnspent="returns a list of temporarily unspendable (locked) outputs." %}
{% autocrossref %}
*Requires wallet support.*
The `listlockunspent` RPC {{summary_listLockUnspent}}
*Parameters: none*
*Result---an array of locked outputs*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing all locked outputs. May be empty"
- n: "→<br>Output"
t: "object"
p: "Optional<br>(1 or more)"
d: "An object describing a particular locked output"
- n: "→ →<br>`txid`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction containing the locked output, encoded as hex in RPC byte order"
- n: "→ →<br>`vout`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The output index number (vout) of the locked output within the transaction. Output index `0` is the first output within the transaction"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet listlockunspent
{% endhighlight %}
Result:
{% highlight json %}
[
{
"txid" : "ca7cb6a5ffcc2f21036879493db4530c0ce9b5bff9648f9a3be46e2dfc8e0166",
"vout" : 0
}
]
{% endhighlight %}
*See also*
* [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}}
{% endautocrossref %}

View file

@ -0,0 +1,107 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/listreceivedbyaccount.md" %}
##### ListReceivedByAccount
{% include helpers/subhead-links.md %}
{% assign summary_listReceivedByAccount="lists the total number of bitcoins received by each account." %}
{% autocrossref %}
*Requires wallet support.*
The `listreceivedbyaccount` RPC {{summary_listReceivedByAccount}}
{{WARNING}} `listreceivedbyaccount` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---the minimum number of confirmations a transaction must have to be counted*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Parameter #2---whether to include empty accounts*
{% itemplate ntpd1 %}
- n: "Include Empty"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to display accounts which have never received a payment. Set to `false` (the default) to only include accounts which have received a payment. Any account which has received a payment will be displayed even if its current balance is `0`"
{% enditemplate %}
*Parameter #3---whether to include watch-only addresses in results*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Result---account names, balances, and minimum confirmations*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing objects each describing an account. At the very least, the default account (\"\") will be included"
- n: "→<br>Account"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing an account"
- n: "→ →<br>`involvesWatchonly`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if the balance of this account includes a watch-only address which has received a spendable payment (that is, a payment with at least the specified number of confirmations and which is not an immature coinbase). Otherwise not returned"
- n: "→ →<br>`account`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account"
- n: "→ →<br>`amount`<!--noref-->"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The total amount received by this account in bitcoins"
- n: "→ →<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations received by the last transaction received by this account. May be `0`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Get the balances for all non-empty accounts, including only transactions
which have been confirmed at least six times:
{% highlight bash %}
bitcoin-cli -testnet listreceivedbyaccount 6 false
{% endhighlight %}
Result (edited to only show the first two results):
{% highlight json %}
[
{
"account" : "",
"amount" : 0.19960000,
"confirmations" : 53601
},
{
"account" : "doc test",
"amount" : 0.30000000,
"confirmations" : 8991
}
]
{% endhighlight %}
*See also*
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}}
* [GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}}
* [GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}
{% endautocrossref %}

View file

@ -0,0 +1,136 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/listreceivedbyaddress.md" %}
##### ListReceivedByAddress
{% include helpers/subhead-links.md %}
{% assign summary_listReceivedByAddress="lists the total number of bitcoins received by each address." %}
{% autocrossref %}
*Requires wallet support.*
The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
*Parameter #1---the minimum number of confirmations a transaction must have to be counted*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Parameter #2---whether to include empty accounts*
{% itemplate ntpd1 %}
- n: "Include Empty"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to display accounts which have never received a payment. Set to `false` (the default) to only include accounts which have received a payment. Any account which has received a payment will be displayed even if its current balance is `0`"
{% enditemplate %}
*Parameter #3---whether to include watch-only addresses in results*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Result---addresses, account names, balances, and minimum confirmations*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing objects each describing a particular address"
- n: "→<br>Address"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing an address"
- n: "→ →<br>`involvesWatchonly`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if this address is a watch-only address which has received a spendable payment (that is, a payment with at least the specified number of confirmations and which is not an immature coinbase). Otherwise not returned"
- n: "→ →<br>`address`"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The address being described encoded in base58check"
- n: "→ →<br>`account`"
t: "string"
p: "Required<br>(exactly 1)"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The account the address belongs to. May be the default account, an empty string (\"\")"
- n: "→ →<br>`amount`"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The total amount the address has received in bitcoins"
- n: "→ →<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations of the latest transaction to the address. May be `0` for unconfirmed"
- n: "→ →<br>`label`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The account the address belongs to. May be the default account, an empty string (\"\")"
- n: "→ →<br>`txids`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of TXIDs belonging to transactions that pay the address"
- n: "→ → →<br>TXID"
t: "string"
p: "Optional<br>(0 or more)"
d: "The TXID of a transaction paying the address, encoded as hex in RPC byte order"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
List addresses with balances confirmed by at least six blocks, including
watch-only addresses:
{% highlight bash %}
bitcoin-cli -testnet listreceivedbyaddress 6 false true
{% endhighlight %}
Result (edit to show only two entries):
{% highlight json %}
[
{
"address" : "mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck",
"account" : "test1",
"amount" : 1.99900000,
"confirmations" : 55680,
"label" : "test1",
"txids" : [
"4d71a6127796766c39270881c779b6e05183f2bf35589261e9572436356f287f",
"997115d0cf7b83ed332e6c1f2e8c44f803c95ea43490c84ce3e9ede4b2e1605f"
]
},
{
"involvesWatchonly" : true,
"address" : "n3GNqMveyvaPvUbH469vDRadqpJMPc84JA",
"account" : "someone else's address2",
"amount" : 0.00050000,
"confirmations" : 34714,
"label" : "someone else's address2",
"txids" : [
"99845fd840ad2cc4d6f93fafb8b072d188821f55d9298772415175c456f3077d"
]
}
]
{% endhighlight %}
*See also*
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}}
* [GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}
* [GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}}
{% endautocrossref %}

Some files were not shown because too many files have changed in this diff Show more