Group _includes files in subfolders

This commit is contained in:
Saivann 2015-09-05 20:48:01 -04:00
parent 90dc6a02b6
commit af1704002b
120 changed files with 230 additions and 230 deletions

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/rpcs/intro.md" %}
### Remote Procedure Calls (RPCs)
{% include helpers/subhead-links.md %}
{% autocrossref %}
Bitcoin 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 Bitcoin Core using `bitcoin-qt`, the RPC interface is disabled by
default. To enable it, set `server=1` in `bitcoin.conf` or supply the `-server`
argument when invoking the program. If you start Bitcoin Core using `bitcoind`,
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
`bitcoin.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 Bitcoin 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. Bitcoin Core also ships with its own compiled C++ RPC client,
`bitcoin-cli`, located in the `bin` directory alongside `bitcoind` and
`bitcoin-qt`. The `bitcoin-cli` program can be used as a command-line interface
(CLI) to Bitcoin Core or for making RPC calls from applications written in
languages lacking a suitable native client. The remainder of this section
describes the Bitcoin Core RPC protocol in detail.
The Bitcoin Core RPC service listens for HTTP `POST` requests on port 8332 in
mainnet mode or 18332 in testnet or regtest mode. The port number can be changed
by setting `rpcport` in `bitcoin.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 Bitcoin 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 Bitcoin 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 `bitcoin-cli` is:
{% highlight bash %}
bitcoin-cli getblockhash 0
{% endhighlight %}
Alternatively, we could `POST` this request using the cURL command-line program
as follows:
{% highlight bash %}
curl --user ':my_secret_password' --data-binary '''
{
"method": "getblockhash",
"params": [0],
"id": "foo"
}''' \
--header 'Content-Type: text/plain;' localhost:8332
{% endhighlight %}
The HTTP response data for this request would be:
{% highlight json %}
{
"result": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"error": null,
"id": "foo"
}
{% endhighlight %}
Note: In order to minimize its size, the raw JSON response from Bitcoin Core
doesn't include any extraneous whitespace characters. Here we've added
whitespace to make the object more readable. Speaking of which, `bitcoin-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 `bitcoin-cli`
command would be simply:
{% highlight text %}
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
{% endhighlight %}
If there's an error processing a request, Bitcoin 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 `bitcoin-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, "message": "Block height out of range"}
{% endhighlight %}
Starting in Bitcoin Core version 0.7.0, 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 `bitcoin-cli`
RPC client does not support batch requests.
To keep this documentation compact and readable, the examples for each of the
available RPC calls will be given as `bitcoin-cli` commands:
{% highlight text %}
bitcoin-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,209 @@
{% 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-ref.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 %}
<!-- master -->
{% assign NEW_MASTER='**<abbr title="New in Bitcoin Cores master branch (unreleased)">New in master</abbr>**' %}
{% assign UPDATED_MASTER='**<abbr title="Updated in Bitcoin Cores master branch (unreleased)">Updated in master</abbr>**' %}
<!-- Bitcoin Core 0.10.0 expected January 2015 -->
{% assign DEPRECATED='**<abbr title="Deprecated; will be removed in a future version of Bitcoin Core">Deprecated</abbr>**' %}
{% assign NEW0_10_0='**<abbr title="New in Bitcoin Core v0.10.0">New in 0.10.0</abbr>**' %}
{% assign NEW0_11_0='**<abbr title="New in Bitcoin Core v0.11.0">New in 0.11.0</abbr>**' %}
{% assign UPDATED0_10_0='**<abbr title="Updated in Bitcoin Core v0.10.0">Updated in 0.10.0</abbr>**' %}
<!-- Bitcoin Core 0.9.2 June 2014 -->
{% assign NEW0_9_2='*<abbr title="New in Bitcoin Core v0.9.2">New in 0.9.2</abbr>*' %}
<!-- Bitcoin Core 0.9.0 March 2014 -->
{% assign NEW0_9_0='*<abbr title="New in Bitcoin Core v0.9.0">New in 0.9.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 %}
#### Block Chain RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}} {{NEW0_9_0}}
* [GetBlock][rpc getblock]: {{summary_getBlock}}
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{NEW0_9_2}}, {{UPDATED0_10_0}}
* [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetChainTips][rpc getchaintips]: {{summary_getChainTips}} {{NEW0_10_0}}
* [GetDifficulty][rpc getdifficulty]: {{summary_getDifficultly}}
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}} {{NEW0_10_0}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
* [GetTxOut][rpc gettxout]: {{summary_getTxOut}}
* [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}} {{NEW0_11_0}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
* [VerifyChain][rpc verifychain]: {{summary_verifyChain}}
* [VerifyTxOutProof][rpc verifytxoutproof]: {{summary_verifyTxOutProof}} {{NEW0_11_0}}
{% endautocrossref %}
#### Control RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetInfo][rpc getinfo]: {{summary_getInfo}} {{UPDATED0_10_0}}, {{DEPRECATED}}
* [Help][rpc help]: {{summary_help}}
* [Stop][rpc stop]: {{summary_stop}}
{% endautocrossref %}
#### Generating RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [Generate][rpc generate]: {{summary_generate}} {{NEW_MASTER}}
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}} {{UPDATED_MASTER}}
{% endautocrossref %}
#### Mining RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}} {{UPDATED_MASTER}}
* [GetNetworkHashPS][rpc getnetworkhashps]: {{summary_getNetworkHashPS}}
* [PrioritiseTransaction][rpc prioritisetransaction]: {{summary_prioritiseTransaction}} {{NEW0_10_0}}
* [SubmitBlock][rpc submitblock]: {{summary_submitBlock}}
{% endautocrossref %}
#### Network RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [AddNode][rpc addnode]: {{summary_addNode}}
* [GetAddedNodeInfo][rpc getaddednodeinfo]: {{summary_getAddedNodeInfo}}
* [GetConnectionCount][rpc getconnectioncount]: {{summary_getConnectionCount}}
* [GetNetTotals][rpc getnettotals]: {{summary_getNetTotals}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}} {{NEW0_9_2}}, {{UPDATED0_10_0}}
* [GetPeerInfo][rpc getpeerinfo]: {{summary_getPeerInfo}} {{UPDATED0_10_0}}
* [Ping][rpc ping]: {{summary_ping-rpc}}
{% endautocrossref %}
#### Raw Transaction RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}}
* [DecodeScript][rpc decodescript]: {{summary_decodeScript}}
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}}
* [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}} {{NEW0_10_0}}
* [EstimatePriority][rpc estimatepriority]: {{summary_estimatePriority}} {{NEW0_10_0}}
* [ValidateAddress][rpc validateaddress]: {{summary_validateAddress}}
* [VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}}
{% endautocrossref %}
#### Wallet RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
**Note:** the wallet RPCs are only available if Bitcoin Core was built
with [wallet support][]{:#term-wallet-support}{:.term}, which is the
default.
* [AddMultiSigAddress][rpc addmultisigaddress]: {{summary_addMultiSigAddress}}
* [BackupWallet][rpc backupwallet]: {{summary_backupWallet}}
* [DumpPrivKey][rpc dumpprivkey]: {{summary_dumpPrivKey}}
* [DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}}
* [EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}}
* [GetAccountAddress][rpc getaccountaddress]: {{summary_getAccountAddress}}
* [GetAccount][rpc getaccount]: {{summary_getAccount}}
* [GetAddressesByAccount][rpc getaddressesbyaccount]: {{summary_getAddressesByAccount}}
* [GetBalance][rpc getbalance]: {{summary_getBalance}}
* [GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}
* [GetRawChangeAddress][rpc getrawchangeaddress]: {{summary_getRawChangeAddress}}
* [GetReceivedByAccount][rpc getreceivedbyaccount]: {{summary_getReceivedByAccount}}
* [GetReceivedByAddress][rpc getreceivedbyaddress]: {{summary_getReceivedByAddress}}
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}} {{UPDATED0_10_0}}
* [GetUnconfirmedBalance][rpc getunconfirmedbalance]: {{summary_getUnconfirmedBalance}}
* [GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}} {{NEW0_9_2}}
* [ImportAddress][rpc importaddress]: {{summary_importAddress}} {{NEW0_10_0}}
* [ImportPrivKey][rpc importprivkey]: {{summary_importPrivKey}}
* [ImportWallet][rpc importwallet]: {{summary_importWallet}}
* [KeyPoolRefill][rpc keypoolrefill]: {{summary_keyPoolRefill}}
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}} {{UPDATED0_10_0}}
* [ListAddressGroupings][rpc listaddressgroupings]: {{summary_listAddressGroupings}}
* [ListLockUnspent][rpc listlockunspent]: {{summary_listLockUnspent}}
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}} {{UPDATED0_10_0}}
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}} {{UPDATED0_10_0}}
* [ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}} {{UPDATED0_10_0}}
* [ListTransactions][rpc listtransactions]: {{summary_listTransactions}} {{UPDATED0_10_0}}
* [ListUnspent][rpc listunspent]: {{summary_listUnspent}} {{UPDATED0_10_0}}
* [LockUnspent][rpc lockunspent]: {{summary_lockUnspent}}
* [Move][rpc move]: {{summary_move}}
* [SendFrom][rpc sendfrom]: {{summary_sendFrom}}
* [SendMany][rpc sendmany]: {{summary_sendMany}}
* [SendToAddress][rpc sendtoaddress]: {{summary_sendToAddress}}
* [SetAccount][rpc setaccount]: {{summary_setAccount}}
* [SetTxFee][rpc settxfee]: {{summary_setTxFee}}
* [SignMessage][rpc signmessage]: {{summary_signMessage}}
* [WalletLock][rpc walletlock]: {{summary_walletLock}}
* [WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}
* [WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}
{% endautocrossref %}
#### Removed RPCs
{:.no_toc}
<!-- no subhead-links here -->
{% autocrossref %}
* [GetHashesPerSec][rpc gethashespersec]: {{summary_getHashesPerSec}}
* [GetWork][rpc getwork]: {{summary_getWork}}
{% 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. This will not connect immediately if the outgoing connection slots are full<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,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,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,93 @@
{% 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---references to previous outputs*
{% itemplate ntpd1 %}
- n: "Outpoints"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array of objects, each one being an unspent outpoint"
- n: "→ Outpoint"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular unspent outpoint"
- n: "→ →<br>`txid`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the outpoint 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; the first output in a transaction is index `0`"
{% 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 %}
*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,121 @@
{% 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.10.0*
Decode a signed one-input, three-output transaction:
{% highlight bash %}
bitcoin-cli -testnet decoderawtransaction 0100000001268a9ad7bfb2\
1d3c086f0ff28f73a064964aa069ebb69a9e437da85c7e55c7d7000000006b48\
3045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560f\
eb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd4\
5a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b\
3118f3db16cbbcf8f326ffffffff0350ac6002000000001976a91456847befbd\
2360df0e35b4e3b77bae48585ae06888ac80969800000000001976a9142b1495\
0b8d31620c6cc923c5408a701b1ec0a02088ac002d3101000000001976a9140d\
fc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000
{% endhighlight %}
Result:
{% highlight json %}
{
"txid" : "ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "d7c7557e5ca87d439e9ab6eb69a04a9664a0738ff20f6f083c1db2bfd79a8a26",
"vout" : 0,
"scriptSig" : {
"asm" : "3045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc001 03a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326",
"hex" : "483045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.39890000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 56847befbd2360df0e35b4e3b77bae48585ae068 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91456847befbd2360df0e35b4e3b77bae48585ae06888ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7"
]
}
},
{
"value" : 0.10000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 2b14950b8d31620c6cc923c5408a701b1ec0a020 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN"
]
}
},
{
"value" : 0.20000000,
"n" : 2,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 0dfc8bafc8419853b34d5e072ad37d1a5159f584 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe"
]
}
}
]
}
{% 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 op codes 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,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,67 @@
{% 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 %}
*Added in Bitcoin Core 0.10.0.*
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"
{% 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.10.0*
{% highlight bash %}
bitcoin-cli estimatefee 6
{% endhighlight %}
Result:
{% highlight json %}
0.00026809
{% endhighlight %}
Requesting data the node can't calculate yet:
{% highlight bash %}
bitcoin-cli estimatefee 100
{% endhighlight %}
Result:
{% highlight json %}
-1.00000000
{% endhighlight %}
*See also*
* [EstimatePriority][rpc estimatepriority]: {{summary_estimatePriority}}
* [SetTxFee][rpc settxfee]: {{summary_setTxFee}}
{% 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/estimatepriority.md" %}
##### EstimatePriority
{% include helpers/subhead-links.md %}
{% autocrossref %}
{% assign summary_estimatePriority="estimates the priority 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}}
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,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/generate.md" %}
##### Generate
{% include helpers/subhead-links.md %}
{% assign summary_generate="nearly instantly generates blocks (in regtest mode only)" %}
{% 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"
{% 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 %}
*Examples from Bitcoin Core master (commit c2fa0846)*
Using regtest mode, generate 2 blocks:
{% highlight bash %}
bitcoin-cli -regtest generate 2
{% endhighlight %}
Result:
{% highlight json %}
[
"36252b5852a5921bdfca8701f936b39edeb1f8c39fffe73b0d8437921401f9af",
"5f2956817db1e386759aa5794285977c70596b39ea093b9eab0aa4ba8cd50c06"
]
{% endhighlight %}
*See also*
* [SetGenerate][rpc getgenerate]: {{summary_getGenerate}}
* [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,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/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}}
*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: "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.10.0*
{% highlight bash %}
bitcoin-cli -testnet getaddednodeinfo true
{% endhighlight %}
Result (real hostname and IP address replaced):
{% highlight json %}
[
{
"addednode" : "bitcoind.example.com:18333",
"connected" : true,
"addresses" : [
{
"address" : "192.0.2.113:18333",
"connected" : "outbound"
}
]
}
]
{% endhighlight %}
*See also*
* [AddNode][rpc addnode]: {{summary_addNode}}
* [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/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}}
*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: "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,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/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 %}
*Added in Bitcoin Core 0.9.0*
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,188 @@
{% 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---JSON or hex output*
{% itemplate ntpd1 %}
- n: "Format"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `false` to get the block in serialized block format; set to `true` (the default) to get the decoded block as a JSON object"
{% enditemplate %}
*Result (if format was `false`)---a serialized block*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (hex)/null"
p: "Required<br>(exactly 1)"
d: "The requested block as a serialized block, encoded as hex, or JSON `null` if an error occurred"
{% enditemplate %}
*Result (if format was `true` or omitted)---a JSON block*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object/null"
p: "Required<br>(exactly 1)"
d: "An object containing the requested block, or JSON `null` if an error occurred"
- n: "→<br>`hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1"
- n: "→<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"
- n: "→<br>`size`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of this block in serialized block format, counted in bytes"
- n: "→<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of this block on its block chain"
- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"
- n: "→<br>`merkleroot`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The merkle root for this block, encoded as hex in RPC byte order"
- n: "→<br>`tx`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"
- n: "→ →<br>TXID"
t: "string (hex)"
p: "Required<br>(1 or more)"
d: "The TXID of a transaction in this block, encoded as hex in RPC byte order"
- n: "→<br>`time`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The value of the *time* field in the block header, indicating approximately when the block was created"
- n: "→<br>`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 %}
*Example from Bitcoin Core 0.10.0*
Get a block in raw hex:
{% highlight bash %}
bitcoin-cli -testnet getblock \
000000000fe549a89848c76070d4132872cfb6efe5315d01d7ef77e4900f2d39 \
false
{% endhighlight %}
Result (wrapped):
{% highlight text %}
02000000df11c014a8d798395b5059c722ebdf3171a4217ead71bf6e0e99f4c7\
000000004a6f6a2db225c81e77773f6f0457bcb05865a94900ed11356d0b7522\
8efb38c7785d6053ffff001d005d437001010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff0d03b4770301\
64062f503253482fffffffff0100f9029500000000232103adb7d8ef6b63de74\
313e0cd4e07670d09a169b13e4eda2d650f529332c47646dac00000000
{% endhighlight %}
Get the same block in JSON:
{% highlight bash %}
bitcoin-cli -testnet getblock \
000000000fe549a89848c76070d4132872cfb6efe5315d01d7ef77e4900f2d39 \
true
{% endhighlight %}
Result:
{% highlight json %}
{
"hash" : "000000000fe549a89848c76070d4132872cfb6efe5315d01d7ef77e4900f2d39",
"confirmations" : 88029,
"size" : 189,
"height" : 227252,
"version" : 2,
"merkleroot" : "c738fb8e22750b6d3511ed0049a96558b0bc57046f3f77771ec825b22d6a6f4a",
"tx" : [
"c738fb8e22750b6d3511ed0049a96558b0bc57046f3f77771ec825b22d6a6f4a"
],
"time" : 1398824312,
"nonce" : 1883462912,
"bits" : "1d00ffff",
"difficulty" : 1.00000000,
"chainwork" : "000000000000000000000000000000000000000000000000083ada4a4009841a",
"previousblockhash" : "00000000c7f4990e6ebf71ad7e21a47131dfeb22c759505b3998d7a814c011df",
"nextblockhash" : "00000000afe1928529ac766f1237657819a11cfcc8ca6d67f119e868ed5b6188"
}
{% endhighlight %}
*See also*
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
{% 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/getblockchaininfo.md" %}
##### GetBlockChainInfo
{% include helpers/subhead-links.md %}
{% assign summary_getBlockChainInfo="provides information about the current state of the block chain." %}
{% autocrossref %}
*Added in Bitcoin Core 0.9.2*
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: "*Added in Bitcoin Core 0.10.0*<br><br>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>`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"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getblockchaininfo
{% endhighlight %}
Result:
{% highlight json %}
{
"chain" : "test",
"blocks" : 315280,
"headers" : 315280,
"bestblockhash" : "000000000ebb17fb455e897b8f3e343eea1b07d926476d00bc66e2c0342ed50f",
"difficulty" : 1.00000000,
"verificationprogress" : 1.00000778,
"chainwork" : "0000000000000000000000000000000000000000000000015e984b4fb9f9b350"
}
{% 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,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,90 @@
{% 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 %}
*Added in Bitcoin Core 0.10.0.*
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,48 @@
{% 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="returns true if the node is set to generate blocks using its CPU." %}
{% autocrossref %}
*Requires wallet support.*
The `getgenerate` RPC {{summary_getGenerate}}
*Parameters: none*
*Result---whether the server is set to generate blocks*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the server is set to generate blocks; set to `false` if it is not"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getgenerate
{% endhighlight %}
Result:
{% highlight json %}
false
{% endhighlight %}
*See also*
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [GetHashesPerSec][rpc gethashespersec]: {{summary_getHashesPerSec}}
{% 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/gethashespersec.md" %}
##### GetHashesPerSec
{% include helpers/subhead-links.md %}
{% assign summary_getHashesPerSec="was removed in Bitcoin Core master (unreleased). It returned a recent hashes per second performance measurement when the node was generating blocks." %}
{% autocrossref %}
*Requires wallet support.*
The `gethashespersec` RPC {{summary_getHashesPerSec}}
*Parameters: none*
*Result---the number of hashes your computer generated per second*
{% itemplate ntpd1 %}
- n: "`result`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "If generation is enabled, the number of hashes per second your computer most recently generated. If generation is disabled, the value `0`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet gethashespersec
{% endhighlight %}
Result:
{% highlight json %}
1995356
{% endhighlight %}
*See also*
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
* [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: "*Added in Bitcoin Core 0.10.0*<br><br>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,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/getmempoolinfo.md" %}
##### GetMemPoolInfo
{% include helpers/subhead-links.md %}
{% assign summary_getMemPoolInfo="returns information about the node's current transaction memory pool." %}
{% autocrossref %}
*Added in Bitcoin Core 0.10.0*
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"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getmempoolinfo
{% endhighlight %}
Result:
{% highlight json %}
{
"size" : 37,
"bytes" : 9423
}
{% endhighlight %}
*See also*
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,120 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/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: "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: "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: "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 master (unreleased)*<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.10.0*
{% highlight bash %}
bitcoin-cli -testnet getmininginfo
{% endhighlight %}
Result:
{% highlight json %}
{
"blocks" : 313168,
"currentblocksize" : 1819,
"currentblocktx" : 3,
"difficulty" : 1.00000000,
"errors" : "",
"genproclimit" : 1,
"networkhashps" : 5699977416637,
"pooledtx" : 8,
"testnet" : true,
"chain" : "test",
"generate" : true,
"hashespersec" : 921200
}
{% endhighlight %}
*See also*
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
* [GetRawMemPool][rpc getrawmempool]: {{summary_getRawMemPool}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
{% 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/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)"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getnettotals
{% endhighlight %}
Result:
{% highlight json %}
{
"totalbytesrecv" : 723992206,
"totalbytessent" : 16846662695,
"timemillis" : 1419268217354
}
{% 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,184 @@
{% 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 %}
*Added in Bitcoin Core 0.9.2.*
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: "*Added in Bitcoin Core 0.10.0*<br><br>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>`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>`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>`localservices`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.10.0*<br><br>The services supported by this node as advertised in its `version` message"
- n: "→<br>`networks`"
t: "array"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.10.0*<br><br>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>`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
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getnetworkinfo
{% endhighlight %}
Result (actual addresses have been replaced with reserved addresses):
{% highlight json %}
{
"version" : 100000,
"subversion" : "/Satoshi:0.10.0/",
"protocolversion" : 70002,
"localservices" : "0000000000000001",
"timeoffset" : 0,
"connections" : 51,
"networks" : [
{
"name" : "ipv4",
"limited" : false,
"reachable" : true,
"proxy" : ""
},
{
"name" : "ipv6",
"limited" : false,
"reachable" : true,
"proxy" : ""
},
{
"name" : "onion",
"limited" : false,
"reachable" : false,
"proxy" : ""
}
],
"relayfee" : 0.00001000,
"localaddresses" : [
{
"address" : "192.0.2.113",
"port" : 18333,
"score" : 6470
},
{
"address" : "0600:3c03::f03c:91ff:fe89:dfc4",
"port" : 18333,
"score" : 2029
}
]
}
{% 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,185 @@
{% 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: "*Added in Bitcoin Core 0.10.0*<br><br>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. Many 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>`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>`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: "*Added in Bitcoin Core 0.10.0*<br><br>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: "*Added in Bitcoin Core 0.10.0*<br><br>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>`syncnode`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "*Removed in Bitcoin Core 0.10.0*<br><br>Whether we're using this node as our syncnode during initial block download"
- n: "→ →<br>`inflight`"
t: "array"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.10.0*<br><br>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: "*Added in Bitcoin Core 0.10.0*<br><br>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"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet getpeerinfo
{% endhighlight %}
Result (edited to show only a single entry, with IP addresses changed to
[RFC5737][] reserved IP addresses):
{% highlight json %}
[
{
"id" : 9,
"addr" : "192.0.2.113:18333",
"addrlocal" : "192.0.2.51:18333",
"services" : "0000000000000002",
"lastsend" : 1419277992,
"lastrecv" : 1419277992,
"bytessent" : 4968,
"bytesrecv" : 105078,
"conntime" : 1419265985,
"pingtime" : 0.05617800,
"version" : 70001,
"subver" : "/Satoshi:0.8.6/",
"inbound" : false,
"startingheight" : 315280,
"banscore" : 0,
"synced_headers" : -1,
"synced_blocks" : -1,
"inflight" : [
],
"whitelisted" : false
}
]
{% 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,141 @@
{% 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>`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>`depends`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array holding TXIDs of unconfirmed transactions this transaction depends upon. 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.10.0*
The default (`false`):
{% highlight bash %}
bitcoin-cli -testnet getrawmempool
{% endhighlight %}
Result:
{% highlight json %}
[
"2b1f41d6f1837e164d6d6811d3d8dad2e66effbd1058cd9ed7bdbe1cab20ae03",
"2baa1f49ac9b951fa781c4c95814333a2f3eda71ed3d0245cd76c2829b3ce354"
]
{% endhighlight %}
Verbose output (`true`):
{% highlight bash %}
bitcoin-cli -testnet getrawmempool true
{% endhighlight %}
Result:
{% highlight json %}
{
"2baa1f49ac9b951fa781c4c95814333a2f3eda71ed3d0245cd76c2829b3ce354" : {
"size" : 191,
"fee" : 0.00020000,
"time" : 1398867772,
"height" : 227310,
"startingpriority" : 54545454.54545455,
"currentpriority" : 54545454.54545455,
"depends" : [
]
}
}
{% endhighlight %}
*See also*
* [GetMemPoolInfo][rpc getmempoolinfo]: {{summary_getMemPoolInfo}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,191 @@
{% 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: "Verbose"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Set to `0` (the default) to return the serialized transaction as hex. Set to `1` to return a decoded transaction"
{% 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=`0`)---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=`1`)---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"
{{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.10.0*
A transaction in serialized transaction format:
{% highlight bash %}
bitcoin-cli -testnet getrawtransaction \
ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e
{% endhighlight %}
Result (wrapped):
{% highlight text %}
0100000001268a9ad7bfb21d3c086f0ff28f73a064964aa069ebb69a9e437da8\
5c7e55c7d7000000006b483045022100ee69171016b7dd218491faf6e13f53d4\
0d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed28\
8d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc\
8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326ffffffff0350ac60020000\
00001976a91456847befbd2360df0e35b4e3b77bae48585ae06888ac80969800\
000000001976a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac002d\
3101000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac\
00000000
{% endhighlight %}
Get the same transaction in JSON:
{% highlight bash %}
bitcoin-cli -testnet getrawtransaction \
ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e \
1
{% endhighlight %}
Result:
{% highlight json %}
{
"hex" : "0100000001268a9ad7bfb21d3c086f0ff28f73a064964aa069ebb69a9e437da85c7e55c7d7000000006b483045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326ffffffff0350ac6002000000001976a91456847befbd2360df0e35b4e3b77bae48585ae06888ac80969800000000001976a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac002d3101000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000",
"txid" : "ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "d7c7557e5ca87d439e9ab6eb69a04a9664a0738ff20f6f083c1db2bfd79a8a26",
"vout" : 0,
"scriptSig" : {
"asm" : "3045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc001 03a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326",
"hex" : "483045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.39890000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 56847befbd2360df0e35b4e3b77bae48585ae068 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91456847befbd2360df0e35b4e3b77bae48585ae06888ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7"
]
}
},
{
"value" : 0.10000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 2b14950b8d31620c6cc923c5408a701b1ec0a020 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN"
]
}
},
{
"value" : 0.20000000,
"n" : 2,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 0dfc8bafc8419853b34d5e072ad37d1a5159f584 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe"
]
}
}
],
"blockhash" : "00000000103e0091b7d27e5dc744a305108f0c752be249893c749e19c1c82317",
"confirmations" : 88192,
"time" : 1398734825,
"blocktime" : 1398734825
}
{% endhighlight %}
*See also*
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
{% 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/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}}
*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,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/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: "*Added in Bitcoin Core 0.10.0*<br><br>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: "*Added in Bitcoin Core 0.10.0*<br><br>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>`hex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The transaction in serialized transaction format"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% 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,
"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 op codes 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. Added in Bitcoin Core 0.9.2.*
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,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/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 the `help` RPC to get help. For example:
`help getwork`
*See also*
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
* [SubmitBlock][rpc submitblock]: {{summary_submitBlock}}
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
{% 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. Added in Bitcoin Core 0.10.0.*
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. Notes: if the address or pubkey script 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 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,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,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,73 @@
{% 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}}
*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: "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,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,104 @@
{% 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}}
*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: "*Added in Bitcoin Core 0.10.0*<br><br>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,129 @@
{% 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: "*Added in Bitcoin Core 0.10.0*<br><br>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: "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>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.10.0*
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,
"txids" : [
"4d71a6127796766c39270881c779b6e05183f2bf35589261e9572436356f287f",
"997115d0cf7b83ed332e6c1f2e8c44f803c95ea43490c84ce3e9ede4b2e1605f"
]
},
{
"involvesWatchonly" : true,
"address" : "n3GNqMveyvaPvUbH469vDRadqpJMPc84JA",
"account" : "someone else's address2",
"amount" : 0.00050000,
"confirmations" : 34714,
"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,132 @@
{% 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.10.0*
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
},
{
"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
}
],
"lastblock" : "0000000000984add1a686d513e66d25686572c7276ec3e358a7e3e9f7eb88619"
}
{% endhighlight %}
*See also*
* [ListReceivedByAccount][rpc listreceivedbyaccount]: {{summary_listReceivedByAccount}}
* [ListReceivedByAddress][rpc listreceivedbyaddress]: {{summary_listReceivedByAddress}}
{% 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/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: "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: "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>`vout`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.10.0*<br><br>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>`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: "Only returned for confirmed transactions. The hash of the block on the local best block chain which includes this transaction, encoded as hex in RPC byte order"
- n: "→ →<br>`blockindex`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Only returned for confirmed transactions. The block height of the block on the local best block chain which includes this transaction"
- n: "→ →<br>`blocktime`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Only returned for confirmed transactions. The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction"
- 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: "Only returned by *move* category payments. This is the account the bitcoins were moved from or moved to, as indicated by a negative or positive *amount* field in this payment"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
List the most recent transaction from the account "someone else's
address2" including watch-only addresses.
{% highlight bash %}
bitcoin-cli -testnet listtransactions \
"someone else's address2" 1 0 true
{% endhighlight %}
Result:
{% highlight json %}
[
{
"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
}
]
{% endhighlight %}
*See also*
* [GetTransaction][rpc gettransaction]: {{summary_getTransaction}}
* [ListSinceBlock][rpc listsinceblock]: {{summary_listSinceBlock}}
{% 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/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: "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: "*Added in Bitcoin Core 0.10.0*<br><br>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)"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
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
}
]
{% 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,104 @@
{% 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}} 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,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/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 %}
*Added in Bitcoin Core 0.10.0.*
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,112 @@
{% 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}}
*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,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/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: "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 %}
*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 %}

View file

@ -0,0 +1,92 @@
{% 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/sendtoaddress.md" %}
##### SendToAddress
{% include helpers/subhead-links.md %}
{% assign summary_sendToAddress="spends an amount to a given address." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an
unencrypted wallet.*
The `sendtoaddress` RPC {{summary_sendToAddress}}
*Parameter #1---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 #2---amount to spend*
{% itemplate ntpd1 %}
- n: "Amount"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The amount to spent in bitcoins"
{% enditemplate %}
*Parameter #3---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 #4---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 to the address below with the comment "sendtoadress
example" and the comment-to "Nemo From Example.com":
{% highlight bash %}
bitcoin-cli -testnet sendtoaddress mmXgiR6KAhZCyQ8ndr2BCfEq1wNG2UnyG6 \
0.1 "sendtoaddress example" "Nemo From Example.com"
{% endhighlight %}
Result:
{% highlight text %}
a2a2eb18cb051b5fe896a32b1cb20b179d981554b6bd7c5a956e56a0eecb04f0
{% endhighlight %}
*See also*
* [SendFrom][rpc sendfrom]: {{summary_sendFrom}}
* [SendMany][rpc sendmany]: {{summary_sendMany}}
* [Move][rpc move]: {{summary_move}}
{% 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/setaccount.md" %}
##### SetAccount
{% include helpers/subhead-links.md %}
{% assign summary_setAccount="puts the specified address in the given account." %}
{% autocrossref %}
*Requires wallet support.*
The `setaccount` RPC {{summary_setAccount}}
*Parameter #1---a bitcoin address*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The P2PKH or P2SH address to put in the account. Must already belong to the wallet"
{% enditemplate %}
*Parameter #2---an account*
{% itemplate ntpd1 %}
- n: "Account"
t: "string"
p: "Required<br>(exactly 1)"
d: "The name of the account in which the address should be placed. May be the default account, an empty string (\"\")"
{% enditemplate %}
*Result---`null` if successful*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Set to JSON `null` if the address was successfully placed in the account"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Put the address indicated below in the "doc test" account.
{% highlight bash %}
bitcoin-cli -testnet setaccount \
mmXgiR6KAhZCyQ8ndr2BCfEq1wNG2UnyG6 "doc test"
{% endhighlight %}
(Success: no result displayed.)
*See also*
* [GetAccount][rpc getaccount]: {{summary_getAccount}}
* [ListAccounts][rpc listaccounts]: {{summary_listAccounts}}
* [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/setgenerate.md" %}
##### SetGenerate
{% include helpers/subhead-links.md %}
{% assign summary_setGenerate="enables or disables hashing to attempt to find the next block." %}
{% autocrossref %}
*Requires wallet support.*
The `setgenerate` RPC {{summary_setGenerate}}
*Parameter #1---whether to enable or disable generation*
{% itemplate ntpd1 %}
- n: "Enable/Disable"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` to enable generation; set to `false` to disable generation"
{% enditemplate %}
*Parameter #2 (regular)---the number of processors to use*
{% itemplate ntpd1 %}
- n: "Processors"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of processors to use. Defaults to `1`. Set to `-1` to use all processors"
{% enditemplate %}
*Parameter #2 (regtest)---the number of blocks to generate*
Note: setgenerate in regtest mode has been removed in Bitcoin Core
master. See the `generate` RPC for the replacement.
{% itemplate ntpd1 %}
- n: "Blocks"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "In regtest mode, set to the number of blocks to generate. Defaults to `1`"
{% enditemplate %}
*Result (regular)---generating is enabled*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always JSON `null`"
{% enditemplate %}
*Result (regtest)---the generated block header hashes*
{% itemplate ntpd1 %}
- n: "`result`"
t: "array/null"
p: "Required<br>(exactly 1)"
d: "An array containing the block header hashes of the generated blocks, or JSON `null` if no blocks were generated"
- 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 %}
*Examples from Bitcoin Core 0.10.0*
Enable generation using two logical processors (on this machine, two
cores of one physical processor):
{% highlight bash %}
bitcoin-cli -testnet setgenerate true 2
{% endhighlight %}
(Success: no result displayed. Process manager shows 200% CPU usage.)
Using regtest mode, generate 2 blocks:
{% highlight bash %}
bitcoin-cli -regtest setgenerate true 101
{% endhighlight %}
Result:
{% highlight json %}
[
"7e38de938d0dcbb41be63d78a8353e77e9d1b3ef82e0368eda051d4926eef915",
"61d6e5f1a64d009659f45ef1c614e57f4aa0501708641212be236dc56d726da8"
]
{% endhighlight %}
*See also*
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
* [GetHashesPerSec][rpc gethashespersec]: {{summary_getHashesPerSec}}
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
{% endautocrossref %}

View file

@ -0,0 +1,57 @@
{% 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/settxfee.md" %}
##### SetTxFee
{% include helpers/subhead-links.md %}
{% assign summary_setTxFee="sets the transaction fee per kilobyte paid by transactions created by this wallet." %}
{% autocrossref %}
*Requires wallet support.*
The `settxfee` RPC {{summary_setTxFee}}
*Parameter #1---the transaction fee amount per kilobyte*
{% itemplate ntpd1 %}
- n: "Transaction Fee Per Kilobyte"
t: "number (bitcoins)"
p: "Required<br>(exactly 1)"
d: "The transaction fee to pay, in bitcoins, for each kilobyte of transaction data. Be careful setting the fee too low---your transactions may not be relayed or included in blocks"
{% enditemplate %}
*Result: `true` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool (true)"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the fee was successfully set"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Set the transaction fee per kilobyte to 100,000 satoshis.
{% highlight bash %}
bitcoin-cli -testnet settxfee 0.00100000
{% endhighlight %}
Result:
{% highlight json %}
true
{% endhighlight %}
*See also*
* [GetWalletInfo][rpc getwalletinfo]: {{summary_getWalletInfo}}
* [GetNetworkInfo][rpc getnetworkinfo]: {{summary_getNetworkInfo}}
{% 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/signmessage.md" %}
##### SignMessage
{% include helpers/subhead-links.md %}
{% assign summary_signMessage="signs a message with the private key of an address." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet or an
unencrypted wallet.*
The `signmessage` RPC {{summary_signMessage}}
*Parameter #1---the address corresponding to the private key to sign with*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "A P2PKH address whose private key belongs to this wallet"
{% enditemplate %}
*Parameter #2---the message to sign*
{% itemplate ntpd1 %}
- n: "Message"
t: "string"
p: "Required<br>(exactly 1)"
d: "The message to sign"
{% enditemplate %}
*Result---the message signature*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string (base64)"
p: "Required<br>(exactly 1)"
d: "The signature of the message, encoded in base64. Note that Bitcoin Core before 0.10.0 creates signatures with random *k* values, so each time you sign the same message, it will create a different signature"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Sign a the message "Hello, World!" using the following address:
{% highlight bash %}
bitcoin-cli -testnet signmessage mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe \
'Hello, World!'
{% endhighlight %}
Result:
{% highlight text %}
IL98ziCmwYi5pL+dqKp4Ux+zCa4hP/xbjHmWh+Mk/lefV/0pWV1p/gQ94jgExSmgH2/+PDcCCrOHAady2IEySSI=
{% endhighlight %}
*See also*
* [VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}}
{% 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/signrawtransaction.md" %}
##### SignRawTransaction
{% include helpers/subhead-links.md %}
{% assign summary_signRawTransaction="signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call." %}
{% autocrossref %}
The `signrawtransaction` RPC {{summary_signRawTransaction}}
*Parameter #1---the transaction to sign*
{% itemplate ntpd1 %}
- n: "Transaction"
t: "string (hex"
p: "Required<br>(exactly 1)"
d: "The transaction to sign as a serialized transaction"
{% enditemplate %}
*Parameter #2---unspent transaction output details*
{% itemplate ntpd1 %}
- n: "Dependencies"
t: "array"
p: "Optional<br>(0 or 1)"
d: "The previous outputs being spent by this transaction"
- n: "→<br>Output"
t: "object"
p: "Optional<br>(0 or more)"
d: "An output being spent"
- n: "→ →<br>`txid`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction the output appeared in. The TXID must be encoded in hex in RPC byte order"
- n: "→ →<br>`vout`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The index number of the output (vout) as it appeared in its transaction, with the first output being 0"
- n: "→ →<br>`scriptPubKey`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The output's pubkey script encoded as hex"
- n: "→ →<br>`redeemScript`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "If the pubkey script was a script hash, this must be the corresponding redeem script"
{% enditemplate %}
*Parameter #3---private keys for signing*
{% itemplate ntpd1 %}
- n: "Private Keys"
t: "array"
p: "Optional<br>(0 or 1)"
d: "An array holding private keys. If any keys are provided, only they will be used to sign the transaction (even if the wallet has other matching keys). If this array is empty or not used, and wallet support is enabled, keys from the wallet will be used"
- n: "→<br>Key"
t: "string (base58)"
p: "Required<br>(1 or more)"
d: "A private key in base58check format to use to create a signature for this transaction"
{% enditemplate %}
*Parameter #4---signature hash type*
{% itemplate ntpd1 %}
- n: "SigHash"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The type of signature hash to use for all of the signatures performed. (You must use separate calls to the `signrawtransaction` RPC if you want to use different signature hash types for different signatures. The allowed values are: `ALL`, `NONE`, `SINGLE`, `ALL|ANYONECANPAY`, `NONE|ANYONECANPAY`, and `SINGLE|ANYONECANPAY`"
{% enditemplate %}
*Result---the transaction with any signatures made*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "The results of the signature"
- n: "→<br>`hex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The resulting serialized transaction encoded as hex with any signatures made inserted. If no signatures were made, this will be the same transaction provided in parameter #1"
- n: "→<br>`complete`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "The value `true` if transaction is fully signed; the value `false` if more signatures are required"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Sign the hex generated in the example section for the `createrawtransaction`
RPC:
{% highlight bash %}
bitcoin-cli -testnet signrawtransaction 01000000011da9283b4ddf8d\
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffff\
ffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a51\
59f58488ac00000000
{% endhighlight %}
Result:
{% highlight json %}
{
"hex" : "01000000011da9283b4ddf8d89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e000000006a47304402200ebea9f630f3ee35fa467ffc234592c79538ecd6eb1c9199eb23c4a16a0485a20220172ecaf6975902584987d295b8dddf8f46ec32ca19122510e22405ba52d1f13201210256d16d76a49e6c8e2edc1c265d600ec1a64a45153d45c29a2fd0228c24c3a524ffffffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000",
"complete" : true
}
{% endhighlight %}
*See also*
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
{% endautocrossref %}

View file

@ -0,0 +1,42 @@
{% 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/stop.md" %}
##### Stop
{% include helpers/subhead-links.md %}
{% assign summary_stop="safely shuts down the Bitcoin Core server." %}
{% autocrossref %}
The `stop` RPC {{summary_stop}}
*Parameters: none*
*Result---the server is safely shut down*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The string \"Bitcoin server stopping\""
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet stop
{% endhighlight %}
Result:
{% highlight text %}
Bitcoin server stopping
{% endhighlight %}
*See also: none*
{% endautocrossref %}

View file

@ -0,0 +1,71 @@
{% 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/submitblock.md" %}
##### SubmitBlock
{% include helpers/subhead-links.md %}
{% assign summary_submitBlock="accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Bitcoin Core but may be used by mining pools or other programs." %}
{% autocrossref %}
The `submitblock` RPC {{summary_submitBlock}}
*Parameter #1---the new block in serialized block format as hex*
{% itemplate ntpd1 %}
- n: "Block"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The full block to submit in serialized block format as hex"
{% enditemplate %}
*Parameter #2---additional parameters*
{% itemplate ntpd1 %}
- n: "Parameters"
t: "object"
p: "Optional<br>(0 or 1)"
d: "A JSON object containing extra parameters. Not used directly by Bitcoin Core and also not broadcast to the network. This is available for use by mining pools and other software. A common parameter is a `workid` string"
{% enditemplate %}
*Result---`null` or error string*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null/string"
p: "Required<br>(exactly 1)"
d: "If the block submission succeeded, set to JSON `null`. If submission failed, set to one of the following strings: `duplicate`, `duplicate-invalid`, `inconclusive`, or `rejected`. The JSON-RPC `error` field will still be set to `null` if submission failed for one of these reasons"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Submit the following block with the workid, "test".
{% highlight bash %}
bitcoin-cli -testnet submitblock 02000000df11c014a8d798395b5059c\
722ebdf3171a4217ead71bf6e0e99f4c7000000004a6f6a2db225c81e77773f6\
f0457bcb05865a94900ed11356d0b75228efb38c7785d6053ffff001d005d437\
0010100000001000000000000000000000000000000000000000000000000000\
0000000000000ffffffff0d03b477030164062f503253482fffffffff0100f90\
29500000000232103adb7d8ef6b63de74313e0cd4e07670d09a169b13e4eda2d\
650f529332c47646dac00000000 \
'{ "workid": "test" }'
{% endhighlight %}
Result (the block above was already on a local block chain):
{% highlight text %}
duplicate
{% endhighlight %}
*See also*
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
{% 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/validateaddress.md" %}
##### ValidateAddress
{% include helpers/subhead-links.md %}
{% assign summary_validateAddress="returns information about the given Bitcoin address." %}
{% autocrossref %}
The `validateaddress` RPC {{summary_validateAddress}}
*Parameter #1---a P2PKH or P2SH address*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The P2PKH or P2SH address to validate encoded in base58check format"
{% enditemplate %}
*Result---information about the address*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "Information about the address"
- n: "→<br>`isvalid`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the address is a valid P2PKH or P2SH address; set to `false` otherwise"
- n: "→<br>`address`"
t: "string (base58)"
p: "Optional<br>(0 or 1)"
d: "If the address is valid, this is the address <!--TODO: figure out in what cases this might be different from the address provided in the parameter -->"
- n: "→<br>`ismine`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if the address belongs to the wallet; set to false if it does not. Only returned if wallet support enabled"
- n: "→<br>`iswatchonly`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if the address is watch-only. Otherwise set to `false`. Only returned if address is in the wallet"
- n: "→<br>`isscript`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if a P2SH address; otherwise set to `false`. Only returned if the address is in the wallet"
- n: "→<br>`script`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "Only returned for P2SH addresses belonging to this wallet. This is the type of script:<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>`hex`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "Only returned for P2SH addresses belonging to this wallet. This is the redeem script encoded as hex"
- n: "→<br>`addresses`"
t: "array"
p: "Optional<br>(0 or 1)"
d: "Only returned for P2SH addresses belonging to the wallet. A P2PKH addresses used in this script, or the computed P2PKH addresses of any pubkeys in this script. This array will be empty for `nonstandard` script types"
- n: "→ →<br>Address"
t: "string"
p: "Optional<br>(0 or more)"
d: "A P2PKH address"
- n: "→<br>`sigrequired`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Only returned for multisig P2SH addresses belonging to the wallet. The number of signatures required by this script"
- n: "→<br>`pubkey`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The public key corresponding to this address. Only returned if the address is a P2PKH address in the wallet"
- n: "→<br>`iscompressed`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "Set to `true` if a compressed public key or set to `false` if an uncompressed public key. Only returned if the address is a P2PKH address in the wallet"
- n: "→<br>`account`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "The account this address belong to. May be an empty string for the default account. Only returned if the address belongs to the wallet"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Validate the following P2PKH address from the wallet:
{% highlight bash %}
bitcoin-cli -testnet validateaddress mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe
{% endhighlight %}
Result:
{% highlight json %}
{
"isvalid" : true,
"address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe",
"ismine" : true,
"iswatchonly" : false,
"isscript" : false,
"pubkey" : "03bacb84c6464a58b3e0a53cc0ba4cb3b82848cd7bed25a7724b3cc75d76c9c1ba",
"iscompressed" : true,
"account" : "test label"
}
{% endhighlight %}
Validate the following P2SH multisig address from the wallet:
{% highlight bash %}
bitcoin-cli -testnet validateaddress 2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq
{% endhighlight %}
Result:
{% highlight json %}
{
"isvalid" : true,
"address" : "2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq",
"ismine" : true,
"iswatchonly" : false,
"isscript" : true,
"script" : "multisig",
"hex" : "522103ede722780d27b05f0b1169efc90fa15a601a32fc6c3295114500c586831b6aaf2102ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f21022d609d2f0d359e5bc0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d553ae",
"addresses" : [
"mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ",
"mo1vzGwCzWqteip29vGWWW6MsEBREuzW94",
"mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG"
],
"sigsrequired" : 2,
"account" : "test account"
}
{% endhighlight %}
*See also*
* [ImportAddress][rpc importaddress]: {{summary_importAddress}}
* [GetNewAddress][rpc getnewaddress]: {{summary_getNewAddress}}
{% 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/verifychain.md" %}
##### VerifyChain
{% include helpers/subhead-links.md %}
{% assign summary_verifyChain="verifies each entry in the local block chain database." %}
{% autocrossref %}
The `verifychain` RPC {{summary_verifyChain}}
*Parameter #1---how thoroughly to check each block*
{% itemplate ntpd1 %}
- n: "Check Level"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "How thoroughly to check each block, from 0 to 4. Default is the level set with the `-checklevel` command line argument; if that isn't set, the default is `3`. Each higher level includes the tests from the lower levels<br><br>Levels are:<br>**0.** Read from disk to ensure the files are accessible<br>**1.** Ensure each block is valid<br>**2.** Make sure undo files can be read from disk and are in a valid format<br>**3.** Test each block undo to ensure it results in correct state<br>**4.** After undoing blocks, reconnect them to ensure they reconnect correctly"
{% enditemplate %}
*Parameter #2---the number of blocks to check*
{% itemplate ntpd1 %}
- n: "Number Of Blocks"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of blocks to verify. Set to `0` to check all blocks. Defaults to the value of the `-checkblocks` command-line argument; if that isn't set, the default is `288`"
{% enditemplate %}
*Result---verification results*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "Set to `true` if verified; set to `false` if verification failed for any reason"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Verify the most recent 10,000 blocks in the most through way:
{% highlight bash %}
bitcoin-cli -testnet verifychain 4 10000
{% endhighlight %}
Result (took 4 minutes and 25 seconds on a generic PC laptop; it
would've taken much longer on mainnet):
{% highlight json %}
true
{% endhighlight %}
*See also*
* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}}
* [GetTxOutSetInfo][rpc gettxoutsetinfo]: {{summary_getTxOutSetInfo}}
{% endautocrossref %}

View file

@ -0,0 +1,78 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/bitcoin-core/rpcs/rpcs/verifymessage.md" %}
##### VerifyMessage
{% include helpers/subhead-links.md %}
{% assign summary_verifyMessage="verifies a signed message." %}
{% autocrossref %}
The `verifymessage` RPC {{summary_verifyMessage}}
*Parameter #1---the address corresponding to the signing key*
{% itemplate ntpd1 %}
- n: "Address"
t: "string (base58)"
p: "Required<br>(exactly 1)"
d: "The P2PKH address corresponding to the private key which made the signature. A P2PKH address is a hash of the public key corresponding to the private key which made the signature. When the ECDSA signature is checked, up to four possible ECDSA public keys will be reconstructed from from the signature; each key will be hashed and compared against the P2PKH address provided to see if any of them match. If there are no matches, signature validation will fail"
{% enditemplate %}
*Parameter #2---the signature*
{% itemplate ntpd1 %}
- n: "Signature"
t: "string (base64)"
p: "Required<br>(exactly 1)"
d: "The signature created by the signer encoded as base-64 (the format output by the `signmessage` RPC)"
{% enditemplate %}
*Parameter #3---the message*
{% itemplate ntpd1 %}
- n: "Message"
t: "string"
p: "Required<br>(exactly 1)"
d: "The message exactly as it was signed (e.g. no extra whitespace)"
{% enditemplate %}
*Result: `true`, `false`, or an error*
{% itemplate ntpd1 %}
- n: "`result`"
t: "bool/null"
p: "Required<br>(exactly 1)"
d: "Set to `true` if the message was signed by a key corresponding to the provided P2PKH address; set to `false` if it was not signed by that key; set to JSON `null` if an error occurred"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Check the signature on the message created in the example for
`signmessage`:
{% highlight bash %}
bitcoin-cli -testnet verifymessage \
mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe \
IL98ziCmwYi5pL+dqKp4Ux+zCa4hP/xbjHmWh+Mk/lefV/0pWV1p/gQ94jgExSmgH2/+PDcCCrOHAady2IEySSI= \
'Hello, World!'
{% endhighlight %}
Result:
{% highlight json %}
true
{% endhighlight %}
*See also*
* [SignMessage][rpc signmessage]: {{summary_signMessage}}
{% endautocrossref %}

View file

@ -0,0 +1,73 @@
{% 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/verifytxoutproof.md" %}
##### VerifyTxOutProof
{% include helpers/subhead-links.md %}
{% assign summary_verifyTxOutProof="verifies that a proof points to one or more transactions in a block, returning the transactions the proof commits to and throwing an RPC error if the block is not in our best block chain." %}
{% autocrossref %}
The `verifytxoutproof` RPC {{summary_verifyTxOutProof}}
*Parameter #1---The hex-encoded proof generated by gettxoutproof*
{% itemplate ntpd1 %}
- n: "`proof`"
t: "string"
p: "Required"
d: "A hex-encoded proof"
{% enditemplate %}
*Result---txid(s) which the proof commits to*
{% itemplate ntpd1 %}
- n: "`result`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The txid(s) which the proof commits to, or empty array if the proof is invalid"
{% enditemplate %}
*Example from Bitcoin Core 0.11.0*
Verify a proof:
{% highlight bash %}
bitcoin-cli verifytxoutproof \
03000000394ab3f08f712aa0f1d26c5daa4040b50e96d31d4e8e3c130000000000000000\
ca89aaa0bbbfcd5d1210c7888501431256135736817100d8c2cf7e4ab9c02b168115d455\
04dd1418836b20a6cb0800000d3a61beb3859abf1b773d54796c83b0b937968cc4ce3c0f\
71f981b2407a3241cb8908f2a88ac90a2844596e6019450f507e7efb8542cbe54ea55634\
c87bee474ee48aced68179564290d476e16cff01b483edcd2004d555c617dfc08200c083\
08ba511250e459b49d6a465e1ab1d5d8005e0778359c2993236c85ec66bac4bfd974131a\
dc1ee0ad8b645f459164eb38325ac88f98c9607752bc1b637e16814f0d9d8c2775ac3f20\
f85260947929ceef16ead56fcbfd77d9dc6126cce1b5aacd9f834690f7508ee2db2ab67d\
382c5e738b1b6fe3fb079511952d33ec18c8440ef291eb8d3546a971ee4aa5e574b7be7f\
5aff0b1c989b2059ae5a611c8ce5c58e8e8476246c5e7c6b70e0065f2a6654e2e6cf4efb\
6ae19bf2548a7d9febf5b0aceaff28610922e1b9e23e52f650a4a11d2986c9c2b09bb168\
a70a7d4ac16e4d389bc2868ee91da1837d2cd79288bdc680e9c35ebb3ddfd045d69d767b\
164ec69d5db9f995c045d10af5bd90cd9d1116c3732e14796ef9d1a57fa7bb718c07989e\
d06ff359bf2009eaf1b9e000c054b87230567991b447757bc6ca8e1bb6e9816ad604dbd6\
0600
{% endhighlight %}
Result:
{% highlight json %}
[
"f20e44c818ec332d95119507fbe36f1b8b735e2c387db62adbe28e50f7904683"
]
{% endhighlight %}
*See also*
* [GetTxOutProof][rpc gettxoutproof]: {{summary_getTxOutProof}}
* [`merkleblock` message][merkleblock message]: A description of the
format used for the proof.
{% endautocrossref %}

View file

@ -0,0 +1,44 @@
{% 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/walletlock.md" %}
##### WalletLock
{% include helpers/subhead-links.md %}
{% assign summary_walletLock="removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call `walletpassphrase` again before being able to call any methods which require the wallet to be unlocked." %}
{% autocrossref %}
*Requires wallet support. Requires an unlocked wallet.*
The `walletlock` RPC {{summary_walletLock}}
*Parameters: none*
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always set to JSON `null`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
{% highlight bash %}
bitcoin-cli -testnet walletlock
{% endhighlight %}
(Success: nothing printed.)
*See also*
* [EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}}
* [WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}
* [WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}
{% 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/walletpassphrase.md" %}
##### WalletPassphrase
{% include helpers/subhead-links.md %}
{% assign summary_walletPassphrase="stores the wallet decryption key in memory for the indicated number of seconds. Issuing the `walletpassphrase` command while the wallet is already unlocked will set a new unlock time that overrides the old one." %}
{% autocrossref %}
*Requires wallet support. Requires an encrypted wallet.*
The `walletpassphrase` RPC {{summary_walletPassphrase}}
{{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).
*Parameter #1---the passphrase*
{% itemplate ntpd1 %}
- n: "Passphrase"
t: "string"
p: "Required<br>(exactly 1)"
d: "The passphrase that unlocks the wallet"
{% enditemplate %}
*Parameter #2---the number of seconds to leave the wallet unlocked*
{% itemplate ntpd1 %}
- n: "Seconds"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of seconds after which the decryption key will be automatically deleted from memory"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always set to JSON `null`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Unlock the wallet for 10 minutes (the passphrase is "test"):
{% highlight bash %}
bitcoin-cli -testnet walletpassphrase test 600
{% endhighlight %}
(Success: no result printed.)
*See also*
* [EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}}
* [WalletPassphraseChange][rpc walletpassphrasechange]: {{summary_walletPassphraseChange}}
* [WalletLock][rpc walletlock]: {{summary_walletLock}}
{% 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/walletpassphrasechange.md" %}
##### WalletPassphraseChange
{% include helpers/subhead-links.md %}
{% assign summary_walletPassphraseChange="changes the wallet passphrase from 'old passphrase' to 'new passphrase'." %}
{% autocrossref %}
*Requires wallet support. Requires an encrypted wallet.*
The `walletpassphrasechange` RPC {{summary_walletPassphraseChange}}
{{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).
*Parameter #1---the current passphrase*
{% itemplate ntpd1 %}
- n: "Current Passphrase"
t: "string"
p: "Required<br>(exactly 1)"
d: "The current wallet passphrase"
{% enditemplate %}
*Parameter #2---the new passphrase*
{% itemplate ntpd1 %}
- n: "New Passphrase"
t: "string"
p: "Required<br>(exactly 1)"
d: "The new passphrase for the wallet"
{% enditemplate %}
*Result---`null` on success*
{% itemplate ntpd1 %}
- n: "`result`"
t: "null"
p: "Required<br>(exactly 1)"
d: "Always set to JSON `null`"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
Change the wallet passphrase from "test" to "example":
{% highlight bash %}
bitcoin-cli -testnet walletpassphrasechange test example
{% endhighlight %}
(Success: no result printed.)
*See also*
* [EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}}
* [WalletPassphrase][rpc walletpassphrase]: {{summary_walletPassphrase}}
* [WalletLock][rpc walletlock]: {{summary_walletLock}}
{% endautocrossref %}