Skip to content

Commit 76c1ad3

Browse files
committed
Merge #824: RPC Docs: add 22.0.0
ee81ea6 RPC Docs: add 22.0.0 (Andrew Toth) aa71246 RPC Docs: update generate.go to use new version scheme (Andrew Toth) Pull request description: Generated using this repo's `contrib/doc-gen/generate.go`. The first commit is updating that script to use the new version scheme introduced in 22.0.0. Should be fully deterministic, so anyone wanting to review can install 22.0.0 and run the following: ``` bitcoind --daemon --regtest cd contrib/doc-gen go run generate.go ``` I lightly tested a local preview and didn't see anything broken this release. Closes #820. ACKs for top commit: Sjors: tACK ee81ea6 harding: Tested ACK ee81ea6 Thanks! Tree-SHA512: f0768411b6cc2d28a13f69efa353a0cd70269db2605816de41cd21f229e2860441159b9781a8f71577e2817d88c949b2017d999ae105f8f1e13dfdf323443e55
2 parents ad78ed3 + ee81ea6 commit 76c1ad3

File tree

144 files changed

+5488
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+5488
-1
lines changed

_doc/en/22.0.0/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: index
3+
btcversion: 22.0.0
4+
btcgroup: index
5+
permalink: en/doc/22.0.0/
6+
---
7+
8+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: getbestblockhash
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getbestblockhash/
6+
---
7+
8+
getbestblockhash
9+
10+
Returns the hash of the best (tip) block in the most-work fully-validated chain.
11+
12+
Result:
13+
"hex" (string) the block hash, hex-encoded
14+
15+
Examples:
16+
> bitcoin-cli getbestblockhash
17+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
18+
19+
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: getblock
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblock/
6+
---
7+
8+
getblock "blockhash" ( verbosity )
9+
10+
If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
11+
If verbosity is 1, returns an Object with information about block <hash>.
12+
If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
13+
14+
Arguments:
15+
1. blockhash (string, required) The block hash
16+
2. verbosity (numeric, optional, default=1) 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data
17+
18+
Result (for verbosity = 0):
19+
"hex" (string) A string that is serialized, hex-encoded data for block 'hash'
20+
21+
Result (for verbosity = 1):
22+
{ (json object)
23+
"hash" : "hex", (string) the block hash (same as provided)
24+
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
25+
"size" : n, (numeric) The block size
26+
"strippedsize" : n, (numeric) The block size excluding witness data
27+
"weight" : n, (numeric) The block weight as defined in BIP 141
28+
"height" : n, (numeric) The block height or index
29+
"version" : n, (numeric) The block version
30+
"versionHex" : "hex", (string) The block version formatted in hexadecimal
31+
"merkleroot" : "hex", (string) The merkle root
32+
"tx" : [ (json array) The transaction ids
33+
"hex", (string) The transaction id
34+
...
35+
],
36+
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
37+
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
38+
"nonce" : n, (numeric) The nonce
39+
"bits" : "hex", (string) The bits
40+
"difficulty" : n, (numeric) The difficulty
41+
"chainwork" : "hex", (string) Expected number of hashes required to produce the chain up to this block (in hex)
42+
"nTx" : n, (numeric) The number of transactions in the block
43+
"previousblockhash" : "hex", (string, optional) The hash of the previous block (if available)
44+
"nextblockhash" : "hex" (string, optional) The hash of the next block (if available)
45+
}
46+
47+
Result (for verbosity = 2):
48+
{ (json object)
49+
..., Same output as verbosity = 1
50+
"tx" : [ (json array)
51+
{ (json object)
52+
..., The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result
53+
"fee" : n (numeric) The transaction fee in BTC, omitted if block undo data is not available
54+
},
55+
...
56+
]
57+
}
58+
59+
Examples:
60+
> bitcoin-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
61+
> 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/
62+
63+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: getblockchaininfo
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblockchaininfo/
6+
---
7+
8+
getblockchaininfo
9+
Returns an object containing various state info regarding blockchain processing.
10+
11+
Result:
12+
{ (json object)
13+
"chain" : "str", (string) current network name (main, test, signet, regtest)
14+
"blocks" : n, (numeric) the height of the most-work fully-validated chain. The genesis block has height 0
15+
"headers" : n, (numeric) the current number of headers we have validated
16+
"bestblockhash" : "str", (string) the hash of the currently best block
17+
"difficulty" : n, (numeric) the current difficulty
18+
"mediantime" : n, (numeric) median time for the current best block
19+
"verificationprogress" : n, (numeric) estimate of verification progress [0..1]
20+
"initialblockdownload" : true|false, (boolean) (debug information) estimate of whether this node is in Initial Block Download mode
21+
"chainwork" : "hex", (string) total amount of work in active chain, in hexadecimal
22+
"size_on_disk" : n, (numeric) the estimated size of the block and undo files on disk
23+
"pruned" : true|false, (boolean) if the blocks are subject to pruning
24+
"pruneheight" : n, (numeric) lowest-height complete block stored (only present if pruning is enabled)
25+
"automatic_pruning" : true|false, (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
26+
"prune_target_size" : n, (numeric) the target size used by pruning (only present if automatic pruning is enabled)
27+
"softforks" : { (json object) status of softforks
28+
"xxxx" : { (json object) name of the softfork
29+
"type" : "str", (string) one of "buried", "bip9"
30+
"bip9" : { (json object) status of bip9 softforks (only for "bip9" type)
31+
"status" : "str", (string) one of "defined", "started", "locked_in", "active", "failed"
32+
"bit" : n, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
33+
"start_time" : xxx, (numeric) the minimum median time past of a block at which the bit gains its meaning
34+
"timeout" : xxx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
35+
"since" : n, (numeric) height of the first block to which the status applies
36+
"min_activation_height" : n, (numeric) minimum height of blocks for which the rules may be enforced
37+
"statistics" : { (json object) numeric statistics about BIP9 signalling for a softfork (only for "started" status)
38+
"period" : n, (numeric) the length in blocks of the BIP9 signalling period
39+
"threshold" : n, (numeric) the number of blocks with the version bit set required to activate the feature
40+
"elapsed" : n, (numeric) the number of blocks elapsed since the beginning of the current period
41+
"count" : n, (numeric) the number of blocks with the version bit set in the current period
42+
"possible" : true|false (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
43+
}
44+
},
45+
"height" : n, (numeric) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
46+
"active" : true|false (boolean) true if the rules are enforced for the mempool and the next block
47+
},
48+
...
49+
},
50+
"warnings" : "str" (string) any network and blockchain warnings
51+
}
52+
53+
Examples:
54+
> bitcoin-cli getblockchaininfo
55+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
56+
57+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: getblockcount
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblockcount/
6+
---
7+
8+
getblockcount
9+
10+
Returns the height of the most-work fully-validated chain.
11+
The genesis block has height 0.
12+
13+
Result:
14+
n (numeric) The current block count
15+
16+
Examples:
17+
> bitcoin-cli getblockcount
18+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
19+
20+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: getblockfilter
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblockfilter/
6+
---
7+
8+
getblockfilter "blockhash" ( "filtertype" )
9+
10+
Retrieve a BIP 157 content filter for a particular block.
11+
12+
Arguments:
13+
1. blockhash (string, required) The hash of the block
14+
2. filtertype (string, optional, default="basic") The type name of the filter
15+
16+
Result:
17+
{ (json object)
18+
"filter" : "hex", (string) the hex-encoded filter data
19+
"header" : "hex" (string) the hex-encoded filter header
20+
}
21+
22+
Examples:
23+
> bitcoin-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
24+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
25+
26+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: getblockhash
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblockhash/
6+
---
7+
8+
getblockhash height
9+
10+
Returns hash of block in best-block-chain at height provided.
11+
12+
Arguments:
13+
1. height (numeric, required) The height index
14+
15+
Result:
16+
"hex" (string) The block hash
17+
18+
Examples:
19+
> bitcoin-cli getblockhash 1000
20+
> 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/
21+
22+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: getblockheader
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblockheader/
6+
---
7+
8+
getblockheader "blockhash" ( verbose )
9+
10+
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.
11+
If verbose is true, returns an Object with information about blockheader <hash>.
12+
13+
Arguments:
14+
1. blockhash (string, required) The block hash
15+
2. verbose (boolean, optional, default=true) true for a json object, false for the hex-encoded data
16+
17+
Result (for verbose = true):
18+
{ (json object)
19+
"hash" : "hex", (string) the block hash (same as provided)
20+
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
21+
"height" : n, (numeric) The block height or index
22+
"version" : n, (numeric) The block version
23+
"versionHex" : "hex", (string) The block version formatted in hexadecimal
24+
"merkleroot" : "hex", (string) The merkle root
25+
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
26+
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
27+
"nonce" : n, (numeric) The nonce
28+
"bits" : "hex", (string) The bits
29+
"difficulty" : n, (numeric) The difficulty
30+
"chainwork" : "hex", (string) Expected number of hashes required to produce the current chain
31+
"nTx" : n, (numeric) The number of transactions in the block
32+
"previousblockhash" : "hex", (string, optional) The hash of the previous block (if available)
33+
"nextblockhash" : "hex" (string, optional) The hash of the next block (if available)
34+
}
35+
36+
Result (for verbose=false):
37+
"hex" (string) A string that is serialized, hex-encoded data for block 'hash'
38+
39+
Examples:
40+
> bitcoin-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
41+
> 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/
42+
43+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: getblockstats
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getblockstats/
6+
---
7+
8+
getblockstats hash_or_height ( stats )
9+
10+
Compute per block statistics for a given window. All amounts are in satoshis.
11+
It won't work for some heights with pruning.
12+
13+
Arguments:
14+
1. hash_or_height (string or numeric, required) The block hash or height of the target block
15+
2. stats (json array, optional, default=all values) Values to plot (see result below)
16+
[
17+
"height", (string) Selected statistic
18+
"time", (string) Selected statistic
19+
...
20+
]
21+
22+
Result:
23+
{ (json object)
24+
"avgfee" : n, (numeric) Average fee in the block
25+
"avgfeerate" : n, (numeric) Average feerate (in satoshis per virtual byte)
26+
"avgtxsize" : n, (numeric) Average transaction size
27+
"blockhash" : "hex", (string) The block hash (to check for potential reorgs)
28+
"feerate_percentiles" : [ (json array) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
29+
n, (numeric) The 10th percentile feerate
30+
n, (numeric) The 25th percentile feerate
31+
n, (numeric) The 50th percentile feerate
32+
n, (numeric) The 75th percentile feerate
33+
n (numeric) The 90th percentile feerate
34+
],
35+
"height" : n, (numeric) The height of the block
36+
"ins" : n, (numeric) The number of inputs (excluding coinbase)
37+
"maxfee" : n, (numeric) Maximum fee in the block
38+
"maxfeerate" : n, (numeric) Maximum feerate (in satoshis per virtual byte)
39+
"maxtxsize" : n, (numeric) Maximum transaction size
40+
"medianfee" : n, (numeric) Truncated median fee in the block
41+
"mediantime" : n, (numeric) The block median time past
42+
"mediantxsize" : n, (numeric) Truncated median transaction size
43+
"minfee" : n, (numeric) Minimum fee in the block
44+
"minfeerate" : n, (numeric) Minimum feerate (in satoshis per virtual byte)
45+
"mintxsize" : n, (numeric) Minimum transaction size
46+
"outs" : n, (numeric) The number of outputs
47+
"subsidy" : n, (numeric) The block subsidy
48+
"swtotal_size" : n, (numeric) Total size of all segwit transactions
49+
"swtotal_weight" : n, (numeric) Total weight of all segwit transactions
50+
"swtxs" : n, (numeric) The number of segwit transactions
51+
"time" : n, (numeric) The block time
52+
"total_out" : n, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])
53+
"total_size" : n, (numeric) Total size of all non-coinbase transactions
54+
"total_weight" : n, (numeric) Total weight of all non-coinbase transactions
55+
"totalfee" : n, (numeric) The fee total
56+
"txs" : n, (numeric) The number of transactions (including coinbase)
57+
"utxo_increase" : n, (numeric) The increase/decrease in the number of unspent outputs
58+
"utxo_size_inc" : n (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar)
59+
}
60+
61+
Examples:
62+
> bitcoin-cli getblockstats '"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]'
63+
> bitcoin-cli getblockstats 1000 '["minfeerate","avgfeerate"]'
64+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockstats", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"]]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
65+
> 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/
66+
67+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: getchaintips
3+
btcversion: 22.0.0
4+
btcgroup: blockchain
5+
permalink: en/doc/22.0.0/rpc/blockchain/getchaintips/
6+
---
7+
8+
getchaintips
9+
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
10+
11+
Result:
12+
[ (json array)
13+
{ (json object)
14+
"height" : n, (numeric) height of the chain tip
15+
"hash" : "hex", (string) block hash of the tip
16+
"branchlen" : n, (numeric) zero for main chain, otherwise length of branch connecting the tip to the main chain
17+
"status" : "str" (string) status of the chain, "active" for the main chain
18+
Possible values for status:
19+
1. "invalid" This branch contains at least one invalid block
20+
2. "headers-only" Not all blocks for this branch are available, but the headers are valid
21+
3. "valid-headers" All blocks are available for this branch, but they were never fully validated
22+
4. "valid-fork" This branch is not part of the active chain, but is fully validated
23+
5. "active" This is the tip of the active main chain, which is certainly valid
24+
},
25+
...
26+
]
27+
28+
Examples:
29+
> bitcoin-cli getchaintips
30+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getchaintips", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
31+
32+

0 commit comments

Comments
 (0)