Renamed devdocs/bitcoin-core to dash-core

- Updated developer-reference.md to point at new location
This commit is contained in:
thephez 2017-09-14 15:05:24 -04:00
parent a4df61c041
commit 43ee8beb9a
119 changed files with 120 additions and 120 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/bitcoin-core/api-intro.md" %}
## Bitcoin 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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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,308 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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 %}
<!-- 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 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 0.14.0</abbr>**' %}
{% assign UPDATED0_14_0='**<abbr title="Updated in Bitcoin Core v0.14.0">Updated in 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 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 0.13.0</abbr>*' %}
{% assign UPDATED0_13_0='*<abbr title="Updated in Bitcoin Core v0.13.0">Updated in 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 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 0.12.0</abbr>*' %}
{% assign UPDATED0_12_0='*<abbr title="Updated in Bitcoin Core v0.12.0">Updated in 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 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
{:.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}}
* [GetBlockHeader][rpc getblockheader]: {{summary_getBlockHeader}} {{NEW0_12_0}}
* [GetBlockHeaders][rpc getblockheaders]: {{summary_getBlockHeaders}}
* [GetChainTips][rpc getchaintips]: {{summary_getChainTips}}
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficultly}}
<!-- Not in Dash
* [GetMemPoolAncestors][rpc getmempoolancestors]: {{summary_getMemPoolAncestors}} {{NEW0_13_0}}
* [GetMemPoolDescendants][rpc getmempooldescendants]: {{summary_getMemPoolDescendants}} {{NEW0_13_0}}
* [GetMemPoolEntry][rpc getmempoolentry]: {{summary_getMemPoolEntry}} {{NEW0_13_0}}
-->
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{UPDATED0_12_0}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}} {{UPDATED0_13_0}}
* [GetSpentInfo][rpc getspentifo]: {{summary_getSpentInfo}}
* [GetTxOut][rpc gettxout]: {{summary_getTxOut}}
* [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
<!-- Not in Dash
* [PreciousBlock][rpc preciousblock]: {{summary_preciousBlock}} {{NEW0_14_0}}
* [PruneBlockChain][rpc pruneblockchain]: {{summary_pruneBlockChain}} {{NEW0_14_0}}
-->
* [VerifyChain][rpc verifychain]: {{summary_verifyChain}}
* [VerifyTxOutProof][rpc verifytxoutproof]: {{summary_verifyTxOutProof}} {{NEW0_11_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}}
* [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}}
<!-- Not in Dash
* [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}}
<!-- Not in Dash
* [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}}
<!-- Not in Dash
* [GetMemoryInfo][rpc getmemoryinfo]: {{summary_getMemoryInfo}} {{NEW_14_0}}
-->
* [ValidateAddress][rpc validateaddress]: {{summary_validateAddress}} {{UPDATED0_13_0}}
* [VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}}
{% 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}}
<!-- Not in Dash
* [AddWitnessAddress][rpc addwitnessaddress]: {{summary_addWitnessAddress}} {{NEW0_13_0}}
-->
* [AddMultiSigAddress][rpc addmultisigaddress]: {{summary_addMultiSigAddress}}
* [BackupWallet][rpc backupwallet]: {{summary_backupWallet}}
<!-- Not in Dash
* [BumpFee][rpc bumpfee]: {{summary_bumpFee}} {{NEW0_14_0}}
-->
* [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}}
<!-- Not in Dash
* [ImportMulti][rpc importmulti]: {{summary_importMulti}} {{NEW0_14_0}}
* [ImportPrunedFunds][rpc importprunedfunds]: {{summary_importPrunedFunds}} {{NEW0_13_0}}
-->
* [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}}
<!-- Not in Dash
* [RemovePrunedFunds][rpc removeprunedfunds]: {{summary_removePrunedFunds}} {{NEW0_13_0}}
-->
* [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}}
<!-- Not in Dash
* [SignMessageWithPrivKey][rpc signmessagewithprivkey]: {{summary_signMessageWithPrivKey}} {{NEW0_13_0}}
-->
* [WalletLock][rpc walletlock]: {{summary_walletLock}}
* [WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}
* [WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}
{% 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/bitcoin-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/bitcoin-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/bitcoin-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>`. The IP address may be a hostname resolvable through DNS, an IPv4 address, an IPv4-as-IPv6 address, or an IPv6 address"
{% 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 removing a node that is not on the addnodes list"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Try connecting to the following node.
{% highlight bash %}
bitcoin-cli -testnet addnode 192.0.2.113:18333 onetry
{% endhighlight %}
Result (no output from `bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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 Bitcoin Core 0.13.1*
Clears the ban list.
{% highlight bash %}
bitcoin-cli clearbanned
{% endhighlight %}
Result (no output from `bitcoin-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/bitcoin-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,108 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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: "Inputs"
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: "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 (bitcoins)"
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 bitcoins"
{% 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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet createrawtransaction '''
[
{
"txid": "1eb590cd06127f78bf38ab4140c4cdce56ad9eb8886999eb898ddf4d3b28a91d",
"vout" : 0
}
]''' '{ "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe": 0.13 }'
{% endhighlight %}
Result (wrapped):
{% highlight text %}
01000000011da9283b4ddf8d89eb996988b89ead56cecdc44041ab38bf787f12\
06cd90b51e0000000000ffffffff01405dc600000000001976a9140dfc8bafc8\
419853b34d5e072ad37d1a5159f58488ac00000000
{% 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,97 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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/bitcoin-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/bitcoin-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: "Address"
t: "string"
p: "Required<br>(exactly 1)"
d: "*Updated in Bitcoin Core 0.14.1*<br><br>The node you want to disconnect from as a string in the form of `<IP address>:<port>`. The IP address may be a hostname resolvable through DNS, an IPv4 address, an IPv4-as-IPv6 address, or an IPv6 address"
{% 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 Bitcoin Core 0.14.1*
Disconnects following node from your node.
{% highlight bash %}
bitcoin-cli -testnet disconnectnode 192.0.2.113:18333
{% endhighlight %}
Result (no output from `bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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,75 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/generate.md" %}
##### Generate
{% include helpers/subhead-links.md %}
{% assign summary_generate="nearly instantly generates blocks." %}
{% autocrossref %}
*Requires wallet support.*
The `generate` RPC {{summary_generate}}
*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---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 in regtest mode, as hex in RPC byte order"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
Using regtest mode (also works in normal mode), generate 2 blocks:
{% highlight bash %}
bitcoin-cli -regtest generate 2 500000
{% endhighlight %}
Result:
{% highlight json %}
[
"36252b5852a5921bdfca8701f936b39edeb1f8c39fffe73b0d8437921401f9af",
"5f2956817db1e386759aa5794285977c70596b39ea093b9eab0aa4ba8cd50c06"
]
{% endhighlight %}
*See also*
* [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
{% 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/bitcoin-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*
*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}}
{% 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/bitcoin-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/bitcoin-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/bitcoin-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: "Details"
t: "bool"
p: "Required<br>(exactly 1)"
d: "*Removed in Bitcoin Core 0.14.0*<br><br>Set to `true` to display detailed information about each added node; set to `false` to only display the IP address or hostname and port added"
{% 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"
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. This element is present for any added node whether or not the Details parameter was set to `true`"
- n: "→ →<br>`connected`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "If the Details parameter was set to `true`, this will be set to `true` if the node is currently connected and `false` if it is not"
- n: "→ →<br>`addresses`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "If the Details parameter was set to `true`, this will be an array of addresses belonging to the added node"
- n: "→ → →<br>Address"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing one of this node's addresses"
- 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 Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli getaddednodeinfo
{% endhighlight %}
Result (real hostname and IP address replaced):
{% highlight json %}
[
{
"addednode" : "bitcoind.example.com:8333",
"connected" : true,
"addresses" : [
{
"address" : "192.0.2.113:8333",
"connected" : "outbound"
}
]
}
]
{% endhighlight %}
*See also*
* [AddNode][rpc addnode]: {{summary_addNode}}
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}}
{% 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/bitcoin-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,68 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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/bitcoin-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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getbestblockhash
{% endhighlight %}
Result:
{% highlight text %}
0000000000075c58ed39c3e50f99b32183d090aefa0cf8c324a82eea9b01a887
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,212 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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: "number"
p: "Optional<br>(0, 1 or 2)"
d: "Set to `0` to get the block in serialized block format; set to `1` (the default) to get the decoded block as a JSON object; set to `2` to get the decoded block as a JSON object with verbose transaction decoding"
{% 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>`strippedsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The size of this block in serialized block format excluding witness data, counted in bytes"
- n: "→<br>`weight`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>This block's weight as defined in BIP141"
- 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 formatted in hexadecimal"
- 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 Bitcoin Core 0.13.1*
Get a block in raw hex:
{% highlight bash %}
bitcoin-cli getblock \
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 \
false
{% endhighlight %}
Result (wrapped):
{% highlight text %}
010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900\
00000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e8\
57233e0e61bc6649ffff001d01e3629901010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff0704ffff001d\
0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781\
e62294721166bf621e73a82cbf2342c858eeac00000000
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
bitcoin-cli getblock \
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
{% endhighlight %}
Result:
{% highlight json %}
{
"hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"confirmations": 447014,
"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*
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% 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/bitcoin-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 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"
- n: "→ → →<br>`since`"
t: "numeric<br>(int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.14.0*<br><br>The height of the first block to which the status applies"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli getblockchaininfo
{% endhighlight %}
Result:
{% highlight json %}
{
"chain": "main",
"blocks": 464562,
"headers": 464562,
"bestblockhash": "00000000000000000085bd56990c579a36bade6ea427646612f13476edb30ceb",
"difficulty": 521974519553.6282,
"mediantime": 1493758169,
"verificationprogress": 0.999989733170878,
"chainwork": "00000000000000000000000000000000000000000052c26f32ffa22706efd28c",
"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*
* [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/bitcoin-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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getblockcount
{% endhighlight %}
Result:
{% highlight text %}
315280
{% 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/bitcoin-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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getblockhash 240886
{% endhighlight %}
Result:
{% highlight text %}
00000000a0faf83ab5799354ae9c11da2a2bd6db44058e03c528851dee0a3fff
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,178 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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>`versionHex`"
t: "number (hex)"
p: "Required<br>(exactly 1)"
d: "This block's hex 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>`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 Bitcoin Core 0.12.1*
Get a block header in raw hex:
{% highlight bash %}
bitcoin-cli -testnet getblockheader \
00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09 \
false
{% endhighlight %}
Result (wrapped):
{% highlight text %}
010000007de867cc8adc5cc8fb6b898ca4462cf9fd667d7830a275277447e608\
00000000338f121232e169d3100edd82004dc2a1f0e1f030c6c488fa61eafa93\
0b0528fe021f7449ffff001d36b4af9a
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
bitcoin-cli -testnet getblockheader \
00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09
{% endhighlight %}
Result:
{% highlight json %}
{
"hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
"confirmations": 437926,
"height": 1000,
"version": 1,
"versionHex": "00000001",
"merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33",
"time": 1232346882,
"mediantime": 1232344831,
"nonce": 2595206198,
"bits": "1d00ffff",
"difficulty": 1,
"chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9",
"previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d",
"nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6"
}
{% endhighlight %}
*See also*
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% endautocrossref %}

View file

@ -0,0 +1,28 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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][]
*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/bitcoin-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>`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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getchaintips
{% endhighlight %}
{% highlight json %}
[
{
"height" : 312647,
"hash" : "000000000b1be96f87b31485f62c1361193304a5ad78acf47f9164ea4773a843",
"branchlen" : 0,
"status" : "active"
},
{
"height" : 282072,
"hash" : "00000000712340a499b185080f94b28c365d8adb9fc95bca541ea5e708f31028",
"branchlen" : 5,
"status" : "valid-fork"
},
{
"height" : 281721,
"hash" : "000000006e1f2a32199629c6c1fbd37766f5ce7e8c42bab0c6e1ae42b88ffe12",
"branchlen" : 1,
"status" : "valid-headers"
},
]
{% 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/bitcoin-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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-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/bitcoin-core/rpcs/rpcs/getdifficulty.md" %}
##### GetDifficulty
{% include helpers/subhead-links.md %}
{% assign summary_getDifficultly="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 Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getdifficulty
{% endhighlight %}
Result:
{% highlight text %}
1.00000000
{% endhighlight %}
*See also*
* [GetNetworkHashPS][rpc getnetworkhashps]: {{summary_getNetworkHashPS}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,26 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/getgenerate.md" %}
##### GetGenerate
{% include helpers/subhead-links.md %}
{% assign summary_getGenerate="was removed in Bitcoin Core 0.13.0." %}
{% autocrossref %}
*Requires wallet support.*
The `getgenerate` RPC {{summary_getGenerate}} If you have an older
version of Bitcoin Core, use `help getgenerate` to get help.
*See also*
* [Generate][rpc generate]: {{summary_generate}}
* [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
{% 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/bitcoin-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,147 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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 Bitcoin
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, Bitcoin Core 0.9.2 has the integer version number 90200"
- 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 (bitcoins)"
p: "Optional<br>(0 or 1)"
d: "The balance of the wallet in bitcoins. Only returned if wallet support is enabled"
- 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>`paytxfee`"
t: "number (bitcoins)"
p: "Optional<br>(0 or 1)"
d: "The minimum fee to pay per kilobyte of transaction; may be `0`. Only returned if wallet suuport is enabled"
- n: "→<br>`relayfee`"
t: "number (bitcoins)"
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>`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>`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 Bitcoin Core 0.10.0 with wallet support enabled*
{% highlight bash %}
bitcoin-cli -testnet getinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"version" : 100000,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 1.27007770,
"blocks" : 315281,
"timeoffset" : 0,
"connections" : 9,
"proxy" : "",
"difficulty" : 1.00000000,
"testnet" : true,
"keypoololdest" : 1418924649,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"relayfee" : 0.00001000,
"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/bitcoin-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,214 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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*
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}}
{% endautocrossref %}

View file

@ -0,0 +1,214 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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*
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}}
{% endautocrossref %}

View file

@ -0,0 +1,148 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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*
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}}
{% 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/bitcoin-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 Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli -testnet getmempoolinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"size": 1237,
"bytes": 591126,
"usage": 1900416,
"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,117 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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: "*Removed in Bitcoin Core 0.13.0*<br><br>The limit on the number of processors to use for generation. If generation was enabled since the last time this node was restarted, this is the number used in the second parameter of the `setgenerate` RPC (or the default). Otherwise, it is `-1`"
- 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: "*Removed in Bitcoin Core 0.14.0*<br><br>Set to `true` if this node is running on testnet. Set to `false` if this node is on mainnet or a regtest"
- 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: "*Removed in Bitcoin Core 0.13.0*<br><br>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"
- n: "→<br>`hashespersec`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "*Removed in Bitcoin Core 0.11.0*<br><br>The approximate number of hashes per second this node is generating across all CPUs, if generation is enabled. Otherwise `0`. Only returned if the node has wallet support enabled"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli getmininginfo
{% endhighlight %}
Result:
{% highlight json %}
{
"blocks": 464545,
"currentblocksize": 0,
"currentblockweight": 0,
"currentblocktx": 0,
"difficulty": 521974519553.6282,
"errors": "",
"networkhashps": 4.126888339085874e+18,
"pooledtx": 31241,
"chain": "main"
}
{% 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/bitcoin-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. The timeframe is currently set to `24` hours"
- n: "→ →<br>`target`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The maximum allowed outbound traffic in bytes. The default is `0`. Can be changed with `-maxuploadtarget`"
- n: "→ →<br>`target_reached`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Indicates if the target is reached. If the target 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 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 is set"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli getnettotals
{% endhighlight %}
Result:
{% highlight json %}
{
"totalbytesrecv": 7137052851,
"totalbytessent": 211648636140,
"timemillis": 1481227418585,
"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/bitcoin-core/rpcs/rpcs/getnetworkhashps.md" %}
##### GetNetworkHashPS
{% include helpers/subhead-links.md %}
{% assign summary_getNetworkHashPS="returns the estimated current or historical 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 Bitcoin Core 0.10.0*
Get the average hashes per second for all the blocks since the last
difficulty change before block 227255.
{% highlight bash %}
bitcoin-cli -testnet getnetworkhashps -1 227255
{% endhighlight %}
Result:
{% highlight json %}
79510076167
{% endhighlight %}
*See also*
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficultly}}
* [GetBlock][rpc getblock]: {{summary_getBlock}}
{% 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/bitcoin-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 Bitcoin Core in its internal integer format. For example, Bitcoin Core 0.9.2 has the integer version number 90200"
- 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"
t: "object"
p: "Optional<br>(0 to 3)"
d: "An object describing a network. If the network is unroutable, it will not be returned"
- n: "→ → →<br>`name`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the network. 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 are allowed according to the `-onlynet` Bitcoin 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. 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. 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 (bitcoins)"
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>`localaddresses`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects each describing the local addresses this node believes it listens on"
- n: "→ →<br>Address"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing a particular address this node believes it listens on"
- n: "→ → →<br>`address`"
t: "string"
p: "Required<br>(exactly 1)"
d: "An IP address or .onion address 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 Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli getnetworkinfo
{% endhighlight %}
Result (actual addresses have been replaced with reserved addresses):
{% highlight json %}
{
"version": 130100,
"subversion": "/Satoshi:0.13.1/",
"protocolversion": 70014,
"localservices": "000000000000000d",
"localrelay": true,
"timeoffset": -19,
"connections": 8,
"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": 5000.00000000,
"localaddresses": [
{
"address": "0600:3c03::f03c:91ff:fe89:dfc4",
"port": 8333,
"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/bitcoin-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,230 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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"
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 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:8333`"
- 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; set to `false` if we connected to this node"
- 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, Bitcoin 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"
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 Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-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:43132",
"addrlocal": "127.0.0.1:8333",
"services": "0000000000000000",
"relaytxes": true,
"lastsend": 1481158534,
"lastrecv": 1481158534,
"bytessent": 142772,
"bytesrecv": 14167,
"conntime": 1481158420,
"timeoffset": 11,
"pingtime": 0.226368,
"minping": 0.226368,
"version": 70001,
"subver": "/Satoshi:0.12.1/",
"inbound": true,
"startingheight": 0,
"banscore": 0,
"synced_headers": -1,
"synced_blocks": -1,
"inflight": [
],
"whitelisted": false,
"bytessent_per_msg": {
"addr": 55,
"inv": 12161,
"ping": 32,
"pong": 1824,
"tx": 128549,
"verack": 24,
"version": 127
},
"bytesrecv_per_msg": {
"getdata": 12161,
"ping": 1824,
"pong": 32,
"verack": 24,
"version": 126
}
}
]
{% endhighlight %}
*See also*
* [GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}}
* [GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
{% 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/bitcoin-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,201 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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: "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*
The default (`false`):
{% highlight bash %}
bitcoin-cli getrawmempool
{% endhighlight %}
Result:
{% highlight json %}
[
"b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873",
"094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4"
]
{% endhighlight %}
Verbose output (`true`):
{% highlight bash %}
bitcoin-cli getrawmempool 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*
* [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/bitcoin-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/bitcoin-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/bitcoin-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,154 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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/bitcoin-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 (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The amount of bitcoins 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 Bitcoin Core 0.10.0*
Get the UTXO from the following transaction from the first output index ("0"),
searching the memory pool if necessary.
{% highlight bash %}
bitcoin-cli -testnet gettxout \
d77aee99e8bdc11f40b8a9354956f0346fec5535b82c77c8b5c06047e3bca86a \
0 true
{% endhighlight %}
Result:
{% highlight json %}
{
"bestblock" : "00000000c92356f7030b1deeab54b3b02885711320b4c48523be9daa3e0ace5d",
"confirmations" : 0,
"value" : 0.00100000,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 a11418d3c144876258ba02909514d90e71ad8443 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a914a11418d3c144876258ba02909514d90e71ad844388ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mvCfAJSKaoFXoJEvv8ssW7wxaqRPphQuSv"
]
},
"version" : 1,
"coinbase" : false
}
{% endhighlight %}
*See also*
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}}
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
{% 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/bitcoin-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 Bitcoin Core 0.11.0*
Get the hex-encoded proof that "txid" was included in block 0000000000000000140e84bf183d8d5207d65fbfae596bdf48f684d13d951847:
{% highlight bash %}
bitcoin-cli gettxoutproof \
'''
[
"f20e44c818ec332d95119507fbe36f1b8b735e2c387db62adbe28e50f7904683"
]
''' \
'0000000000000000140e84bf183d8d5207d65fbfae596bdf48f684d13d951847'
{% endhighlight %}
Result (wrapped):
{% highlight text %}
03000000394ab3f08f712aa0f1d26c5daa4040b50e96d31d4e8e3c130000000000000000\
ca89aaa0bbbfcd5d1210c7888501431256135736817100d8c2cf7e4ab9c02b168115d455\
04dd1418836b20a6cb0800000d3a61beb3859abf1b773d54796c83b0b937968cc4ce3c0f\
71f981b2407a3241cb8908f2a88ac90a2844596e6019450f507e7efb8542cbe54ea55634\
c87bee474ee48aced68179564290d476e16cff01b483edcd2004d555c617dfc08200c083\
08ba511250e459b49d6a465e1ab1d5d8005e0778359c2993236c85ec66bac4bfd974131a\
dc1ee0ad8b645f459164eb38325ac88f98c9607752bc1b637e16814f0d9d8c2775ac3f20\
f85260947929ceef16ead56fcbfd77d9dc6126cce1b5aacd9f834690f7508ee2db2ab67d\
382c5e738b1b6fe3fb079511952d33ec18c8440ef291eb8d3546a971ee4aa5e574b7be7f\
5aff0b1c989b2059ae5a611c8ce5c58e8e8476246c5e7c6b70e0065f2a6654e2e6cf4efb\
6ae19bf2548a7d9febf5b0aceaff28610922e1b9e23e52f650a4a11d2986c9c2b09bb168\
a70a7d4ac16e4d389bc2868ee91da1837d2cd79288bdc680e9c35ebb3ddfd045d69d767b\
164ec69d5db9f995c045d10af5bd90cd9d1116c3732e14796ef9d1a57fa7bb718c07989e\
d06ff359bf2009eaf1b9e000c054b87230567991b447757bc6ca8e1bb6e9816ad604dbd6\
0600
{% 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/bitcoin-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 (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The total number of bitcoins in the UTXO set"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet gettxoutsetinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"height" : 315293,
"bestblock" : "00000000c92356f7030b1deeab54b3b02885711320b4c48523be9daa3e0ace5d",
"transactions" : 771920,
"txouts" : 2734587,
"bytes_serialized" : 102629817,
"hash_serialized" : "4753470fda0145760109e79b8c218a1331e84bb4269d116857b8a4597f109905",
"total_amount" : 13131746.33839451
}
{% 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/bitcoin-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/bitcoin-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/bitcoin-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,63 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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, Bitcoin Core 0.9x will display an alphabetical list of commands; Bitcoin Core 0.10.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 `bitcoin-cli` command will parse this text and format it as human-readable text"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Command to get help about the `help` RPC:
{% highlight bash %}
bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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/bitcoin-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,88 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-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"
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 Bitcoin Core 0.12.1*
The default (`false`):
{% highlight bash %}
bitcoin-cli listbanned
{% endhighlight %}
Result:
{% highlight json %}
[
{
"address": "83.84.25.82/32",
"banned_until": 1487269503,
"ban_created": 1478629503,
"ban_reason": "node misbehaving"
},
{
"address": "111.111.0.111/32",
"banned_until": 1487791655,
"ban_created": 1479151655,
"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/bitcoin-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/bitcoin-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/bitcoin-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 %}

View file

@ -0,0 +1,133 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/listsinceblock.md" %}
##### ListSinceBlock
{% include helpers/subhead-links.md %}
{% assign summary_listSinceBlock="gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth." %}
{% autocrossref %}
*Requires wallet support.*
The `listsinceblock` RPC {{summary_listSinceBlock}}
*Parameter #1---a block header hash*
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The hash of a block header encoded as hex in RPC byte order. All transactions affecting the wallet which are not in that block or any earlier block will be returned, including unconfirmed transactions. Default is the hash of the genesis block, so all transactions affecting the wallet are returned by default"
{% enditemplate %}
*Parameter #2---the target confirmations for the lastblock field*
{% itemplate ntpd1 %}
- n: "Target Confirmations"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Sets the lastblock field of the results to the header hash of a block with this many confirmations. This does not affect which transactions are returned. Default is `1`, so the hash of the most recent block on the local best block chain is returned"
{% enditemplate %}
*Parameter #3---whether to include watch-only addresses in details and calculations*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
**Result**
{% assign DEPTH="→ → → " %}
{% include helpers/vars.md %}
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object containing an array of transactions and the lastblock field"
- n: "→<br>`transactions`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects each describing a particular **payment** to or from this wallet. The objects in this array do not describe an actual transactions, so more than one object in this array may come from the same transaction. This array may be empty"
- n: "→ →<br>Payment"
t: "object"
p: "Optional<br>(0 or more)"
d: "An payment which did not appear in the specified block or an earlier block"
{{INCLUDE_F_LIST_TRANSACTIONS}}
{{INCLUDE_F_LIST_TRANSACTIONS_F_FULL}}
- n: "→<br>`lastblock`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The header hash of the block with the number of confirmations specified in the *target confirmations* parameter, encoded as hex in RPC byte order"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
Get all transactions since a particular block (including watch-only
transactions) and the header hash of the sixth most recent block.
{% highlight bash %}
bitcoin-cli -testnet listsinceblock \
00000000688633a503f69818a70eac281302e9189b1bb57a76a05c329fcda718 \
6 true
{% endhighlight %}
Result (edited to show only two payments):
{% highlight json %}
{
"transactions" : [
{
"account" : "doc test",
"address" : "mmXgiR6KAhZCyQ8ndr2BCfEq1wNG2UnyG6",
"category" : "receive",
"amount" : 0.10000000,
"vout" : 0,
"confirmations" : 76478,
"blockhash" : "000000000017c84015f254498c62a7c884a51ccd75d4dd6dbdcb6434aa3bd44d",
"blockindex" : 1,
"blocktime" : 1399294967,
"txid" : "85a98fdf1529f7d5156483ad020a51b7f3340e47448cf932f470b72ff01a6821",
"walletconflicts" : [
],
"time" : 1399294967,
"timereceived" : 1418924714,
"bip125-replaceable": "no"
},
{
"involvesWatchonly" : true,
"account" : "someone else's address2",
"address" : "n3GNqMveyvaPvUbH469vDRadqpJMPc84JA",
"category" : "receive",
"amount" : 0.00050000,
"vout" : 0,
"confirmations" : 34714,
"blockhash" : "00000000bd0ed80435fc9fe3269da69bb0730ebb454d0a29128a870ea1a37929",
"blockindex" : 11,
"blocktime" : 1411051649,
"txid" : "99845fd840ad2cc4d6f93fafb8b072d188821f55d9298772415175c456f3077d",
"walletconflicts" : [
],
"time" : 1418695703,
"timereceived" : 1418925580,
"bip125-replaceable": "no"
}
],
"lastblock" : "0000000000984add1a686d513e66d25686572c7276ec3e358a7e3e9f7eb88619"
}
{% endhighlight %}
*See also*
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}}
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}}
{% endautocrossref %}

View file

@ -0,0 +1,222 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/listtransactions.md" %}
##### ListTransactions
{% include helpers/subhead-links.md %}
{% assign summary_listTransactions="returns the most recent transactions that affect the wallet." %}
{% autocrossref %}
*Requires wallet support.*
The `listtransactions` RPC {{summary_listTransactions}}
*Parameter #1---an account name to get transactions from*
{% 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 transactinos from. Use an empty string (\"\") to get transactions for the default account. Default is `*` to get transactions for all accounts."
{% enditemplate %}
*Parameter #2---the number of transactions to get*
{% itemplate ntpd1 %}
- n: "Count"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of the most recent transactions to list. Default is `10`"
{% enditemplate %}
*Parameter #3---the number of transactions to skip*
{% itemplate ntpd1 %}
- n: "Skip"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of the most recent transactions which should not be returned. Allows for pagination of results. Default is `0`"
{% enditemplate %}
*Parameter #4---whether to include watch-only addresses in details and calculations*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
*Result---payment details*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing objects, with each object describing a **payment** or internal accounting entry (not a transaction). More than one object in this array may come from a single transaction. Array may be empty"
- n: "→<br>Payment"
t: "object"
p: "Optional<br>(0 or more)"
d: "A payment or internal accounting entry"
- 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 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: "The address paid in this payment, which may be someone else's address not belonging to this wallet. May be empty if the address is unknown, such as when paying to a non-standard pubkey script or if this is in the *move* category"
- 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<br>`move` if an off-block-chain move made with the `move` RPC"
- 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>`label`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A comment for the address/transaction"
- n: "→ →<br>`vout`"
t: "number (int)"
p: "Optional<br>(0 or 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. Not returned for *move* category payments"
- 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 or for *move* category payments"
- n: "→ →<br>`confirmations`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of confirmations the transaction has received. Will be `0` for unconfirmed and `-1` for conflicted. Not returned for *move* category payments"
- n: "→ →<br>`trusted`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Indicates whether we consider the outputs of this unconfirmed transaction safe to spend. Only returned for unconfirmed transactions"
- n: "→ →<br>`generated`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if the transaction is a coinbase. Not returned for regular transactions or *move* category payments"
- n: "→ →<br>`blockhash`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The hash of the block on the local best block chain which includes this transaction, encoded as hex in RPC byte order. Only returned for confirmed transactions"
- n: "→ →<br>`blockindex`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The index of the transaction in the block that includes it. Only returned for confirmed transactions"
- n: "→ →<br>`blocktime`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction. Only returned for confirmed transactions"
- n: "→ →<br>`txid`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The TXID of the transaction, encoded as hex in RPC byte order. Not returned for *move* category payments"
- n: "→ →<br>`walletconflicts`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "An array containing the TXIDs of other transactions that spend the same inputs (UTXOs) as this transaction. Array may be empty. Not returned for *move* category payments"
- n: "→ → →<br>TXID"
t: "string (hex)"
p: "Optional<br>(0 or more)"
d: "The TXID of a conflicting transaction, encoded as hex in RPC byte order"
- n: "→ →<br>`time`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "A Unix epoch time when the transaction was added to the wallet"
- n: "→ →<br>`timereceived`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "A Unix epoch time when the transaction was detected by the local node, or the time of the block on the local best block chain that included the transaction. Not returned for *move* category payments"
- n: "→ →<br>`comment`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "For transaction originating with this wallet, a locally-stored comment added to the transaction. Only returned in regular payments if a comment was added. Always returned in *move* category payments. May be an empty string"
- n: "→ →<br>`to`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "For transaction originating with this wallet, a locally-stored comment added to the transaction identifying who the transaction was sent to. Only returned if a comment-to was added. Never returned by *move* category payments. May be an empty string"
- n: "→ →<br>`otheraccount`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "This is the account the bitcoins were moved from or moved to, as indicated by a negative or positive *amount* field in this payment. Only returned by *move* category payments"
- n: "→ →<br>`bip125-replaceable`"
t: "string"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.12.0*<br><br>Indicates if a transaction is replaceable under BIP125:<br>`yes` replaceable<br>`no` not replaceable<br>`unknown` for unconfirmed transactions not in the mempool"
- 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"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
List the most recent transaction from all accounts including watch-only addresses.
{% highlight bash %}
bitcoin-cli listtransactions "*" 1 0 true
{% endhighlight %}
Result:
{% highlight json %}
[
{
"involvesWatchonly" : true,
"account" : "",
"address" : "1GeDA9rRpqaCdsdkTzGtbajt6jPvn3pg2N",
"category" : "send",
"amount" : -3.45902877,
"vout" : 0,
"fee" : -0.00032890,
"confirmations" : 29710,
"blockhash" : "0000000000000000008b9cb38cd3105e75af94b3af79d0a59cbe4edb618fb814",
"blockindex" : 1705,
"blocktime" : 1463173519,
"txid" : "9b32d4315ac4c5e0d3a5fb947b9a198d3641698badc820643a7df23081f99695e",
"walletconflicts" : [
],
"time" : 1418695703,
"timereceived" : 1418925580,
"bip125-replaceable" : "no",
"abandoned": false
}
]
{% endhighlight %}
*See also*
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
* [ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}}
{% endautocrossref %}

View file

@ -0,0 +1,156 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/listunspent.md" %}
##### ListUnspent
{% include helpers/subhead-links.md %}
{% assign summary_listUnspent="returns an array of unspent transaction outputs belonging to this wallet." %}
{% autocrossref %}
*Requires wallet support.*
The `listunspent` RPC {{summary_listUnspent}} **Note:** as of Bitcoin
Core 0.10.0, outputs affecting watch-only addresses will be returned; see
the *spendable* field in the results described below.
*Parameter #1---the minimum number of confirmations an output must have*
{% itemplate ntpd1 %}
- n: "Minimum Confirmations"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The minimum number of confirmations the transaction containing an output must have in order to be returned. Use `0` to return outputs from unconfirmed transactions. Default is `1`"
{% enditemplate %}
*Parameter #2---the maximum number of confirmations an output may have*
{% itemplate ntpd1 %}
- n: "Maximum Confirmations"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The maximum number of confirmations the transaction containing an output may have in order to be returned. Default is `9999999` (~10 million)"
{% enditemplate %}
*Parameter #3---the addresses an output must pay*
{% itemplate ntpd1 %}
- n: "Addresses"
t: "array"
p: "Optional<br>(0 or 1)"
d: "If present, only outputs which pay an address in this array will be returned"
- n: "→<br>Address"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "A P2PKH or P2SH address"
{% enditemplate %}
*Result---the list of unspent outputs*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects each describing an unspent output. May be empty"
- n: "→<br>Unspent Output"
t: "object"
p: "Optional<br>(0 or more)"
d: "An object describing a particular unspent output belonging to this wallet"
- n: "→ →<br>`txid`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction containing the 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 output within its containing transaction"
- n: "→ →<br>`address`"
t: "string (base58)"
p: "Optional<br>(0 or 1)"
d: "The P2PKH or P2SH address the output paid. Only returned for P2PKH or P2SH output scripts"
- 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>If the address returned belongs to an account, this is the account. Otherwise not returned"
- n: "→ →<br>`scriptPubKey`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The output script paid, encoded as hex"
- n: "→ →<br>`redeemScript`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "If the output is a P2SH whose script belongs to this wallet, this is the redeem script"
- n: "→ →<br>`amount`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The amount paid to the output in bitcoins"
- n: "→ →<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations received for the transaction containing this output"
- n: "→ →<br>`spendable`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the private key or keys needed to spend this output are part of the wallet. Set to `false` if not (such as for watch-only addresses)"
- n: "→ →<br>`solvable`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>Set to `true` if the wallet knows how to spend this output. Set to `false` if the wallet does not know how to spend the output. It is ignored if the private keys are available "
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
Get all outputs confirmed at least 6 times for a particular
address:
{% highlight bash %}
bitcoin-cli -testnet listunspent 6 99999999 '''
[
"mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe"
]
'''
{% endhighlight %}
Result:
{% highlight json %}
[
{
"txid" : "d54994ece1d11b19785c7248868696250ab195605b469632b7bd68130e880c9a",
"vout" : 1,
"address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe",
"account" : "test label",
"scriptPubKey" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac",
"amount" : 0.00010000,
"confirmations" : 6210,
"spendable" : true,
"sovable" : true
}
]
{% endhighlight %}
*See also*
* [ListTransactions][rpc listtransactions]: {{summary_listTransactions}}
* [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}}
{% endautocrossref %}

View file

@ -0,0 +1,150 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/lockunspent.md" %}
##### LockUnspent
{% include helpers/subhead-links.md %}
{% assign summary_lockUnspent="temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending bitcoins. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails." %}
{% autocrossref %}
*Requires wallet support.*
The `lockunspent` RPC {{summary_lockUnspent}}
*Parameter #1---whether to lock or unlock the outputs*
{% itemplate ntpd1 %}
- n: "Unlock"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `false` to lock the outputs specified in the following parameter. Set to `true` to unlock the outputs specified. If this is the only argument specified and it is set to `true`, all outputs will be unlocked; if it is the only argument and is set to `false`, there will be no change"
{% enditemplate %}
*Parameter #2---the outputs to lock or unlock*
{% itemplate ntpd1 %}
- n: "Outputs"
t: "array"
p: "Optional<br>(0 or 1)"
d: "An array of outputs to lock or unlock"
- n: "→<br>Output"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular output"
- n: "→ →<br>`txid`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction containing the output to lock or unlock, encoded as hex in internal byte order"
- n: "→ →<br>`vout`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The output index number (vout) of the output to lock or unlock. The first output in a transaction has an index of `0`"
{% enditemplate %}
*Result---`true` if successful*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the outputs were successfully locked or unlocked. If the outputs were already locked or unlocked, it will also return `true`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Lock two outputs:
{% highlight bash %}
bitcoin-cli -testnet lockunspent false '''
[
{
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"vout": 0
},
{
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd",
"vout": 0
}
]
'''
{% endhighlight %}
Result:
{% highlight json %}
true
{% endhighlight %}
Verify the outputs have been locked:
{% highlight bash %}
bitcoin-cli -testnet listlockunspent
{% endhighlight %}
Result
{% highlight json %}
[
{
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"vout": 0
},
{
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd",
"vout": 0
}
]
{% endhighlight %}
Unlock one of the above outputs:
{% highlight bash %}
bitcoin-cli -testnet lockunspent true '''
[
{
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"vout": 0
}
]
'''
{% endhighlight %}
Result:
{% highlight json %}
true
{% endhighlight %}
Verify the output has been unlocked:
{% highlight bash %}
bitcoin-cli -testnet listlockunspent
{% endhighlight %}
Result:
{% highlight json %}
[
{
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd",
"vout": 0
}
]
{% endhighlight %}
*See also*
* [ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}}
* [ListUnspent][rpc listunspent]: {{summary_listUnspent}}
{% 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/bitcoin-core/rpcs/rpcs/move.md" %}
##### Move
{% include helpers/subhead-links.md %}
{% assign summary_move="moves a specified amount from one account in your wallet to another using an off-block-chain transaction." %}
{% autocrossref %}
*Requires wallet support.*
The `move` RPC {{summary_move}}
{{WARNING}} `move` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
{{WARNING}} it's allowed to move more funds than are in an account,
giving the sending account a negative balance and giving the receiving
account a balance that may exceed the number of bitcoins in the wallet
(or the number of bitcoins in existence).
*Parameter #1---from account*
{% itemplate ntpd1 %}
- n: "From Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account to move the funds from"
{% enditemplate %}
*Parameter #2---to account*
{% itemplate ntpd1 %}
- n: "To Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account to move the funds to"
{% enditemplate %}
*Parameter #3---amount to move*
{% itemplate ntpd1 %}
- n: "Amount"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The amount of bitcoins to move"
{% enditemplate %}
*Parameter #4---an unused parameter*
{% itemplate ntpd1 %}
- n: "*Unused*"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "This parameter is no longer used. If parameter #5 needs to be specified, this can be any integer"
{% enditemplate %}
*Parameter #5---a comment*
{% itemplate ntpd1 %}
- n: "Comment"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A comment to assign to this move payment"
{% enditemplate %}
*Result---`true` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the move was successful"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Move 0.1 bitcoins from "doc test" to "test1", giving the transaction the
comment "Example move":
{% highlight bash %}
bitcoin-cli -testnet move "doc test" "test1" 0.1 0 "Example move"
{% endhighlight %}
Result:
{% highlight json %}
true
{% endhighlight %}
*See also*
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}}
* [SendFrom][rpc sendfrom]: {{summary_sendFrom}}
* [SendToAddress][rpc sendtoaddress]: {{summary_sendToAddress}}
{% 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/bitcoin-core/rpcs/rpcs/ping.md" %}
##### Ping {#ping-rpc}
{% include helpers/subhead-links.md %}
{% assign summary_ping-rpc="sends a P2P ping message to all connected nodes to measure ping time. Results are provided by the `getpeerinfo` RPC pingtime and pingwait fields as decimal seconds. The P2P `ping` message is handled in a queue with all other commands, so it measures processing backlog, not just network ping." %}
{% autocrossref %}
The `ping` RPC {{summary_ping-rpc}}
*Parameters: none*
*Result---`null`*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required"
d: "Always JSON `null`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet ping
{% endhighlight %}
(Success: no result printed.)
Get the results using the `getpeerinfo` RPC:
{% highlight bash %}
bitcoin-cli -testnet getpeerinfo | grep ping
{% endhighlight %}
Results:
{% highlight json %}
"pingtime" : 0.11790800,
"pingtime" : 0.22673400,
"pingtime" : 0.16451900,
"pingtime" : 0.12465200,
"pingtime" : 0.13267900,
"pingtime" : 0.23983300,
"pingtime" : 0.16764700,
"pingtime" : 0.11337300,
{% endhighlight %}
*See also*
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}}
* [P2P Ping Message][ping message]
{% 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/bitcoin-core/rpcs/rpcs/preciousblock.md" %}
##### PreciousBlock
{% include helpers/subhead-links.md %}
{% assign summary_preciousBlock="treats a block as if it were received before others with the same work." %}
{% autocrossref %}
*Added in Bitcoin Core 0.14.0*
The `preciousblock` RPC {{summary_preciousBlock}} A later `preciousblock` call can override the effect of an earlier one. The effects of `preciousblock` are not retained across restarts.
*Parameter #1---the block hash*
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the block to mark as precious"
{% enditemplate %}
*Result---`null` or error on failure*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "JSON `null`. The JSON-RPC error field will be set only if you entered an invalid block hash"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli preciousblock 000000000000000001517a0bac70b8cd6f27ee\
1b50a8f12bf606ea6fb6d561cd
{% endhighlight %}
Result (no output from `bitcoin-cli` because result is set to `null`).
{% 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/bitcoin-core/rpcs/rpcs/prioritisetransaction.md" %}
##### PrioritiseTransaction
{% include helpers/subhead-links.md %}
{% assign summary_prioritiseTransaction="adds virtual priority or fee to a transaction, allowing it to be accepted into blocks mined by this node (or miners which use this node) with a lower priority or fee. (It can also remove virtual priority or fee, requiring the transaction have a higher priority or fee to be accepted into a locally-mined block.)" %}
{% autocrossref %}
The `prioritisetransaction` RPC {{summary_prioritiseTransaction}}
*Parameter #1---the TXID of the transaction to modify*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction whose virtual priority or fee you want to modify, encoded as hex in RPC byte order"
{% enditemplate %}
*Parameter #2---the change to make to the virtual priority*
{% itemplate ntpd1 %}
- n: "Priority"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "If positive, the priority to add to the transaction in addition to its computed priority; if negative, the priority to subtract from the transaction's computed priory. Computed priority is the age of each input in days since it was added to the block chain as an output (coinage) times the value of the input in satoshis (value) divided by the size of the serialized transaction (size), which is `coinage * value / size`"
{% enditemplate %}
*Parameter #3---the change to make to the virtual fee*
{% itemplate ntpd1 %}
- n: "Fee"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "**Warning:** this value is in satoshis, not bitcoins<br><br>If positive, the virtual fee to add to the actual fee paid by the transaction; if negative, the virtual fee to subtract from the actual fee paid by the transaction. No change is made to the actual fee paid by the transaction"
{% enditemplate %}
*Result---`true` if the priority is changed*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool (true only)"
p: "Required<br>(exactly 1)"
d: "Always set to `true` if all three parameters are provided. Will not return an error if the TXID is not in the memory pool. If fewer or more than three arguments are provided, or if something goes wrong, will be set to `null`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet prioritisetransaction \
fe0165147da737e16f5096ab6c1709825217377a95a882023ed089a89af4cff9 \
1234 456789
{% endhighlight %}
Result:
{% highlight json %}
true
{% endhighlight %}
*See also*
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
{% 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/bitcoin-core/rpcs/rpcs/pruneblockchain.md" %}
##### PruneBlockChain
{% include helpers/subhead-links.md %}
{% assign summary_pruneBlockChain="prunes the blockchain up to a specified height or timestamp." %}
{% autocrossref %}
*Added in Bitcoin Core 0.14.0*
The `pruneblockchain` RPC {{summary_pruneBlockChain}} The `-prune` option needs to be enabled (disabled by default).
*Parameter #1---the block height or timestamp*
{% itemplate ntpd1 %}
- n: "Height"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The block height to prune up to. May be set to a particular height, or a unix timestamp to prune blocks whose block time is at least 2 hours older than the provided timestamp"
{% enditemplate %}
*Result---the height of the last block pruned*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of the last block pruned"
{% enditemplate %}
*Examples from Bitcoin Core 0.14.1*
{% highlight bash %}
bitcoin-cli pruneblockchain 413555
{% endhighlight %}
Result:
{% highlight text %}
413555
{% endhighlight %}
*See also*
* [ImportPrunedFunds][rpc importprunedfunds]: {{summary_importPrunedFunds}}
{% 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/bitcoin-core/rpcs/rpcs/removeprunedfunds.md" %}
##### RemovePrunedFunds
{% include helpers/subhead-links.md %}
{% assign summary_removePrunedFunds="deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds." %}
{% autocrossref %}
*Added in Bitcoin Core 0.13.0*
*Requires wallet support.*
The `removeprunedfunds` RPC {{summary_removePrunedFunds}} This will effect wallet balances.
*Parameter #1---the raw transaction to import*
{% itemplate ntpd1 %}
- n: "TXID"
t: "string<br>(hex)"
p: "Required<br>(exactly 1)"
d: "The hex-encoded id of the transaction you are removing"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "If the funds are removed from the wallet, JSON `null` will be returned"
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli removeprunedfunds a8d0c0184dde994a09ec054286f1ce581b\
ebf46446a512166eae7628734ea0a5
{% endhighlight %}
(Success: no result displayed.)
*See also*
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [ImportPrunedFunds][rpc importprunedfunds]: {{summary_importPrunedFunds}}
{% endautocrossref %}

View file

@ -0,0 +1,115 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/sendfrom.md" %}
##### SendFrom
{% include helpers/subhead-links.md %}
{% assign summary_sendFrom="spends an amount from a local account to a bitcoin address." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an
unencrypted wallet.*
The `sendfrom` RPC {{summary_sendFrom}}
{{WARNING}} `sendfrom` will be removed in a later version of Bitcoin
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---from account*
{% itemplate ntpd1 %}
- n: "From Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account from which the bitcoins should be spent. Use an empty string (\"\") for the default account"
{% enditemplate %}
*Parameter #2---to address*
{% itemplate ntpd1 %}
- n: "To Address"
t: "string"
p: "Required<br>(exactly 1)"
d: "A P2PKH or P2SH address to which the bitcoins should be sent"
{% enditemplate %}
*Parameter #3---amount to spend*
{% itemplate ntpd1 %}
- n: "Amount"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The amount to spend in bitcoins. Bitcoin Core will ensure the account has sufficient bitcoins to pay this amount (but the transaction fee paid is not included in the calculation, so an account can spend a total of its balance plus the transaction fee)"
{% enditemplate %}
*Parameter #4---minimum confirmations*
{{INCLUDE_SPEND_CONFIRMATIONS}}
*Parameter #5---a comment*
{% itemplate ntpd1 %}
- n: "Comment"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment"
{% enditemplate %}
*Parameter #6---a comment about who the payment was sent to*
{% itemplate ntpd1 %}
- n: "Comment To"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment"
{% enditemplate %}
*Result---a TXID of the sent transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The TXID of the sent transaction, encoded as hex in RPC byte order"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Spend 0.1 bitcoins from the account "test" to the address indicated below
using only UTXOs with at least six confirmations, giving the
transaction the comment "Example spend" and labeling the spender
"Example.com":
{% highlight bash %}
bitcoin-cli -testnet sendfrom "test" \
mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe \
0.1 \
6 \
"Example spend" \
"Example.com"
{% endhighlight %}
Result:
{% highlight text %}
f14ee5368c339644d3037d929bbe1f1544a532f8826c7b7288cb994b0b0ff5d8
{% endhighlight %}
*See also*
* [SendToAddress][rpc sendtoaddress]: {{summary_sendToAddress}}
* [SendMany][rpc sendmany]: {{summary_sendMany}}
{% 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/bitcoin-core/rpcs/rpcs/sendmany.md" %}
##### SendMany
{% include helpers/subhead-links.md %}
{% assign summary_sendMany="creates and broadcasts a transaction which sends outputs to multiple addresses." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an
unencrypted wallet.*
The `sendmany` RPC {{summary_sendMany}}
*Parameter #1---from account*
{% itemplate ntpd1 %}
- n: "From Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The name of the account from which the bitcoins should be spent. Use an empty string (\"\") for the default account. Bitcoin Core will ensure the account has sufficient bitcoins to pay the total amount in the *outputs* field described below (but the transaction fee paid is not included in the calculation, so an account can spend a total of its balance plus the transaction fee)"
{% enditemplate %}
*Parameter #2---the addresses and amounts to pay*
{% itemplate ntpd1 %}
- n: "Outputs"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object containing key/value pairs corresponding to the addresses and amounts to pay"
- n: "→<br>Address/Amount"
t: "string (base58) : number (bitcoins)"
p: "Required<br>(1 or more)"
d: "A key/value pair with a base58check-encoded string containing the P2PKH or P2SH address to pay as the key, and an amount of bitcoins to pay as the value"
{% enditemplate %}
*Parameter #3---minimum confirmations*
{{INCLUDE_SPEND_CONFIRMATIONS}}
*Parameter #4---a comment*
{% itemplate ntpd1 %}
- n: "Comment"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment"
{% enditemplate %}
*Parameter #5---automatic fee subtraction*
{% itemplate ntpd1 %}
- n: "Subtract Fee From Amount"
t: "array"
p: "Optional<br>(0 or 1)"
d: "An array of addresses. The fee will be equally divided by as many addresses as are entries in this array and subtracted from each address. If this array is empty or not provided, the fee will be paid by the sender"
- n: "→<br>Address"
t: "string (base58)"
p: "Optional (0 or more)"
d: "An address previously listed as one of the recipients."
{% enditemplate %}
*Result---a TXID of the sent transaction*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The TXID of the sent transaction, encoded as hex in RPC byte order"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
From the account *test1*, send 0.1 bitcoins to the first address and 0.2
bitcoins to the second address, with a comment of "Example Transaction".
{% highlight bash %}
bitcoin-cli -testnet sendmany \
"test1" \
'''
{
"mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN": 0.1,
"mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe": 0.2
} ''' \
6 \
"Example Transaction"
{% endhighlight %}
Result:
{% highlight text %}
ec259ab74ddff199e61caa67a26e29b13b5688dc60f509ce0df4d044e8f4d63d
{% endhighlight %}
*See also*
* [SendFrom][rpc sendfrom]: {{summary_sendFrom}}
* [SendToAddress][rpc sendtoaddress]: {{summary_sendToAddress}}
* [Move][rpc move]: {{summary_move}}
{% endautocrossref %}

View file

@ -0,0 +1,72 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/sendrawtransaction.md" %}
##### SendRawTransaction
{% include helpers/subhead-links.md %}
{% assign summary_sendRawTransaction="validates a transaction and broadcasts it to the peer-to-peer network." %}
{% autocrossref %}
The `sendrawtransaction` RPC {{summary_sendRawTransaction}}
*Parameter #1---a serialized transaction to broadcast*
{% itemplate ntpd1 %}
- n: "Transaction"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The serialized transaction to broadcast encoded as hex"
{% enditemplate %}
*Parameter #2--whether to allow high fees**
{% itemplate ntpd1 %}
- n: "Allow High Fees"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` to allow the transaction to pay a high transaction fee. Set to `false` (the default) to prevent Bitcoin Core from broadcasting the transaction if it includes a high fee. Transaction fees are the sum of the inputs minus the sum of the outputs, so this high fees check helps ensures user including a change address to return most of the difference back to themselves"
{% enditemplate %}
*Result---a TXID or error message*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null/string (hex)"
p: "Required<br>(exactly 1)"
d: "If the transaction was accepted by the node for broadcast, this will be the TXID of the transaction encoded as hex in RPC byte order. If the transaction was rejected by the node, this will set to `null`, the JSON-RPC error field will be set to a code, and the JSON-RPC message field may contain an informative error message"
{% enditemplate %}
*Examples from Bitcoin Core 0.10.0*
Broadcast a signed transaction:
{% highlight bash %}
bitcoin-cli -testnet sendrawtransaction 01000000011da9283b4ddf8d\
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e000000006a4730\
4402200ebea9f630f3ee35fa467ffc234592c79538ecd6eb1c9199eb23c4a16a\
0485a20220172ecaf6975902584987d295b8dddf8f46ec32ca19122510e22405\
ba52d1f13201210256d16d76a49e6c8e2edc1c265d600ec1a64a45153d45c29a\
2fd0228c24c3a524ffffffff01405dc600000000001976a9140dfc8bafc84198\
53b34d5e072ad37d1a5159f58488ac00000000
{% endhighlight %}
Result:
{% highlight text %}
f5a5ce5988cc72b9b90e8d1d6c910cda53c88d2175177357cc2f2cf0899fbaad
{% endhighlight %}
*See also*
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}
{% endautocrossref %}

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