Current section
Files
Jump to
Current section
Files
priv/rpc/blockchain.json
{
"ns": "Core",
"items": [
{
"name": "getbestblockhash",
"desc": "getbestblockhash\n\nReturns the hash of the best (tip) block in the longest blockchain.\n\nResult:\n\"hex\" (string) the block hash hex encoded\n\nExamples:\n> bitcoin-cli getbestblockhash \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbestblockhash\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "getblock",
"desc": "getblock \"blockhash\" ( verbosity ) \n\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\nIf verbosity is 1, returns an Object with information about block <hash>.\nIf verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \n\nArguments:\n1. \"blockhash\" (string, required) The block hash\n2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data\n\nResult (for verbosity = 0):\n\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n\nResult (for verbosity = 1):\n{\n \"hash\" : \"hash\", (string) the block hash (same as provided)\n \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n \"size\" : n, (numeric) The block size\n \"strippedsize\" : n, (numeric) The block size excluding witness data\n \"weight\" : n (numeric) The block weight as defined in BIP 141\n \"height\" : n, (numeric) The block height or index\n \"version\" : n, (numeric) The block version\n \"versionHex\" : \"00000000\", (string) The block version formatted in hexadecimal\n \"merkleroot\" : \"xxxx\", (string) The merkle root\n \"tx\" : [ (array of string) The transaction ids\n \"transactionid\" (string) The transaction id\n ,...\n ],\n \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n \"nonce\" : n, (numeric) The nonce\n \"bits\" : \"1d00ffff\", (string) The bits\n \"difficulty\" : x.xxx, (numeric) The difficulty\n \"chainwork\" : \"xxxx\", (string) Expected number of hashes required to produce the chain up to this block (in hex)\n \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n \"nextblockhash\" : \"hash\" (string) The hash of the next block\n}\n\nResult (for verbosity = 2):\n{\n ..., Same output as verbosity = 1.\n \"tx\" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 \"tx\" result.\n ,...\n ],\n ,... Same output as verbosity = 1.\n}\n\nExamples:\n> bitcoin-cli getblock \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"\n> 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/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "blockhash",
"desc": "The block hash",
"default": null
},
{
"type": "numeric",
"required": false,
"name": "verbosity",
"desc": "0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data",
"default": "1"
}
]
},
{
"name": "getblockchaininfo",
"desc": "getblockchaininfo\nReturns an object containing various state info regarding blockchain processing.\n\nResult:\n{\n \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n \"bestblockhash\": \"...\", (string) the hash of the currently best block\n \"difficulty\": xxxxxx, (numeric) the current difficulty\n \"mediantime\": xxxxxx, (numeric) median time for the current best block\n \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n \"pruned\": xx, (boolean) if the blocks are subject to pruning\n \"pruneheight\": xxxxxx, (numeric) lowest-height complete block stored\n \"softforks\": [ (array) status of softforks in progress\n {\n \"id\": \"xxxx\", (string) name of softfork\n \"version\": xx, (numeric) block version\n \"reject\": { (object) progress toward rejecting pre-softfork blocks\n \"status\": xx, (boolean) true if threshold reached\n },\n }, ...\n ],\n \"bip9_softforks\": { (object) status of BIP9 softforks in progress\n \"xxxx\" : { (string) name of the softfork\n \"status\": \"xxxx\", (string) one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\"\n \"bit\": xx, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for \"started\" status)\n \"startTime\": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n \"timeout\": xx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n \"since\": xx, (numeric) height of the first block to which the status applies\n \"statistics\": { (object) numeric statistics about BIP9 signalling for a softfork (only for \"started\" status)\n \"period\": xx, (numeric) the length in blocks of the BIP9 signalling period \n \"threshold\": xx, (numeric) the number of blocks with the version bit set required to activate the feature \n \"elapsed\": xx, (numeric) the number of blocks elapsed since the beginning of the current period \n \"count\": xx, (numeric) the number of blocks with the version bit set in the current period \n \"possible\": xx (boolean) returns false if there are not enough blocks left in this period to pass activation threshold \n }\n }\n }\n}\n\nExamples:\n> bitcoin-cli getblockchaininfo \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockchaininfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "getblockcount",
"desc": "getblockcount\n\nReturns the number of blocks in the longest blockchain.\n\nResult:\nn (numeric) The current block count\n\nExamples:\n> bitcoin-cli getblockcount \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockcount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "getblockhash",
"desc": "getblockhash height\n\nReturns hash of block in best-block-chain at height provided.\n\nArguments:\n1. height (numeric, required) The height index\n\nResult:\n\"hash\" (string) The block hash\n\nExamples:\n> bitcoin-cli getblockhash 1000\n> 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/\n\n",
"args": [
{
"type": "numeric",
"required": true,
"name": "height",
"desc": "The height index",
"default": null
}
]
},
{
"name": "getblockheader",
"desc": "getblockheader \"hash\" ( verbose )\n\nIf verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.\nIf verbose is true, returns an Object with information about blockheader <hash>.\n\nArguments:\n1. \"hash\" (string, required) The block hash\n2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n\nResult (for verbose = true):\n{\n \"hash\" : \"hash\", (string) the block hash (same as provided)\n \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n \"height\" : n, (numeric) The block height or index\n \"version\" : n, (numeric) The block version\n \"versionHex\" : \"00000000\", (string) The block version formatted in hexadecimal\n \"merkleroot\" : \"xxxx\", (string) The merkle root\n \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n \"nonce\" : n, (numeric) The nonce\n \"bits\" : \"1d00ffff\", (string) The bits\n \"difficulty\" : x.xxx, (numeric) The difficulty\n \"chainwork\" : \"0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n \"nextblockhash\" : \"hash\", (string) The hash of the next block\n}\n\nResult (for verbose=false):\n\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n\nExamples:\n> bitcoin-cli getblockheader \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"\n> 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/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "hash",
"desc": "The block hash",
"default": null
},
{
"type": "boolean",
"required": false,
"name": "verbose",
"desc": "true for a json object, false for the hex encoded data",
"default": "true"
}
]
},
{
"name": "getchaintips",
"desc": "getchaintips\nReturn information about all known tips in the block tree, including the main chain as well as orphaned branches.\n\nResult:\n[\n {\n \"height\": xxxx, (numeric) height of the chain tip\n \"hash\": \"xxxx\", (string) block hash of the tip\n \"branchlen\": 0 (numeric) zero for main chain\n \"status\": \"active\" (string) \"active\" for the main chain\n },\n {\n \"height\": xxxx,\n \"hash\": \"xxxx\",\n \"branchlen\": 1 (numeric) length of branch connecting the tip to the main chain\n \"status\": \"xxxx\" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)\n }\n]\nPossible values for status:\n1. \"invalid\" This branch contains at least one invalid block\n2. \"headers-only\" Not all blocks for this branch are available, but the headers are valid\n3. \"valid-headers\" All blocks are available for this branch, but they were never fully validated\n4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n5. \"active\" This is the tip of the active main chain, which is certainly valid\n\nExamples:\n> bitcoin-cli getchaintips \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getchaintips\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "getchaintxstats",
"desc": "getchaintxstats ( nblocks blockhash )\n\nCompute statistics about the total number and rate of transactions in the chain.\n\nArguments:\n1. nblocks (numeric, optional) Size of the window in number of blocks (default: one month).\n2. \"blockhash\" (string, optional) The hash of the block that ends the window.\n\nResult:\n{\n \"time\": xxxxx, (numeric) The timestamp for the statistics in UNIX format.\n \"txcount\": xxxxx, (numeric) The total number of transactions in the chain up to that point.\n \"txrate\": x.xx, (numeric) The average rate of transactions per second in the window.\n}\n\nExamples:\n> bitcoin-cli getchaintxstats \n> 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/\n\n",
"args": [
{
"type": "numeric",
"required": false,
"name": "nblocks",
"desc": "Size of the window in number of blocks (default: one month).",
"default": null
},
{
"type": "string",
"required": false,
"name": "blockhash",
"desc": "The hash of the block that ends the window.",
"default": null
}
]
},
{
"name": "getdifficulty",
"desc": "getdifficulty\n\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n\nResult:\nn.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.\n\nExamples:\n> bitcoin-cli getdifficulty \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getdifficulty\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "getmempoolancestors",
"desc": "getmempoolancestors txid (verbose)\n\nIf txid is in the mempool, returns all in-mempool ancestors.\n\nArguments:\n1. \"txid\" (string, required) The transaction id (must be in mempool)\n2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\n\nResult (for verbose=false):\n[ (json array of strings)\n \"transactionid\" (string) The transaction id of an in-mempool ancestor transaction\n ,...\n]\n\nResult (for verbose=true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"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.\n \"fee\" : n, (numeric) transaction fee in BTC\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n }, ...\n}\n\nExamples:\n> bitcoin-cli getmempoolancestors \"mytxid\"\n> 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/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "txid",
"desc": "The transaction id (must be in mempool)",
"default": null
},
{
"type": "boolean",
"required": false,
"name": "verbose",
"desc": "True for a json object, false for array of transaction ids",
"default": "false"
}
]
},
{
"name": "getmempooldescendants",
"desc": "getmempooldescendants txid (verbose)\n\nIf txid is in the mempool, returns all in-mempool descendants.\n\nArguments:\n1. \"txid\" (string, required) The transaction id (must be in mempool)\n2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\n\nResult (for verbose=false):\n[ (json array of strings)\n \"transactionid\" (string) The transaction id of an in-mempool descendant transaction\n ,...\n]\n\nResult (for verbose=true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"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.\n \"fee\" : n, (numeric) transaction fee in BTC\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n }, ...\n}\n\nExamples:\n> bitcoin-cli getmempooldescendants \"mytxid\"\n> 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/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "txid",
"desc": "The transaction id (must be in mempool)",
"default": null
},
{
"type": "boolean",
"required": false,
"name": "verbose",
"desc": "True for a json object, false for array of transaction ids",
"default": "false"
}
]
},
{
"name": "getmempoolentry",
"desc": "getmempoolentry txid\n\nReturns mempool data for given transaction\n\nArguments:\n1. \"txid\" (string, required) The transaction id (must be in mempool)\n\nResult:\n{ (json object)\n \"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.\n \"fee\" : n, (numeric) transaction fee in BTC\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n}\n\nExamples:\n> bitcoin-cli getmempoolentry \"mytxid\"\n> 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/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "txid",
"desc": "The transaction id (must be in mempool)",
"default": null
}
]
},
{
"name": "getmempoolinfo",
"desc": "getmempoolinfo\n\nReturns details on the active state of the TX memory pool.\n\nResult:\n{\n \"size\": xxxxx, (numeric) Current tx count\n \"bytes\": xxxxx, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted\n \"usage\": xxxxx, (numeric) Total memory usage for the mempool\n \"maxmempool\": xxxxx, (numeric) Maximum memory usage for the mempool\n \"mempoolminfee\": xxxxx (numeric) Minimum feerate (BTC per KB) for tx to be accepted\n}\n\nExamples:\n> bitcoin-cli getmempoolinfo \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempoolinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "getrawmempool",
"desc": "getrawmempool ( verbose )\n\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n\nArguments:\n1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\n\nResult: (for verbose = false):\n[ (json array of string)\n \"transactionid\" (string) The transaction id\n ,...\n]\n\nResult: (for verbose = true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"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.\n \"fee\" : n, (numeric) transaction fee in BTC\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n }, ...\n}\n\nExamples:\n> bitcoin-cli getrawmempool true\n> 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/\n\n",
"args": [
{
"type": "boolean",
"required": false,
"name": "verbose",
"desc": "True for a json object, false for array of transaction ids",
"default": "false"
}
]
},
{
"name": "gettxout",
"desc": "gettxout \"txid\" n ( include_mempool )\n\nReturns details about an unspent transaction output.\n\nArguments:\n1. \"txid\" (string, required) The transaction id\n2. \"n\" (numeric, required) vout number\n3. \"include_mempool\" (boolean, optional) Whether to include the mempool. Default: true. Note that an unspent output that is spent in the mempool won't appear.\n\nResult:\n{\n \"bestblock\" : \"hash\", (string) the block hash\n \"confirmations\" : n, (numeric) The number of confirmations\n \"value\" : x.xxx, (numeric) The transaction value in BTC\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"code\", (string) \n \"hex\" : \"hex\", (string) \n \"reqSigs\" : n, (numeric) Number of required signatures\n \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n \"addresses\" : [ (array of string) array of bitcoin addresses\n \"address\" (string) bitcoin address\n ,...\n ]\n },\n \"coinbase\" : true|false (boolean) Coinbase or not\n}\n\nExamples:\n\nGet unspent transactions\n> bitcoin-cli listunspent \n\nView the details\n> bitcoin-cli gettxout \"txid\" 1\n\nAs a json rpc call\n> 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/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "txid",
"desc": "The transaction id",
"default": null
},
{
"type": "numeric",
"required": true,
"name": "n",
"desc": "vout number",
"default": null
},
{
"type": "boolean",
"required": false,
"name": "include_mempool",
"desc": "Whether to include the mempool. Default: true. Note that an unspent output that is spent in the mempool won't appear.",
"default": null
}
]
},
{
"name": "gettxoutproof",
"desc": "gettxoutproof [\"txid\",...] ( blockhash )\n\nReturns a hex-encoded proof that \"txid\" was included in a block.\n\nNOTE: By default this function only works sometimes. This is when there is an\nunspent output in the utxo for this transaction. To make it always work,\nyou need to maintain a transaction index, using the -txindex command line option or\nspecify the block in which the transaction is included manually (by blockhash).\n\nArguments:\n1. \"txids\" (string) A json array of txids to filter\n [\n \"txid\" (string) A transaction hash\n ,...\n ]\n2. \"blockhash\" (string, optional) If specified, looks for txid in the block with this hash\n\nResult:\n\"data\" (string) A string that is a serialized, hex-encoded data for the proof.\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "txids",
"desc": "A json array of txids to filter [ \"txid\" (string) A transaction hash ,... ]",
"default": null
},
{
"type": "string",
"required": false,
"name": "blockhash",
"desc": "If specified, looks for txid in the block with this hash",
"default": null
}
]
},
{
"name": "gettxoutsetinfo",
"desc": "gettxoutsetinfo\n\nReturns statistics about the unspent transaction output set.\nNote this call may take some time.\n\nResult:\n{\n \"height\":n, (numeric) The current block height (index)\n \"bestblock\": \"hex\", (string) the best block hash hex\n \"transactions\": n, (numeric) The number of transactions\n \"txouts\": n, (numeric) The number of output transactions\n \"bogosize\": n, (numeric) A meaningless metric for UTXO set size\n \"hash_serialized_2\": \"hash\", (string) The serialized hash\n \"disk_size\": n, (numeric) The estimated size of the chainstate on disk\n \"total_amount\": x.xxx (numeric) The total amount\n}\n\nExamples:\n> bitcoin-cli gettxoutsetinfo \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxoutsetinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": []
},
{
"name": "preciousblock",
"desc": "preciousblock \"blockhash\"\n\nTreats a block as if it were received before others with the same work.\n\nA later preciousblock call can override the effect of an earlier one.\n\nThe effects of preciousblock are not retained across restarts.\n\nArguments:\n1. \"blockhash\" (string, required) the hash of the block to mark as precious\n\nResult:\n\nExamples:\n> bitcoin-cli preciousblock \"blockhash\"\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"preciousblock\", \"params\": [\"blockhash\"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "blockhash",
"desc": "the hash of the block to mark as precious",
"default": null
}
]
},
{
"name": "pruneblockchain",
"desc": "pruneblockchain\n\nArguments:\n1. \"height\" (numeric, required) The block height to prune up to. May be set to a discrete height, or a unix timestamp\n to prune blocks whose block time is at least 2 hours older than the provided timestamp.\n\nResult:\nn (numeric) Height of the last block pruned.\n\nExamples:\n> bitcoin-cli pruneblockchain 1000\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"pruneblockchain\", \"params\": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": [
{
"type": "numeric",
"required": true,
"name": "height",
"desc": "The block height to prune up to. May be set to a discrete height, or a unix timestamp to prune blocks whose block time is at least 2 hours older than the provided timestamp.",
"default": null
}
]
},
{
"name": "verifychain",
"desc": "verifychain ( checklevel nblocks )\n\nVerifies blockchain database.\n\nArguments:\n1. checklevel (numeric, optional, 0-4, default=3) How thorough the block verification is.\n2. nblocks (numeric, optional, default=6, 0=all) The number of blocks to check.\n\nResult:\ntrue|false (boolean) Verified or not\n\nExamples:\n> bitcoin-cli verifychain \n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifychain\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": [
{
"type": "numeric",
"required": false,
"name": "checklevel",
"desc": "How thorough the block verification is.",
"default": "3"
},
{
"type": "numeric",
"required": false,
"name": "nblocks",
"desc": "The number of blocks to check.",
"default": "6"
}
]
},
{
"name": "verifytxoutproof",
"desc": "verifytxoutproof \"proof\"\n\nVerifies that a proof points to a transaction in a block, returning the transaction it commits to\nand throwing an RPC error if the block is not in our best chain\n\nArguments:\n1. \"proof\" (string, required) The hex-encoded proof generated by gettxoutproof\n\nResult:\n[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "proof",
"desc": "The hex-encoded proof generated by gettxoutproof",
"default": null
}
]
}
],
"desc": "General blockchain RPC"
}