From 8c6bab6c4323e3d43fad3d393c91131ac12be30c Mon Sep 17 00:00:00 2001 From: Cornelius Schumacher Date: Sun, 28 Feb 2021 00:32:50 +0100 Subject: [PATCH] Update RPC docs to Bitcoin Core 0.21 --- helpers/rpc/TODO.md | 12 +- helpers/rpc/annotations-bitcoin-0.21.json | 9 ++ reference/rpc/abandontransaction.rst | 9 +- reference/rpc/abortrescan.rst | 17 +- reference/rpc/addmultisigaddress.rst | 15 +- reference/rpc/addnode.rst | 9 +- reference/rpc/analyzepsbt.rst | 49 +++--- reference/rpc/backupwallet.rst | 9 +- reference/rpc/bumpfee.rst | 51 +++--- reference/rpc/clearbanned.rst | 9 +- reference/rpc/combinepsbt.rst | 17 +- reference/rpc/combinerawtransaction.rst | 8 +- reference/rpc/converttopsbt.rst | 23 ++- reference/rpc/createmultisig.rst | 11 +- reference/rpc/createpsbt.rst | 17 +- reference/rpc/createrawtransaction.rst | 10 +- reference/rpc/createwallet.rst | 38 ++++- reference/rpc/decodepsbt.rst | 152 +++++++++--------- reference/rpc/decoderawtransaction.rst | 87 +++++----- reference/rpc/decodescript.rst | 30 ++-- reference/rpc/deriveaddresses.rst | 5 +- reference/rpc/disconnectnode.rst | 11 +- reference/rpc/dumpprivkey.rst | 4 +- reference/rpc/dumpwallet.rst | 8 +- reference/rpc/encryptwallet.rst | 15 +- reference/rpc/estimatesmartfee.rst | 15 +- reference/rpc/finalizepsbt.rst | 9 +- reference/rpc/fundrawtransaction.rst | 42 +++-- reference/rpc/generateblock.rst | 52 ++++++ reference/rpc/generatetoaddress.rst | 7 +- reference/rpc/generatetodescriptor.rst | 51 ++++++ reference/rpc/getaddednodeinfo.rst | 27 ++-- reference/rpc/getaddressesbylabel.rst | 11 +- reference/rpc/getaddressinfo.rst | 82 +++++----- reference/rpc/getbalance.rst | 19 ++- reference/rpc/getbalances.rst | 43 +++++ reference/rpc/getbestblockhash.rst | 4 +- reference/rpc/getblock.rst | 64 ++++---- reference/rpc/getblockchaininfo.rst | 79 +++++---- reference/rpc/getblockcount.rst | 6 +- reference/rpc/getblockfilter.rst | 48 ++++++ reference/rpc/getblockhash.rst | 4 +- reference/rpc/getblockheader.rst | 38 ++--- reference/rpc/getblockstats.rst | 82 +++++----- reference/rpc/getblocktemplate.rst | 96 +++++------ reference/rpc/getchaintips.rst | 27 ++-- reference/rpc/getchaintxstats.rst | 19 +-- reference/rpc/getconnectioncount.rst | 2 +- reference/rpc/getdescriptorinfo.rst | 11 +- reference/rpc/getdifficulty.rst | 4 +- reference/rpc/getindexinfo.rst | 51 ++++++ reference/rpc/getmemoryinfo.rst | 28 ++-- reference/rpc/getmempoolancestors.rst | 69 ++++---- reference/rpc/getmempooldescendants.rst | 69 ++++---- reference/rpc/getmempoolentry.rst | 58 +++---- reference/rpc/getmempoolinfo.rst | 18 ++- reference/rpc/getmininginfo.rst | 20 +-- reference/rpc/getnettotals.rst | 25 ++- reference/rpc/getnetworkhashps.rst | 4 +- reference/rpc/getnetworkinfo.rst | 66 ++++---- reference/rpc/getnewaddress.rst | 4 +- reference/rpc/getnodeaddresses.rst | 20 +-- reference/rpc/getpeerinfo.rst | 117 +++++++++----- reference/rpc/getrawchangeaddress.rst | 4 +- reference/rpc/getrawmempool.rst | 91 +++++++---- reference/rpc/getrawtransaction.rst | 91 ++++++----- reference/rpc/getreceivedbyaddress.rst | 10 +- reference/rpc/getreceivedbylabel.rst | 4 +- reference/rpc/getrpcinfo.rst | 19 +-- reference/rpc/gettransaction.rst | 90 +++++++---- reference/rpc/gettxout.rst | 30 ++-- reference/rpc/gettxoutproof.rst | 4 +- reference/rpc/gettxoutsetinfo.rst | 29 ++-- reference/rpc/getunconfirmedbalance.rst | 16 +- reference/rpc/getwalletinfo.rst | 37 +++-- reference/rpc/help.rst | 2 +- reference/rpc/importaddress.rst | 13 +- reference/rpc/importdescriptors.rst | 72 +++++++++ reference/rpc/importmulti.rst | 35 ++-- reference/rpc/importprivkey.rst | 11 +- reference/rpc/importprunedfunds.rst | 7 + reference/rpc/importpubkey.rst | 13 +- reference/rpc/importwallet.rst | 11 +- reference/rpc/index.rst | 11 +- reference/rpc/joinpsbts.rst | 15 +- reference/rpc/keypoolrefill.rst | 11 +- reference/rpc/listaddressgroupings.rst | 23 +-- reference/rpc/listbanned.rst | 18 ++- reference/rpc/listlabels.rst | 6 +- reference/rpc/listlockunspent.rst | 14 +- reference/rpc/listreceivedbyaddress.rst | 32 ++-- reference/rpc/listreceivedbylabel.rst | 22 +-- reference/rpc/listsinceblock.rst | 79 +++++---- reference/rpc/listtransactions.rst | 68 ++++---- reference/rpc/listunspent.rst | 47 +++--- reference/rpc/listwalletdir.rst | 14 +- reference/rpc/listwallets.rst | 8 +- reference/rpc/loadwallet.rst | 19 ++- reference/rpc/lockunspent.rst | 6 +- reference/rpc/logging.rst | 12 +- reference/rpc/ping.rst | 9 +- reference/rpc/preciousblock.rst | 9 +- reference/rpc/prioritisetransaction.rst | 4 +- reference/rpc/pruneblockchain.rst | 6 +- reference/rpc/psbtbumpfee.rst | 94 +++++++++++ reference/rpc/removeprunedfunds.rst | 9 +- reference/rpc/rescanblockchain.rst | 10 +- reference/rpc/savemempool.rst | 9 +- reference/rpc/scantxoutset.rst | 37 +++-- reference/rpc/send.rst | 138 ++++++++++++++++ reference/rpc/sendmany.rst | 62 ++++--- reference/rpc/sendrawtransaction.rst | 20 ++- reference/rpc/sendtoaddress.rst | 66 +++++--- reference/rpc/setban.rst | 11 +- reference/rpc/sethdseed.rst | 11 +- reference/rpc/setlabel.rst | 11 +- reference/rpc/setnetworkactive.rst | 13 ++ reference/rpc/settxfee.rst | 6 +- reference/rpc/setwalletflag.rst | 49 ++++++ reference/rpc/signmessage.rst | 5 +- reference/rpc/signmessagewithprivkey.rst | 4 +- reference/rpc/signrawtransactionwithkey.rst | 34 ++-- .../rpc/signrawtransactionwithwallet.rst | 32 ++-- reference/rpc/stop.rst | 15 +- reference/rpc/submitblock.rst | 15 +- reference/rpc/submitheader.rst | 12 +- reference/rpc/testmempoolaccept.rst | 36 +++-- reference/rpc/unloadwallet.rst | 24 ++- reference/rpc/upgradewallet.rst | 46 ++++++ reference/rpc/uptime.rst | 4 +- reference/rpc/utxoupdatepsbt.rst | 35 +++- reference/rpc/validateaddress.rst | 10 +- reference/rpc/verifychain.rst | 10 +- reference/rpc/verifymessage.rst | 2 +- reference/rpc/verifytxoutproof.rst | 15 +- reference/rpc/walletcreatefundedpsbt.rst | 45 +++--- reference/rpc/walletlock.rst | 11 +- reference/rpc/walletpassphrase.rst | 9 +- reference/rpc/walletpassphrasechange.rst | 9 +- reference/rpc/walletprocesspsbt.rst | 13 +- 140 files changed, 2680 insertions(+), 1290 deletions(-) create mode 100644 reference/rpc/generateblock.rst create mode 100644 reference/rpc/generatetodescriptor.rst create mode 100644 reference/rpc/getbalances.rst create mode 100644 reference/rpc/getblockfilter.rst create mode 100644 reference/rpc/getindexinfo.rst create mode 100644 reference/rpc/importdescriptors.rst create mode 100644 reference/rpc/psbtbumpfee.rst create mode 100644 reference/rpc/send.rst create mode 100644 reference/rpc/setwalletflag.rst create mode 100644 reference/rpc/upgradewallet.rst diff --git a/helpers/rpc/TODO.md b/helpers/rpc/TODO.md index 15b0d95..01788d1 100644 --- a/helpers/rpc/TODO.md +++ b/helpers/rpc/TODO.md @@ -1,10 +1,12 @@ # RPC helper To do -* Add RST - * Add basic renderer - * Try rendered result - * Add unit tests - * Refactor (share between backends, abstract rst page) +* Add command to add deprecation notice and deprecate getbalance, getunconfirmedbalance in 0.19 + +* Remove markdown support + * Remove renderer + * Remove helper subcommands which rely on markdown files + +* Add command to add "see also" and add references, e.g. in importaddress, importmulti, importprivkey, importpubkey, importwallet, rescanblockchain, walletprocesspsbt * Fix description * gettxoutproof (first line cut off before "txids") diff --git a/helpers/rpc/annotations-bitcoin-0.21.json b/helpers/rpc/annotations-bitcoin-0.21.json index 82c644d..c9a637b 100644 --- a/helpers/rpc/annotations-bitcoin-0.21.json +++ b/helpers/rpc/annotations-bitcoin-0.21.json @@ -186,6 +186,9 @@ "deprecated": "0.18.0", "removed": "0.19" }, + "generateblock": { + "added": "0.21" + }, "generatetoaddress": { "added": "0.13.0", "see_also": { @@ -586,6 +589,9 @@ ] } }, + "importdescriptors": { + "added": "0.21" + }, "importmulti": { "added": "0.14.0", "see_also": { @@ -743,6 +749,9 @@ ] } }, + "psbtbumpfee": { + "added": "0.21" + }, "removeprunedfunds": { "added": "0.13.0", "see_also": { diff --git a/reference/rpc/abandontransaction.rst b/reference/rpc/abandontransaction.rst index ae6f9b7..b999f86 100644 --- a/reference/rpc/abandontransaction.rst +++ b/reference/rpc/abandontransaction.rst @@ -21,6 +21,13 @@ Argument #1 - txid The transaction id +Result +~~~~~~ + +:: + + null (json null) + Examples ~~~~~~~~ @@ -33,5 +40,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/abortrescan.rst b/reference/rpc/abortrescan.rst index 2378796..15fa0d6 100644 --- a/reference/rpc/abortrescan.rst +++ b/reference/rpc/abortrescan.rst @@ -8,6 +8,21 @@ abortrescan Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call. +Note: Use "getwalletinfo" to query the scanning progress. + +Result +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Name + - Type + - Description + * - true|false + - boolean + - Whether the abort was successful + Examples ~~~~~~~~ @@ -24,5 +39,5 @@ Abort the running wallet rescan:: As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abortrescan", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "abortrescan", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/addmultisigaddress.rst b/reference/rpc/addmultisigaddress.rst index e9fb9e1..35bcff5 100644 --- a/reference/rpc/addmultisigaddress.rst +++ b/reference/rpc/addmultisigaddress.rst @@ -6,7 +6,7 @@ addmultisigaddress ``addmultisigaddress nrequired ["key",...] ( "label" "address_type" )`` -Add a nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup. +Add an nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup. Each key is a Bitcoin address or hex-encoded public key. @@ -28,7 +28,7 @@ Argument #2 - keys **Type:** json array, required -A json array of bitcoin addresses or hex-encoded public keys +The bitcoin addresses or hex-encoded public keys :: @@ -56,9 +56,10 @@ Result :: - { - "address":"multisigaddress", (string) The value of the new multisig address. - "redeemScript":"script" (string) The string value of the hex-encoded redemption script. + { (json object) + "address" : "str", (string) The value of the new multisig address + "redeemScript" : "hex", (string) The string value of the hex-encoded redemption script + "descriptor" : "str" (string) The descriptor for this multisig } Examples @@ -69,9 +70,9 @@ Examples Add a multisig address from 2 addresses:: - bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]" + bitcoin-cli addmultisigaddress 2 "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]" As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/addnode.rst b/reference/rpc/addnode.rst index 58d91a7..2d66366 100644 --- a/reference/rpc/addnode.rst +++ b/reference/rpc/addnode.rst @@ -27,6 +27,13 @@ Argument #2 - command 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once +Result +~~~~~~ + +:: + + null (json null) + Examples ~~~~~~~~ @@ -39,5 +46,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/analyzepsbt.rst b/reference/rpc/analyzepsbt.rst index 3931797..85b1fa7 100644 --- a/reference/rpc/analyzepsbt.rst +++ b/reference/rpc/analyzepsbt.rst @@ -20,29 +20,32 @@ Result :: - { - "inputs" : [ (array of json objects) - { - "has_utxo" : true|false (boolean) Whether a UTXO is provided - "is_final" : true|false (boolean) Whether the input is finalized - "missing" : { (json object, optional) Things that are missing that are required to complete this input - "pubkeys" : [ (array, optional) - "keyid" (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing - ] - "signatures" : [ (array, optional) - "keyid" (string) Public key ID, hash160 of the public key, of a public key whose signature is missing - ] - "redeemscript" : "hash" (string, optional) Hash160 of the redeemScript that is missing - "witnessscript" : "hash" (string, optional) SHA256 of the witnessScript that is missing - } - "next" : "role" (string, optional) Role of the next person that this input needs to go to - } - ,... - ] - "estimated_vsize" : vsize (numeric, optional) Estimated vsize of the final signed transaction - "estimated_feerate" : feerate (numeric, optional) Estimated feerate of the final signed transaction in BTC/kB. Shown only if all UTXO slots in the PSBT have been filled. - "fee" : fee (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled. - "next" : "role" (string) Role of the next person that this psbt needs to go to + { (json object) + "inputs" : [ (json array) + { (json object) + "has_utxo" : true|false, (boolean) Whether a UTXO is provided + "is_final" : true|false, (boolean) Whether the input is finalized + "missing" : { (json object, optional) Things that are missing that are required to complete this input + "pubkeys" : [ (json array, optional) + "hex", (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing + ... + ], + "signatures" : [ (json array, optional) + "hex", (string) Public key ID, hash160 of the public key, of a public key whose signature is missing + ... + ], + "redeemscript" : "hex", (string, optional) Hash160 of the redeemScript that is missing + "witnessscript" : "hex" (string, optional) SHA256 of the witnessScript that is missing + }, + "next" : "str" (string, optional) Role of the next person that this input needs to go to + }, + ... + ], + "estimated_vsize" : n, (numeric, optional) Estimated vsize of the final signed transaction + "estimated_feerate" : n, (numeric, optional) Estimated feerate of the final signed transaction in BTC/kB. Shown only if all UTXO slots in the PSBT have been filled + "fee" : n, (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled + "next" : "str", (string) Role of the next person that this psbt needs to go to + "error" : "str" (string, optional) Error message (if there is one) } Examples diff --git a/reference/rpc/backupwallet.rst b/reference/rpc/backupwallet.rst index 7b60b36..d24e1d9 100644 --- a/reference/rpc/backupwallet.rst +++ b/reference/rpc/backupwallet.rst @@ -15,6 +15,13 @@ Argument #1 - destination The destination directory or file +Result +~~~~~~ + +:: + + null (json null) + Examples ~~~~~~~~ @@ -27,5 +34,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "backupwallet", "params": ["backup.dat"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/bumpfee.rst b/reference/rpc/bumpfee.rst index 4e26110..b6877fd 100644 --- a/reference/rpc/bumpfee.rst +++ b/reference/rpc/bumpfee.rst @@ -10,21 +10,25 @@ Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transactio An opt-in RBF transaction with the given txid must be in the wallet. -The command will pay the additional fee by decreasing (or perhaps removing) its change output. +The command will pay the additional fee by reducing change outputs or adding inputs when necessary. + +It may add a new change output if one does not already exist. + +All inputs in the original transaction will be included in the replacement transaction. -If the change output is not big enough to cover the increased fee, the command will currently fail -instead of adding new inputs to compensate. (A future implementation could improve this.) The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs. -By default, the new fee will be calculated automatically using estimatesmartfee. +By default, the new fee will be calculated automatically using the estimatesmartfee RPC. The user can specify a confirmation target for estimatesmartfee. -Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate. +Alternatively, the user can specify a fee rate in sat/vB for the new transaction. At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node's mempool. +\* WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. \* + Argument #1 - txid ~~~~~~~~~~~~~~~~~~ @@ -40,11 +44,13 @@ Argument #2 - options :: { - "confTarget": n, (numeric, optional, default=fallback to wallet's default) Confirmation target (in blocks) - "totalFee": n, (numeric, optional, default=fallback to 'confTarget') Total fee (NOT feerate) to pay, in satoshis. - In rare cases, the actual fee paid might be slightly higher than the specified - totalFee if the tx change output has to be removed because it is too close to - the dust threshold. + "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks + + "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) + Specify a fee rate in sat/vB instead of relying on the built-in fee estimator. + Must be at least 1.000 sat/vB higher than the current transaction fee rate. + WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. + "replaceable": bool, (boolean, optional, default=true) Whether the new transaction should still be marked bip-125 replaceable. If true, the sequence numbers in the transaction will be left unchanged from the original. If false, any input sequence numbers in the @@ -52,10 +58,11 @@ Argument #2 - options so the new transaction will not be explicitly bip-125 replaceable (though it may still be replaceable in practice, for example if it has unconfirmed ancestors which are replaceable). - "estimate_mode": "str", (string, optional, default=UNSET) The fee estimate mode, must be one of: - "UNSET" - "ECONOMICAL" - "CONSERVATIVE" + + "estimate_mode": "str", (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): + "unset" + "economical" + "conservative" } Result @@ -63,11 +70,15 @@ Result :: - { - "txid": "value", (string) The id of the new transaction - "origfee": n, (numeric) Fee of the replaced transaction - "fee": n, (numeric) Fee of the new transaction - "errors": [ str... ] (json array of strings) Errors encountered during processing (may be empty) + { (json object) + "psbt" : "str", (string) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled. (DEPRECATED) + "txid" : "hex", (string) The id of the new transaction. Only returned when wallet private keys are enabled. + "origfee" : n, (numeric) The fee of the replaced transaction. + "fee" : n, (numeric) The fee of the new transaction. + "errors" : [ (json array) Errors encountered during processing (may be empty). + "str", (string) + ... + ] } Examples @@ -76,7 +87,7 @@ Examples .. highlight:: shell -Bump the fee, get the new transaction's txid:: +Bump the fee, get the new transaction'stxid:: bitcoin-cli bumpfee diff --git a/reference/rpc/clearbanned.rst b/reference/rpc/clearbanned.rst index 688c0a8..5398f34 100644 --- a/reference/rpc/clearbanned.rst +++ b/reference/rpc/clearbanned.rst @@ -8,6 +8,13 @@ clearbanned Clear all banned IPs. +Result +~~~~~~ + +:: + + null (json null) + Examples ~~~~~~~~ @@ -20,5 +27,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "clearbanned", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/combinepsbt.rst b/reference/rpc/combinepsbt.rst index 42ae6bc..c86eade 100644 --- a/reference/rpc/combinepsbt.rst +++ b/reference/rpc/combinepsbt.rst @@ -15,7 +15,7 @@ Argument #1 - txs **Type:** json array, required -A json array of base64 strings of partially signed transactions +The base64 strings of partially signed transactions :: @@ -24,6 +24,19 @@ A json array of base64 strings of partially signed transactions ... ] +Result +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Name + - Type + - Description + * - str + - string + - The base64-encoded partially signed transaction + Examples ~~~~~~~~ @@ -32,5 +45,5 @@ Examples :: - bitcoin-cli combinepsbt ["mybase64_1", "mybase64_2", "mybase64_3"] + bitcoin-cli combinepsbt '["mybase64_1", "mybase64_2", "mybase64_3"]' diff --git a/reference/rpc/combinerawtransaction.rst b/reference/rpc/combinerawtransaction.rst index 0696d9f..8287b2a 100644 --- a/reference/rpc/combinerawtransaction.rst +++ b/reference/rpc/combinerawtransaction.rst @@ -16,12 +16,12 @@ Argument #1 - txs **Type:** json array, required -A json array of hex strings of partially signed transactions +The hex strings of partially signed transactions :: [ - "hexstring", (string) A transaction hash + "hexstring", (string) A hex-encoded raw transaction ... ] @@ -34,7 +34,7 @@ Result * - Name - Type - Description - * - hex + * - str - string - The hex-encoded raw transaction with signature(s) @@ -46,5 +46,5 @@ Examples :: - bitcoin-cli combinerawtransaction ["myhex1", "myhex2", "myhex3"] + bitcoin-cli combinerawtransaction '["myhex1", "myhex2", "myhex3"]' diff --git a/reference/rpc/converttopsbt.rst b/reference/rpc/converttopsbt.rst index 53678e1..91cd85a 100644 --- a/reference/rpc/converttopsbt.rst +++ b/reference/rpc/converttopsbt.rst @@ -21,7 +21,7 @@ Argument #2 - permitsigdata **Type:** boolean, optional, default=false -If true, any signatures in the input will be discarded and conversion. +If true, any signatures in the input will be discarded and conversion will continue. If false, RPC will fail if any signatures are present. Argument #3 - iswitness @@ -30,9 +30,24 @@ Argument #3 - iswitness **Type:** boolean, optional, default=depends on heuristic tests Whether the transaction hex is a serialized witness transaction. - If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserializaion - will be tried. If false, only non-witness deserialization will be tried. Only has an effect if - permitsigdata is true. + If iswitness is not present, heuristic tests will be used in decoding. + If true, only witness deserialization will be tried. + If false, only non-witness deserialization will be tried. + This boolean should reflect whether the transaction has inputs + (e.g. fully valid, or on-chain transactions), if known by the caller. + +Result +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Name + - Type + - Description + * - str + - string + - The resulting raw transaction (base64-encoded string) Examples ~~~~~~~~ diff --git a/reference/rpc/createmultisig.rst b/reference/rpc/createmultisig.rst index f6739a5..23a3bea 100644 --- a/reference/rpc/createmultisig.rst +++ b/reference/rpc/createmultisig.rst @@ -22,7 +22,7 @@ Argument #2 - keys **Type:** json array, required -A json array of hex-encoded public keys. +The hex-encoded public keys. :: @@ -43,9 +43,10 @@ Result :: - { - "address":"multisigaddress", (string) The value of the new multisig address. - "redeemScript":"script" (string) The string value of the hex-encoded redemption script. + { (json object) + "address" : "str", (string) The value of the new multisig address. + "redeemScript" : "hex", (string) The string value of the hex-encoded redemption script. + "descriptor" : "str" (string) The descriptor for this multisig } Examples @@ -60,5 +61,5 @@ Create a multisig address from 2 public keys:: As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createmultisig", "params": [2, "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/createpsbt.rst b/reference/rpc/createpsbt.rst index 5d12c45..2e5f3d5 100644 --- a/reference/rpc/createpsbt.rst +++ b/reference/rpc/createpsbt.rst @@ -15,7 +15,7 @@ Argument #1 - inputs **Type:** json array, required -A json array of json objects +The json objects :: @@ -33,7 +33,7 @@ Argument #2 - outputs **Type:** json array, required -a json array with outputs (key-value pairs), where none of the keys are duplicated. +The outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. @@ -65,6 +65,19 @@ Argument #4 - replaceable Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible. +Result +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Name + - Type + - Description + * - str + - string + - The resulting raw transaction (base64-encoded string) + Examples ~~~~~~~~ diff --git a/reference/rpc/createrawtransaction.rst b/reference/rpc/createrawtransaction.rst index 9bb3526..33444e8 100644 --- a/reference/rpc/createrawtransaction.rst +++ b/reference/rpc/createrawtransaction.rst @@ -20,7 +20,7 @@ Argument #1 - inputs **Type:** json array, required -A json array of json objects +The inputs :: @@ -38,7 +38,7 @@ Argument #2 - outputs **Type:** json array, required -a json array with outputs (key-value pairs), where none of the keys are duplicated. +The outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. @@ -79,7 +79,7 @@ Result * - Name - Type - Description - * - transaction + * - hex - string - hex string of the transaction @@ -99,9 +99,9 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"data\":\"00010203\"}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"data\":\"00010203\"}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/createwallet.rst b/reference/rpc/createwallet.rst index 91e991f..c978840 100644 --- a/reference/rpc/createwallet.rst +++ b/reference/rpc/createwallet.rst @@ -4,7 +4,7 @@ createwallet ============ -``createwallet "wallet_name" ( disable_private_keys blank )`` +``createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup )`` Creates and loads a new wallet. @@ -29,14 +29,42 @@ Argument #3 - blank Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using sethdseed. +Argument #4 - passphrase +~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** string + +Encrypt the wallet with this passphrase. + +Argument #5 - avoid_reuse +~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** boolean, optional, default=false + +Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind. + +Argument #6 - descriptors +~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** boolean, optional, default=false + +Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation + +Argument #7 - load_on_startup +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** boolean, optional, default=null + +Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged. + Result ~~~~~~ :: - { - "name" : , (string) The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path. - "warning" : , (string) Warning message if wallet was not loaded cleanly. + { (json object) + "name" : "str", (string) The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path. + "warning" : "str" (string) Warning message if wallet was not loaded cleanly. } Examples @@ -51,5 +79,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createwallet", "params": ["testwallet"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/decodepsbt.rst b/reference/rpc/decodepsbt.rst index 137c6e4..c7e0609 100644 --- a/reference/rpc/decodepsbt.rst +++ b/reference/rpc/decodepsbt.rst @@ -20,91 +20,93 @@ Result :: - { - "tx" : { (json object) The decoded network-serialized unsigned transaction. - ... The layout is the same as the output of decoderawtransaction. + { (json object) + "tx" : { (json object) The decoded network-serialized unsigned transaction. + ... The layout is the same as the output of decoderawtransaction. }, - "unknown" : { (json object) The unknown global fields - "key" : "value" (key-value pair) An unknown key-value pair - ... + "unknown" : { (json object) The unknown global fields + "key" : "hex", (string) (key-value pair) An unknown key-value pair + ... }, - "inputs" : [ (array of json objects) - { - "non_witness_utxo" : { (json object, optional) Decoded network transaction for non-witness UTXOs + "inputs" : [ (json array) + { (json object) + "non_witness_utxo" : { (json object, optional) Decoded network transaction for non-witness UTXOs ... }, - "witness_utxo" : { (json object, optional) Transaction output for witness UTXOs - "amount" : x.xxx, (numeric) The value in BTC - "scriptPubKey" : { (json object) - "asm" : "asm", (string) The asm - "hex" : "hex", (string) The hex - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - "address" : "address" (string) Bitcoin address if there is one + "witness_utxo" : { (json object, optional) Transaction output for witness UTXOs + "amount" : n, (numeric) The value in BTC + "scriptPubKey" : { (json object) + "asm" : "str", (string) The asm + "hex" : "hex", (string) The hex + "type" : "str", (string) The type, eg 'pubkeyhash' + "address" : "str" (string) Bitcoin address if there is one } }, "partial_signatures" : { (json object, optional) - "pubkey" : "signature", (string) The public key and signature that corresponds to it. - ,... - } - "sighash" : "type", (string, optional) The sighash type to be used - "redeem_script" : { (json object, optional) - "asm" : "asm", (string) The asm - "hex" : "hex", (string) The hex - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - } - "witness_script" : { (json object, optional) - "asm" : "asm", (string) The asm - "hex" : "hex", (string) The hex - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - } - "bip32_derivs" : { (json object, optional) - "pubkey" : { (json object, optional) The public key with the derivation path as the value. - "master_fingerprint" : "fingerprint" (string) The fingerprint of the master key - "path" : "path", (string) The path - } - ,... - } - "final_scriptsig" : { (json object, optional) - "asm" : "asm", (string) The asm - "hex" : "hex", (string) The hex - } - "final_scriptwitness": ["hex", ...] (array of string) hex-encoded witness data (if any) - "unknown" : { (json object) The unknown global fields - "key" : "value" (key-value pair) An unknown key-value pair - ... + "pubkey" : "str", (string) The public key and signature that corresponds to it. + ... }, - } - ,... - ] - "outputs" : [ (array of json objects) - { - "redeem_script" : { (json object, optional) - "asm" : "asm", (string) The asm - "hex" : "hex", (string) The hex - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - } - "witness_script" : { (json object, optional) - "asm" : "asm", (string) The asm - "hex" : "hex", (string) The hex - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - } - "bip32_derivs" : [ (array of json objects, optional) - { - "pubkey" : "pubkey", (string) The public key this path corresponds to - "master_fingerprint" : "fingerprint" (string) The fingerprint of the master key - "path" : "path", (string) The path - } - } - ,... + "sighash" : "str", (string, optional) The sighash type to be used + "redeem_script" : { (json object, optional) + "asm" : "str", (string) The asm + "hex" : "hex", (string) The hex + "type" : "str" (string) The type, eg 'pubkeyhash' + }, + "witness_script" : { (json object, optional) + "asm" : "str", (string) The asm + "hex" : "hex", (string) The hex + "type" : "str" (string) The type, eg 'pubkeyhash' + }, + "bip32_derivs" : [ (json array, optional) + { (json object, optional) The public key with the derivation path as the value. + "master_fingerprint" : "str", (string) The fingerprint of the master key + "path" : "str" (string) The path + }, + ... + ], + "final_scriptsig" : { (json object, optional) + "asm" : "str", (string) The asm + "hex" : "str" (string) The hex + }, + "final_scriptwitness" : [ (json array) + "hex", (string) hex-encoded witness data (if any) + ... ], - "unknown" : { (json object) The unknown global fields - "key" : "value" (key-value pair) An unknown key-value pair - ... + "unknown" : { (json object) The unknown global fields + "key" : "hex", (string) (key-value pair) An unknown key-value pair + ... + } + }, + ... + ], + "outputs" : [ (json array) + { (json object) + "redeem_script" : { (json object, optional) + "asm" : "str", (string) The asm + "hex" : "hex", (string) The hex + "type" : "str" (string) The type, eg 'pubkeyhash' }, - } - ,... - ] - "fee" : fee (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled. + "witness_script" : { (json object, optional) + "asm" : "str", (string) The asm + "hex" : "hex", (string) The hex + "type" : "str" (string) The type, eg 'pubkeyhash' + }, + "bip32_derivs" : [ (json array, optional) + { (json object) + "pubkey" : "str", (string) The public key this path corresponds to + "master_fingerprint" : "str", (string) The fingerprint of the master key + "path" : "str" (string) The path + }, + ... + ], + "unknown" : { (json object) The unknown global fields + "key" : "hex", (string) (key-value pair) An unknown key-value pair + ... + } + }, + ... + ], + "fee" : n (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled. } Examples diff --git a/reference/rpc/decoderawtransaction.rst b/reference/rpc/decoderawtransaction.rst index 923ad18..2dfe594 100644 --- a/reference/rpc/decoderawtransaction.rst +++ b/reference/rpc/decoderawtransaction.rst @@ -20,52 +20,59 @@ Argument #2 - iswitness **Type:** boolean, optional, default=depends on heuristic tests -Whether the transaction hex is a serialized witness transaction - If iswitness is not present, heuristic tests will be used in decoding +Whether the transaction hex is a serialized witness transaction. + If iswitness is not present, heuristic tests will be used in decoding. + If true, only witness deserialization will be tried. + If false, only non-witness deserialization will be tried. + This boolean should reflect whether the transaction has inputs + (e.g. fully valid, or on-chain transactions), if known by the caller. Result ~~~~~~ :: - { - "txid" : "id", (string) The transaction id - "hash" : "id", (string) The transaction hash (differs from txid for witness transactions) - "size" : n, (numeric) The transaction size - "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) - "weight" : n, (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4) - "version" : n, (numeric) The version - "locktime" : ttt, (numeric) The lock time - "vin" : [ (array of json objects) - { - "txid": "id", (string) The transaction id - "vout": n, (numeric) The output number - "scriptSig": { (json object) The script - "asm": "asm", (string) asm - "hex": "hex" (string) hex - }, - "txinwitness": ["hex", ...] (array of string) hex-encoded witness data (if any) - "sequence": n (numeric) The script sequence number - } - ,... - ], - "vout" : [ (array of json objects) - { - "value" : x.xxx, (numeric) The value in BTC - "n" : n, (numeric) index - "scriptPubKey" : { (json object) - "asm" : "asm", (string) the asm - "hex" : "hex", (string) the hex - "reqSigs" : n, (numeric) The required sigs - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - "addresses" : [ (json array of string) - "12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc" (string) bitcoin address - ,... - ] - } - } - ,... + { (json object) + "txid" : "hex", (string) The transaction id + "hash" : "hex", (string) The transaction hash (differs from txid for witness transactions) + "size" : n, (numeric) The transaction size + "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) + "weight" : n, (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4) + "version" : n, (numeric) The version + "locktime" : xxx, (numeric) The lock time + "vin" : [ (json array) + { (json object) + "txid" : "hex", (string) The transaction id + "vout" : n, (numeric) The output number + "scriptSig" : { (json object) The script + "asm" : "str", (string) asm + "hex" : "hex" (string) hex + }, + "txinwitness" : [ (json array) + "hex", (string) hex-encoded witness data (if any) + ... + ], + "sequence" : n (numeric) The script sequence number + }, + ... ], + "vout" : [ (json array) + { (json object) + "value" : n, (numeric) The value in BTC + "n" : n, (numeric) index + "scriptPubKey" : { (json object) + "asm" : "str", (string) the asm + "hex" : "hex", (string) the hex + "reqSigs" : n, (numeric) The required sigs + "type" : "str", (string) The type, eg 'pubkeyhash' + "addresses" : [ (json array) + "str", (string) bitcoin address + ... + ] + } + }, + ... + ] } Examples @@ -80,5 +87,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "decoderawtransaction", "params": ["hexstring"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/decodescript.rst b/reference/rpc/decodescript.rst index 02212c9..123ed9c 100644 --- a/reference/rpc/decodescript.rst +++ b/reference/rpc/decodescript.rst @@ -20,16 +20,26 @@ Result :: - { - "asm":"asm", (string) Script public key - "hex":"hex", (string) hex-encoded public key - "type":"type", (string) The output type - "reqSigs": n, (numeric) The required signatures - "addresses": [ (json array of string) - "address" (string) bitcoin address - ,... + { (json object) + "asm" : "str", (string) Script public key + "type" : "str", (string) The output type (e.g. nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown) + "reqSigs" : n, (numeric) The required signatures + "addresses" : [ (json array) + "str", (string) bitcoin address + ... ], - "p2sh","address" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH). + "p2sh" : "str", (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH) + "segwit" : { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness) + "asm" : "str", (string) String representation of the script public key + "hex" : "hex", (string) Hex string of the script public key + "type" : "str", (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash) + "reqSigs" : n, (numeric) The required signatures (always 1) + "addresses" : [ (json array) (always length 1) + "str", (string) segwit address + ... + ], + "p2sh-segwit" : "str" (string) address of the P2SH script wrapping this witness redeem script + } } Examples @@ -44,5 +54,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "decodescript", "params": ["hexstring"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/deriveaddresses.rst b/reference/rpc/deriveaddresses.rst index 7315f37..dbc6976 100644 --- a/reference/rpc/deriveaddresses.rst +++ b/reference/rpc/deriveaddresses.rst @@ -39,7 +39,10 @@ Result :: - [ address ] (array) the derived addresses + [ (json array) + "str", (string) the derived addresses + ... + ] Examples ~~~~~~~~ diff --git a/reference/rpc/disconnectnode.rst b/reference/rpc/disconnectnode.rst index c319021..ec4db53 100644 --- a/reference/rpc/disconnectnode.rst +++ b/reference/rpc/disconnectnode.rst @@ -26,6 +26,13 @@ Argument #2 - nodeid The node ID (see getpeerinfo for node IDs) +Result +~~~~~~ + +:: + + null (json null) + Examples ~~~~~~~~ @@ -42,9 +49,9 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8333"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "disconnectnode", "params": ["192.168.0.6:8333"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "disconnectnode", "params": ["", 1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/dumpprivkey.rst b/reference/rpc/dumpprivkey.rst index 4d214b9..52bfe2b 100644 --- a/reference/rpc/dumpprivkey.rst +++ b/reference/rpc/dumpprivkey.rst @@ -26,7 +26,7 @@ Result * - Name - Type - Description - * - key + * - str - string - The private key @@ -46,5 +46,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpprivkey", "params": ["myaddress"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "dumpprivkey", "params": ["myaddress"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/dumpwallet.rst b/reference/rpc/dumpwallet.rst index 872d09e..6e426b0 100644 --- a/reference/rpc/dumpwallet.rst +++ b/reference/rpc/dumpwallet.rst @@ -18,15 +18,15 @@ Argument #1 - filename **Type:** string, required -The filename with path (either absolute or relative to bitcoind) +The filename with path (absolute path recommended) Result ~~~~~~ :: - { (json object) - "filename" : { (string) The filename with full absolute path + { (json object) + "filename" : "str" (string) The filename with full absolute path } Examples @@ -41,5 +41,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "dumpwallet", "params": ["test"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/encryptwallet.rst b/reference/rpc/encryptwallet.rst index f21b7e5..a2085c3 100644 --- a/reference/rpc/encryptwallet.rst +++ b/reference/rpc/encryptwallet.rst @@ -22,6 +22,19 @@ Argument #1 - passphrase The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long. +Result +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Name + - Type + - Description + * - str + - string + - A string with further instructions + Examples ~~~~~~~~ @@ -46,5 +59,5 @@ Now lock the wallet again by removing the passphrase:: As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["my pass phrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "encryptwallet", "params": ["my pass phrase"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/estimatesmartfee.rst b/reference/rpc/estimatesmartfee.rst index edfe95b..678bc74 100644 --- a/reference/rpc/estimatesmartfee.rst +++ b/reference/rpc/estimatesmartfee.rst @@ -38,10 +38,17 @@ Result :: - { - "feerate" : x.x, (numeric, optional) estimate fee rate in BTC/kB - "errors": [ str... ] (json array of strings, optional) Errors encountered during processing - "blocks" : n (numeric) block number where estimate was found + { (json object) + "feerate" : n, (numeric, optional) estimate fee rate in BTC/kB (only present if no errors were encountered) + "errors" : [ (json array, optional) Errors encountered during processing (if there are any) + "str", (string) error + ... + ], + "blocks" : n (numeric) block number where estimate was found + The request target will be clamped between 2 and the highest target + fee estimation is able to return based on how long it has been running. + An error is returned if not enough transactions and blocks + have been observed to make an estimate for any number of blocks. } Examples diff --git a/reference/rpc/finalizepsbt.rst b/reference/rpc/finalizepsbt.rst index bb18890..c9f3ae5 100644 --- a/reference/rpc/finalizepsbt.rst +++ b/reference/rpc/finalizepsbt.rst @@ -32,11 +32,10 @@ Result :: - { - "psbt" : "value", (string) The base64-encoded partially signed transaction if not extracted - "hex" : "value", (string) The hex-encoded network transaction if extracted - "complete" : true|false, (boolean) If the transaction has a complete set of signatures - ] + { (json object) + "psbt" : "str", (string) The base64-encoded partially signed transaction if not extracted + "hex" : "hex", (string) The hex-encoded network transaction if extracted + "complete" : true|false (boolean) If the transaction has a complete set of signatures } Examples diff --git a/reference/rpc/fundrawtransaction.rst b/reference/rpc/fundrawtransaction.rst index f35ab03..0a1280a 100644 --- a/reference/rpc/fundrawtransaction.rst +++ b/reference/rpc/fundrawtransaction.rst @@ -6,9 +6,9 @@ fundrawtransaction ``fundrawtransaction "hexstring" ( options iswitness )`` -Add inputs to a transaction until it has enough in value to meet its out value. +If the transaction has no inputs, they will be automatically selected to meet its out value. -This will not modify existing inputs, and will add at most one change output to the outputs. +It will add at most one change output to the outputs. No existing outputs will be modified unless "subtractFeeFromOutputs" is specified. @@ -39,25 +39,29 @@ Argument #2 - options **Type:** json object, optional for backward compatibility: passing in a true instead of an object will result in {"includeWatching":true} - "replaceable": bool, (boolean, optional, default=fallback to wallet's default) Marks this transaction as BIP125 replaceable. + "replaceable": bool, (boolean, optional, default=wallet default) Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees - "conf_target": n, (numeric, optional, default=fallback to wallet's default) Confirmation target (in blocks) - "estimate_mode": "str", (string, optional, default=UNSET) The fee estimate mode, must be one of: - "UNSET" - "ECONOMICAL" - "CONSERVATIVE" + "conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks + "estimate_mode": "str", (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive): + "unset" + "economical" + "conservative" } :: { + "add_inputs": bool, (boolean, optional, default=true) For a transaction with existing inputs, automatically include more if they are not enough. "changeAddress": "str", (string, optional, default=pool address) The bitcoin address to receive the change "changePosition": n, (numeric, optional, default=random) The index of the change output "change_type": "str", (string, optional, default=set by -changetype) The output type to use. Only valid if changeAddress is not specified. Options are "legacy", "p2sh-segwit", and "bech32". - "includeWatching": bool, (boolean, optional, default=false) Also select inputs which are watch only + "includeWatching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only. + Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported, + e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field. "lockUnspents": bool, (boolean, optional, default=false) Lock selected unspent outputs - "feeRate": amount, (numeric or string, optional, default=not set: makes wallet determine the fee) Set a specific fee rate in BTC/kB - "subtractFeeFromOutputs": [ (json array, optional, default=empty array) A json array of integers. + "fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB. + "feeRate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in BTC/kvB. + "subtractFeeFromOutputs": [ (json array, optional, default=empty array) The integers. The fee will be equally deducted from the amount of each specified output. Those recipients will receive less bitcoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. @@ -70,18 +74,22 @@ Argument #3 - iswitness **Type:** boolean, optional, default=depends on heuristic tests -Whether the transaction hex is a serialized witness transaction - If iswitness is not present, heuristic tests will be used in decoding +Whether the transaction hex is a serialized witness transaction. + If iswitness is not present, heuristic tests will be used in decoding. + If true, only witness deserialization will be tried. + If false, only non-witness deserialization will be tried. + This boolean should reflect whether the transaction has inputs + (e.g. fully valid, or on-chain transactions), if known by the caller. Result ~~~~~~ :: - { - "hex": "value", (string) The resulting raw transaction (hex-encoded string) - "fee": n, (numeric) Fee in BTC the resulting transaction pays - "changepos": n (numeric) The position of the added change output, or -1 + { (json object) + "hex" : "hex", (string) The resulting raw transaction (hex-encoded string) + "fee" : n, (numeric) Fee in BTC the resulting transaction pays + "changepos" : n (numeric) The position of the added change output, or -1 } Examples diff --git a/reference/rpc/generateblock.rst b/reference/rpc/generateblock.rst new file mode 100644 index 0000000..b703155 --- /dev/null +++ b/reference/rpc/generateblock.rst @@ -0,0 +1,52 @@ +.. This file is licensed under the MIT License (MIT) available on + http://opensource.org/licenses/MIT. + +generateblock +============= + +``generateblock "output" ["rawtx/txid",...]`` + +Mine a block with a set of ordered transactions immediately to a specified address or descriptor (before the RPC call returns) + +Argument #1 - output +~~~~~~~~~~~~~~~~~~~~ + +**Type:** string, required + +The address or descriptor to send the newly generated bitcoin to. + +Argument #2 - transactions +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** json array, required + +An array of hex strings which are either txids or raw transactions. + Txids must reference transactions currently in the mempool. + All transactions must be valid and in valid order, otherwise the block will be rejected. + +:: + + [ + "rawtx/txid", (string) + ... + ] + +Result +~~~~~~ + +:: + + { (json object) + "hash" : "hex" (string) hash of generated block + } + +Examples +~~~~~~~~ + + +.. highlight:: shell + +Generate a block to myaddress, with txs rawtx and mempool_txid:: + + bitcoin-cli generateblock "myaddress" '["rawtx", "mempool_txid"]' + diff --git a/reference/rpc/generatetoaddress.rst b/reference/rpc/generatetoaddress.rst index ccbc335..0bbbea0 100644 --- a/reference/rpc/generatetoaddress.rst +++ b/reference/rpc/generatetoaddress.rst @@ -34,7 +34,10 @@ Result :: - [ blockhashes ] (array) hashes of blocks generated + [ (json array) hashes of blocks generated + "hex", (string) blockhash + ... + ] Examples ~~~~~~~~ @@ -46,7 +49,7 @@ Generate 11 blocks to myaddress:: bitcoin-cli generatetoaddress 11 "myaddress" -If you are running the bitcoin core wallet, you can get a new address to send the newly generated bitcoin to with::: +If you are using the Bitcoin Core wallet, you can get a new address to send the newly generated bitcoin to with::: bitcoin-cli getnewaddress diff --git a/reference/rpc/generatetodescriptor.rst b/reference/rpc/generatetodescriptor.rst new file mode 100644 index 0000000..bed3987 --- /dev/null +++ b/reference/rpc/generatetodescriptor.rst @@ -0,0 +1,51 @@ +.. This file is licensed under the MIT License (MIT) available on + http://opensource.org/licenses/MIT. + +generatetodescriptor +==================== + +``generatetodescriptor num_blocks "descriptor" ( maxtries )`` + +Mine blocks immediately to a specified descriptor (before the RPC call returns) + +Argument #1 - num_blocks +~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** numeric, required + +How many blocks are generated immediately. + +Argument #2 - descriptor +~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** string, required + +The descriptor to send the newly generated bitcoin to. + +Argument #3 - maxtries +~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** numeric, optional, default=1000000 + +How many iterations to try. + +Result +~~~~~~ + +:: + + [ (json array) hashes of blocks generated + "hex", (string) blockhash + ... + ] + +Examples +~~~~~~~~ + + +.. highlight:: shell + +Generate 11 blocks to mydesc:: + + bitcoin-cli generatetodescriptor 11 "mydesc" + diff --git a/reference/rpc/getaddednodeinfo.rst b/reference/rpc/getaddednodeinfo.rst index 8a73faa..984b09c 100644 --- a/reference/rpc/getaddednodeinfo.rst +++ b/reference/rpc/getaddednodeinfo.rst @@ -21,18 +21,19 @@ Result :: - [ - { - "addednode" : "192.168.0.201", (string) The node IP address or name (as provided to addnode) - "connected" : true|false, (boolean) If connected - "addresses" : [ (list of objects) Only when connected = true - { - "address" : "192.168.0.201:8333", (string) The bitcoin server IP and port we're connected to - "connected" : "outbound" (string) connection, inbound or outbound - } - ] - } - ,... + [ (json array) + { (json object) + "addednode" : "str", (string) The node IP address or name (as provided to addnode) + "connected" : true|false, (boolean) If connected + "addresses" : [ (json array) Only when connected = true + { (json object) + "address" : "str", (string) The bitcoin server IP and port we're connected to + "connected" : "str" (string) connection, inbound or outbound + }, + ... + ] + }, + ... ] Examples @@ -47,5 +48,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": ["192.168.0.201"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getaddednodeinfo", "params": ["192.168.0.201"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getaddressesbylabel.rst b/reference/rpc/getaddressesbylabel.rst index 5bcf409..9e833d1 100644 --- a/reference/rpc/getaddressesbylabel.rst +++ b/reference/rpc/getaddressesbylabel.rst @@ -20,10 +20,11 @@ Result :: - { (json object with addresses as keys) - "address": { (json object with information about address) - "purpose": "string" (string) Purpose of address ("send" for sending address, "receive" for receiving address) - },... + { (json object) json object with addresses as keys + "address" : { (json object) json object with information about address + "purpose" : "str" (string) Purpose of address ("send" for sending address, "receive" for receiving address) + }, + ... } Examples @@ -38,5 +39,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbylabel", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getaddressesbylabel", "params": ["tabby"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getaddressinfo.rst b/reference/rpc/getaddressinfo.rst index 3e18de1..8690aae 100644 --- a/reference/rpc/getaddressinfo.rst +++ b/reference/rpc/getaddressinfo.rst @@ -6,56 +6,58 @@ getaddressinfo ``getaddressinfo "address"`` -Return information about the given bitcoin address. Some information requires the address -to be in the wallet. +Return information about the given bitcoin address. + +Some of the information will only be present if the address is in the active wallet. Argument #1 - address ~~~~~~~~~~~~~~~~~~~~~ **Type:** string, required -The bitcoin address to get the information of. +The bitcoin address for which to get information. Result ~~~~~~ :: - { - "address" : "address", (string) The bitcoin address validated - "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address - "ismine" : true|false, (boolean) If the address is yours or not - "iswatchonly" : true|false, (boolean) If the address is watchonly - "solvable" : true|false, (boolean) Whether we know how to spend coins sent to this address, ignoring the possible lack of private keys - "desc" : "desc", (string, optional) A descriptor for spending coins sent to this address (only when solvable) - "isscript" : true|false, (boolean) If the key is a script - "ischange" : true|false, (boolean) If the address was used for change output - "iswitness" : true|false, (boolean) If the address is a witness address - "witness_version" : version (numeric, optional) The version number of the witness program - "witness_program" : "hex" (string, optional) The hex value of the witness program - "script" : "type" (string, optional) The output script type. Only if "isscript" is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash, witness_unknown - "hex" : "hex", (string, optional) The redeemscript for the p2sh address - "pubkeys" (string, optional) Array of pubkeys associated with the known redeemscript (only if "script" is "multisig") - [ - "pubkey" - ,... - ] - "sigsrequired" : xxxxx (numeric, optional) Number of signatures required to spend multisig output (only if "script" is "multisig") - "pubkey" : "publickeyhex", (string, optional) The hex value of the raw public key, for single-key addresses (possibly embedded in P2SH or P2WSH) - "embedded" : {...}, (object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. It includes all getaddressinfo output fields for the embedded address, excluding metadata ("timestamp", "hdkeypath", "hdseedid") and relation to the wallet ("ismine", "iswatchonly"). - "iscompressed" : true|false, (boolean, optional) If the pubkey is compressed - "label" : "label" (string) The label associated with the address, "" is the default label - "timestamp" : timestamp, (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT) - "hdkeypath" : "keypath" (string, optional) The HD keypath if the key is HD and available - "hdseedid" : "" (string, optional) The Hash160 of the HD seed - "hdmasterfingerprint" : "" (string, optional) The fingperint of the master key. - "labels" (object) Array of labels associated with the address. - [ - { (json object of label data) - "name": "labelname" (string) The label - "purpose": "string" (string) Purpose of address ("send" for sending address, "receive" for receiving address) - },... - ] + { (json object) + "address" : "str", (string) The bitcoin address validated. + "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address. + "ismine" : true|false, (boolean) If the address is yours. + "iswatchonly" : true|false, (boolean) If the address is watchonly. + "solvable" : true|false, (boolean) If we know how to spend coins sent to this address, ignoring the possible lack of private keys. + "desc" : "str", (string, optional) A descriptor for spending coins sent to this address (only when solvable). + "isscript" : true|false, (boolean) If the key is a script. + "ischange" : true|false, (boolean) If the address was used for change output. + "iswitness" : true|false, (boolean) If the address is a witness address. + "witness_version" : n, (numeric, optional) The version number of the witness program. + "witness_program" : "hex", (string, optional) The hex value of the witness program. + "script" : "str", (string, optional) The output script type. Only if isscript is true and the redeemscript is known. Possible + types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, + witness_v0_scripthash, witness_unknown. + "hex" : "hex", (string, optional) The redeemscript for the p2sh address. + "pubkeys" : [ (json array, optional) Array of pubkeys associated with the known redeemscript (only if script is multisig). + "str", (string) + ... + ], + "sigsrequired" : n, (numeric, optional) The number of signatures required to spend multisig output (only if script is multisig). + "pubkey" : "hex", (string, optional) The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH). + "embedded" : { (json object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. + ... Includes all getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath, hdseedid) + and relation to the wallet (ismine, iswatchonly). + }, + "iscompressed" : true|false, (boolean, optional) If the pubkey is compressed. + "timestamp" : xxx, (numeric, optional) The creation time of the key, if available, expressed in UNIX epoch time. + "hdkeypath" : "str", (string, optional) The HD keypath, if the key is HD and available. + "hdseedid" : "hex", (string, optional) The Hash160 of the HD seed. + "hdmasterfingerprint" : "hex", (string, optional) The fingerprint of the master key. + "labels" : [ (json array) Array of labels associated with the address. Currently limited to one label but returned + as an array to keep the API stable if multiple labels are enabled in the future. + "str", (string) Label name (defaults to ""). + ... + ] } Examples @@ -66,9 +68,9 @@ Examples :: - bitcoin-cli getaddressinfo "1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc" + bitcoin-cli getaddressinfo "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressinfo", "params": ["1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getaddressinfo", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getbalance.rst b/reference/rpc/getbalance.rst index 382da4d..6733c20 100644 --- a/reference/rpc/getbalance.rst +++ b/reference/rpc/getbalance.rst @@ -4,7 +4,7 @@ getbalance ========== -``getbalance ( "dummy" minconf include_watchonly )`` +``getbalance ( "dummy" minconf include_watchonly avoid_reuse )`` Returns the total available balance. @@ -28,10 +28,17 @@ Only include transactions confirmed at least this many times. Argument #3 - include_watchonly ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Type:** boolean, optional, default=false +**Type:** boolean, optional, default=true for watch-only wallets, otherwise false Also include balance in watch-only addresses (see 'importaddress') +Argument #4 - avoid_reuse +~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** boolean, optional, default=true + +(only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction. + Result ~~~~~~ @@ -41,7 +48,7 @@ Result * - Name - Type - Description - * - amount + * - n - numeric - The total amount in BTC received for this wallet. @@ -51,15 +58,15 @@ Examples .. highlight:: shell -The total amount in the wallet with 1 or more confirmations:: +The total amount in the wallet with 0 or more confirmations:: bitcoin-cli getbalance -The total amount in the wallet at least 6 blocks confirmed:: +The total amount in the wallet with at least 6 confirmations:: bitcoin-cli getbalance "*" 6 As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["*", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbalance", "params": ["*", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getbalances.rst b/reference/rpc/getbalances.rst new file mode 100644 index 0000000..b8f94dc --- /dev/null +++ b/reference/rpc/getbalances.rst @@ -0,0 +1,43 @@ +.. This file is licensed under the MIT License (MIT) available on + http://opensource.org/licenses/MIT. + +getbalances +=========== + +``getbalances`` + +Returns an object with all balances in BTC. + +Result +~~~~~~ + +:: + + { (json object) + "mine" : { (json object) balances from outputs that the wallet can sign + "trusted" : n, (numeric) trusted balance (outputs created by the wallet or confirmed outputs) + "untrusted_pending" : n, (numeric) untrusted pending balance (outputs created by others that are in the mempool) + "immature" : n, (numeric) balance from immature coinbase outputs + "used" : n (numeric) (only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating) + }, + "watchonly" : { (json object) watchonly balances (not present if wallet does not watch anything) + "trusted" : n, (numeric) trusted balance (outputs created by the wallet or confirmed outputs) + "untrusted_pending" : n, (numeric) untrusted pending balance (outputs created by others that are in the mempool) + "immature" : n (numeric) balance from immature coinbase outputs + } + } + +Examples +~~~~~~~~ + + +.. highlight:: shell + +:: + + bitcoin-cli getbalances + +:: + + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbalances", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + diff --git a/reference/rpc/getbestblockhash.rst b/reference/rpc/getbestblockhash.rst index fc8061d..297af4b 100644 --- a/reference/rpc/getbestblockhash.rst +++ b/reference/rpc/getbestblockhash.rst @@ -6,7 +6,7 @@ getbestblockhash ``getbestblockhash`` -Returns the hash of the best (tip) block in the longest blockchain. +Returns the hash of the best (tip) block in the most-work fully-validated chain. Result ~~~~~~ @@ -33,5 +33,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblock.rst b/reference/rpc/getblock.rst index ac4b01c..729b0c5 100644 --- a/reference/rpc/getblock.rst +++ b/reference/rpc/getblock.rst @@ -35,38 +35,38 @@ Result (for verbosity = 0) * - Name - Type - Description - * - data + * - hex - string - - A string that is serialized, hex-encoded data for block 'hash'. + - A string that is serialized, hex-encoded data for block 'hash' Result (for verbosity = 1) ~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - { - "hash" : "hash", (string) the block hash (same as provided) - "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain - "size" : n, (numeric) The block size - "strippedsize" : n, (numeric) The block size excluding witness data - "weight" : n (numeric) The block weight as defined in BIP 141 - "height" : n, (numeric) The block height or index - "version" : n, (numeric) The block version - "versionHex" : "00000000", (string) The block version formatted in hexadecimal - "merkleroot" : "xxxx", (string) The merkle root - "tx" : [ (array of string) The transaction ids - "transactionid" (string) The transaction id - ,... + { (json object) + "hash" : "hex", (string) the block hash (same as provided) + "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain + "size" : n, (numeric) The block size + "strippedsize" : n, (numeric) The block size excluding witness data + "weight" : n, (numeric) The block weight as defined in BIP 141 + "height" : n, (numeric) The block height or index + "version" : n, (numeric) The block version + "versionHex" : "hex", (string) The block version formatted in hexadecimal + "merkleroot" : "hex", (string) The merkle root + "tx" : [ (json array) The transaction ids + "hex", (string) The transaction id + ... ], - "time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) - "mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT) - "nonce" : n, (numeric) The nonce - "bits" : "1d00ffff", (string) The bits - "difficulty" : x.xxx, (numeric) The difficulty - "chainwork" : "xxxx", (string) Expected number of hashes required to produce the chain up to this block (in hex) - "nTx" : n, (numeric) The number of transactions in the block. - "previousblockhash" : "hash", (string) The hash of the previous block - "nextblockhash" : "hash" (string) The hash of the next block + "time" : xxx, (numeric) The block time expressed in UNIX epoch time + "mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time + "nonce" : n, (numeric) The nonce + "bits" : "hex", (string) The bits + "difficulty" : n, (numeric) The difficulty + "chainwork" : "hex", (string) Expected number of hashes required to produce the chain up to this block (in hex) + "nTx" : n, (numeric) The number of transactions in the block + "previousblockhash" : "hex", (string) The hash of the previous block + "nextblockhash" : "hex" (string) The hash of the next block } Result (for verbosity = 2) @@ -74,12 +74,14 @@ Result (for verbosity = 2) :: - { - ..., Same output as verbosity = 1. - "tx" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result. - ,... - ], - ,... Same output as verbosity = 1. + { (json object) + ..., Same output as verbosity = 1 + "tx" : [ (json array) + { (json object) + ... The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result + }, + ... + ] } Examples @@ -94,5 +96,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblockchaininfo.rst b/reference/rpc/getblockchaininfo.rst index 6ba9559..e4c726f 100644 --- a/reference/rpc/getblockchaininfo.rst +++ b/reference/rpc/getblockchaininfo.rst @@ -13,47 +13,44 @@ Result :: - { - "chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest) - "blocks": xxxxxx, (numeric) the current number of blocks processed in the server - "headers": xxxxxx, (numeric) the current number of headers we have validated - "bestblockhash": "...", (string) the hash of the currently best block - "difficulty": xxxxxx, (numeric) the current difficulty - "mediantime": xxxxxx, (numeric) median time for the current best block - "verificationprogress": xxxx, (numeric) estimate of verification progress [0..1] - "initialblockdownload": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode. - "chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal - "size_on_disk": xxxxxx, (numeric) the estimated size of the block and undo files on disk - "pruned": xx, (boolean) if the blocks are subject to pruning - "pruneheight": xxxxxx, (numeric) lowest-height complete block stored (only present if pruning is enabled) - "automatic_pruning": xx, (boolean) whether automatic pruning is enabled (only present if pruning is enabled) - "prune_target_size": xxxxxx, (numeric) the target size used by pruning (only present if automatic pruning is enabled) - "softforks": [ (array) status of softforks in progress - { - "id": "xxxx", (string) name of softfork - "version": xx, (numeric) block version - "reject": { (object) progress toward rejecting pre-softfork blocks - "status": xx, (boolean) true if threshold reached - }, - }, ... - ], - "bip9_softforks": { (object) status of BIP9 softforks in progress - "xxxx" : { (string) name of the softfork - "status": "xxxx", (string) one of "defined", "started", "locked_in", "active", "failed" - "bit": xx, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status) - "startTime": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning - "timeout": xx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in - "since": xx, (numeric) height of the first block to which the status applies - "statistics": { (object) numeric statistics about BIP9 signalling for a softfork (only for "started" status) - "period": xx, (numeric) the length in blocks of the BIP9 signalling period - "threshold": xx, (numeric) the number of blocks with the version bit set required to activate the feature - "elapsed": xx, (numeric) the number of blocks elapsed since the beginning of the current period - "count": xx, (numeric) the number of blocks with the version bit set in the current period - "possible": xx (boolean) returns false if there are not enough blocks left in this period to pass activation threshold + { (json object) + "chain" : "str", (string) current network name (main, test, regtest) + "blocks" : n, (numeric) the height of the most-work fully-validated chain. The genesis block has height 0 + "headers" : n, (numeric) the current number of headers we have validated + "bestblockhash" : "str", (string) the hash of the currently best block + "difficulty" : n, (numeric) the current difficulty + "mediantime" : n, (numeric) median time for the current best block + "verificationprogress" : n, (numeric) estimate of verification progress [0..1] + "initialblockdownload" : true|false, (boolean) (debug information) estimate of whether this node is in Initial Block Download mode + "chainwork" : "hex", (string) total amount of work in active chain, in hexadecimal + "size_on_disk" : n, (numeric) the estimated size of the block and undo files on disk + "pruned" : true|false, (boolean) if the blocks are subject to pruning + "pruneheight" : n, (numeric) lowest-height complete block stored (only present if pruning is enabled) + "automatic_pruning" : true|false, (boolean) whether automatic pruning is enabled (only present if pruning is enabled) + "prune_target_size" : n, (numeric) the target size used by pruning (only present if automatic pruning is enabled) + "softforks" : { (json object) status of softforks + "xxxx" : { (json object) name of the softfork + "type" : "str", (string) one of "buried", "bip9" + "bip9" : { (json object) status of bip9 softforks (only for "bip9" type) + "status" : "str", (string) one of "defined", "started", "locked_in", "active", "failed" + "bit" : n, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status) + "start_time" : xxx, (numeric) the minimum median time past of a block at which the bit gains its meaning + "timeout" : xxx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in + "since" : n, (numeric) height of the first block to which the status applies + "statistics" : { (json object) numeric statistics about BIP9 signalling for a softfork (only for "started" status) + "period" : n, (numeric) the length in blocks of the BIP9 signalling period + "threshold" : n, (numeric) the number of blocks with the version bit set required to activate the feature + "elapsed" : n, (numeric) the number of blocks elapsed since the beginning of the current period + "count" : n, (numeric) the number of blocks with the version bit set in the current period + "possible" : true|false (boolean) returns false if there are not enough blocks left in this period to pass activation threshold } - } - } - "warnings" : "...", (string) any network and blockchain warnings. + }, + "height" : n, (numeric) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status) + "active" : true|false (boolean) true if the rules are enforced for the mempool and the next block + }, + ... + }, + "warnings" : "str" (string) any network and blockchain warnings } Examples @@ -68,5 +65,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblockcount.rst b/reference/rpc/getblockcount.rst index 61ba39c..41446c8 100644 --- a/reference/rpc/getblockcount.rst +++ b/reference/rpc/getblockcount.rst @@ -6,7 +6,9 @@ getblockcount ``getblockcount`` -Returns the number of blocks in the longest blockchain. +Returns the height of the most-work fully-validated chain. + +The genesis block has height 0. Result ~~~~~~ @@ -33,5 +35,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblockfilter.rst b/reference/rpc/getblockfilter.rst new file mode 100644 index 0000000..f027549 --- /dev/null +++ b/reference/rpc/getblockfilter.rst @@ -0,0 +1,48 @@ +.. This file is licensed under the MIT License (MIT) available on + http://opensource.org/licenses/MIT. + +getblockfilter +============== + +``getblockfilter "blockhash" ( "filtertype" )`` + +Retrieve a BIP 157 content filter for a particular block. + +Argument #1 - blockhash +~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** string, required + +The hash of the block + +Argument #2 - filtertype +~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** string, optional, default=basic + +The type name of the filter + +Result +~~~~~~ + +:: + + { (json object) + "filter" : "hex", (string) the hex-encoded filter data + "header" : "hex" (string) the hex-encoded filter header + } + +Examples +~~~~~~~~ + + +.. highlight:: shell + +:: + + bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic" + +:: + + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + diff --git a/reference/rpc/getblockhash.rst b/reference/rpc/getblockhash.rst index 826893a..caec69e 100644 --- a/reference/rpc/getblockhash.rst +++ b/reference/rpc/getblockhash.rst @@ -24,7 +24,7 @@ Result * - Name - Type - Description - * - hash + * - hex - string - The block hash @@ -40,5 +40,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockhash", "params": [1000]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblockheader.rst b/reference/rpc/getblockheader.rst index 2e17c3f..b15871b 100644 --- a/reference/rpc/getblockheader.rst +++ b/reference/rpc/getblockheader.rst @@ -29,22 +29,22 @@ Result (for verbose = true) :: - { - "hash" : "hash", (string) the block hash (same as provided) - "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain - "height" : n, (numeric) The block height or index - "version" : n, (numeric) The block version - "versionHex" : "00000000", (string) The block version formatted in hexadecimal - "merkleroot" : "xxxx", (string) The merkle root - "time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) - "mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT) - "nonce" : n, (numeric) The nonce - "bits" : "1d00ffff", (string) The bits - "difficulty" : x.xxx, (numeric) The difficulty - "chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex) - "nTx" : n, (numeric) The number of transactions in the block. - "previousblockhash" : "hash", (string) The hash of the previous block - "nextblockhash" : "hash", (string) The hash of the next block + { (json object) + "hash" : "hex", (string) the block hash (same as provided) + "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain + "height" : n, (numeric) The block height or index + "version" : n, (numeric) The block version + "versionHex" : "hex", (string) The block version formatted in hexadecimal + "merkleroot" : "hex", (string) The merkle root + "time" : xxx, (numeric) The block time expressed in UNIX epoch time + "mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time + "nonce" : n, (numeric) The nonce + "bits" : "hex", (string) The bits + "difficulty" : n, (numeric) The difficulty + "chainwork" : "hex", (string) Expected number of hashes required to produce the current chain + "nTx" : n, (numeric) The number of transactions in the block + "previousblockhash" : "hex", (string) The hash of the previous block + "nextblockhash" : "hex" (string) The hash of the next block } Result (for verbose=false) @@ -56,9 +56,9 @@ Result (for verbose=false) * - Name - Type - Description - * - data + * - hex - string - - A string that is serialized, hex-encoded data for block 'hash'. + - A string that is serialized, hex-encoded data for block 'hash' Examples ~~~~~~~~ @@ -72,5 +72,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblockstats.rst b/reference/rpc/getblockstats.rst index 72a917e..9f57901 100644 --- a/reference/rpc/getblockstats.rst +++ b/reference/rpc/getblockstats.rst @@ -10,8 +10,6 @@ Compute per block statistics for a given window. All amounts are in satoshis. It won't work for some heights with pruning. -It won't work without -txindex for utxo_size_inc, \*fee or \*feerate stats. - Argument #1 - hash_or_height ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -39,42 +37,42 @@ Result :: - { (json object) - "avgfee": xxxxx, (numeric) Average fee in the block - "avgfeerate": xxxxx, (numeric) Average feerate (in satoshis per virtual byte) - "avgtxsize": xxxxx, (numeric) Average transaction size - "blockhash": xxxxx, (string) The block hash (to check for potential reorgs) - "feerate_percentiles": [ (array of numeric) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte) - "10th_percentile_feerate", (numeric) The 10th percentile feerate - "25th_percentile_feerate", (numeric) The 25th percentile feerate - "50th_percentile_feerate", (numeric) The 50th percentile feerate - "75th_percentile_feerate", (numeric) The 75th percentile feerate - "90th_percentile_feerate", (numeric) The 90th percentile feerate + { (json object) + "avgfee" : n, (numeric) Average fee in the block + "avgfeerate" : n, (numeric) Average feerate (in satoshis per virtual byte) + "avgtxsize" : n, (numeric) Average transaction size + "blockhash" : "hex", (string) The block hash (to check for potential reorgs) + "feerate_percentiles" : [ (json array) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte) + n, (numeric) The 10th percentile feerate + n, (numeric) The 25th percentile feerate + n, (numeric) The 50th percentile feerate + n, (numeric) The 75th percentile feerate + n (numeric) The 90th percentile feerate ], - "height": xxxxx, (numeric) The height of the block - "ins": xxxxx, (numeric) The number of inputs (excluding coinbase) - "maxfee": xxxxx, (numeric) Maximum fee in the block - "maxfeerate": xxxxx, (numeric) Maximum feerate (in satoshis per virtual byte) - "maxtxsize": xxxxx, (numeric) Maximum transaction size - "medianfee": xxxxx, (numeric) Truncated median fee in the block - "mediantime": xxxxx, (numeric) The block median time past - "mediantxsize": xxxxx, (numeric) Truncated median transaction size - "minfee": xxxxx, (numeric) Minimum fee in the block - "minfeerate": xxxxx, (numeric) Minimum feerate (in satoshis per virtual byte) - "mintxsize": xxxxx, (numeric) Minimum transaction size - "outs": xxxxx, (numeric) The number of outputs - "subsidy": xxxxx, (numeric) The block subsidy - "swtotal_size": xxxxx, (numeric) Total size of all segwit transactions - "swtotal_weight": xxxxx, (numeric) Total weight of all segwit transactions divided by segwit scale factor (4) - "swtxs": xxxxx, (numeric) The number of segwit transactions - "time": xxxxx, (numeric) The block time - "total_out": xxxxx, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee]) - "total_size": xxxxx, (numeric) Total size of all non-coinbase transactions - "total_weight": xxxxx, (numeric) Total weight of all non-coinbase transactions divided by segwit scale factor (4) - "totalfee": xxxxx, (numeric) The fee total - "txs": xxxxx, (numeric) The number of transactions (excluding coinbase) - "utxo_increase": xxxxx, (numeric) The increase/decrease in the number of unspent outputs - "utxo_size_inc": xxxxx, (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar) + "height" : n, (numeric) The height of the block + "ins" : n, (numeric) The number of inputs (excluding coinbase) + "maxfee" : n, (numeric) Maximum fee in the block + "maxfeerate" : n, (numeric) Maximum feerate (in satoshis per virtual byte) + "maxtxsize" : n, (numeric) Maximum transaction size + "medianfee" : n, (numeric) Truncated median fee in the block + "mediantime" : n, (numeric) The block median time past + "mediantxsize" : n, (numeric) Truncated median transaction size + "minfee" : n, (numeric) Minimum fee in the block + "minfeerate" : n, (numeric) Minimum feerate (in satoshis per virtual byte) + "mintxsize" : n, (numeric) Minimum transaction size + "outs" : n, (numeric) The number of outputs + "subsidy" : n, (numeric) The block subsidy + "swtotal_size" : n, (numeric) Total size of all segwit transactions + "swtotal_weight" : n, (numeric) Total weight of all segwit transactions + "swtxs" : n, (numeric) The number of segwit transactions + "time" : n, (numeric) The block time + "total_out" : n, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee]) + "total_size" : n, (numeric) Total size of all non-coinbase transactions + "total_weight" : n, (numeric) Total weight of all non-coinbase transactions + "totalfee" : n, (numeric) The fee total + "txs" : n, (numeric) The number of transactions (including coinbase) + "utxo_increase" : n, (numeric) The increase/decrease in the number of unspent outputs + "utxo_size_inc" : n (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar) } Examples @@ -83,11 +81,19 @@ Examples .. highlight:: shell +:: + + bitcoin-cli getblockstats '"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]' + :: bitcoin-cli getblockstats 1000 '["minfeerate","avgfeerate"]' :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockstats", "params": [1000 '["minfeerate","avgfeerate"]'] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockstats", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + +:: + + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockstats", "params": [1000, ["minfeerate","avgfeerate"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getblocktemplate.rst b/reference/rpc/getblocktemplate.rst index 4312cb6..14b1e6e 100644 --- a/reference/rpc/getblocktemplate.rst +++ b/reference/rpc/getblocktemplate.rst @@ -4,7 +4,7 @@ getblocktemplate ================ -``getblocktemplate "template_request"`` +``getblocktemplate ( "template_request" )`` If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. @@ -20,11 +20,12 @@ For full specification, see BIPs 22, 23, 9, and 145: Argument #1 - template_request ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Type:** json object, required +**Type:** json object, optional, default={} -A json object in the following spec +Format of the template "rules": [ (json array, required) A list of strings - "support", (string) client side supported softfork deployment + "segwit", (string, required) (literal) indicates client side segwit support + "str", (string) other client side supported softfork deployment ... ], } @@ -34,7 +35,7 @@ A json object in the following spec { "mode": "str", (string, optional) This must be set to "template", "proposal" (see BIP 23), or omitted "capabilities": [ (json array, optional) A list of strings - "support", (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid' + "str", (string) client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ... ], @@ -43,48 +44,53 @@ Result :: - { - "version" : n, (numeric) The preferred block version - "rules" : [ "rulename", ... ], (array of strings) specific block rules that are to be enforced - "vbavailable" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments - "rulename" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule - ,... + { (json object) + "version" : n, (numeric) The preferred block version + "rules" : [ (json array) specific block rules that are to be enforced + "str", (string) name of a rule the client must understand to some extent; see BIP 9 for format + ... + ], + "vbavailable" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments + "rulename" : n, (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule + ... }, - "vbrequired" : n, (numeric) bit mask of versionbits the server requires set in submissions - "previousblockhash" : "xxxx", (string) The hash of current highest block - "transactions" : [ (array) contents of non-coinbase transactions that should be included in the next block - { - "data" : "xxxx", (string) transaction data encoded in hexadecimal (byte-for-byte) - "txid" : "xxxx", (string) transaction id encoded in little-endian hexadecimal - "hash" : "xxxx", (string) hash encoded in little-endian hexadecimal (including witness data) - "depends" : [ (array) array of numbers - n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is - ,... - ], - "fee": n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one - "sigops" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero - "weight" : n, (numeric) total transaction weight, as counted for purposes of block limits - } - ,... + "vbrequired" : n, (numeric) bit mask of versionbits the server requires set in submissions + "previousblockhash" : "str", (string) The hash of current highest block + "transactions" : [ (json array) contents of non-coinbase transactions that should be included in the next block + { (json object) + "data" : "hex", (string) transaction data encoded in hexadecimal (byte-for-byte) + "txid" : "hex", (string) transaction id encoded in little-endian hexadecimal + "hash" : "hex", (string) hash encoded in little-endian hexadecimal (including witness data) + "depends" : [ (json array) array of numbers + n, (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is + ... + ], + "fee" : n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one + "sigops" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero + "weight" : n (numeric) total transaction weight, as counted for purposes of block limits + }, + ... ], - "coinbaseaux" : { (json object) data that should be included in the coinbase's scriptSig content - "flags" : "xx" (string) key name is to be ignored, and value included in scriptSig + "coinbaseaux" : { (json object) data that should be included in the coinbase's scriptSig content + "key" : "hex", (string) values must be in the coinbase (keys may be ignored) + ... }, - "coinbasevalue" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis) - "coinbasetxn" : { ... }, (json object) information for coinbase transaction - "target" : "xxxx", (string) The hash target - "mintime" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT) - "mutable" : [ (array of string) list of ways the block template may be changed - "value" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock' - ,... + "coinbasevalue" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis) + "longpollid" : "str", (string) an id to include with a request to longpoll on an update to this template + "target" : "str", (string) The hash target + "mintime" : xxx, (numeric) The minimum timestamp appropriate for the next block time, expressed in UNIX epoch time + "mutable" : [ (json array) list of ways the block template may be changed + "str", (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock' + ... ], - "noncerange" : "00000000ffffffff",(string) A range of valid nonces - "sigoplimit" : n, (numeric) limit of sigops in blocks - "sizelimit" : n, (numeric) limit of block size - "weightlimit" : n, (numeric) limit of block weight - "curtime" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT) - "bits" : "xxxxxxxx", (string) compressed target of next block - "height" : n (numeric) The height of the next block + "noncerange" : "hex", (string) A range of valid nonces + "sigoplimit" : n, (numeric) limit of sigops in blocks + "sizelimit" : n, (numeric) limit of block size + "weightlimit" : n, (numeric) limit of block weight + "curtime" : xxx, (numeric) current timestamp in UNIX epoch time + "bits" : "str", (string) compressed target of next block + "height" : n, (numeric) The height of the next block + "default_witness_commitment" : "str" (string, optional) a valid witness commitment for the unmodified block template } Examples @@ -95,9 +101,9 @@ Examples :: - bitcoin-cli getblocktemplate {"rules": ["segwit"]} + bitcoin-cli getblocktemplate '{"rules": ["segwit"]}' :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocktemplate", "params": [{"rules": ["segwit"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblocktemplate", "params": [{"rules": ["segwit"]}]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getchaintips.rst b/reference/rpc/getchaintips.rst index 5aeec3e..c6b3ecd 100644 --- a/reference/rpc/getchaintips.rst +++ b/reference/rpc/getchaintips.rst @@ -13,19 +13,20 @@ Result :: - [ - { - "height": xxxx, (numeric) height of the chain tip - "hash": "xxxx", (string) block hash of the tip - "branchlen": 0 (numeric) zero for main chain - "status": "active" (string) "active" for the main chain + [ (json array) + { (json object) + "height" : n, (numeric) height of the chain tip + "hash" : "hex", (string) block hash of the tip + "branchlen" : n, (numeric) zero for main chain, otherwise length of branch connecting the tip to the main chain + "status" : "str" (string) status of the chain, "active" for the main chain + Possible values for status: + 1. "invalid" This branch contains at least one invalid block + 2. "headers-only" Not all blocks for this branch are available, but the headers are valid + 3. "valid-headers" All blocks are available for this branch, but they were never fully validated + 4. "valid-fork" This branch is not part of the active chain, but is fully validated + 5. "active" This is the tip of the active main chain, which is certainly valid }, - { - "height": xxxx, - "hash": "xxxx", - "branchlen": 1 (numeric) length of branch connecting the tip to the main chain - "status": "xxxx" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid) - } + ... ] Examples @@ -40,5 +41,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintips", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getchaintips", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getchaintxstats.rst b/reference/rpc/getchaintxstats.rst index d284e38..a75fd59 100644 --- a/reference/rpc/getchaintxstats.rst +++ b/reference/rpc/getchaintxstats.rst @@ -27,14 +27,15 @@ Result :: - { - "time": xxxxx, (numeric) The timestamp for the final block in the window in UNIX format. - "txcount": xxxxx, (numeric) The total number of transactions in the chain up to that point. - "window_final_block_hash": "...", (string) The hash of the final block in the window. - "window_block_count": xxxxx, (numeric) Size of the window in number of blocks. - "window_tx_count": xxxxx, (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0. - "window_interval": xxxxx, (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0. - "txrate": x.xx, (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0. + { (json object) + "time" : xxx, (numeric) The timestamp for the final block in the window, expressed in UNIX epoch time + "txcount" : n, (numeric) The total number of transactions in the chain up to that point + "window_final_block_hash" : "hex", (string) The hash of the final block in the window + "window_final_block_height" : n, (numeric) The height of the final block in the window. + "window_block_count" : n, (numeric) Size of the window in number of blocks + "window_tx_count" : n, (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0 + "window_interval" : n, (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0 + "txrate" : n (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0 } Examples @@ -49,5 +50,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintxstats", "params": [2016] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getchaintxstats", "params": [2016]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getconnectioncount.rst b/reference/rpc/getconnectioncount.rst index 5b6ccd3..2d89c62 100644 --- a/reference/rpc/getconnectioncount.rst +++ b/reference/rpc/getconnectioncount.rst @@ -33,5 +33,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getconnectioncount", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getdescriptorinfo.rst b/reference/rpc/getdescriptorinfo.rst index a061f47..c66918e 100644 --- a/reference/rpc/getdescriptorinfo.rst +++ b/reference/rpc/getdescriptorinfo.rst @@ -20,11 +20,12 @@ Result :: - { - "descriptor" : "desc", (string) The descriptor in canonical form, without private keys - "isrange" : true|false, (boolean) Whether the descriptor is ranged - "issolvable" : true|false, (boolean) Whether the descriptor is solvable - "hasprivatekeys" : true|false, (boolean) Whether the input descriptor contained at least one private key + { (json object) + "descriptor" : "str", (string) The descriptor in canonical form, without private keys + "checksum" : "str", (string) The checksum for the input descriptor + "isrange" : true|false, (boolean) Whether the descriptor is ranged + "issolvable" : true|false, (boolean) Whether the descriptor is solvable + "hasprivatekeys" : true|false (boolean) Whether the input descriptor contained at least one private key } Examples diff --git a/reference/rpc/getdifficulty.rst b/reference/rpc/getdifficulty.rst index c5baafd..053a0ac 100644 --- a/reference/rpc/getdifficulty.rst +++ b/reference/rpc/getdifficulty.rst @@ -17,7 +17,7 @@ Result * - Name - Type - Description - * - n.nnn + * - n - numeric - the proof-of-work difficulty as a multiple of the minimum difficulty. @@ -33,5 +33,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getdifficulty", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getindexinfo.rst b/reference/rpc/getindexinfo.rst new file mode 100644 index 0000000..2c575e4 --- /dev/null +++ b/reference/rpc/getindexinfo.rst @@ -0,0 +1,51 @@ +.. This file is licensed under the MIT License (MIT) available on + http://opensource.org/licenses/MIT. + +getindexinfo +============ + +``getindexinfo ( "index_name" )`` + +Returns the status of one or all available indices currently running in the node. + +Argument #1 - index_name +~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** string, optional + +Filter results for an index with a specific name. + +Result +~~~~~~ + +:: + + { (json object) + "name" : { (json object) The name of the index + "synced" : true|false, (boolean) Whether the index is synced or not + "best_block_height" : n (numeric) The block height to which the index is synced + } + } + +Examples +~~~~~~~~ + + +.. highlight:: shell + +:: + + bitcoin-cli getindexinfo + +:: + + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getindexinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + +:: + + bitcoin-cli getindexinfo txindex + +:: + + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getindexinfo", "params": [txindex]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + diff --git a/reference/rpc/getmemoryinfo.rst b/reference/rpc/getmemoryinfo.rst index 386bbfe..202caa2 100644 --- a/reference/rpc/getmemoryinfo.rst +++ b/reference/rpc/getmemoryinfo.rst @@ -22,23 +22,29 @@ Result (mode "stats") :: - { - "locked": { (json object) Information about locked memory manager - "used": xxxxx, (numeric) Number of bytes used - "free": xxxxx, (numeric) Number of bytes available in current arenas - "total": xxxxxxx, (numeric) Total number of bytes managed - "locked": xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk. - "chunks_used": xxxxx, (numeric) Number allocated chunks - "chunks_free": xxxxx, (numeric) Number unused chunks + { (json object) + "locked" : { (json object) Information about locked memory manager + "used" : n, (numeric) Number of bytes used + "free" : n, (numeric) Number of bytes available in current arenas + "total" : n, (numeric) Total number of bytes managed + "locked" : n, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk. + "chunks_used" : n, (numeric) Number allocated chunks + "chunks_free" : n (numeric) Number unused chunks } } Result (mode "mallocinfo") ~~~~~~~~~~~~~~~~~~~~~~~~~~ -:: +.. list-table:: + :header-rows: 1 - "..." + * - Name + - Type + - Description + * - str + - string + - "..." Examples ~~~~~~~~ @@ -52,5 +58,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmemoryinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmemoryinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getmempoolancestors.rst b/reference/rpc/getmempoolancestors.rst index 9fc50d6..06b0e84 100644 --- a/reference/rpc/getmempoolancestors.rst +++ b/reference/rpc/getmempoolancestors.rst @@ -27,9 +27,9 @@ Result (for verbose = false) :: - [ (json array of strings) - "transactionid" (string) The transaction id of an in-mempool ancestor transaction - ,... + [ (json array) + "hex", (string) The transaction id of an in-mempool ancestor transaction + ... ] Result (for verbose = true) @@ -37,34 +37,39 @@ Result (for verbose = true) :: - { (json object) - "transactionid" : { (json object) - "size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. - "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) - "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) - "time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT - "height" : n, (numeric) block height when transaction entered pool - "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) - "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) - "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) - "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) - "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) - "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) - "wtxid" : hash, (string) hash of serialized transaction, including witness data - "fees" : { - "base" : n, (numeric) transaction fee in BTC - "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC - "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC - "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC - } - "depends" : [ (array) unconfirmed transactions used as inputs for this transaction - "transactionid", (string) parent transaction id - ... ] - "spentby" : [ (array) unconfirmed transactions spending outputs from this transaction - "transactionid", (string) child transaction id - ... ] - "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) - }, ... + { (json object) + "transactionid" : { (json object) + "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. + "weight" : n, (numeric) transaction weight as defined in BIP 141. + "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) + "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) + "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT + "height" : n, (numeric) block height when transaction entered pool + "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) + "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) + "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) + "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) + "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "wtxid" : "hex", (string) hash of serialized transaction, including witness data + "fees" : { (json object) + "base" : n, (numeric) transaction fee in BTC + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC + "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC + }, + "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction + "hex", (string) parent transaction id + ... + ], + "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction + "hex", (string) child transaction id + ... + ], + "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) + "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) + }, + ... } Examples @@ -79,5 +84,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolancestors", "params": ["mytxid"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmempoolancestors", "params": ["mytxid"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getmempooldescendants.rst b/reference/rpc/getmempooldescendants.rst index 9dc4657..6de89b9 100644 --- a/reference/rpc/getmempooldescendants.rst +++ b/reference/rpc/getmempooldescendants.rst @@ -27,9 +27,9 @@ Result (for verbose = false) :: - [ (json array of strings) - "transactionid" (string) The transaction id of an in-mempool descendant transaction - ,... + [ (json array) + "hex", (string) The transaction id of an in-mempool descendant transaction + ... ] Result (for verbose = true) @@ -37,34 +37,39 @@ Result (for verbose = true) :: - { (json object) - "transactionid" : { (json object) - "size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. - "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) - "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) - "time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT - "height" : n, (numeric) block height when transaction entered pool - "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) - "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) - "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) - "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) - "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) - "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) - "wtxid" : hash, (string) hash of serialized transaction, including witness data - "fees" : { - "base" : n, (numeric) transaction fee in BTC - "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC - "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC - "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC - } - "depends" : [ (array) unconfirmed transactions used as inputs for this transaction - "transactionid", (string) parent transaction id - ... ] - "spentby" : [ (array) unconfirmed transactions spending outputs from this transaction - "transactionid", (string) child transaction id - ... ] - "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) - }, ... + { (json object) + "transactionid" : { (json object) + "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. + "weight" : n, (numeric) transaction weight as defined in BIP 141. + "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) + "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) + "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT + "height" : n, (numeric) block height when transaction entered pool + "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) + "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) + "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) + "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) + "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "wtxid" : "hex", (string) hash of serialized transaction, including witness data + "fees" : { (json object) + "base" : n, (numeric) transaction fee in BTC + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC + "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC + }, + "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction + "hex", (string) parent transaction id + ... + ], + "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction + "hex", (string) child transaction id + ... + ], + "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) + "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) + }, + ... } Examples @@ -79,5 +84,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempooldescendants", "params": ["mytxid"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmempooldescendants", "params": ["mytxid"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getmempoolentry.rst b/reference/rpc/getmempoolentry.rst index be93f9d..e5c3582 100644 --- a/reference/rpc/getmempoolentry.rst +++ b/reference/rpc/getmempoolentry.rst @@ -20,32 +20,36 @@ Result :: - { (json object) - "size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. - "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) - "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) - "time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT - "height" : n, (numeric) block height when transaction entered pool - "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) - "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) - "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) - "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) - "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) - "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) - "wtxid" : hash, (string) hash of serialized transaction, including witness data - "fees" : { - "base" : n, (numeric) transaction fee in BTC - "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC - "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC - "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC - } - "depends" : [ (array) unconfirmed transactions used as inputs for this transaction - "transactionid", (string) parent transaction id - ... ] - "spentby" : [ (array) unconfirmed transactions spending outputs from this transaction - "transactionid", (string) child transaction id - ... ] - "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) + { (json object) + "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. + "weight" : n, (numeric) transaction weight as defined in BIP 141. + "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) + "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) + "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT + "height" : n, (numeric) block height when transaction entered pool + "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) + "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) + "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) + "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) + "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "wtxid" : "hex", (string) hash of serialized transaction, including witness data + "fees" : { (json object) + "base" : n, (numeric) transaction fee in BTC + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC + "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC + }, + "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction + "hex", (string) parent transaction id + ... + ], + "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction + "hex", (string) child transaction id + ... + ], + "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) + "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) } Examples @@ -60,5 +64,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolentry", "params": ["mytxid"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmempoolentry", "params": ["mytxid"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getmempoolinfo.rst b/reference/rpc/getmempoolinfo.rst index 4cb8c43..079233a 100644 --- a/reference/rpc/getmempoolinfo.rst +++ b/reference/rpc/getmempoolinfo.rst @@ -13,13 +13,15 @@ Result :: - { - "size": xxxxx, (numeric) Current tx count - "bytes": xxxxx, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted - "usage": xxxxx, (numeric) Total memory usage for the mempool - "maxmempool": xxxxx, (numeric) Maximum memory usage for the mempool - "mempoolminfee": xxxxx (numeric) Minimum fee rate in BTC/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee - "minrelaytxfee": xxxxx (numeric) Current minimum relay fee for transactions + { (json object) + "loaded" : true|false, (boolean) True if the mempool is fully loaded + "size" : n, (numeric) Current tx count + "bytes" : n, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted + "usage" : n, (numeric) Total memory usage for the mempool + "maxmempool" : n, (numeric) Maximum memory usage for the mempool + "mempoolminfee" : n, (numeric) Minimum fee rate in BTC/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee + "minrelaytxfee" : n, (numeric) Current minimum relay fee for transactions + "unbroadcastcount" : n (numeric) Current number of transactions that haven't passed initial broadcast yet } Examples @@ -34,5 +36,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmempoolinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getmininginfo.rst b/reference/rpc/getmininginfo.rst index 5a36f4c..dbd0060 100644 --- a/reference/rpc/getmininginfo.rst +++ b/reference/rpc/getmininginfo.rst @@ -13,15 +13,15 @@ Result :: - { - "blocks": nnn, (numeric) The current block - "currentblockweight": nnn, (numeric, optional) The block weight of the last assembled block (only present if a block was ever assembled) - "currentblocktx": nnn, (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled) - "difficulty": xxx.xxxxx (numeric) The current difficulty - "networkhashps": nnn, (numeric) The network hashes per second - "pooledtx": n (numeric) The size of the mempool - "chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest) - "warnings": "..." (string) any network and blockchain warnings + { (json object) + "blocks" : n, (numeric) The current block + "currentblockweight" : n, (numeric, optional) The block weight of the last assembled block (only present if a block was ever assembled) + "currentblocktx" : n, (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled) + "difficulty" : n, (numeric) The current difficulty + "networkhashps" : n, (numeric) The network hashes per second + "pooledtx" : n, (numeric) The size of the mempool + "chain" : "str", (string) current network name (main, test, regtest) + "warnings" : "str" (string) any network and blockchain warnings } Examples @@ -36,5 +36,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmininginfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getnettotals.rst b/reference/rpc/getnettotals.rst index 2f4aa27..f3194ae 100644 --- a/reference/rpc/getnettotals.rst +++ b/reference/rpc/getnettotals.rst @@ -14,18 +14,17 @@ Result :: - { - "totalbytesrecv": n, (numeric) Total bytes received - "totalbytessent": n, (numeric) Total bytes sent - "timemillis": t, (numeric) Current UNIX time in milliseconds - "uploadtarget": - { - "timeframe": n, (numeric) Length of the measuring timeframe in seconds - "target": n, (numeric) Target in bytes - "target_reached": true|false, (boolean) True if target is reached - "serve_historical_blocks": true|false, (boolean) True if serving historical blocks - "bytes_left_in_cycle": t, (numeric) Bytes left in current time cycle - "time_left_in_cycle": t (numeric) Seconds left in current time cycle + { (json object) + "totalbytesrecv" : n, (numeric) Total bytes received + "totalbytessent" : n, (numeric) Total bytes sent + "timemillis" : xxx, (numeric) Current UNIX epoch time in milliseconds + "uploadtarget" : { (json object) + "timeframe" : n, (numeric) Length of the measuring timeframe in seconds + "target" : n, (numeric) Target in bytes + "target_reached" : true|false, (boolean) True if target is reached + "serve_historical_blocks" : true|false, (boolean) True if serving historical blocks + "bytes_left_in_cycle" : n, (numeric) Bytes left in current time cycle + "time_left_in_cycle" : n (numeric) Seconds left in current time cycle } } @@ -41,5 +40,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnettotals", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getnetworkhashps.rst b/reference/rpc/getnetworkhashps.rst index 70629e3..bab864b 100644 --- a/reference/rpc/getnetworkhashps.rst +++ b/reference/rpc/getnetworkhashps.rst @@ -35,7 +35,7 @@ Result * - Name - Type - Description - * - x + * - n - numeric - Hashes per second estimated @@ -51,5 +51,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhashps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnetworkhashps", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getnetworkinfo.rst b/reference/rpc/getnetworkinfo.rst index 083b1ff..6179424 100644 --- a/reference/rpc/getnetworkinfo.rst +++ b/reference/rpc/getnetworkinfo.rst @@ -13,36 +13,42 @@ Result :: - { - "version": xxxxx, (numeric) the server version - "subversion": "/Satoshi:x.x.x/", (string) the server subversion string - "protocolversion": xxxxx, (numeric) the protocol version - "localservices": "xxxxxxxxxxxxxxxx", (string) the services we offer to the network - "localrelay": true|false, (bool) true if transaction relay is requested from peers - "timeoffset": xxxxx, (numeric) the time offset - "connections": xxxxx, (numeric) the number of connections - "networkactive": true|false, (bool) whether p2p networking is enabled - "networks": [ (array) information per network - { - "name": "xxx", (string) network (ipv4, ipv6 or onion) - "limited": true|false, (boolean) is the network limited using -onlynet? - "reachable": true|false, (boolean) is the network reachable? - "proxy": "host:port" (string) the proxy that is used for this network, or empty if none - "proxy_randomize_credentials": true|false, (string) Whether randomized credentials are used - } - ,... + { (json object) + "version" : n, (numeric) the server version + "subversion" : "str", (string) the server subversion string + "protocolversion" : n, (numeric) the protocol version + "localservices" : "hex", (string) the services we offer to the network + "localservicesnames" : [ (json array) the services we offer to the network, in human-readable form + "str", (string) the service name + ... ], - "relayfee": x.xxxxxxxx, (numeric) minimum relay fee for transactions in BTC/kB - "incrementalfee": x.xxxxxxxx, (numeric) minimum fee increment for mempool limiting or BIP 125 replacement in BTC/kB - "localaddresses": [ (array) list of local addresses - { - "address": "xxxx", (string) network address - "port": xxx, (numeric) network port - "score": xxx (numeric) relative score - } - ,... - ] - "warnings": "..." (string) any network and blockchain warnings + "localrelay" : true|false, (boolean) true if transaction relay is requested from peers + "timeoffset" : n, (numeric) the time offset + "connections" : n, (numeric) the total number of connections + "connections_in" : n, (numeric) the number of inbound connections + "connections_out" : n, (numeric) the number of outbound connections + "networkactive" : true|false, (boolean) whether p2p networking is enabled + "networks" : [ (json array) information per network + { (json object) + "name" : "str", (string) network (ipv4, ipv6 or onion) + "limited" : true|false, (boolean) is the network limited using -onlynet? + "reachable" : true|false, (boolean) is the network reachable? + "proxy" : "str", (string) ("host:port") the proxy that is used for this network, or empty if none + "proxy_randomize_credentials" : true|false (boolean) Whether randomized credentials are used + }, + ... + ], + "relayfee" : n, (numeric) minimum relay fee for transactions in BTC/kB + "incrementalfee" : n, (numeric) minimum fee increment for mempool limiting or BIP 125 replacement in BTC/kB + "localaddresses" : [ (json array) list of local addresses + { (json object) + "address" : "str", (string) network address + "port" : n, (numeric) network port + "score" : n (numeric) relative score + }, + ... + ], + "warnings" : "str" (string) any network and blockchain warnings } Examples @@ -57,5 +63,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnetworkinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getnewaddress.rst b/reference/rpc/getnewaddress.rst index 8a0e5ae..9fdbd0f 100644 --- a/reference/rpc/getnewaddress.rst +++ b/reference/rpc/getnewaddress.rst @@ -34,7 +34,7 @@ Result * - Name - Type - Description - * - address + * - str - string - The new bitcoin address @@ -50,5 +50,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnewaddress", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getnodeaddresses.rst b/reference/rpc/getnodeaddresses.rst index 42c5402..e34ca37 100644 --- a/reference/rpc/getnodeaddresses.rst +++ b/reference/rpc/getnodeaddresses.rst @@ -13,21 +13,21 @@ Argument #1 - count **Type:** numeric, optional, default=1 -How many addresses to return. Limited to the smaller of 2500 or 23% of all known addresses. +The maximum number of addresses to return. Specify 0 to return all known addresses. Result ~~~~~~ :: - [ - { - "time": ttt, (numeric) Timestamp in seconds since epoch (Jan 1 1970 GMT) keeping track of when the node was last seen - "services": n, (numeric) The services offered - "address": "host", (string) The address of the node - "port": n (numeric) The port of the node - } - ,.... + [ (json array) + { (json object) + "time" : xxx, (numeric) The UNIX epoch time of when the node was last seen + "services" : n, (numeric) The services offered + "address" : "str", (string) The address of the node + "port" : n (numeric) The port of the node + }, + ... ] Examples @@ -42,5 +42,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnodeaddresses", "params": [8] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnodeaddresses", "params": [8]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getpeerinfo.rst b/reference/rpc/getpeerinfo.rst index ca26320..76360b4 100644 --- a/reference/rpc/getpeerinfo.rst +++ b/reference/rpc/getpeerinfo.rst @@ -13,51 +13,82 @@ Result :: - [ - { - "id": n, (numeric) Peer index - "addr":"host:port", (string) The IP address and port of the peer - "addrbind":"ip:port", (string) Bind address of the connection to the peer - "addrlocal":"ip:port", (string) Local address as reported by the peer - "services":"xxxxxxxxxxxxxxxx", (string) The services offered - "relaytxes":true|false, (boolean) Whether peer has asked us to relay transactions to it - "lastsend": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send - "lastrecv": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive - "bytessent": n, (numeric) The total bytes sent - "bytesrecv": n, (numeric) The total bytes received - "conntime": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT) - "timeoffset": ttt, (numeric) The time offset in seconds - "pingtime": n, (numeric) ping time (if available) - "minping": n, (numeric) minimum observed ping time (if any at all) - "pingwait": n, (numeric) ping wait (if non-zero) - "version": v, (numeric) The peer version, such as 70001 - "subver": "/Satoshi:0.8.5/", (string) The string version - "inbound": true|false, (boolean) Inbound (true) or Outbound (false) - "addnode": true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection - "startingheight": n, (numeric) The starting height (block) of the peer - "banscore": n, (numeric) The ban score - "synced_headers": n, (numeric) The last header we have in common with this peer - "synced_blocks": n, (numeric) The last block we have in common with this peer - "inflight": [ - n, (numeric) The heights of blocks we're currently asking from this peer - ... + [ (json array) + { (json object) + "id" : n, (numeric) Peer index + "addr" : "str", (string) (host:port) The IP address and port of the peer + "addrbind" : "str", (string) (ip:port) Bind address of the connection to the peer + "addrlocal" : "str", (string) (ip:port) Local address as reported by the peer + "network" : "str", (string) Network (ipv4, ipv6, or onion) the peer connected through + "mapped_as" : n, (numeric) The AS in the BGP route to the peer used for diversifying + peer selection (only available if the asmap config flag is set) + "services" : "hex", (string) The services offered + "servicesnames" : [ (json array) the services offered, in human-readable form + "str", (string) the service name if it is recognised + ... ], - "whitelisted": true|false, (boolean) Whether the peer is whitelisted - "minfeefilter": n, (numeric) The minimum fee rate for transactions this peer accepts - "bytessent_per_msg": { - "msg": n, (numeric) The total bytes sent aggregated by message type - When a message type is not listed in this json object, the bytes sent are 0. - Only known message types can appear as keys in the object. - ... + "relaytxes" : true|false, (boolean) Whether peer has asked us to relay transactions to it + "lastsend" : xxx, (numeric) The UNIX epoch time of the last send + "lastrecv" : xxx, (numeric) The UNIX epoch time of the last receive + "last_transaction" : xxx, (numeric) The UNIX epoch time of the last valid transaction received from this peer + "last_block" : xxx, (numeric) The UNIX epoch time of the last block received from this peer + "bytessent" : n, (numeric) The total bytes sent + "bytesrecv" : n, (numeric) The total bytes received + "conntime" : xxx, (numeric) The UNIX epoch time of the connection + "timeoffset" : n, (numeric) The time offset in seconds + "pingtime" : n, (numeric) ping time (if available) + "minping" : n, (numeric) minimum observed ping time (if any at all) + "pingwait" : n, (numeric) ping wait (if non-zero) + "version" : n, (numeric) The peer version, such as 70001 + "subver" : "str", (string) The string version + "inbound" : true|false, (boolean) Inbound (true) or Outbound (false) + "addnode" : true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection + (DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed) + "connection_type" : "str", (string) Type of connection: + outbound-full-relay (default automatic connections), + block-relay-only (does not relay transactions or addresses), + inbound (initiated by the peer), + manual (added via addnode RPC or -addnode/-connect configuration options), + addr-fetch (short-lived automatic connection for soliciting addresses), + feeler (short-lived automatic connection for testing addresses). + Please note this output is unlikely to be stable in upcoming releases as we iterate to + best capture connection behaviors. + "startingheight" : n, (numeric) The starting height (block) of the peer + "banscore" : n, (numeric) The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed) + "synced_headers" : n, (numeric) The last header we have in common with this peer + "synced_blocks" : n, (numeric) The last block we have in common with this peer + "inflight" : [ (json array) + n, (numeric) The heights of blocks we're currently asking from this peer + ... + ], + "whitelisted" : true|false, (boolean, optional) Whether the peer is whitelisted with default permissions + (DEPRECATED, returned only if config option -deprecatedrpc=whitelisted is passed) + "permissions" : [ (json array) Any special permissions that have been granted to this peer + "str", (string) bloomfilter (allow requesting BIP37 filtered blocks and transactions), + noban (do not ban for misbehavior; implies download), + forcerelay (relay transactions that are already in the mempool; implies relay), + relay (relay even in -blocksonly mode, and unlimited transaction announcements), + mempool (allow requesting BIP35 mempool contents), + download (allow getheaders during IBD, no disconnect after maxuploadtarget limit), + addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info). + + ... + ], + "minfeefilter" : n, (numeric) The minimum fee rate for transactions this peer accepts + "bytessent_per_msg" : { (json object) + "msg" : n, (numeric) The total bytes sent aggregated by message type + When a message type is not listed in this json object, the bytes sent are 0. + Only known message types can appear as keys in the object. + ... }, - "bytesrecv_per_msg": { - "msg": n, (numeric) The total bytes received aggregated by message type - When a message type is not listed in this json object, the bytes received are 0. - Only known message types can appear as keys in the object and all bytes received of unknown message types are listed under '*other*'. - ... + "bytesrecv_per_msg" : { (json object) + "msg" : n (numeric) The total bytes received aggregated by message type + When a message type is not listed in this json object, the bytes received are 0. + Only known message types can appear as keys in the object and all bytes received + of unknown message types are listed under '*other*'. } - } - ,... + }, + ... ] Examples @@ -72,5 +103,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getpeerinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getrawchangeaddress.rst b/reference/rpc/getrawchangeaddress.rst index c3db397..a5fe923 100644 --- a/reference/rpc/getrawchangeaddress.rst +++ b/reference/rpc/getrawchangeaddress.rst @@ -26,7 +26,7 @@ Result * - Name - Type - Description - * - address + * - str - string - The address @@ -42,5 +42,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawchangeaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrawchangeaddress", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getrawmempool.rst b/reference/rpc/getrawmempool.rst index d36c444..cefe7a9 100644 --- a/reference/rpc/getrawmempool.rst +++ b/reference/rpc/getrawmempool.rst @@ -4,7 +4,7 @@ getrawmempool ============= -``getrawmempool ( verbose )`` +``getrawmempool ( verbose mempool_sequence )`` Returns all transaction ids in memory pool as a json array of string transaction ids. @@ -17,14 +17,21 @@ Argument #1 - verbose True for a json object, false for array of transaction ids +Argument #2 - mempool_sequence +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** boolean, optional, default=false + +If verbose=false, returns a json object with transaction list and mempool sequence number attached. + Result (for verbose = false) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - [ (json array of string) - "transactionid" (string) The transaction id - ,... + [ (json array) + "hex", (string) The transaction id + ... ] Result (for verbose = true) @@ -32,34 +39,52 @@ Result (for verbose = true) :: - { (json object) - "transactionid" : { (json object) - "size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. - "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) - "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) - "time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT - "height" : n, (numeric) block height when transaction entered pool - "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) - "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) - "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) - "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) - "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) - "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) - "wtxid" : hash, (string) hash of serialized transaction, including witness data - "fees" : { - "base" : n, (numeric) transaction fee in BTC - "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC - "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC - "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC - } - "depends" : [ (array) unconfirmed transactions used as inputs for this transaction - "transactionid", (string) parent transaction id - ... ] - "spentby" : [ (array) unconfirmed transactions spending outputs from this transaction - "transactionid", (string) child transaction id - ... ] - "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) - }, ... + { (json object) + "transactionid" : { (json object) + "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. + "weight" : n, (numeric) transaction weight as defined in BIP 141. + "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) + "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) + "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT + "height" : n, (numeric) block height when transaction entered pool + "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) + "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) + "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) + "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) + "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "wtxid" : "hex", (string) hash of serialized transaction, including witness data + "fees" : { (json object) + "base" : n, (numeric) transaction fee in BTC + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC + "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC + }, + "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction + "hex", (string) parent transaction id + ... + ], + "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction + "hex", (string) child transaction id + ... + ], + "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) + "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) + }, + ... + } + +Result (for verbose = false and mempool_sequence = true) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:: + + { (json object) + "txids" : [ (json array) + "hex", (string) The transaction id + ... + ], + "mempool_sequence" : n (numeric) The mempool sequence value. } Examples @@ -74,5 +99,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawmempool", "params": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrawmempool", "params": [true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getrawtransaction.rst b/reference/rpc/getrawtransaction.rst index 04dbb0d..855f36e 100644 --- a/reference/rpc/getrawtransaction.rst +++ b/reference/rpc/getrawtransaction.rst @@ -50,7 +50,7 @@ Result (if verbose is not set or set to false) * - Name - Type - Description - * - data + * - str - string - The serialized, hex-encoded data for 'txid' @@ -59,50 +59,53 @@ Result (if verbose is set to true) :: - { - "in_active_chain": b, (bool) Whether specified block is in the active chain or not (only present with explicit "blockhash" argument) - "hex" : "data", (string) The serialized, hex-encoded data for 'txid' - "txid" : "id", (string) The transaction id (same as provided) - "hash" : "id", (string) The transaction hash (differs from txid for witness transactions) - "size" : n, (numeric) The serialized transaction size - "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) - "weight" : n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4) - "version" : n, (numeric) The version - "locktime" : ttt, (numeric) The lock time - "vin" : [ (array of json objects) - { - "txid": "id", (string) The transaction id - "vout": n, (numeric) - "scriptSig": { (json object) The script - "asm": "asm", (string) asm - "hex": "hex" (string) hex - }, - "sequence": n (numeric) The script sequence number - "txinwitness": ["hex", ...] (array of string) hex-encoded witness data (if any) - } - ,... + { (json object) + "in_active_chain" : true|false, (boolean) Whether specified block is in the active chain or not (only present with explicit "blockhash" argument) + "hex" : "hex", (string) The serialized, hex-encoded data for 'txid' + "txid" : "hex", (string) The transaction id (same as provided) + "hash" : "hex", (string) The transaction hash (differs from txid for witness transactions) + "size" : n, (numeric) The serialized transaction size + "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) + "weight" : n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4) + "version" : n, (numeric) The version + "locktime" : xxx, (numeric) The lock time + "vin" : [ (json array) + { (json object) + "txid" : "hex", (string) The transaction id + "vout" : n, (numeric) The output number + "scriptSig" : { (json object) The script + "asm" : "str", (string) asm + "hex" : "hex" (string) hex + }, + "sequence" : n, (numeric) The script sequence number + "txinwitness" : [ (json array) + "hex", (string) hex-encoded witness data (if any) + ... + ] + }, + ... ], - "vout" : [ (array of json objects) - { - "value" : x.xxx, (numeric) The value in BTC - "n" : n, (numeric) index - "scriptPubKey" : { (json object) - "asm" : "asm", (string) the asm - "hex" : "hex", (string) the hex - "reqSigs" : n, (numeric) The required sigs - "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' - "addresses" : [ (json array of string) - "address" (string) bitcoin address - ,... - ] - } - } - ,... + "vout" : [ (json array) + { (json object) + "value" : n, (numeric) The value in BTC + "n" : n, (numeric) index + "scriptPubKey" : { (json object) + "asm" : "str", (string) the asm + "hex" : "str", (string) the hex + "reqSigs" : n, (numeric) The required sigs + "type" : "str", (string) The type, eg 'pubkeyhash' + "addresses" : [ (json array) + "str", (string) bitcoin address + ... + ] + } + }, + ... ], - "blockhash" : "hash", (string) the block hash - "confirmations" : n, (numeric) The confirmations - "blocktime" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) - "time" : ttt, (numeric) Same as "blocktime" + "blockhash" : "hex", (string) the block hash + "confirmations" : n, (numeric) The confirmations + "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time + "time" : n (numeric) Same as "blocktime" } Examples @@ -121,7 +124,7 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["mytxid", true] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrawtransaction", "params": ["mytxid", true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ :: diff --git a/reference/rpc/getreceivedbyaddress.rst b/reference/rpc/getreceivedbyaddress.rst index cb17041..9d40507 100644 --- a/reference/rpc/getreceivedbyaddress.rst +++ b/reference/rpc/getreceivedbyaddress.rst @@ -31,7 +31,7 @@ Result * - Name - Type - Description - * - amount + * - n - numeric - The total amount in BTC received at this address. @@ -43,17 +43,17 @@ Examples The amount from transactions with at least 1 confirmation:: - bitcoin-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" + bitcoin-cli getreceivedbyaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" The amount including unconfirmed transactions, zero confirmations:: - bitcoin-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" 0 + bitcoin-cli getreceivedbyaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 0 The amount with at least 6 confirmations:: - bitcoin-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" 6 + bitcoin-cli getreceivedbyaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" 6 As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaddress", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getreceivedbyaddress", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getreceivedbylabel.rst b/reference/rpc/getreceivedbylabel.rst index a83fdcf..b5612f2 100644 --- a/reference/rpc/getreceivedbylabel.rst +++ b/reference/rpc/getreceivedbylabel.rst @@ -31,7 +31,7 @@ Result * - Name - Type - Description - * - amount + * - n - numeric - The total amount in BTC received for this label. @@ -55,5 +55,5 @@ The amount with at least 6 confirmations:: As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbylabel", "params": ["tabby", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getreceivedbylabel", "params": ["tabby", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getrpcinfo.rst b/reference/rpc/getrpcinfo.rst index e82655a..0041dde 100644 --- a/reference/rpc/getrpcinfo.rst +++ b/reference/rpc/getrpcinfo.rst @@ -13,14 +13,15 @@ Result :: - { - "active_commands" (array) All active commands - [ - { (object) Information about an active command - "method" (string) The name of the RPC command - "duration" (numeric) The running time in microseconds - },... - ] + { (json object) + "active_commands" : [ (json array) All active commands + { (json object) Information about an active command + "method" : "str", (string) The name of the RPC command + "duration" : n (numeric) The running time in microseconds + }, + ... + ], + "logpath" : "str" (string) The complete file path to the debug log } Examples @@ -35,5 +36,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrpcinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrpcinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/gettransaction.rst b/reference/rpc/gettransaction.rst index 3cbfbf4..b7fcad0 100644 --- a/reference/rpc/gettransaction.rst +++ b/reference/rpc/gettransaction.rst @@ -4,7 +4,7 @@ gettransaction ============== -``gettransaction "txid" ( include_watchonly )`` +``gettransaction "txid" ( include_watchonly verbose )`` Get detailed information about in-wallet transaction @@ -18,48 +18,68 @@ The transaction id Argument #2 - include_watchonly ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Type:** boolean, optional, default=false +**Type:** boolean, optional, default=true for watch-only wallets, otherwise false Whether to include watch-only addresses in balance calculation and details[] +Argument #3 - verbose +~~~~~~~~~~~~~~~~~~~~~ + +**Type:** boolean, optional, default=false + +Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction) + Result ~~~~~~ :: - { - "amount" : x.xxx, (numeric) The transaction amount in BTC - "fee": x.xxx, (numeric) The amount of the fee in BTC. This is negative and only available for the - 'send' category of transactions. - "confirmations" : n, (numeric) The number of confirmations - "blockhash" : "hash", (string) The block hash - "blockindex" : xx, (numeric) The index of the transaction in the block that includes it - "blocktime" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT) - "txid" : "transactionid", (string) The transaction id. - "time" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT) - "timereceived" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT) - "bip125-replaceable": "yes|no|unknown", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee); - may be unknown for unconfirmed transactions not in the mempool - "details" : [ - { - "address" : "address", (string) The bitcoin address involved in the transaction - "category" : (string) The transaction category. - "send" Transactions sent. - "receive" Non-coinbase transactions received. - "generate" Coinbase transactions received with more than 100 confirmations. - "immature" Coinbase transactions received with 100 or fewer confirmations. - "orphan" Orphaned coinbase transactions received. - "amount" : x.xxx, (numeric) The amount in BTC - "label" : "label", (string) A comment for the address/transaction, if any - "vout" : n, (numeric) the vout value - "fee": x.xxx, (numeric) The amount of the fee in BTC. This is negative and only available for the + { (json object) + "amount" : n, (numeric) The amount in BTC + "fee" : n, (numeric) The amount of the fee in BTC. This is negative and only available for the 'send' category of transactions. - "abandoned": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the + "confirmations" : n, (numeric) The number of confirmations for the transaction. Negative confirmations means the + transaction conflicted that many blocks ago. + "generated" : true|false, (boolean) Only present if transaction only input is a coinbase one. + "trusted" : true|false, (boolean) Only present if we consider transaction to be trusted and so safe to spend from. + "blockhash" : "hex", (string) The block hash containing the transaction. + "blockheight" : n, (numeric) The block height containing the transaction. + "blockindex" : n, (numeric) The index of the transaction in the block that includes it. + "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time. + "txid" : "hex", (string) The transaction id. + "walletconflicts" : [ (json array) Conflicting transaction ids. + "hex", (string) The transaction id. + ... + ], + "time" : xxx, (numeric) The transaction time expressed in UNIX epoch time. + "timereceived" : xxx, (numeric) The time received expressed in UNIX epoch time. + "comment" : "str", (string) If a comment is associated with the transaction, only present if not empty. + "bip125-replaceable" : "str", (string) ("yes|no|unknown") Whether this transaction could be replaced due to BIP125 (replace-by-fee); + may be unknown for unconfirmed transactions not in the mempool + "details" : [ (json array) + { (json object) + "involvesWatchonly" : true|false, (boolean) Only returns true if imported addresses were involved in transaction. + "address" : "str", (string) The bitcoin address involved in the transaction. + "category" : "str", (string) The transaction category. + "send" Transactions sent. + "receive" Non-coinbase transactions received. + "generate" Coinbase transactions received with more than 100 confirmations. + "immature" Coinbase transactions received with 100 or fewer confirmations. + "orphan" Orphaned coinbase transactions received. + "amount" : n, (numeric) The amount in BTC + "label" : "str", (string) A comment for the address/transaction, if any + "vout" : n, (numeric) the vout value + "fee" : n, (numeric) The amount of the fee in BTC. This is negative and only available for the + 'send' category of transactions. + "abandoned" : true|false (boolean) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions. - } - ,... + }, + ... ], - "hex" : "data" (string) Raw data for transaction + "hex" : "hex", (string) Raw data for transaction + "decoded" : { (json object) Optional, the decoded transaction (only present when `verbose` is passed) + ... Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed. + } } Examples @@ -78,5 +98,9 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + bitcoin-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" false true + +:: + + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/gettxout.rst b/reference/rpc/gettxout.rst index 9b397e9..366f511 100644 --- a/reference/rpc/gettxout.rst +++ b/reference/rpc/gettxout.rst @@ -34,21 +34,21 @@ Result :: - { - "bestblock": "hash", (string) The hash of the block at the tip of the chain - "confirmations" : n, (numeric) The number of confirmations - "value" : x.xxx, (numeric) The transaction value in BTC - "scriptPubKey" : { (json object) - "asm" : "code", (string) - "hex" : "hex", (string) - "reqSigs" : n, (numeric) Number of required signatures - "type" : "pubkeyhash", (string) The type, eg pubkeyhash - "addresses" : [ (array of string) array of bitcoin addresses - "address" (string) bitcoin address - ,... - ] + { (json object) + "bestblock" : "hex", (string) The hash of the block at the tip of the chain + "confirmations" : n, (numeric) The number of confirmations + "value" : n, (numeric) The transaction value in BTC + "scriptPubKey" : { (json object) + "asm" : "hex", (string) + "hex" : "hex", (string) + "reqSigs" : n, (numeric) Number of required signatures + "type" : "hex", (string) The type, eg pubkeyhash + "addresses" : [ (json array) array of bitcoin addresses + "str", (string) bitcoin address + ... + ] }, - "coinbase" : true|false (boolean) Coinbase or not + "coinbase" : true|false (boolean) Coinbase or not } Examples @@ -67,5 +67,5 @@ View the details:: As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxout", "params": ["txid", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettxout", "params": ["txid", 1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/gettxoutproof.rst b/reference/rpc/gettxoutproof.rst index c5af663..ac77b36 100644 --- a/reference/rpc/gettxoutproof.rst +++ b/reference/rpc/gettxoutproof.rst @@ -18,7 +18,7 @@ Argument #1 - txids **Type:** json array, required -A json array of txids to filter +The txids to filter :: @@ -43,7 +43,7 @@ Result * - Name - Type - Description - * - data + * - str - string - A string that is a serialized, hex-encoded data for the proof. diff --git a/reference/rpc/gettxoutsetinfo.rst b/reference/rpc/gettxoutsetinfo.rst index 2e08b93..12edd32 100644 --- a/reference/rpc/gettxoutsetinfo.rst +++ b/reference/rpc/gettxoutsetinfo.rst @@ -4,26 +4,33 @@ gettxoutsetinfo =============== -``gettxoutsetinfo`` +``gettxoutsetinfo ( "hash_type" )`` Returns statistics about the unspent transaction output set. Note this call may take some time. +Argument #1 - hash_type +~~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** string, optional, default=hash_serialized_2 + +Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'none'. + Result ~~~~~~ :: - { - "height":n, (numeric) The current block height (index) - "bestblock": "hex", (string) The hash of the block at the tip of the chain - "transactions": n, (numeric) The number of transactions with unspent outputs - "txouts": n, (numeric) The number of unspent transaction outputs - "bogosize": n, (numeric) A meaningless metric for UTXO set size - "hash_serialized_2": "hash", (string) The serialized hash - "disk_size": n, (numeric) The estimated size of the chainstate on disk - "total_amount": x.xxx (numeric) The total amount + { (json object) + "height" : n, (numeric) The current block height (index) + "bestblock" : "hex", (string) The hash of the block at the tip of the chain + "transactions" : n, (numeric) The number of transactions with unspent outputs + "txouts" : n, (numeric) The number of unspent transaction outputs + "bogosize" : n, (numeric) A meaningless metric for UTXO set size + "hash_serialized_2" : "hex", (string) The serialized hash (only present if 'hash_serialized_2' hash_type is chosen) + "disk_size" : n, (numeric) The estimated size of the chainstate on disk + "total_amount" : n (numeric) The total amount } Examples @@ -38,5 +45,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutsetinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettxoutsetinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/getunconfirmedbalance.rst b/reference/rpc/getunconfirmedbalance.rst index 5484257..6006988 100644 --- a/reference/rpc/getunconfirmedbalance.rst +++ b/reference/rpc/getunconfirmedbalance.rst @@ -6,5 +6,19 @@ getunconfirmedbalance ``getunconfirmedbalance`` -Returns the server's total unconfirmed balance +DEPRECATED +Identical to getbalances().mine.untrusted_pending + +Result +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Name + - Type + - Description + * - n + - numeric + - The balance diff --git a/reference/rpc/getwalletinfo.rst b/reference/rpc/getwalletinfo.rst index 076c676..384979c 100644 --- a/reference/rpc/getwalletinfo.rst +++ b/reference/rpc/getwalletinfo.rst @@ -13,20 +13,27 @@ Result :: - { - "walletname": xxxxx, (string) the wallet name - "walletversion": xxxxx, (numeric) the wallet version - "balance": xxxxxxx, (numeric) the total confirmed balance of the wallet in BTC - "unconfirmed_balance": xxx, (numeric) the total unconfirmed balance of the wallet in BTC - "immature_balance": xxxxxx, (numeric) the total immature balance of the wallet in BTC - "txcount": xxxxxxx, (numeric) the total number of transactions in the wallet - "keypoololdest": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool - "keypoolsize": xxxx, (numeric) how many new keys are pre-generated (only counts external keys) - "keypoolsize_hd_internal": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used) - "unlocked_until": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked - "paytxfee": x.xxxx, (numeric) the transaction fee configuration, set in BTC/kB - "hdseedid": "" (string, optional) the Hash160 of the HD seed (only present when HD is enabled) - "private_keys_enabled": true|false (boolean) false if privatekeys are disabled for this wallet (enforced watch-only wallet) + { (json object) + "walletname" : "str", (string) the wallet name + "walletversion" : n, (numeric) the wallet version + "format" : "str", (string) the database format (bdb or sqlite) + "balance" : n, (numeric) DEPRECATED. Identical to getbalances().mine.trusted + "unconfirmed_balance" : n, (numeric) DEPRECATED. Identical to getbalances().mine.untrusted_pending + "immature_balance" : n, (numeric) DEPRECATED. Identical to getbalances().mine.immature + "txcount" : n, (numeric) the total number of transactions in the wallet + "keypoololdest" : xxx, (numeric) the UNIX epoch time of the oldest pre-generated key in the key pool. Legacy wallets only. + "keypoolsize" : n, (numeric) how many new keys are pre-generated (only counts external keys) + "keypoolsize_hd_internal" : n, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used) + "unlocked_until" : xxx, (numeric, optional) the UNIX epoch time until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets) + "paytxfee" : n, (numeric) the transaction fee configuration, set in BTC/kvB + "hdseedid" : "hex", (string, optional) the Hash160 of the HD seed (only present when HD is enabled) + "private_keys_enabled" : true|false, (boolean) false if privatekeys are disabled for this wallet (enforced watch-only wallet) + "avoid_reuse" : true|false, (boolean) whether this wallet tracks clean/dirty coins in terms of reuse + "scanning" : { (json object) current scanning details, or false if no scan is in progress + "duration" : n, (numeric) elapsed seconds since scan start + "progress" : n (numeric) scanning progress percentage [0.0, 1.0] + }, + "descriptors" : true|false (boolean) whether this wallet uses descriptors for scriptPubKey management } Examples @@ -41,5 +48,5 @@ Examples :: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getwalletinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/help.rst b/reference/rpc/help.rst index f3353b9..31959e7 100644 --- a/reference/rpc/help.rst +++ b/reference/rpc/help.rst @@ -24,7 +24,7 @@ Result * - Name - Type - Description - * - text + * - str - string - The help text diff --git a/reference/rpc/importaddress.rst b/reference/rpc/importaddress.rst index 26fb8fa..8e10df7 100644 --- a/reference/rpc/importaddress.rst +++ b/reference/rpc/importaddress.rst @@ -13,9 +13,13 @@ may report that the imported address exists but related transactions are still m If you have the full public key, you should call importpubkey instead of this. +Hint: use importmulti to import more than one address. + Note: If you import a non-standard raw script in hex form, outputs sending to it will be treated as change, and not show up in many RPCs. +Note: Use "getwalletinfo" to query the scanning progress. + Argument #1 - address ~~~~~~~~~~~~~~~~~~~~~ @@ -44,6 +48,13 @@ Argument #4 - p2sh Add the P2SH version of the script as well +Result +~~~~~~ + +:: + + null (json null) + Examples ~~~~~~~~ @@ -60,5 +71,5 @@ Import using a label without rescan:: As a JSON-RPC call:: - curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myaddress", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importaddress", "params": ["myaddress", "testing", false]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ diff --git a/reference/rpc/importdescriptors.rst b/reference/rpc/importdescriptors.rst new file mode 100644 index 0000000..3e7ca1e --- /dev/null +++ b/reference/rpc/importdescriptors.rst @@ -0,0 +1,72 @@ +.. This file is licensed under the MIT License (MIT) available on + http://opensource.org/licenses/MIT. + +importdescriptors +================= + +``importdescriptors "requests"`` + +Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup. + +Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls +may report that the imported keys, addresses or scripts exist but related transactions are still missing. + +Argument #1 - requests +~~~~~~~~~~~~~~~~~~~~~~ + +**Type:** json array, required + +Data to be imported + +:: + + [ + { (json object) + "desc": "str", (string, required) Descriptor to import. + "active": bool, (boolean, optional, default=false) Set this descriptor to be the active descriptor for the corresponding output type/externality + "range": n or [n,n], (numeric or array) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import + "next_index": n, (numeric) If a ranged descriptor is set to active, this specifies the next index to generate addresses from + "timestamp": timestamp | "now", (integer / string, required) Time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time + Use the string "now" to substitute the current synced blockchain time. + "now" can be specified to bypass scanning, for outputs which are known to never have been used, and + 0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp + of all descriptors being imported will be scanned. + "internal": bool, (boolean, optional, default=false) Whether matching outputs should be treated as not incoming payments (e.g. change) + "label": "str", (string, optional, default='') Label to assign to the address, only allowed with internal=false + }, + ... + ] + +Result +~~~~~~ + +:: + + [ (json array) Response is an array with the same size as the input that has the execution result + { (json object) + "success" : true|false, (boolean) + "warnings" : [ (json array, optional) + "str", (string) + ... + ], + "error" : { (json object, optional) + ... JSONRPC error + } + }, + ... + ] + +Examples +~~~~~~~~ + + +.. highlight:: shell + +:: + + bitcoin-cli importdescriptors '[{ "desc": "", "timestamp":1455191478, "internal": true }, { "desc": "", "label": "example 2", "timestamp": 1455191480 }]' + +:: + + bitcoin-cli importdescriptors '[{ "desc": "", "timestamp":1455191478, "active": true, "range": [0,100], "label": "" }]' + diff --git a/reference/rpc/importmulti.rst b/reference/rpc/importmulti.rst index 632d7fd..83535f3 100644 --- a/reference/rpc/importmulti.rst +++ b/reference/rpc/importmulti.rst @@ -13,7 +13,9 @@ If an address/script is imported without all of the private keys required to spe Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned. Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls -may report that the imported keys, addresses or scripts exists but related transactions are still missing. +may report that the imported keys, addresses or scripts exist but related transactions are still missing. + +Note: Use "getwalletinfo" to query the scanning progress. Argument #1 - requests ~~~~~~~~~~~~~~~~~~~~~~ @@ -21,6 +23,14 @@ Argument #1 - requests **Type:** json array, required Data to be imported + "range": n or [n,n], (numeric or array) If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import + "internal": bool, (boolean, optional, default=false) Stating whether matching outputs should be treated as not incoming payments (also known as change) + "watchonly": bool, (boolean, optional, default=false) Stating whether matching outputs should be considered watchonly. + "label": "str", (string, optional, default='') Label to assign to the address, only allowed with internal=false + "keypool": bool, (boolean, optional, default=false) Stating whether imported public keys should be added to the keypool for when users request new addresses. Only allowed when wallet private keys are disabled + }, + ... + ] :: @@ -28,7 +38,7 @@ Data to be imported { (json object) "desc": "str", (string) Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys "scriptPubKey": "