{% comment %} This file is licensed under the MIT License (MIT) available on http://opensource.org/licenses/MIT. {% endcomment %} {% assign filename="_includes/ref_core_rpcs-hijklmn.md" %} #### help {% include helpers/subhead-links.md %} ~~~ help [RPC] ~~~ {% autocrossref %} List all commands, or get help for the specified RPC. {% endautocrossref %} **Argument: An RPC** {% autocrossref %} *String, optional:* get detailed help for the specified RPC. {% endautocrossref %} **Result: A List Of RPCs Or Detailed Help** {% autocrossref %} If an RPC was specified, detailed help for that RPC. If nothing specified, a list of available RPCs. {% endautocrossref %} **Example** {% autocrossref %} Command to get a description similar to this subsection: {% endautocrossref %} ~~~ > bitcoin-cli -testnet help help ~~~ #### importprivkey {% include helpers/subhead-links.md %} ~~~ importprivkey [label] [rescan] ~~~ {% autocrossref %} Adds a private key (in the format created by `dumpprivkey` to your wallet. {% endautocrossref %} **Argument #1: Private Key** {% autocrossref %} *String; required:* a private key in the hexadecimal format created by `dumpprivkey`. {% endautocrossref %} **Argument #2: Label** {% autocrossref %} *String; optional:* the name to associate with the address corresponding to the private key. Defaults to no label. {% endautocrossref %} **Argument #3: Whether To Rescan The Block Chain** {% autocrossref %} *Boolean; optional:* whether or not to rescan the saved block chain data for transactions related to this private key. If true, scans the block chain (which may take a while); if false, only show transactions related to this key from the UTXO set. The default is true. {% endautocrossref %} **Result: None On Success** {% autocrossref %} No result generated if key imported successfully. {% endautocrossref %} **Example** {% autocrossref %} Import the private key for the address mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe, giving it a label and scanning the entire block chain: {% endautocrossref %} ~~~ > bitcoin-cli -testnet importprivkey \ cU8Q2jGeX3GNKNa5etiC8mgEgFSeVUTRQfWE2ZCzszyqYNK4Mepy \ "test label" \ true ~~~ (Success: no result generated.) #### importwallet {% include helpers/subhead-links.md %} ~~~ importwallet ~~~ {% autocrossref %} Imports private keys from a file in wallet dump file format (see `dumpwallet`). These keys will be added to the keys currently in the wallet. {% endautocrossref %} **Argument: The Filename** {% autocrossref %} *String; required:* the filename of the wallet file relative to the working directory of `bitcoind`. {% endautocrossref %} **Result: None On Success** {% autocrossref %} No result generate on successful import. {% endautocrossref %} **Example** {% autocrossref %} Import the file shown in the example subsection of `dumpwallet`. {% endautocrossref %} ~~~ > bitcoin-cli -testnet importwallet /tmp/dump.txt ~~~ (Success: no result generated.) #### keypoolrefill {% include helpers/subhead-links.md %} ~~~ keypoolrefill [size] ~~~ {% autocrossref %} Fills the cache of unused pre-generated keys, the keypool. Requires the wallet be unlocked if encryption is used. {% endautocrossref %} **Argument: New Keypool Size** {% autocrossref %} *Number; optional:* the number of keys which should be in the keypool after generating new cache keys. Defaults to 100. {% endautocrossref %} **Result: None On Success** {% autocrossref %} No result generated on success. {% endautocrossref %} **Example** {% autocrossref %} Generate one extra key than the default: {% endautocrossref %} ~~~ > bitcoin-cli -testnet keypoolrefill 101 ~~~ #### listaccounts {% include helpers/subhead-links.md %} ~~~ listaccounts [minconf] ~~~ {% autocrossref %} Provides a JSON object which lists accounts and their balances. {% endautocrossref %} **Argument: Minimum Number Of Confirmations** {% autocrossref %} *Number; optional:* the minimum number of confirmations an incoming transaction must have before it is counted towards the balance. Outgoing transactions are counted regardless of the number of confirmations. Default is 1; use 0 to count unconfirmed transactions. {% endautocrossref %} **Result: A JSON Object With Paired Account/Balance Values** {% autocrossref %} A JSON object is produced which lists every account name and its corresponding value in decimal bitcoins. "" is the default account. Balance can be negative if transaction fees paid by this account exceed satoshis received. {% endautocrossref %} ~~~ { "": , [...] } ~~~ **Example** ~~~ > bitcoin-cli -testnet listaccounts ~~~ Result: ~~~ { "" : -1.40010000, "Refund from example.com" : 0.00000000, "doc test" : 0.30000000, "test" : 0.00000000, "test account" : 0.00000000, "test label" : 0.29960000, "test1" : 1.69900000 } ~~~ #### listaddressgroupings {% include helpers/subhead-links.md %} ~~~ listaddressgroupings ~~~ {% autocrossref %} Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions. {% endautocrossref %} **Result** {% autocrossref %} A JSON array of JSON arrays of JSON arrays, with the inner array listing *address*, *amount*, and *account* tuples. The middle array shows which of the tuples are associated with each other. The outer array simply stores the results. {% endautocrossref %} ~~~ [ [ [ "
", , "" ] ,... ] ,... ] ~~~ **Example** ~~~ > bitcoin-cli -testnet listaddressgroupings ~~~ Result (truncated): ~~~ [ [ [ "mgKgzJ7HR64CrB3zm1B4FUUCLtaSqUKfDb", 0.00000000 ], [ "mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck", 0.00000000, "test1" ], [ "myNrzM1Dda4t1q4UEqwuRosapCbBA8z61o", 0.00000000 ], [ "moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7", 0.00000000 ], [ "mpHeUC7RGRaypfcLNGNrGgfkT872WnKasb", 0.00000000 ] ], ~~~ #### listlockunspent {% include helpers/subhead-links.md %} ~~~ listlockunspent ~~~ {% autocrossref %} Returns list of temporarily unspendable outputs. See also: `lockunspent` {% endautocrossref %} **Result** {% autocrossref %} A JSON array of JSON objects, with each object listing a locked *txid* and output index number (*vout*). {% endautocrossref %} ~~~ [ { "txid" : "", "vout" : } ,[...] ] ~~~ **Example** ~~~ > bitcoin-cli -testnet listlockunspent ~~~ Result: ~~~ [ { "txid" : "ca7cb6a5ffcc2f21036879493db4530c0ce9b5bff9648f9a3be46e2dfc8e0166", "vout" : 0 } ] ~~~ #### listreceivedbyaccount {% include helpers/subhead-links.md %} ~~~ listreceivedbyaccount [confirmations] [true|false] ~~~ {% autocrossref %} List the total number of bitcoins received by each account. {% endautocrossref %} **Argument #1: Minimum Number Of Confirmations** {% autocrossref %} *Number; optional:* the minimum number of confirmations an incoming transaction must have before it is counted towards the balance. Outgoing transactions are counted regardless of the number of confirmations. Default is 1; use 0 to count unconfirmed transactions. {% endautocrossref %} **Argument #2: Whether To Include Empty Accounts** {% autocrossref %} *Boolean; optional:* whether or not accounts which have not received a payment should be included in the results. Defaults to *true* to display all accounts. {% endautocrossref %} **Result: Account Names, Balances, And Minimum Confirmations** {% autocrossref %} A JSON array of JSON objects, with each object containing an *account* name, an *amount* in decimal bitcoins, and the *confirmation* score of the transaction most recently received by that account. {% endautocrossref %} ~~~ [ { "account" : "", "amount" : , "confirmations" : } ,[...] ] ~~~ **Example** {% autocrossref %} Get the balances for all non-empty accounts, including only transactions which have been confirmed at least six times: {% endautocrossref %} ~~~ > bitcoin-cli -testnet listreceivedbyaccount 6 false ~~~ Result: ~~~ [ { "account" : "", "amount" : 0.19960000, "confirmations" : 53601 }, { "account" : "doc test", "amount" : 0.30000000, "confirmations" : 8991 } ] ~~~ #### listreceivedbyaddress {% include helpers/subhead-links.md %} ~~~ listreceivedbyaddress [confirmations] [true|false] ~~~ {% autocrossref %} List the total number of bitcoins received by each account. {% endautocrossref %} **Argument #1: Minimum Number Of Confirmations** {% autocrossref %} *Number; optional:* the minimum number of confirmations an incoming transaction must have before it is counted towards the balance. Outgoing transactions are counted regardless of the number of confirmations. Default is 1; use 0 to count unconfirmed transactions. {% endautocrossref %} **Argument #2: Whether To Include Empty Accounts** {% autocrossref %} *Boolean; optional:* whether or not addresses which have not received a payment should be included in the results. Defaults to *false* to display only addresses which have received payment. {% endautocrossref %} **Result: Addresses, Account Names, Balances, And Minimum Confirmations** {% autocrossref %} A JSON array of JSON objects, with each object containing an *address*, the *account* that address belongs to, an *amount* in decimal bitcoins, and the *confirmation* score of the transaction most recently received by that address. Also provided is a *txids* JSON array of txids affecting that address. {% endautocrossref %} ~~~ [ { "address" : "
", "account" : "", "amount" : , "confirmations" : [ "txids" : [ "", [...] ] } ,[...] ] ~~~ **Example** List addresses with balances confirmed by at least six blocks: ~~~ > bitcoin-cli -testnet listreceivedbyaddress 6 ~~~ Result (truncated after first entry): ~~~ [ { "address" : "mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck", "account" : "test1", "amount" : 1.99900000, "confirmations" : 55680, "txids" : [ "4d71a6127796766c39270881c779b6e05183f2bf35589261e9572436356f287f", "997115d0cf7b83ed332e6c1f2e8c44f803c95ea43490c84ce3e9ede4b2e1605f" ] }, [...] ~~~ #### listsinceblock {% include helpers/subhead-links.md %} ~~~ listsinceblock [block hash] [block depth] ~~~ {% autocrossref %} Get all transactions affecting addresses in the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth. {% endautocrossref %} **Argument #1: Block Hash** {% autocrossref %} *String; optional:* the hash of a block header from which all subsequent transactions should be listed. If omitted, all transactions affecting addresses in this wallet which have occurred since the genesis block will be listed. {% endautocrossref %} **Argument #2: Block Depth For Header Hash** {% autocrossref %} *Number; optional:* return the hash of a block header at a particular depth. The default is 1, which will return the most recent block header hash (the same result as the `getbestblockhash` RPC). Note: this argument does not affect which transactions are returned; it only changes the `lastblock` value in the returned data. {% endautocrossref %} **Result** {% autocrossref %} A JSON object containing a *transactions* JSON array, with each JSON object in the array describing a single transaction: the name of the *account* the transaction affects (with "" for the default account), the Bitcoin *address* (not present for transactions between address in this wallet), the *category* of transaction (either send or receive), the *amount* of the transaction in decimal bitcoins (negative for sends), the *fee*, the number of *confirmations*, the *blockhash* and *blocktime* of the block the transaction appears in, the *blockindex* number indicating what number it was in the block (counting from one), the *txid*, the *time* and *timereceived* of the transaction, plus a *comment* and *to* (label) for the transaction, if set. Outside of the array, the *lastblock* value stores the header hash of a block at the depth indicated by the second argument, the most recent block by default. {% endautocrossref %} ~~~ { "transactions": [ "account":"", "address":"
", "category":"", "amount": , "fee": , "confirmations": , "blockhash": "", "blockindex": , "blocktime": , "txid": "", "time": , "timereceived": , "comment": "", "to": "