diff --git a/_doc/0.22.0/rpc/avalanche/addavalanchenode.html b/_doc/0.22.0/rpc/avalanche/addavalanchenode.html new file mode 100644 index 0000000..7be3202 --- /dev/null +++ b/_doc/0.22.0/rpc/avalanche/addavalanchenode.html @@ -0,0 +1,23 @@ +--- +name: addavalanchenode +version: 0.22.0 +group: avalanche +permalink: doc/0.22.0/rpc/avalanche/addavalanchenode/ +--- + +addavalanchenode nodeid "publickey" "proof" + +Add a node in the set of peers to poll for avalanche. + +Arguments: +1. nodeid (numeric, required) Node to be added to avalanche. +2. publickey (string, required) The public key of the node. +3. proof (string, required) Proof that the node is not a sybil. + +Result: +"success" (boolean) Whether the addition succeeded or not. + +Examples: +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addavalanchenode", "params": [5, "", ""] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/avalanche/buildavalancheproof.html b/_doc/0.22.0/rpc/avalanche/buildavalancheproof.html new file mode 100644 index 0000000..73abf1a --- /dev/null +++ b/_doc/0.22.0/rpc/avalanche/buildavalancheproof.html @@ -0,0 +1,35 @@ +--- +name: buildavalancheproof +version: 0.22.0 +group: avalanche +permalink: doc/0.22.0/rpc/avalanche/buildavalancheproof/ +--- + +buildavalancheproof sequence expiration "master" [{"txid":"hex","vout":n,"amount":amount,"height":n,"iscoinbase":bool,"privatekey":"str"},...] + +Build a proof for avalanche's sybil resistance. + +Arguments: +1. sequence (numeric, required) The proof's sequence +2. expiration (numeric, required) A timestamp indicating when the proof expire +3. master (string, required) The master public key +4. stakes (json array, required) The stakes to be signed and associated private keys + [ + { (json object, required) A stake to be attached to this proof + "txid": "hex", (string, required) The transaction id + "vout": n, (numeric, required) The output number + "amount": amount, (numeric or string, required) The amount in this UTXO + "height": n, (numeric, required) The height at which this UTXO was mined + "iscoinbase": bool, (boolean, optional, default=false) Indicate wether the UTXO is a coinbase + "privatekey": "str", (string, required) private key in base58-encoding + }, + ... + ] + +Result: +"proof" (string) A string that is a serialized, hex-encoded proof data. + +Examples: +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "buildavalancheproof", "params": [0 1234567800 "" []] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/avalanche/getavalanchekey.html b/_doc/0.22.0/rpc/avalanche/getavalanchekey.html new file mode 100644 index 0000000..34be9d6 --- /dev/null +++ b/_doc/0.22.0/rpc/avalanche/getavalanchekey.html @@ -0,0 +1,15 @@ +--- +name: getavalanchekey +version: 0.22.0 +group: avalanche +permalink: doc/0.22.0/rpc/avalanche/getavalanchekey/ +--- + +getavalanchekey + +Returns the key used to sign avalanche messages. + +Examples: +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getavalanchekey", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/blockchain/getbestblockhash.html b/_doc/0.22.0/rpc/blockchain/getbestblockhash.html new file mode 100644 index 0000000..6f1c7ec --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getbestblockhash.html @@ -0,0 +1,19 @@ +--- +name: getbestblockhash +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getbestblockhash/ +--- + +getbestblockhash + +Returns the hash of the best (tip) block in the longest blockchain. + +Result: +"hex" (string) the block hash, hex-encoded + +Examples: +> bitcoin-cli getbestblockhash +> 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/_doc/0.22.0/rpc/blockchain/getblock.html b/_doc/0.22.0/rpc/blockchain/getblock.html new file mode 100644 index 0000000..dd8a7df --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblock.html @@ -0,0 +1,58 @@ +--- +name: getblock +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblock/ +--- + +getblock "blockhash" ( verbosity ) + +If verbosity is 0 or false, returns a string that is serialized, hex-encoded data for block 'hash'. +If verbosity is 1 or true, returns an Object with information about block . +If verbosity is 2, returns an Object with information about block and information about each transaction. + +Arguments: +1. blockhash (string, required) The block hash +2. verbosity (numeric, optional, default=1) 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data + +Result (for verbosity = 0): +"data" (string) 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 + "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 + ,... + ], + "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 +} + +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 +} + +Examples: +> bitcoin-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" +> 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/_doc/0.22.0/rpc/blockchain/getblockchaininfo.html b/_doc/0.22.0/rpc/blockchain/getblockchaininfo.html new file mode 100644 index 0000000..0fa9cff --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblockchaininfo.html @@ -0,0 +1,55 @@ +--- +name: getblockchaininfo +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblockchaininfo/ +--- + +getblockchaininfo + +Returns an object containing various state info regarding blockchain processing. + +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": { (object) status of softforks in progress + "xxxx" : { (string) name of the softfork + "type" : "bip9", (string) currently only set to "bip9" + "bip9" : { (object) status of bip9 softforks (only for "bip9" type) + "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 + }, + "active": xx, (boolean) true if the rules are enforced for the mempool and the next block + } + } + } + "warnings" : "...", (string) any network and blockchain warnings. +} + +Examples: +> bitcoin-cli getblockchaininfo +> 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/_doc/0.22.0/rpc/blockchain/getblockcount.html b/_doc/0.22.0/rpc/blockchain/getblockcount.html new file mode 100644 index 0000000..31efa47 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblockcount.html @@ -0,0 +1,19 @@ +--- +name: getblockcount +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblockcount/ +--- + +getblockcount + +Returns the number of blocks in the longest blockchain. + +Result: +n (numeric) The current block count + +Examples: +> bitcoin-cli getblockcount +> 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/_doc/0.22.0/rpc/blockchain/getblockfilter.html b/_doc/0.22.0/rpc/blockchain/getblockfilter.html new file mode 100644 index 0000000..762190c --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblockfilter.html @@ -0,0 +1,25 @@ +--- +name: getblockfilter +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblockfilter/ +--- + +getblockfilter "blockhash" ( "filtertype" ) + +Retrieve a BIP 157 content filter for a particular block. + +Arguments: +1. blockhash (string, required) The hash of the block +2. filtertype (string, optional, default=basic) The type name of the filter + +Result: +{ + "filter" : (string) the hex-encoded filter data + "header" : (string) the hex-encoded filter header +} + +Examples: +> bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic" + + diff --git a/_doc/0.22.0/rpc/blockchain/getblockhash.html b/_doc/0.22.0/rpc/blockchain/getblockhash.html new file mode 100644 index 0000000..0cfc04b --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblockhash.html @@ -0,0 +1,22 @@ +--- +name: getblockhash +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblockhash/ +--- + +getblockhash height + +Returns hash of block in best-block-chain at height provided. + +Arguments: +1. height (numeric, required) The height index + +Result: +"hash" (string) The block hash + +Examples: +> bitcoin-cli getblockhash 1000 +> 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/_doc/0.22.0/rpc/blockchain/getblockheader.html b/_doc/0.22.0/rpc/blockchain/getblockheader.html new file mode 100644 index 0000000..b8a78bd --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblockheader.html @@ -0,0 +1,43 @@ +--- +name: getblockheader +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblockheader/ +--- + +getblockheader "blockhash" ( verbose ) + +If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. +If verbose is true, returns an Object with information about blockheader . + +Arguments: +1. blockhash (string, required) The block hash +2. verbose (boolean, optional, default=true) true for a json object, false for the hex-encoded data + +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 +} + +Result (for verbose=false): +"data" (string) A string that is serialized, hex-encoded data for block 'hash'. + +Examples: +> bitcoin-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" +> 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/_doc/0.22.0/rpc/blockchain/getblockstats.html b/_doc/0.22.0/rpc/blockchain/getblockstats.html new file mode 100644 index 0000000..01a2bc2 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getblockstats.html @@ -0,0 +1,55 @@ +--- +name: getblockstats +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getblockstats/ +--- + +getblockstats hash_or_height ( stats ) + +Compute per block statistics for a given window. All amounts are in BCH. +It won't work for some heights with pruning. + +Arguments: +1. hash_or_height (string or numeric, required) The block hash or height of the target block +2. stats (json array, optional, default=all values) Values to plot (see result below) + [ + "height", (string) Selected statistic + "time", (string) Selected statistic + ... + ] + +Result: +{ (json object) + "avgfee": x.xxx, (numeric) Average fee in the block + "avgfeerate": x.xxx, (numeric) Average feerate (in BCH per byte) + "avgtxsize": xxxxx, (numeric) Average transaction size + "blockhash": xxxxx, (string) The block hash (to check for potential reorgs) + "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 BCH per byte) + "maxtxsize": xxxxx, (numeric) Maximum transaction size + "medianfee": x.xxx, (numeric) Truncated median fee in the block + "medianfeerate": x.xxx, (numeric) Truncated median feerate (in BCH per byte) + "mediantime": xxxxx, (numeric) The block median time past + "mediantxsize": xxxxx, (numeric) Truncated median transaction size + "minfee": x.xxx, (numeric) Minimum fee in the block + "minfeerate": xx.xx, (numeric) Minimum feerate (in BCH per byte) + "mintxsize": xxxxx, (numeric) Minimum transaction size + "outs": xxxxx, (numeric) The number of outputs + "subsidy": x.xxx, (numeric) The block subsidy + "time": xxxxx, (numeric) The block time + "total_out": x.xxx, (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 + "totalfee": x.xxx, (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) +} + +Examples: +> 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/ + + diff --git a/_doc/0.22.0/rpc/blockchain/getchaintips.html b/_doc/0.22.0/rpc/blockchain/getchaintips.html new file mode 100644 index 0000000..38b8955 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getchaintips.html @@ -0,0 +1,39 @@ +--- +name: getchaintips +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getchaintips/ +--- + +getchaintips + +Return information about all known tips in the block tree, including the main chain as well as orphaned branches. + +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 + }, + { + "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) + } +] +Possible values for status: +1. "invalid" This branch contains at least one invalid block +2. "parked" This branch contains at least one parked block +3. "headers-only" Not all blocks for this branch are available, but the headers are valid +4. "valid-headers" All blocks are available for this branch, but they were never fully validated +5. "valid-fork" This branch is not part of the active chain, but is fully validated +6. "active" This is the tip of the active main chain, which is certainly valid + +Examples: +> bitcoin-cli getchaintips +> 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/_doc/0.22.0/rpc/blockchain/getchaintxstats.html b/_doc/0.22.0/rpc/blockchain/getchaintxstats.html new file mode 100644 index 0000000..df4ab44 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getchaintxstats.html @@ -0,0 +1,31 @@ +--- +name: getchaintxstats +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getchaintxstats/ +--- + +getchaintxstats ( nblocks "blockhash" ) + +Compute statistics about the total number and rate of transactions in the chain. + +Arguments: +1. nblocks (numeric, optional, default=one month) Size of the window in number of blocks +2. blockhash (string, optional, default=chain tip) The hash of the block that ends the window. + +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. +} + +Examples: +> bitcoin-cli getchaintxstats +> 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/_doc/0.22.0/rpc/blockchain/getdifficulty.html b/_doc/0.22.0/rpc/blockchain/getdifficulty.html new file mode 100644 index 0000000..b23ce17 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getdifficulty.html @@ -0,0 +1,19 @@ +--- +name: getdifficulty +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getdifficulty/ +--- + +getdifficulty + +Returns the proof-of-work difficulty as a multiple of the minimum difficulty. + +Result: +n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty. + +Examples: +> bitcoin-cli getdifficulty +> 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/_doc/0.22.0/rpc/blockchain/getmempoolancestors.html b/_doc/0.22.0/rpc/blockchain/getmempoolancestors.html new file mode 100644 index 0000000..72a81d5 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getmempoolancestors.html @@ -0,0 +1,55 @@ +--- +name: getmempoolancestors +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getmempoolancestors/ +--- + +getmempoolancestors "txid" ( verbose ) + +If txid is in the mempool, returns all in-mempool ancestors. + +Arguments: +1. txid (string, required) The transaction id (must be in mempool) +2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids + +Result (for verbose = false): +[ (json array of strings) + "transactionid" (string) The transaction id of an in-mempool ancestor transaction + ,... +] + +Result (for verbose = true): +{ (json object) + "transactionid" : { (json object) + "size" : n, (numeric) transaction size. + "fee" : n, (numeric) transaction fee in BCH(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) 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) transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "fees" : { + "base" : n, (numeric) transaction fee in BCH + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BCH + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BCH + "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BCH + } + "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 + ... ] + }, ... +} + +Examples: +> bitcoin-cli getmempoolancestors "mytxid" +> 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/_doc/0.22.0/rpc/blockchain/getmempooldescendants.html b/_doc/0.22.0/rpc/blockchain/getmempooldescendants.html new file mode 100644 index 0000000..e9877e1 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getmempooldescendants.html @@ -0,0 +1,55 @@ +--- +name: getmempooldescendants +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getmempooldescendants/ +--- + +getmempooldescendants "txid" ( verbose ) + +If txid is in the mempool, returns all in-mempool descendants. + +Arguments: +1. txid (string, required) The transaction id (must be in mempool) +2. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids + +Result (for verbose = false): +[ (json array of strings) + "transactionid" (string) The transaction id of an in-mempool descendant transaction + ,... +] + +Result (for verbose = true): +{ (json object) + "transactionid" : { (json object) + "size" : n, (numeric) transaction size. + "fee" : n, (numeric) transaction fee in BCH(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) 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) transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "fees" : { + "base" : n, (numeric) transaction fee in BCH + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BCH + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BCH + "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BCH + } + "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 + ... ] + }, ... +} + +Examples: +> bitcoin-cli getmempooldescendants "mytxid" +> 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/_doc/0.22.0/rpc/blockchain/getmempoolentry.html b/_doc/0.22.0/rpc/blockchain/getmempoolentry.html new file mode 100644 index 0000000..463b3d1 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getmempoolentry.html @@ -0,0 +1,46 @@ +--- +name: getmempoolentry +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getmempoolentry/ +--- + +getmempoolentry "txid" + +Returns mempool data for given transaction + +Arguments: +1. txid (string, required) The transaction id (must be in mempool) + +Result: +{ (json object) + "size" : n, (numeric) transaction size. + "fee" : n, (numeric) transaction fee in BCH(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) 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) transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "fees" : { + "base" : n, (numeric) transaction fee in BCH + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BCH + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BCH + "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BCH + } + "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 + ... ] +} + +Examples: +> bitcoin-cli getmempoolentry "mytxid" +> 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/_doc/0.22.0/rpc/blockchain/getmempoolinfo.html b/_doc/0.22.0/rpc/blockchain/getmempoolinfo.html new file mode 100644 index 0000000..a3b436e --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getmempoolinfo.html @@ -0,0 +1,27 @@ +--- +name: getmempoolinfo +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getmempoolinfo/ +--- + +getmempoolinfo + +Returns details on the active state of the TX memory pool. + +Result: +{ + "loaded": true|false (boolean) True if the mempool is fully loaded + "size": xxxxx, (numeric) Current tx count + "bytes": xxxxx, (numeric) Transaction size. + "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 BCH/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee + "minrelaytxfee": xxxxx (numeric) Current minimum relay fee for transactions +} + +Examples: +> bitcoin-cli getmempoolinfo +> 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/_doc/0.22.0/rpc/blockchain/getrawmempool.html b/_doc/0.22.0/rpc/blockchain/getrawmempool.html new file mode 100644 index 0000000..60cccdc --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/getrawmempool.html @@ -0,0 +1,56 @@ +--- +name: getrawmempool +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/getrawmempool/ +--- + +getrawmempool ( verbose ) + +Returns all transaction ids in memory pool as a json array of string transaction ids. + +Hint: use getmempoolentry to fetch a specific transaction from the mempool. + +Arguments: +1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids + +Result (for verbose = false): +[ (json array of string) + "transactionid" (string) The transaction id + ,... +] + +Result: (for verbose = true): +{ (json object) + "transactionid" : { (json object) + "size" : n, (numeric) transaction size. + "fee" : n, (numeric) transaction fee in BCH(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) 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) transaction size of in-mempool ancestors (including this one) + "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) + "fees" : { + "base" : n, (numeric) transaction fee in BCH + "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BCH + "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BCH + "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BCH + } + "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 + ... ] + }, ... +} + +Examples: +> bitcoin-cli getrawmempool true +> 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/_doc/0.22.0/rpc/blockchain/gettxout.html b/_doc/0.22.0/rpc/blockchain/gettxout.html new file mode 100644 index 0000000..fc44d67 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/gettxout.html @@ -0,0 +1,46 @@ +--- +name: gettxout +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/gettxout/ +--- + +gettxout "txid" n ( include_mempool ) + +Returns details about an unspent transaction output. + +Arguments: +1. txid (string, required) The transaction id +2. n (numeric, required) vout number +3. include_mempool (boolean, optional, default=true) Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear. + +Result: +{ + "bestblock" : "hash", (string) the block hash + "confirmations" : n, (numeric) The number of confirmations + "value" : x.xxx, (numeric) The transaction value in BCH + "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 + ,... + ] + }, + "coinbase" : true|false (boolean) Coinbase or not +} + +Examples: + +Get unspent transactions +> bitcoin-cli listunspent + +View the details +> bitcoin-cli gettxout "txid" 1 + +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/ + + diff --git a/_doc/0.22.0/rpc/blockchain/gettxoutproof.html b/_doc/0.22.0/rpc/blockchain/gettxoutproof.html new file mode 100644 index 0000000..7ed84ba --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/gettxoutproof.html @@ -0,0 +1,28 @@ +--- +name: gettxoutproof +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/gettxoutproof/ +--- + +gettxoutproof ["txid",...] ( "blockhash" ) + +Returns a hex-encoded proof that "txid" was included in a block. + +NOTE: By default this function only works sometimes. This is when there is an +unspent output in the utxo for this transaction. To make it always work, +you need to maintain a transaction index, using the -txindex command line option or +specify the block in which the transaction is included manually (by blockhash). + +Arguments: +1. txids (json array, required) A json array of txids to filter + [ + "txid", (string) A transaction hash + ... + ] +2. blockhash (string, optional) If specified, looks for txid in the block with this hash + +Result: +"data" (string) A string that is a serialized, hex-encoded data for the proof. + + diff --git a/_doc/0.22.0/rpc/blockchain/gettxoutsetinfo.html b/_doc/0.22.0/rpc/blockchain/gettxoutsetinfo.html new file mode 100644 index 0000000..c2c4771 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/gettxoutsetinfo.html @@ -0,0 +1,29 @@ +--- +name: gettxoutsetinfo +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/gettxoutsetinfo/ +--- + +gettxoutsetinfo + +Returns statistics about the unspent transaction output set. +Note this call may take some time. + +Result: +{ + "height":n, (numeric) The current block height (index) + "bestblock": "hex", (string) the best block hash hex + "transactions": n, (numeric) The number of transactions + "txouts": n, (numeric) The number of output transactions + "bogosize": n, (numeric) A database-independent metric for UTXO set size + "hash_serialized": "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 +} + +Examples: +> bitcoin-cli gettxoutsetinfo +> 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/_doc/0.22.0/rpc/blockchain/preciousblock.html b/_doc/0.22.0/rpc/blockchain/preciousblock.html new file mode 100644 index 0000000..a704601 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/preciousblock.html @@ -0,0 +1,23 @@ +--- +name: preciousblock +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/preciousblock/ +--- + +preciousblock "blockhash" + +Treats a block as if it were received before others with the same work. + +A later preciousblock call can override the effect of an earlier one. + +The effects of preciousblock are not retained across restarts. + +Arguments: +1. blockhash (string, required) the hash of the block to mark as precious + +Examples: +> bitcoin-cli preciousblock "blockhash" +> 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/ + + diff --git a/_doc/0.22.0/rpc/blockchain/pruneblockchain.html b/_doc/0.22.0/rpc/blockchain/pruneblockchain.html new file mode 100644 index 0000000..f231192 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/pruneblockchain.html @@ -0,0 +1,22 @@ +--- +name: pruneblockchain +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/pruneblockchain/ +--- + +pruneblockchain height + + +Arguments: +1. height (numeric, required) 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. + +Result: +n (numeric) Height of the last block pruned. + +Examples: +> bitcoin-cli pruneblockchain 1000 +> 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/ + + diff --git a/_doc/0.22.0/rpc/blockchain/savemempool.html b/_doc/0.22.0/rpc/blockchain/savemempool.html new file mode 100644 index 0000000..034b9a4 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/savemempool.html @@ -0,0 +1,16 @@ +--- +name: savemempool +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/savemempool/ +--- + +savemempool + +Dumps the mempool to disk. It will fail until the previous dump is fully loaded. + +Examples: +> bitcoin-cli savemempool +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "savemempool", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/blockchain/scantxoutset.html b/_doc/0.22.0/rpc/blockchain/scantxoutset.html new file mode 100644 index 0000000..0caf790 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/scantxoutset.html @@ -0,0 +1,57 @@ +--- +name: scantxoutset +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/scantxoutset/ +--- + +scantxoutset "action" [scanobjects,...] + +EXPERIMENTAL warning: this call may be removed or changed in future releases. + +Scans the unspent transaction output set for entries that match certain output descriptors. +Examples of output descriptors are: + addr(
) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK) + raw() Outputs whose scriptPubKey equals the specified hex scripts + combo() P2PK and P2PKH outputs for the given pubkey + pkh() P2PKH outputs for the given pubkey + sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys + +In the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one +or more path elements separated by "/", and optionally ending in "/*" (unhardened), or "/*'" or "/*h" (hardened) to specify all +unhardened or hardened child keys. +In the latter case, a range needs to be specified by below if different from 1000. +For more information on output descriptors, see the documentation in the doc/descriptors.md file. + +Arguments: +1. action (string, required) The action to execute + "start" for starting a scan + "abort" for aborting the current scan (returns true when abort was successful) + "status" for progress report (in %) of the current scan +2. scanobjects (json array, required) Array of scan objects + Every scan object is either a string descriptor or an object: + [ + "descriptor", (string) An output descriptor + { (json object) An object with output descriptor and metadata + "desc": "str", (string, required) An output descriptor + "range": n or [n,n], (numeric or array, optional, default=1000) The range of HD chain indexes to explore (either end or [begin,end]) + }, + ... + ] + +Result: +{ + "unspents": [ + { + "txid" : "transactionid", (string) The transaction id + "vout": n, (numeric) the vout value + "scriptPubKey" : "script", (string) the script key + "desc" : "descriptor", (string) A specialized descriptor for the matched scriptPubKey + "amount" : x.xxx, (numeric) The total amount in BCH of the unspent output + "height" : n, (numeric) Height of the unspent transaction output + } + ,...], + "total_amount" : x.xxx, (numeric) The total amount of all found unspent outputs in BCH +] + + diff --git a/_doc/0.22.0/rpc/blockchain/verifychain.html b/_doc/0.22.0/rpc/blockchain/verifychain.html new file mode 100644 index 0000000..5ad8562 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/verifychain.html @@ -0,0 +1,23 @@ +--- +name: verifychain +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/verifychain/ +--- + +verifychain ( checklevel nblocks ) + +Verifies blockchain database. + +Arguments: +1. checklevel (numeric, optional, default=3, range=0-4) How thorough the block verification is. +2. nblocks (numeric, optional, default=6, 0=all) The number of blocks to check. + +Result: +true|false (boolean) Verified or not + +Examples: +> bitcoin-cli verifychain +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifychain", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/blockchain/verifytxoutproof.html b/_doc/0.22.0/rpc/blockchain/verifytxoutproof.html new file mode 100644 index 0000000..ac5ab69 --- /dev/null +++ b/_doc/0.22.0/rpc/blockchain/verifytxoutproof.html @@ -0,0 +1,19 @@ +--- +name: verifytxoutproof +version: 0.22.0 +group: blockchain +permalink: doc/0.22.0/rpc/blockchain/verifytxoutproof/ +--- + +verifytxoutproof "proof" + +Verifies that a proof points to a transaction in a block, returning the transaction it commits to +and throwing an RPC error if the block is not in our best chain + +Arguments: +1. proof (string, required) The hex-encoded proof generated by gettxoutproof + +Result: +["txid"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof can not be validated. + + diff --git a/_doc/0.22.0/rpc/control/getmemoryinfo.html b/_doc/0.22.0/rpc/control/getmemoryinfo.html new file mode 100644 index 0000000..3bf79e6 --- /dev/null +++ b/_doc/0.22.0/rpc/control/getmemoryinfo.html @@ -0,0 +1,36 @@ +--- +name: getmemoryinfo +version: 0.22.0 +group: control +permalink: doc/0.22.0/rpc/control/getmemoryinfo/ +--- + +getmemoryinfo ( "mode" ) + +Returns an object containing information about memory usage. + +Arguments: +1. mode (string, optional, default="stats") determines what kind of information is returned. + - "stats" returns general statistics about memory usage in the daemon. + - "mallocinfo" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+). + +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 + } +} + +Result (mode "mallocinfo"): +"..." + +Examples: +> bitcoin-cli getmemoryinfo +> 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/_doc/0.22.0/rpc/control/getrpcinfo.html b/_doc/0.22.0/rpc/control/getrpcinfo.html new file mode 100644 index 0000000..1457441 --- /dev/null +++ b/_doc/0.22.0/rpc/control/getrpcinfo.html @@ -0,0 +1,12 @@ +--- +name: getrpcinfo +version: 0.22.0 +group: control +permalink: doc/0.22.0/rpc/control/getrpcinfo/ +--- + +getrpcinfo + +Returns details of the RPC server. + + diff --git a/_doc/0.22.0/rpc/control/help.html b/_doc/0.22.0/rpc/control/help.html new file mode 100644 index 0000000..aaff7d7 --- /dev/null +++ b/_doc/0.22.0/rpc/control/help.html @@ -0,0 +1,18 @@ +--- +name: help +version: 0.22.0 +group: control +permalink: doc/0.22.0/rpc/control/help/ +--- + +help ( "command" ) + +List all commands, or get help for a specified command. + +Arguments: +1. command (string, optional, default=all commands) The command to get help on + +Result: +"text" (string) The help text + + diff --git a/_doc/0.22.0/rpc/control/logging.html b/_doc/0.22.0/rpc/control/logging.html new file mode 100644 index 0000000..bfc7aea --- /dev/null +++ b/_doc/0.22.0/rpc/control/logging.html @@ -0,0 +1,42 @@ +--- +name: logging +version: 0.22.0 +group: control +permalink: doc/0.22.0/rpc/control/logging/ +--- + +logging ( ["include_category",...] ["exclude_category",...] ) + +Gets and sets the logging configuration. +When called without an argument, returns the list of categories with status that are currently being debug logged or not. +When called with arguments, adds or removes categories from debug logging and return the lists above. +The arguments are evaluated in order "include", "exclude". +If an item is both included and excluded, it will thus end up being excluded. +The valid logging categories are: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation +In addition, the following are available as category names with special meanings: + - "all", "1" : represent all logging categories. + - "none", "0" : even if other logging categories are specified, ignore all of them. + +Arguments: +1. include (json array, optional) A json array of categories to add debug logging + [ + "include_category", (string) the valid logging category + ... + ] +2. exclude (json array, optional) A json array of categories to remove debug logging + [ + "exclude_category", (string) the valid logging category + ... + ] + +Result: +{ (json object where keys are the logging categories, and values indicates its status + "category": 0|1, (numeric) if being debug logged or not. 0:inactive, 1:active + ... +} + +Examples: +> bitcoin-cli logging "[\"all\"]" "[\"http\"]" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "logging", "params": [["all"], "[libevent]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/control/stop.html b/_doc/0.22.0/rpc/control/stop.html new file mode 100644 index 0000000..9993fc6 --- /dev/null +++ b/_doc/0.22.0/rpc/control/stop.html @@ -0,0 +1,11 @@ +--- +name: stop +version: 0.22.0 +group: control +permalink: doc/0.22.0/rpc/control/stop/ +--- + +stop + +Stop Bitcoin server. + diff --git a/_doc/0.22.0/rpc/control/uptime.html b/_doc/0.22.0/rpc/control/uptime.html new file mode 100644 index 0000000..c143fa5 --- /dev/null +++ b/_doc/0.22.0/rpc/control/uptime.html @@ -0,0 +1,19 @@ +--- +name: uptime +version: 0.22.0 +group: control +permalink: doc/0.22.0/rpc/control/uptime/ +--- + +uptime + +Returns the total uptime of the server. + +Result: +ttt (numeric) The number of seconds that the server has been running + +Examples: +> bitcoin-cli uptime +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "uptime", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/generating/generatetoaddress.html b/_doc/0.22.0/rpc/generating/generatetoaddress.html new file mode 100644 index 0000000..f4e0c70 --- /dev/null +++ b/_doc/0.22.0/rpc/generating/generatetoaddress.html @@ -0,0 +1,27 @@ +--- +name: generatetoaddress +version: 0.22.0 +group: generating +permalink: doc/0.22.0/rpc/generating/generatetoaddress/ +--- + +generatetoaddress nblocks "address" ( maxtries ) + +Mine blocks immediately to a specified address before the RPC call returns) + +Arguments: +1. nblocks (numeric, required) How many blocks are generated immediately. +2. address (string, required) The address to send the newly generated bitcoin to. +3. maxtries (numeric, optional, default=1000000) How many iterations to try. + +Result: +[ blockhashes ] (array) hashes of blocks generated + +Examples: + +Generate 11 blocks to myaddress +> bitcoin-cli generatetoaddress 11 "myaddress" +If you are running the Bitcoin ABC wallet, you can get a new address to send the newly generated bitcoin to with: +> bitcoin-cli getnewaddress + + diff --git a/_doc/0.22.0/rpc/mining/getblocktemplate.html b/_doc/0.22.0/rpc/mining/getblocktemplate.html new file mode 100644 index 0000000..eb651ba --- /dev/null +++ b/_doc/0.22.0/rpc/mining/getblocktemplate.html @@ -0,0 +1,68 @@ +--- +name: getblocktemplate +version: 0.22.0 +group: mining +permalink: doc/0.22.0/rpc/mining/getblocktemplate/ +--- + +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'. +It returns data needed to construct a block to work on. +For full specification, see BIPs 22, 23, 9, and 145: + https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki + https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki + https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes + +Arguments: +1. template_request (json object, optional, default={}) 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' + ... + ], + } + +Result: +{ + "version" : n, (numeric) The preferred block version + "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 + "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 count, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume it is zero + } + ,... + ], + "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 + }, + "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' + ,... + ], + "noncerange" : "00000000ffffffff",(string) A range of valid nonces + "sigoplimit" : n, (numeric) limit of sigops in blocks + "sizelimit" : n, (numeric) limit of block size + "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 +} + +Examples: +> bitcoin-cli getblocktemplate +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocktemplate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/mining/getmininginfo.html b/_doc/0.22.0/rpc/mining/getmininginfo.html new file mode 100644 index 0000000..2a23917 --- /dev/null +++ b/_doc/0.22.0/rpc/mining/getmininginfo.html @@ -0,0 +1,27 @@ +--- +name: getmininginfo +version: 0.22.0 +group: mining +permalink: doc/0.22.0/rpc/mining/getmininginfo/ +--- + +getmininginfo + +Returns a json object containing mining-related information. +Result: +{ + "blocks": nnn, (numeric) The current block + "currentblocksize": nnn, (numeric, optional) The block size 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 +} + +Examples: +> bitcoin-cli getmininginfo +> 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/_doc/0.22.0/rpc/mining/getnetworkhashps.html b/_doc/0.22.0/rpc/mining/getnetworkhashps.html new file mode 100644 index 0000000..b96e01e --- /dev/null +++ b/_doc/0.22.0/rpc/mining/getnetworkhashps.html @@ -0,0 +1,25 @@ +--- +name: getnetworkhashps +version: 0.22.0 +group: mining +permalink: doc/0.22.0/rpc/mining/getnetworkhashps/ +--- + +getnetworkhashps ( nblocks height ) + +Returns the estimated network hashes per second based on the last n blocks. +Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. +Pass in [height] to estimate the network speed at the time when a certain block was found. + +Arguments: +1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change. +2. height (numeric, optional, default=-1) To estimate at the time of the given height. + +Result: +x (numeric) Hashes per second estimated + +Examples: +> bitcoin-cli getnetworkhashps +> 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/_doc/0.22.0/rpc/mining/prioritisetransaction.html b/_doc/0.22.0/rpc/mining/prioritisetransaction.html new file mode 100644 index 0000000..6b56474 --- /dev/null +++ b/_doc/0.22.0/rpc/mining/prioritisetransaction.html @@ -0,0 +1,27 @@ +--- +name: prioritisetransaction +version: 0.22.0 +group: mining +permalink: doc/0.22.0/rpc/mining/prioritisetransaction/ +--- + +prioritisetransaction "txid" ( dummy ) fee_delta + +Accepts the transaction into mined blocks at a higher (or lower) priority + +Arguments: +1. txid (string, required) The transaction id. +2. dummy (numeric, optional) API-Compatibility for previous API. Must be zero or null. + DEPRECATED. For forward compatibility use named arguments and omit this parameter. +3. fee_delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative). + The fee is not actually paid, only the algorithm for selecting transactions into a block + considers the transaction as it would have paid a higher (or lower) fee. + +Result: +true (boolean) Returns true + +Examples: +> bitcoin-cli prioritisetransaction "txid" 0.0 10000 +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "prioritisetransaction", "params": ["txid", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/mining/submitblock.html b/_doc/0.22.0/rpc/mining/submitblock.html new file mode 100644 index 0000000..86a5081 --- /dev/null +++ b/_doc/0.22.0/rpc/mining/submitblock.html @@ -0,0 +1,21 @@ +--- +name: submitblock +version: 0.22.0 +group: mining +permalink: doc/0.22.0/rpc/mining/submitblock/ +--- + +submitblock "hexdata" ( "dummy" ) + +Attempts to submit new block to network. +See https://en.bitcoin.it/wiki/BIP_0022 for full specification. + +Arguments: +1. hexdata (string, required) the hex-encoded block data to submit +2. dummy (string, optional, default=ignored) dummy value, for compatibility with BIP22. This value is ignored. + +Examples: +> bitcoin-cli submitblock "mydata" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "submitblock", "params": ["mydata"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/mining/submitheader.html b/_doc/0.22.0/rpc/mining/submitheader.html new file mode 100644 index 0000000..687758d --- /dev/null +++ b/_doc/0.22.0/rpc/mining/submitheader.html @@ -0,0 +1,22 @@ +--- +name: submitheader +version: 0.22.0 +group: mining +permalink: doc/0.22.0/rpc/mining/submitheader/ +--- + +submitheader "hexdata" + +Decode the given hexdata as a header and submit it as a candidate chain tip if valid. +Throws when the header is invalid. + +Arguments: +1. hexdata (string, required) the hex-encoded block header data + +Result: +None +Examples: +> bitcoin-cli submitheader "aabbcc" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "submitheader", "params": ["aabbcc"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/network/addnode.html b/_doc/0.22.0/rpc/network/addnode.html new file mode 100644 index 0000000..c1cca7a --- /dev/null +++ b/_doc/0.22.0/rpc/network/addnode.html @@ -0,0 +1,23 @@ +--- +name: addnode +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/addnode/ +--- + +addnode "node" "command" + +Attempts to add or remove a node from the addnode list. +Or try a connection to a node once. +Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be +full nodes as other outbound peers are (though such peers will not be synced from). + +Arguments: +1. node (string, required) The node (see getpeerinfo for nodes) +2. command (string, required) '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 + +Examples: +> bitcoin-cli addnode "192.168.0.6:8333" "onetry" +> 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/_doc/0.22.0/rpc/network/clearbanned.html b/_doc/0.22.0/rpc/network/clearbanned.html new file mode 100644 index 0000000..36acc0c --- /dev/null +++ b/_doc/0.22.0/rpc/network/clearbanned.html @@ -0,0 +1,16 @@ +--- +name: clearbanned +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/clearbanned/ +--- + +clearbanned + +Clear all banned IPs. + +Examples: +> bitcoin-cli clearbanned +> 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/_doc/0.22.0/rpc/network/disconnectnode.html b/_doc/0.22.0/rpc/network/disconnectnode.html new file mode 100644 index 0000000..81ee0fb --- /dev/null +++ b/_doc/0.22.0/rpc/network/disconnectnode.html @@ -0,0 +1,26 @@ +--- +name: disconnectnode +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/disconnectnode/ +--- + +disconnectnode ( "address" nodeid ) + +Immediately disconnects from the specified peer node. + +Strictly one out of 'address' and 'nodeid' can be provided to identify the node. + +To disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only. + +Arguments: +1. address (string, optional, default=fallback to nodeid) The IP address/port of the node +2. nodeid (numeric, optional, default=fallback to address) The node ID (see getpeerinfo for node IDs) + +Examples: +> bitcoin-cli disconnectnode "192.168.0.6:8333" +> bitcoin-cli disconnectnode "" 1 +> 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/ + + diff --git a/_doc/0.22.0/rpc/network/getaddednodeinfo.html b/_doc/0.22.0/rpc/network/getaddednodeinfo.html new file mode 100644 index 0000000..d74b43f --- /dev/null +++ b/_doc/0.22.0/rpc/network/getaddednodeinfo.html @@ -0,0 +1,35 @@ +--- +name: getaddednodeinfo +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getaddednodeinfo/ +--- + +getaddednodeinfo ( "node" ) + +Returns information about the given added node, or all added nodes +(note that onetry addnodes are not listed here) + +Arguments: +1. node (string, optional, default=all nodes) If provided, return information about this specific node, otherwise all nodes are returned. + +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 + } + ] + } + ,... +] + +Examples: +> bitcoin-cli getaddednodeinfo "192.168.0.201" +> 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/_doc/0.22.0/rpc/network/getconnectioncount.html b/_doc/0.22.0/rpc/network/getconnectioncount.html new file mode 100644 index 0000000..e345687 --- /dev/null +++ b/_doc/0.22.0/rpc/network/getconnectioncount.html @@ -0,0 +1,19 @@ +--- +name: getconnectioncount +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getconnectioncount/ +--- + +getconnectioncount + +Returns the number of connections to other nodes. + +Result: +n (numeric) The connection count + +Examples: +> bitcoin-cli getconnectioncount +> 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/_doc/0.22.0/rpc/network/getexcessiveblock.html b/_doc/0.22.0/rpc/network/getexcessiveblock.html new file mode 100644 index 0000000..4dc6688 --- /dev/null +++ b/_doc/0.22.0/rpc/network/getexcessiveblock.html @@ -0,0 +1,18 @@ +--- +name: getexcessiveblock +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getexcessiveblock/ +--- + +getexcessiveblock + +Return the excessive block size. +Result: + excessiveBlockSize (integer) block size in bytes + +Examples: +> bitcoin-cli getexcessiveblock +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getexcessiveblock", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/network/getnettotals.html b/_doc/0.22.0/rpc/network/getnettotals.html new file mode 100644 index 0000000..d182a1e --- /dev/null +++ b/_doc/0.22.0/rpc/network/getnettotals.html @@ -0,0 +1,33 @@ +--- +name: getnettotals +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getnettotals/ +--- + +getnettotals + +Returns information about network traffic, including bytes in, bytes out, +and current time. + +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 + } +} + +Examples: +> bitcoin-cli getnettotals +> 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/_doc/0.22.0/rpc/network/getnetworkinfo.html b/_doc/0.22.0/rpc/network/getnetworkinfo.html new file mode 100644 index 0000000..565ef6a --- /dev/null +++ b/_doc/0.22.0/rpc/network/getnetworkinfo.html @@ -0,0 +1,49 @@ +--- +name: getnetworkinfo +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getnetworkinfo/ +--- + +getnetworkinfo + +Returns an object containing various state info regarding P2P networking. + +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 + } + ,... + ], + "relayfee": x.xxxxxxxx, (numeric) minimum relay fee for transactions in BCH/kB + "excessutxocharge": x.xxxxxxxx, (numeric) minimum charge for excess utxos in BCH + "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 +} + +Examples: +> bitcoin-cli getnetworkinfo +> 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/_doc/0.22.0/rpc/network/getnodeaddresses.html b/_doc/0.22.0/rpc/network/getnodeaddresses.html new file mode 100644 index 0000000..0416927 --- /dev/null +++ b/_doc/0.22.0/rpc/network/getnodeaddresses.html @@ -0,0 +1,30 @@ +--- +name: getnodeaddresses +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getnodeaddresses/ +--- + +getnodeaddresses ( count ) + +Return known addresses which can potentially be used to find new nodes in the network + +Arguments: +1. count (numeric, optional, default=1) How many addresses to return. Limited to the smaller of 2500 or 23% of 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 + } + ,.... +] + +Examples: +> bitcoin-cli getnodeaddresses 8 +> 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/_doc/0.22.0/rpc/network/getpeerinfo.html b/_doc/0.22.0/rpc/network/getpeerinfo.html new file mode 100644 index 0000000..84212f1 --- /dev/null +++ b/_doc/0.22.0/rpc/network/getpeerinfo.html @@ -0,0 +1,64 @@ +--- +name: getpeerinfo +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/getpeerinfo/ +--- + +getpeerinfo + +Returns data about each connected network node as a json array of objects. + +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 + ... + ], + "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. + ... + }, + "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*'. + ... + } + } + ,... +] + +Examples: +> bitcoin-cli getpeerinfo +> 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/_doc/0.22.0/rpc/network/listbanned.html b/_doc/0.22.0/rpc/network/listbanned.html new file mode 100644 index 0000000..c71b3bd --- /dev/null +++ b/_doc/0.22.0/rpc/network/listbanned.html @@ -0,0 +1,16 @@ +--- +name: listbanned +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/listbanned/ +--- + +listbanned + +List all manually banned IPs/Subnets. + +Examples: +> bitcoin-cli listbanned +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/network/ping.html b/_doc/0.22.0/rpc/network/ping.html new file mode 100644 index 0000000..9169390 --- /dev/null +++ b/_doc/0.22.0/rpc/network/ping.html @@ -0,0 +1,18 @@ +--- +name: ping +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/ping/ +--- + +ping + +Requests that a ping be sent to all other nodes, to measure ping time. +Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. +Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping. + +Examples: +> bitcoin-cli ping +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/network/setban.html b/_doc/0.22.0/rpc/network/setban.html new file mode 100644 index 0000000..2f6eda6 --- /dev/null +++ b/_doc/0.22.0/rpc/network/setban.html @@ -0,0 +1,23 @@ +--- +name: setban +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/setban/ +--- + +setban "subnet" "command" ( bantime absolute ) + +Attempts to add or remove an IP/Subnet from the banned list. + +Arguments: +1. subnet (string, required) The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP) +2. command (string, required) 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list +3. bantime (numeric, optional, default=0) time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument) +4. absolute (boolean, optional, default=false) If set, the bantime must be an absolute timestamp in seconds since epoch (Jan 1 1970 GMT) + +Examples: +> bitcoin-cli setban "192.168.0.6" "add" 86400 +> bitcoin-cli setban "192.168.0.0/24" "add" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["192.168.0.6", "add", 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/network/setexcessiveblock.html b/_doc/0.22.0/rpc/network/setexcessiveblock.html new file mode 100644 index 0000000..d33617e --- /dev/null +++ b/_doc/0.22.0/rpc/network/setexcessiveblock.html @@ -0,0 +1,21 @@ +--- +name: setexcessiveblock +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/setexcessiveblock/ +--- + +setexcessiveblock blockSize + +Set the excessive block size. Excessive blocks will not be used in the active chain or relayed. This discourages the propagation of blocks that you consider excessively large. +Arguments: +1. blockSize (numeric, required) Excessive block size in bytes. Must be greater than 1000000. + +Result: + blockSize (integer) excessive block size in bytes + +Examples: +> bitcoin-cli setexcessiveblock 25000000 +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setexcessiveblock", "params": [25000000] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/network/setnetworkactive.html b/_doc/0.22.0/rpc/network/setnetworkactive.html new file mode 100644 index 0000000..074cb41 --- /dev/null +++ b/_doc/0.22.0/rpc/network/setnetworkactive.html @@ -0,0 +1,15 @@ +--- +name: setnetworkactive +version: 0.22.0 +group: network +permalink: doc/0.22.0/rpc/network/setnetworkactive/ +--- + +setnetworkactive state + +Disable/enable all p2p network activity. + +Arguments: +1. state (boolean, required) true to enable networking, false to disable + + diff --git a/_doc/0.22.0/rpc/rawtransactions/analyzepsbt.html b/_doc/0.22.0/rpc/rawtransactions/analyzepsbt.html new file mode 100644 index 0000000..ddd5283 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/analyzepsbt.html @@ -0,0 +1,43 @@ +--- +name: analyzepsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/analyzepsbt/ +--- + +analyzepsbt "psbt" + +Analyzes and provides information about the current status of a PSBT and its inputs + +Arguments: +1. psbt (string, required) A base64 string of a PSBT + +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 + } + "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 BCH/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 +} + +Examples: +> bitcoin-cli analyzepsbt "psbt" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/combinepsbt.html b/_doc/0.22.0/rpc/rawtransactions/combinepsbt.html new file mode 100644 index 0000000..71c061d --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/combinepsbt.html @@ -0,0 +1,26 @@ +--- +name: combinepsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/combinepsbt/ +--- + +combinepsbt ["psbt",...] + +Combine multiple partially signed Bitcoin transactions into one transaction. +Implements the Combiner role. + +Arguments: +1. txs (json array, required) A json array of base64 strings of partially signed transactions + [ + "psbt", (string) A base64 string of a PSBT + ... + ] + +Result: + "psbt" (string) The base64-encoded partially signed transaction + +Examples: +> bitcoin-cli combinepsbt ["mybase64_1", "mybase64_2", "mybase64_3"] + + diff --git a/_doc/0.22.0/rpc/rawtransactions/combinerawtransaction.html b/_doc/0.22.0/rpc/rawtransactions/combinerawtransaction.html new file mode 100644 index 0000000..69e8d5f --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/combinerawtransaction.html @@ -0,0 +1,26 @@ +--- +name: combinerawtransaction +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/combinerawtransaction/ +--- + +combinerawtransaction ["hexstring",...] + +Combine multiple partially signed transactions into one transaction. +The combined transaction may be another partially signed transaction or a +fully signed transaction. +Arguments: +1. txs (json array, required) A json array of hex strings of partially signed transactions + [ + "hexstring", (string) A transaction hash + ... + ] + +Result: +"hex" (string) The hex-encoded raw transaction with signature(s) + +Examples: +> bitcoin-cli combinerawtransaction ["myhex1", "myhex2", "myhex3"] + + diff --git a/_doc/0.22.0/rpc/rawtransactions/converttopsbt.html b/_doc/0.22.0/rpc/rawtransactions/converttopsbt.html new file mode 100644 index 0000000..5b58fee --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/converttopsbt.html @@ -0,0 +1,29 @@ +--- +name: converttopsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/converttopsbt/ +--- + +converttopsbt "hexstring" ( permitsigdata ) + +Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction +createpsbt and walletcreatefundedpsbt should be used for new applications. + +Arguments: +1. hexstring (string, required) The hex string of a raw transaction +2. permitsigdata (boolean, optional, default=false) If true, any signatures in the input will be discarded and conversion. + will continue. If false, RPC will fail if any signatures are present. + +Result: + "psbt" (string) The resulting raw transaction (base64-encoded string) + +Examples: + +Create a transaction +> bitcoin-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]" + +Convert the transaction to a PSBT +> bitcoin-cli converttopsbt "rawtransaction" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/createpsbt.html b/_doc/0.22.0/rpc/rawtransactions/createpsbt.html new file mode 100644 index 0000000..11759be --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/createpsbt.html @@ -0,0 +1,43 @@ +--- +name: createpsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/createpsbt/ +--- + +createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) + +Creates a transaction in the Partially Signed Transaction format. +Implements the Creator role. + +Arguments: +1. inputs (json array, required) A json array of json objects + [ + { (json object) + "txid": "hex", (string, required) The transaction id + "vout": n, (numeric, required) The output number + "sequence": n, (numeric, optional, default=depends on the value of the 'locktime' argument) The sequence number + }, + ... + ] +2. outputs (json array, required) a json array with outputs (key-value pairs). + For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also + accepted as second parameter. + [ + { (json object) + "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BCH + }, + { (json object) + "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data + }, + ... + ] +3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs + +Result: + "psbt" (string) The resulting raw transaction (base64-encoded string) + +Examples: +> bitcoin-cli createpsbt "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/createrawtransaction.html b/_doc/0.22.0/rpc/rawtransactions/createrawtransaction.html new file mode 100644 index 0000000..2b35f97 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/createrawtransaction.html @@ -0,0 +1,49 @@ +--- +name: createrawtransaction +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/createrawtransaction/ +--- + +createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) + +Create a transaction spending the given inputs and creating new outputs. +Outputs can be addresses or data. +Returns hex-encoded raw transaction. +Note that the transaction's inputs are not signed, and +it is not stored in the wallet or transmitted to the network. + +Arguments: +1. inputs (json array, required) A json array of json objects + [ + { (json object) + "txid": "hex", (string, required) The transaction id + "vout": n, (numeric, required) The output number + "sequence": n, (numeric, optional, default=depends on the value of the 'locktime' argument) The sequence number + }, + ... + ] +2. outputs (json array, required) a json array with outputs (key-value pairs). + For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also + accepted as second parameter. + [ + { (json object) + "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BCH + }, + { (json object) + "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data + }, + ... + ] +3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs + +Result: +"transaction" (string) hex string of the transaction + +Examples: +> bitcoin-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"address\":0.01}]" +> bitcoin-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]" +> 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/ + + diff --git a/_doc/0.22.0/rpc/rawtransactions/decodepsbt.html b/_doc/0.22.0/rpc/rawtransactions/decodepsbt.html new file mode 100644 index 0000000..ea91fc4 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/decodepsbt.html @@ -0,0 +1,92 @@ +--- +name: decodepsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/decodepsbt/ +--- + +decodepsbt "psbt" + +Return a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction. + +Arguments: +1. psbt (string, required) The PSBT base64 string + +Result: +{ + "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 + ... + }, + "inputs" : [ (array of json objects) + { + "utxo" : { (json object, optional) Transaction output for UTXOs + "amount" : x.xxx, (numeric) The value in BCH + "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 + } + }, + "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' + } + "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 + } + "unknown" : { (json object) The unknown global fields + "key" : "value" (key-value pair) An unknown key-value pair + ... + }, + } + ,... + ] + "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' + } + "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 + } + } + ,... + ], + "unknown" : { (json object) The unknown global fields + "key" : "value" (key-value pair) An unknown key-value pair + ... + }, + } + ,... + ] + "fee" : fee (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled. +} + +Examples: +> bitcoin-cli decodepsbt "psbt" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/decoderawtransaction.html b/_doc/0.22.0/rpc/rawtransactions/decoderawtransaction.html new file mode 100644 index 0000000..f22bb06 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/decoderawtransaction.html @@ -0,0 +1,57 @@ +--- +name: decoderawtransaction +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/decoderawtransaction/ +--- + +decoderawtransaction "hexstring" + +Return a JSON object representing the serialized, hex-encoded transaction. + +Arguments: +1. hexstring (string, required) The transaction hex string + +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 + "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 + }, + "sequence": n (numeric) The script sequence number + } + ,... + ], + "vout" : [ (array of json objects) + { + "value" : x.xxx, (numeric) The value in BCH + "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 + ,... + ] + } + } + ,... + ], +} + +Examples: +> bitcoin-cli decoderawtransaction "hexstring" +> 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/_doc/0.22.0/rpc/rawtransactions/decodescript.html b/_doc/0.22.0/rpc/rawtransactions/decodescript.html new file mode 100644 index 0000000..5ee84b0 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/decodescript.html @@ -0,0 +1,32 @@ +--- +name: decodescript +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/decodescript/ +--- + +decodescript "hexstring" + +Decode a hex-encoded script. + +Arguments: +1. hexstring (string, required) the hex-encoded script + +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 + ,... + ], + "p2sh","address" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH). +} + +Examples: +> bitcoin-cli decodescript "hexstring" +> 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/_doc/0.22.0/rpc/rawtransactions/finalizepsbt.html b/_doc/0.22.0/rpc/rawtransactions/finalizepsbt.html new file mode 100644 index 0000000..c098909 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/finalizepsbt.html @@ -0,0 +1,31 @@ +--- +name: finalizepsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/finalizepsbt/ +--- + +finalizepsbt "psbt" ( extract ) + +Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a +network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be +created which has the final_scriptSigfields filled for inputs that are complete. +Implements the Finalizer and Extractor roles. + +Arguments: +1. psbt (string, required) A base64 string of a PSBT +2. extract (boolean, optional, default=true) If true and the transaction is complete, + extract and return the complete transaction in normal network serialization instead of the PSBT. + +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 + ] +} + +Examples: +> bitcoin-cli finalizepsbt "psbt" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/fundrawtransaction.html b/_doc/0.22.0/rpc/rawtransactions/fundrawtransaction.html new file mode 100644 index 0000000..0d4b922 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/fundrawtransaction.html @@ -0,0 +1,60 @@ +--- +name: fundrawtransaction +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/fundrawtransaction/ +--- + +fundrawtransaction "hexstring" ( options ) + +Add inputs to a transaction until it has enough in value to meet its out value. +This will not modify existing inputs, and will add at most one change output to the outputs. +No existing outputs will be modified unless "subtractFeeFromOutputs" is specified. +Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. +The inputs added will not be signed, use signrawtransactionwithkey or signrawtransactionwithwallet for that. +Note that all existing inputs must have their previous output transaction be in the wallet. +Note that all inputs selected must be of standard form and P2SH scripts must be +in the wallet using importaddress or addmultisigaddress (to calculate fees). +You can see whether this is the case by checking the "solvable" field in the listunspent output. +Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only + +Arguments: +1. hexstring (string, required) The hex string of the raw transaction +2. options (json object, optional) for backward compatibility: passing in a true instead of an object will result in {"includeWatching":true} + { + "changeAddress": "str", (string, optional, default=pool address) The bitcoin address to receive the change + "changePosition": n, (numeric, optional, default=) The index of the change output + "includeWatching": bool, (boolean, optional, default=true for watch-only wallets, otherwise false) Also select inputs which are watch only + "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 BCH/kB + "subtractFeeFromOutputs": [ (json array, optional, default=empty array) A json array of 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. + vout_index, (numeric) The zero-based output index, before a change output is added. + ... + ], + } + +Result: +{ + "hex": "value", (string) The resulting raw transaction (hex-encoded string) + "fee": n, (numeric) Fee in BCH the resulting transaction pays + "changepos": n (numeric) The position of the added change output, or -1 +} + +Examples: + +Create a transaction with no inputs +> bitcoin-cli createrawtransaction "[]" "{\"myaddress\":0.01}" + +Add sufficient unsigned inputs to meet the output value +> bitcoin-cli fundrawtransaction "rawtransactionhex" + +Sign the transaction +> bitcoin-cli signrawtransactionwithwallet "fundedtransactionhex" + +Send the transaction +> bitcoin-cli sendrawtransaction "signedtransactionhex" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/getrawtransaction.html b/_doc/0.22.0/rpc/rawtransactions/getrawtransaction.html new file mode 100644 index 0000000..8731a1f --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/getrawtransaction.html @@ -0,0 +1,80 @@ +--- +name: getrawtransaction +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/getrawtransaction/ +--- + +getrawtransaction "txid" ( verbose "blockhash" ) + +By default this function only works for mempool transactions. When called with a blockhash +argument, getrawtransaction will return the transaction if the specified block is available and +the transaction is found in that block. When called without a blockhash argument, getrawtransaction +will return the transaction if it is in the mempool, or if -txindex is enabled and the transaction +is in a block in the blockchain. + +Return the raw transaction data. + +If verbose is 'true', returns an Object with information about 'txid'. +If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'. + +Arguments: +1. txid (string, required) The transaction id +2. verbose (boolean, optional, default=false) If false, return a string, otherwise return a json object +3. blockhash (string, optional) The block in which to look for the transaction + +Result (if verbose is not set or set to false): +"data" (string) The serialized, hex-encoded data for 'txid' + +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 + "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 + } + ,... + ], + "vout" : [ (array of json objects) + { + "value" : x.xxx, (numeric) The value in BCH + "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 + ,... + ] + } + } + ,... + ], + "blockhash" : "hash", (string) the block hash + "confirmations" : n, (numeric) The confirmations + "time" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT) + "blocktime" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) +} + +Examples: +> bitcoin-cli getrawtransaction "mytxid" +> bitcoin-cli getrawtransaction "mytxid" true +> 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/ +> bitcoin-cli getrawtransaction "mytxid" false "myblockhash" +> bitcoin-cli getrawtransaction "mytxid" true "myblockhash" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/joinpsbts.html b/_doc/0.22.0/rpc/rawtransactions/joinpsbts.html new file mode 100644 index 0000000..830c66b --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/joinpsbts.html @@ -0,0 +1,26 @@ +--- +name: joinpsbts +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/joinpsbts/ +--- + +joinpsbts ["psbt",...] + +Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs +No input in any of the PSBTs can be in more than one of the PSBTs. + +Arguments: +1. txs (json array, required) A json array of base64 strings of partially signed transactions + [ + "psbt", (string, required) A base64 string of a PSBT + ... + ] + +Result: + "psbt" (string) The base64-encoded partially signed transaction + +Examples: +> bitcoin-cli joinpsbts "psbt" + + diff --git a/_doc/0.22.0/rpc/rawtransactions/sendrawtransaction.html b/_doc/0.22.0/rpc/rawtransactions/sendrawtransaction.html new file mode 100644 index 0000000..e719f89 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/sendrawtransaction.html @@ -0,0 +1,35 @@ +--- +name: sendrawtransaction +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/sendrawtransaction/ +--- + +sendrawtransaction "hexstring" ( maxfeerate ) + +Submits raw transaction (serialized, hex-encoded) to local node and network. + +Also see createrawtransaction and signrawtransactionwithkey calls. + +Arguments: +1. hexstring (string, required) The hex string of the raw transaction +2. maxfeerate (numeric or string, optional, default=0.10) Reject transactions whose fee rate is higher than the specified value, expressed in BCH/kB + + +Result: +"hex" (string) The transaction hash in hex + +Examples: + +Create a transaction +> bitcoin-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}" +Sign the transaction, and get back the hex +> bitcoin-cli signrawtransactionwithwallet "myhex" + +Send the transaction (signed hex) +> bitcoin-cli sendrawtransaction "signedhex" + +As a JSON-RPC call +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["signedhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/rawtransactions/signrawtransactionwithkey.html b/_doc/0.22.0/rpc/rawtransactions/signrawtransactionwithkey.html new file mode 100644 index 0000000..b2d2af4 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/signrawtransactionwithkey.html @@ -0,0 +1,62 @@ +--- +name: signrawtransactionwithkey +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/signrawtransactionwithkey/ +--- + +signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","amount":amount},...] "sighashtype" ) + +Sign inputs for raw transaction (serialized, hex-encoded). +The second argument is an array of base58-encoded private +keys that will be the only keys used to sign the transaction. +The third optional argument (may be null) is an array of previous transaction outputs that +this transaction depends on but may not yet be in the block chain. + +Arguments: +1. hexstring (string, required) The transaction hex string +2. privkeys (json array, required) A json array of base58-encoded private keys for signing + [ + "privatekey", (string) private key in base58-encoding + ... + ] +3. prevtxs (json array, optional) A json array of previous dependent transaction outputs + [ + { (json object) + "txid": "hex", (string, required) The transaction id + "vout": n, (numeric, required) The output number + "scriptPubKey": "hex", (string, required) script key + "redeemScript": "hex", (string) (required for P2SH) redeem script + "amount": amount, (numeric or string, required) The amount spent + }, + ... + ] +4. sighashtype (string, optional, default=ALL|FORKID) The signature hash type. Must be one of: + "ALL|FORKID" + "NONE|FORKID" + "SINGLE|FORKID" + "ALL|FORKID|ANYONECANPAY" + "NONE|FORKID|ANYONECANPAY" + "SINGLE|FORKID|ANYONECANPAY" + +Result: +{ + "hex" : "value", (string) The hex-encoded raw transaction with signature(s) + "complete" : true|false, (boolean) If the transaction has a complete set of signatures + "errors" : [ (json array of objects) Script verification errors (if there are any) + { + "txid" : "hash", (string) The hash of the referenced, previous transaction + "vout" : n, (numeric) The index of the output to spent and used as input + "scriptSig" : "hex", (string) The hex-encoded signature script + "sequence" : n, (numeric) Script sequence number + "error" : "text" (string) Verification or signing error related to the input + } + ,... + ] +} + +Examples: +> bitcoin-cli signrawtransactionwithkey "myhex" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransactionwithkey", "params": ["myhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/rawtransactions/testmempoolaccept.html b/_doc/0.22.0/rpc/rawtransactions/testmempoolaccept.html new file mode 100644 index 0000000..770c6b0 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/testmempoolaccept.html @@ -0,0 +1,49 @@ +--- +name: testmempoolaccept +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/testmempoolaccept/ +--- + +testmempoolaccept ["rawtx",...] ( maxfeerate ) + +Returns if raw transaction (serialized, hex-encoded) would be accepted by mempool. + +This checks if the transaction violates the consensus or policy rules. + +See sendrawtransaction call. + +Arguments: +1. rawtxs (json array, required) An array of hex strings of raw transactions. + Length must be one for now. + [ + "rawtx", (string) + ... + ] +2. maxfeerate (numeric or string, optional, default=0.10) Reject transactions whose fee rate is higher than the specified value, expressed in BCH/kB + + +Result: +[ (array) The result of the mempool acceptance test for each raw transaction in the input array. + Length is exactly one for now. + { + "txid" (string) The transaction hash in hex + "allowed" (boolean) If the mempool allows this tx to be inserted + "reject-reason" (string) Rejection string (only present when 'allowed' is false) + } +] + +Examples: + +Create a transaction +> bitcoin-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}" +Sign the transaction, and get back the hex +> bitcoin-cli signrawtransactionwithwallet "myhex" + +Test acceptance of the transaction (signed hex) +> bitcoin-cli testmempoolaccept ["signedhex"] + +As a JSON-RPC call +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "testmempoolaccept", "params": [["signedhex"]] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/rawtransactions/utxoupdatepsbt.html b/_doc/0.22.0/rpc/rawtransactions/utxoupdatepsbt.html new file mode 100644 index 0000000..49f0f81 --- /dev/null +++ b/_doc/0.22.0/rpc/rawtransactions/utxoupdatepsbt.html @@ -0,0 +1,30 @@ +--- +name: utxoupdatepsbt +version: 0.22.0 +group: rawtransactions +permalink: doc/0.22.0/rpc/rawtransactions/utxoupdatepsbt/ +--- + +utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] ) + +Updates all inputs and outputs in a PSBT with data from output descriptors, the UTXO set or the mempool. + +Arguments: +1. psbt (string, required) A base64 string of a PSBT +2. descriptors (json array, optional) An array of either strings or objects + [ + "", (string) An output descriptor + { (json object) An object with an output descriptor and extra information + "desc": "str", (string, required) An output descriptor + "range": n or [n,n], (numeric or array, optional, default=1000) Up to what index HD chains should be explored (either end or [begin,end]) + }, + ... + ] + +Result: + "psbt" (string) The base64-encoded partially signed transaction with inputs updated + +Examples: +> bitcoin-cli utxoupdatepsbt "psbt" + + diff --git a/_doc/0.22.0/rpc/util/createmultisig.html b/_doc/0.22.0/rpc/util/createmultisig.html new file mode 100644 index 0000000..8fd8049 --- /dev/null +++ b/_doc/0.22.0/rpc/util/createmultisig.html @@ -0,0 +1,35 @@ +--- +name: createmultisig +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/createmultisig/ +--- + +createmultisig nrequired ["key",...] + +Creates a multi-signature address with n signature of m keys required. +It returns a json object with the address and redeemScript. + +Arguments: +1. nrequired (numeric, required) The number of required signatures out of the n keys. +2. keys (json array, required) A json array of hex-encoded public keys. + [ + "key", (string) The hex-encoded public key + ... + ] + +Result: +{ + "address":"multisigaddress", (string) The value of the new multisig address. + "redeemScript":"script" (string) The string value of the hex-encoded redemption script. +} + +Examples: + +Create a multisig address from 2 public keys +> bitcoin-cli createmultisig 2 "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]" + +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/ + + diff --git a/_doc/0.22.0/rpc/util/deriveaddresses.html b/_doc/0.22.0/rpc/util/deriveaddresses.html new file mode 100644 index 0000000..3fc3e65 --- /dev/null +++ b/_doc/0.22.0/rpc/util/deriveaddresses.html @@ -0,0 +1,31 @@ +--- +name: deriveaddresses +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/deriveaddresses/ +--- + +deriveaddresses "descriptor" ( range ) + +Derives one or more addresses corresponding to an output descriptor. +Examples of output descriptors are: + pkh() P2PKH outputs for the given pubkey + sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys + raw() Outputs whose scriptPubKey equals the specified hex scripts + +In the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one +or more path elements separated by "/", where "h" represents a hardened child key. +For more information on output descriptors, see the documentation in the doc/descriptors.md file. + +Arguments: +1. descriptor (string, required) The descriptor. +2. range (numeric or array, optional) If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive. + +Result: +[ address ] (array) the derived addresses + +Examples: +First three pkh receive addresses +> bitcoin-cli deriveaddresses "pkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)#3vhfv5h5" "[0,2]" + + diff --git a/_doc/0.22.0/rpc/util/estimatefee.html b/_doc/0.22.0/rpc/util/estimatefee.html new file mode 100644 index 0000000..72e65b8 --- /dev/null +++ b/_doc/0.22.0/rpc/util/estimatefee.html @@ -0,0 +1,18 @@ +--- +name: estimatefee +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/estimatefee/ +--- + +estimatefee + +Estimates the approximate fee per kilobyte needed for a transaction + +Result: +n (numeric) estimated fee-per-kilobyte + +Examples: +> bitcoin-cli estimatefee + + diff --git a/_doc/0.22.0/rpc/util/getdescriptorinfo.html b/_doc/0.22.0/rpc/util/getdescriptorinfo.html new file mode 100644 index 0000000..89578cd --- /dev/null +++ b/_doc/0.22.0/rpc/util/getdescriptorinfo.html @@ -0,0 +1,28 @@ +--- +name: getdescriptorinfo +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/getdescriptorinfo/ +--- + +getdescriptorinfo "descriptor" + +Analyses a descriptor. + +Arguments: +1. descriptor (string, required) The descriptor. + +Result: +{ + "descriptor" : "desc", (string) The descriptor in canonical form, without private keys + "checksum" : "chksum", (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: +Analyse a descriptor +> bitcoin-cli getdescriptorinfo "pkh([d34db33f/84h/0h/0h]0279be667ef9dcbbac55a06295Ce870b07029Bfcdb2dce28d959f2815b16f81798)" + + diff --git a/_doc/0.22.0/rpc/util/signmessagewithprivkey.html b/_doc/0.22.0/rpc/util/signmessagewithprivkey.html new file mode 100644 index 0000000..fd1112a --- /dev/null +++ b/_doc/0.22.0/rpc/util/signmessagewithprivkey.html @@ -0,0 +1,30 @@ +--- +name: signmessagewithprivkey +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/signmessagewithprivkey/ +--- + +signmessagewithprivkey "privkey" "message" + +Sign a message with the private key of an address + +Arguments: +1. privkey (string, required) The private key to sign the message with. +2. message (string, required) The message to create a signature of. + +Result: +"signature" (string) The signature of the message encoded in base 64 + +Examples: + +Create the signature +> bitcoin-cli signmessagewithprivkey "privkey" "my message" + +Verify the signature +> bitcoin-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "signature" "my message" + +As a JSON-RPC call +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signmessagewithprivkey", "params": ["privkey", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/util/validateaddress.html b/_doc/0.22.0/rpc/util/validateaddress.html new file mode 100644 index 0000000..8c89e8b --- /dev/null +++ b/_doc/0.22.0/rpc/util/validateaddress.html @@ -0,0 +1,27 @@ +--- +name: validateaddress +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/validateaddress/ +--- + +validateaddress "address" + +Return information about the given bitcoin address. + +Arguments: +1. address (string, required) The bitcoin address to validate + +Result: +{ + "isvalid" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned. + "address" : "address", (string) The bitcoin address validated + "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address + "isscript" : true|false, (boolean) If the key is a script +} + +Examples: +> bitcoin-cli validateaddress "1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc" +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "validateaddress", "params": ["1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/util/verifymessage.html b/_doc/0.22.0/rpc/util/verifymessage.html new file mode 100644 index 0000000..8f91662 --- /dev/null +++ b/_doc/0.22.0/rpc/util/verifymessage.html @@ -0,0 +1,34 @@ +--- +name: verifymessage +version: 0.22.0 +group: util +permalink: doc/0.22.0/rpc/util/verifymessage/ +--- + +verifymessage "address" "signature" "message" + +Verify a signed message + +Arguments: +1. address (string, required) The bitcoin address to use for the signature. +2. signature (string, required) The signature provided by the signer in base 64 encoding (see signmessage). +3. message (string, required) The message that was signed. + +Result: +true|false (boolean) If the signature is verified or not. + +Examples: + +Unlock the wallet for 30 seconds +> bitcoin-cli walletpassphrase "mypassphrase" 30 + +Create the signature +> bitcoin-cli signmessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "my message" + +Verify the signature +> bitcoin-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" "signature" "my message" + +As a JSON-RPC call +> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "signature", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/ + + diff --git a/_doc/0.22.0/rpc/wallet/abandontransaction.html b/_doc/0.22.0/rpc/wallet/abandontransaction.html new file mode 100644 index 0000000..0eb61b9 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/abandontransaction.html @@ -0,0 +1,23 @@ +--- +name: abandontransaction +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/abandontransaction/ +--- + +abandontransaction "txid" + +Mark in-wallet transaction as abandoned +This will mark this transaction and all its in-wallet descendants as abandoned which will allow +for their inputs to be respent. It can be used to replace "stuck" or evicted transactions. +It only works on transactions which are not included in a block and are not currently in the mempool. +It has no effect on transactions which are already abandoned. + +Arguments: +1. txid (string, required) The transaction id + +Examples: +> bitcoin-cli abandontransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" +> 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/_doc/0.22.0/rpc/wallet/abortrescan.html b/_doc/0.22.0/rpc/wallet/abortrescan.html new file mode 100644 index 0000000..15ad9ab --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/abortrescan.html @@ -0,0 +1,23 @@ +--- +name: abortrescan +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/abortrescan/ +--- + +abortrescan + +Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call. + +Examples: + +Import a private key +> bitcoin-cli importprivkey "mykey" + +Abort the running wallet rescan +> bitcoin-cli abortrescan + +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/ + + diff --git a/_doc/0.22.0/rpc/wallet/addmultisigaddress.html b/_doc/0.22.0/rpc/wallet/addmultisigaddress.html new file mode 100644 index 0000000..40ca652 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/addmultisigaddress.html @@ -0,0 +1,37 @@ +--- +name: addmultisigaddress +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/addmultisigaddress/ +--- + +addmultisigaddress nrequired ["key",...] ( "label" ) + +Add a nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup. +Each key is a Bitcoin address or hex-encoded public key. +If 'label' is specified (DEPRECATED), assign address to that label. + +Arguments: +1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses. +2. keys (json array, required) A json array of bitcoin addresses or hex-encoded public keys + [ + "key", (string) bitcoin address or hex-encoded public key + ... + ] +3. label (string, optional) A label to assign the addresses to. + +Result: +{ + "address":"multisigaddress", (string) The value of the new multisig address. + "redeemScript":"script" (string) The string value of the hex-encoded redemption script. +} + +Examples: + +Add a multisig address from 2 addresses +> bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]" + +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/ + + diff --git a/_doc/0.22.0/rpc/wallet/backupwallet.html b/_doc/0.22.0/rpc/wallet/backupwallet.html new file mode 100644 index 0000000..0c03646 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/backupwallet.html @@ -0,0 +1,19 @@ +--- +name: backupwallet +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/backupwallet/ +--- + +backupwallet "destination" + +Safely copies current wallet file to destination, which can be a directory or a path with filename. + +Arguments: +1. destination (string, required) The destination directory or file + +Examples: +> bitcoin-cli backupwallet "backup.dat" +> 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/_doc/0.22.0/rpc/wallet/createwallet.html b/_doc/0.22.0/rpc/wallet/createwallet.html new file mode 100644 index 0000000..9f64015 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/createwallet.html @@ -0,0 +1,29 @@ +--- +name: createwallet +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/createwallet/ +--- + +createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse ) + +Creates and loads a new wallet. + +Arguments: +1. wallet_name (string, required) The name for the new wallet. If this is a path, the wallet will be created at the path location. +2. disable_private_keys (boolean, optional, default=false) Disable the possibility of private keys (only watchonlys are possible in this mode). +3. blank (boolean, optional, default=false) Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using sethdseed. +4. passphrase (string) Encrypt the wallet with this passphrase. +5. avoid_reuse (boolean, optional, default=false) Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind. + +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. +} + +Examples: +> bitcoin-cli createwallet "testwallet" +> 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/_doc/0.22.0/rpc/wallet/dumpprivkey.html b/_doc/0.22.0/rpc/wallet/dumpprivkey.html new file mode 100644 index 0000000..845a0ac --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/dumpprivkey.html @@ -0,0 +1,24 @@ +--- +name: dumpprivkey +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/dumpprivkey/ +--- + +dumpprivkey "address" + +Reveals the private key corresponding to 'address'. +Then the importprivkey can be used with this output + +Arguments: +1. address (string, required) The bitcoin address for the private key + +Result: +"key" (string) The private key + +Examples: +> bitcoin-cli dumpprivkey "myaddress" +> bitcoin-cli importprivkey "mykey" +> 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/_doc/0.22.0/rpc/wallet/dumpwallet.html b/_doc/0.22.0/rpc/wallet/dumpwallet.html new file mode 100644 index 0000000..b264766 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/dumpwallet.html @@ -0,0 +1,27 @@ +--- +name: dumpwallet +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/dumpwallet/ +--- + +dumpwallet "filename" + +Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files. +Imported scripts are included in the dumpsfile, but corresponding addresses may not be added automatically by importwallet. +Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by +only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile). + +Arguments: +1. filename (string, required) The filename with path (either absolute or relative to bitcoind) + +Result: +{ (json object) + "filename" : { (string) The filename with full absolute path +} + +Examples: +> bitcoin-cli dumpwallet "test" +> 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/_doc/0.22.0/rpc/wallet/encryptwallet.html b/_doc/0.22.0/rpc/wallet/encryptwallet.html new file mode 100644 index 0000000..ce788ed --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/encryptwallet.html @@ -0,0 +1,36 @@ +--- +name: encryptwallet +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/encryptwallet/ +--- + +encryptwallet "passphrase" + +Encrypts the wallet with 'passphrase'. This is for first time encryption. +After this, any calls that interact with private keys such as sending or signing +will require the passphrase to be set prior the making these calls. +Use the walletpassphrase call for this, and then walletlock call. +If the wallet is already encrypted, use the walletpassphrasechange call. + +Arguments: +1. passphrase (string, required) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long. + +Examples: + +Encrypt your wallet +> bitcoin-cli encryptwallet "my pass phrase" + +Now set the passphrase to use the wallet, such as for signing or sending bitcoin +> bitcoin-cli walletpassphrase "my pass phrase" + +Now we can do something like sign +> bitcoin-cli signmessage "address" "test message" + +Now lock the wallet again by removing the passphrase +> bitcoin-cli walletlock + +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/ + + diff --git a/_doc/0.22.0/rpc/wallet/getaddressesbylabel.html b/_doc/0.22.0/rpc/wallet/getaddressesbylabel.html new file mode 100644 index 0000000..acd3c1f --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getaddressesbylabel.html @@ -0,0 +1,26 @@ +--- +name: getaddressesbylabel +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getaddressesbylabel/ +--- + +getaddressesbylabel "label" + +Returns the list of addresses assigned the specified label. + +Arguments: +1. label (string, required) The label. + +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) + },... +} + +Examples: +> bitcoin-cli getaddressesbylabel "tabby" +> 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/_doc/0.22.0/rpc/wallet/getaddressinfo.html b/_doc/0.22.0/rpc/wallet/getaddressinfo.html new file mode 100644 index 0000000..09b2fac --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getaddressinfo.html @@ -0,0 +1,55 @@ +--- +name: getaddressinfo +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getaddressinfo/ +--- + +getaddressinfo "address" + +Return information about the given bitcoin address. Some information requires the address +to be in the wallet. + +Arguments: +1. address (string, required) The bitcoin address to get the information of. + +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 + "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 + "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) + "embedded" : {...}, (object, optional) Information about the address embedded in P2SH, 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) If the address 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) + },... + ] +} + +Examples: +> bitcoin-cli getaddressinfo "1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc" +> 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/ + + diff --git a/_doc/0.22.0/rpc/wallet/getbalance.html b/_doc/0.22.0/rpc/wallet/getbalance.html new file mode 100644 index 0000000..c172e7b --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getbalance.html @@ -0,0 +1,34 @@ +--- +name: getbalance +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getbalance/ +--- + +getbalance ( "dummy" minconf include_watchonly avoid_reuse ) + +Returns the total available balance. +The available balance is what the wallet considers currently spendable, and is +thus affected by options which limit spendability such as -spendzeroconfchange. + +Arguments: +1. dummy (string, optional) Remains for backward compatibility. Must be excluded or set to "*". +2. minconf (numeric, optional, default=0) Only include transactions confirmed at least this many times. +3. include_watchonly (boolean, optional, default=true for watch-only wallets, otherwise false) Also include balance in watch-only addresses (see 'importaddress') +4. avoid_reuse (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: +amount (numeric) The total amount in BCH received for this wallet. + +Examples: + +The total amount in the wallet with 1 or more confirmations +> bitcoin-cli getbalance + +The total amount in the wallet at least 6 blocks confirmed +> 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/ + + diff --git a/_doc/0.22.0/rpc/wallet/getbalances.html b/_doc/0.22.0/rpc/wallet/getbalances.html new file mode 100644 index 0000000..a343b56 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getbalances.html @@ -0,0 +1,31 @@ +--- +name: getbalances +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getbalances/ +--- + +getbalances + +Returns an object with all balances in BCH. + +Result: +{ + "mine": { (object) balances from outputs that the wallet can sign + "trusted": xxx (numeric) trusted balance (outputs created by the wallet or confirmed outputs) + "untrusted_pending": xxx (numeric) untrusted pending balance (outputs created by others that are in the mempool) + "immature": xxx (numeric) balance from immature coinbase outputs + "used": xxx (numeric) (only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating) + }, + "watchonly": { (object) watchonly balances (not present if wallet does not watch anything) + "trusted": xxx (numeric) trusted balance (outputs created by the wallet or confirmed outputs) + "untrusted_pending": xxx (numeric) untrusted pending balance (outputs created by others that are in the mempool) + "immature": xxx (numeric) balance from immature coinbase outputs + }, +} + +Examples: +> 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/_doc/0.22.0/rpc/wallet/getnewaddress.html b/_doc/0.22.0/rpc/wallet/getnewaddress.html new file mode 100644 index 0000000..40dd7fb --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getnewaddress.html @@ -0,0 +1,25 @@ +--- +name: getnewaddress +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getnewaddress/ +--- + +getnewaddress ( "label" "address_type" ) + +Returns a new Bitcoin address for receiving payments. +If 'label' is specified, it is added to the address book +so payments received with the address will be associated with 'label'. + +Arguments: +1. label (string, optional, default=null) The label name for the address to be linked to. If not provided, the default label "" is used. It can also be set to the empty string "" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name. +2. address_type (string, optional, default=set by -addresstype) The address type to use. Options are "legacy". + +Result: +"address" (string) The new bitcoin address + +Examples: +> bitcoin-cli getnewaddress +> 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/_doc/0.22.0/rpc/wallet/getrawchangeaddress.html b/_doc/0.22.0/rpc/wallet/getrawchangeaddress.html new file mode 100644 index 0000000..f1801f1 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getrawchangeaddress.html @@ -0,0 +1,20 @@ +--- +name: getrawchangeaddress +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getrawchangeaddress/ +--- + +getrawchangeaddress + +Returns a new Bitcoin address, for receiving change. +This is for use with raw transactions, NOT normal use. + +Result: +"address" (string) The address + +Examples: +> bitcoin-cli getrawchangeaddress +> 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/_doc/0.22.0/rpc/wallet/getreceivedbyaddress.html b/_doc/0.22.0/rpc/wallet/getreceivedbyaddress.html new file mode 100644 index 0000000..865aaa2 --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getreceivedbyaddress.html @@ -0,0 +1,33 @@ +--- +name: getreceivedbyaddress +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getreceivedbyaddress/ +--- + +getreceivedbyaddress "address" ( minconf ) + +Returns the total amount received by the given address in transactions with at least minconf confirmations. + +Arguments: +1. address (string, required) The bitcoin address for transactions. +2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times. + +Result: +amount (numeric) The total amount in BCH received at this address. + +Examples: + +The amount from transactions with at least 1 confirmation +> bitcoin-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" + +The amount including unconfirmed transactions, zero confirmations +> bitcoin-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" 0 + +The amount with at least 6 confirmations +> bitcoin-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" 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/ + + diff --git a/_doc/0.22.0/rpc/wallet/getreceivedbylabel.html b/_doc/0.22.0/rpc/wallet/getreceivedbylabel.html new file mode 100644 index 0000000..eeacf0e --- /dev/null +++ b/_doc/0.22.0/rpc/wallet/getreceivedbylabel.html @@ -0,0 +1,33 @@ +--- +name: getreceivedbylabel +version: 0.22.0 +group: wallet +permalink: doc/0.22.0/rpc/wallet/getreceivedbylabel/ +--- + +getreceivedbylabel "label" ( minconf ) + +Returns the total amount received by addresses with