Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _doc/en/30.0.0/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: index
btcversion: 30.0.0
btcgroup: index
permalink: en/doc/30.0.0/
---


39 changes: 39 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/dumptxoutset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: dumptxoutset
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.0/rpc/blockchain/dumptxoutset/
---

dumptxoutset "path" ( "type" {"rollback":n,...} )

Write the serialized UTXO set to a file. This can be used in loadtxoutset afterwards if this snapshot height is supported in the chainparams as well.

Unless the "latest" type is requested, the node will roll back to the requested height and network activity will be suspended during this process. Because of this it is discouraged to interact with the node in any other way during the execution of this call to avoid inconsistent results and race conditions, particularly RPCs that interact with blockstorage.

This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)

Arguments:
1. path (string, required) Path to the output file. If relative, will be prefixed by datadir.
2. type (string, optional, default="") The type of snapshot to create. Can be "latest" to create a snapshot of the current UTXO set or "rollback" to temporarily roll back the state of the node to a historical block before creating the snapshot of a historical UTXO set. This parameter can be omitted if a separate "rollback" named parameter is specified indicating the height or hash of a specific historical block. If "rollback" is specified and separate "rollback" named parameter is not specified, this will roll back to the latest valid snapshot block that can currently be loaded with loadtxoutset.
3. options (json object, optional) Options object that can be used to pass named arguments, listed below.

Named Arguments:
rollback (string or numeric, optional) Height or hash of the block to roll back to before creating the snapshot. Note: The further this number is from the tip, the longer this process will take. Consider setting a higher -rpcclienttimeout value in this case.

Result:
{ (json object)
"coins_written" : n, (numeric) the number of coins written in the snapshot
"base_hash" : "hex", (string) the hash of the base of the snapshot
"base_height" : n, (numeric) the height of the base of the snapshot
"path" : "str", (string) the absolute path that the snapshot was written to
"txoutset_hash" : "hex", (string) the hash of the UTXO set contents
"nchaintx" : n (numeric) the number of transactions in the chain up to and including the base block
}

Examples:
> bitcoin-cli -rpcclienttimeout=0 dumptxoutset utxo.dat latest
> bitcoin-cli -rpcclienttimeout=0 dumptxoutset utxo.dat rollback
> bitcoin-cli -rpcclienttimeout=0 -named dumptxoutset utxo.dat rollback=853456


19 changes: 19 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getbestblockhash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: getbestblockhash
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.0/rpc/blockchain/getbestblockhash/
---

getbestblockhash

Returns the hash of the best (tip) block in the most-work fully-validated chain.

Result:
"hex" (string) the block hash, hex-encoded

Examples:
> bitcoin-cli getbestblockhash
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'content-type: application/json' http://127.0.0.1:8332/


93 changes: 93 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblock.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
name: getblock
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.0/rpc/blockchain/getblock/
---

getblock "blockhash" ( verbosity )

If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
If verbosity is 1, returns an Object with information about block <hash>.
If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
If verbosity is 3, returns an Object with information about block <hash> and information about each transaction, including prevout information for inputs (only for unpruned blocks in the current best chain).

Arguments:
1. blockhash (string, required) The block hash
2. verbosity (numeric, optional, default=1) 0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data, and 3 for JSON object with transaction data including prevout information for inputs

Result (for verbosity = 0):
"hex" (string) A string that is serialized, hex-encoded data for block 'hash'

Result (for verbosity = 1):
{ (json object)
"hash" : "hex", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"size" : n, (numeric) The block size
"strippedsize" : n, (numeric) The block size excluding witness data
"weight" : n, (numeric) The block weight as defined in BIP 141
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"versionHex" : "hex", (string) The block version formatted in hexadecimal
"merkleroot" : "hex", (string) The merkle root
"tx" : [ (json array) The transaction ids
"hex", (string) The transaction id
...
],
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
"nonce" : n, (numeric) The nonce
"bits" : "hex", (string) nBits: compact representation of the block difficulty target
"target" : "hex", (string) The difficulty target
"difficulty" : n, (numeric) The difficulty
"chainwork" : "hex", (string) Expected number of hashes required to produce the chain up to this block (in hex)
"nTx" : n, (numeric) The number of transactions in the block
"previousblockhash" : "hex", (string, optional) The hash of the previous block (if available)
"nextblockhash" : "hex" (string, optional) The hash of the next block (if available)
}

Result (for verbosity = 2):
{ (json object)
..., Same output as verbosity = 1
"tx" : [ (json array)
{ (json object)
..., The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result
"fee" : n (numeric) The transaction fee in BTC, omitted if block undo data is not available
},
...
]
}

Result (for verbosity = 3):
{ (json object)
..., Same output as verbosity = 2
"tx" : [ (json array)
{ (json object)
"vin" : [ (json array)
{ (json object)
..., The same output as verbosity = 2
"prevout" : { (json object) (Only if undo information is available)
"generated" : true|false, (boolean) Coinbase or not
"height" : n, (numeric) The height of the prevout
"value" : n, (numeric) The value in BTC
"scriptPubKey" : { (json object)
"asm" : "str", (string) Disassembly of the output script
"desc" : "str", (string) Inferred descriptor for the output
"hex" : "hex", (string) The raw output script bytes, hex-encoded
"address" : "str", (string, optional) The Bitcoin address (only if a well-defined address exists)
"type" : "str" (string) The type (one of: nonstandard, anchor, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
}
}
},
...
]
},
...
]
}

Examples:
> bitcoin-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: application/json' http://127.0.0.1:8332/


42 changes: 42 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblockchaininfo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: getblockchaininfo
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.0/rpc/blockchain/getblockchaininfo/
---

getblockchaininfo

Returns an object containing various state info regarding blockchain processing.

Result:
{ (json object)
"chain" : "str", (string) current network name (main, test, testnet4, signet, regtest)
"blocks" : n, (numeric) the height of the most-work fully-validated chain. The genesis block has height 0
"headers" : n, (numeric) the current number of headers we have validated
"bestblockhash" : "str", (string) the hash of the currently best block
"bits" : "hex", (string) nBits: compact representation of the block difficulty target
"target" : "hex", (string) The difficulty target
"difficulty" : n, (numeric) the current difficulty
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
"verificationprogress" : n, (numeric) estimate of verification progress [0..1]
"initialblockdownload" : true|false, (boolean) (debug information) estimate of whether this node is in Initial Block Download mode
"chainwork" : "hex", (string) total amount of work in active chain, in hexadecimal
"size_on_disk" : n, (numeric) the estimated size of the block and undo files on disk
"pruned" : true|false, (boolean) if the blocks are subject to pruning
"pruneheight" : n, (numeric, optional) height of the last block pruned, plus one (only present if pruning is enabled)
"automatic_pruning" : true|false, (boolean, optional) whether automatic pruning is enabled (only present if pruning is enabled)
"prune_target_size" : n, (numeric, optional) the target size used by pruning (only present if automatic pruning is enabled)
"signet_challenge" : "hex", (string, optional) the block challenge (aka. block script), in hexadecimal (only present if the current network is a signet)
"warnings" : [ (json array) any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)
"str", (string) warning
...
]
}

Examples:
> bitcoin-cli getblockchaininfo
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: application/json' http://127.0.0.1:8332/


20 changes: 20 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblockcount.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: getblockcount
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.0/rpc/blockchain/getblockcount/
---

getblockcount

Returns the height of the most-work fully-validated chain.
The genesis block has height 0.

Result:
n (numeric) The current block count

Examples:
> bitcoin-cli getblockcount
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockcount", "params": []}' -H 'content-type: application/json' http://127.0.0.1:8332/


26 changes: 26 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblockfilter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: getblockfilter
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.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:
{ (json object)
"filter" : "hex", (string) the hex-encoded filter data
"header" : "hex" (string) the hex-encoded filter header
}

Examples:
> bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: application/json' http://127.0.0.1:8332/


32 changes: 32 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblockfrompeer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: getblockfrompeer
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.0/rpc/blockchain/getblockfrompeer/
---

getblockfrompeer "blockhash" peer_id

Attempt to fetch block from a given peer.

We must have the header for this block, e.g. using submitheader.
The block will not have any undo data which can limit the usage of the block data in a context where the undo data is needed.
Subsequent calls for the same block may cause the response from the previous peer to be ignored.
Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old.
When a peer does not respond with a block, we will disconnect.
Note: The block could be re-pruned as soon as it is received.

Returns an empty JSON object if the request was successfully scheduled.

Arguments:
1. blockhash (string, required) The block hash to try to fetch
2. peer_id (numeric, required) The peer to fetch it from (see getpeerinfo for peer IDs)

Result:
{} (empty JSON object)

Examples:
> bitcoin-cli getblockfrompeer "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 0
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockfrompeer", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 0]}' -H 'content-type: application/json' http://127.0.0.1:8332/


22 changes: 22 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblockhash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: getblockhash
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.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:
"hex" (string) The block hash

Examples:
> bitcoin-cli getblockhash 1000
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockhash", "params": [1000]}' -H 'content-type: application/json' http://127.0.0.1:8332/


44 changes: 44 additions & 0 deletions _doc/en/30.0.0/rpc/blockchain/getblockheader.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: getblockheader
btcversion: 30.0.0
btcgroup: blockchain
permalink: en/doc/30.0.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 <hash>.

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):
{ (json object)
"hash" : "hex", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"versionHex" : "hex", (string) The block version formatted in hexadecimal
"merkleroot" : "hex", (string) The merkle root
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
"nonce" : n, (numeric) The nonce
"bits" : "hex", (string) nBits: compact representation of the block difficulty target
"target" : "hex", (string) The difficulty target
"difficulty" : n, (numeric) The difficulty
"chainwork" : "hex", (string) Expected number of hashes required to produce the current chain
"nTx" : n, (numeric) The number of transactions in the block
"previousblockhash" : "hex", (string, optional) The hash of the previous block (if available)
"nextblockhash" : "hex" (string, optional) The hash of the next block (if available)
}

Result (for verbose=false):
"hex" (string) A string that is serialized, hex-encoded data for block 'hash'

Examples:
> bitcoin-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: application/json' http://127.0.0.1:8332/


Loading