Skip to content

Commit aad3fda

Browse files
committed
Merge #181: Add RPC docs for Elements 23.3.3
2e13474 Add RPC docs for Elements 23.3.3 (Andrea Bonel) 0d7a4ca Add RPC docs for Elements 23.3.1 (Andrea Bonel) eb09493 Trim the empty lines at the end of the file (Andrea Bonel) 88f3022 Add note about enforcing pak (Andrea Bonel) 9ce92c0 Trim strings before applying template (Andrea Bonel) Pull request description: ACKs for top commit: delta1: ACK 2e13474; tested locally and quickly skimmed docs Tree-SHA512: c8e26f93c47d3b2d67d26998985be9fa48f29306d94b26f85e84e77822007bbcea6b2cc80c7613c49e5d72c5e8516003a44656e2857cbae621ae07c0d41391cd
2 parents 71135ba + 2e13474 commit aad3fda

362 files changed

Lines changed: 13596 additions & 2 deletions

File tree

Some content is hidden

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

_doc/en/23.3.1/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: doc
3+
name: index
4+
elemversion: 23.3.1
5+
elemgroup: index
6+
permalink: /en/doc/23.3.1/
7+
---
8+
9+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: doc
3+
name: getbestblockhash
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getbestblockhash/
7+
---
8+
9+
getbestblockhash
10+
11+
Returns the hash of the best (tip) block in the most-work fully-validated chain.
12+
13+
Result:
14+
"hex" (string) the block hash, hex-encoded
15+
16+
Examples:
17+
> elements-cli getbestblockhash
18+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:7041/
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
layout: doc
3+
name: getblock
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblock/
7+
---
8+
9+
getblock "blockhash" ( verbosity )
10+
11+
If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
12+
If verbosity is 1, returns an Object with information about block <hash>.
13+
If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
14+
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).
15+
16+
Arguments:
17+
1. blockhash (string, required) The block hash
18+
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
19+
20+
Result (for verbosity = 0):
21+
"hex" (string) A string that is serialized, hex-encoded data for block 'hash'
22+
23+
Result (for verbosity = 1):
24+
{ (json object)
25+
"hash" : "hex", (string) the block hash (same as provided)
26+
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
27+
"size" : n, (numeric) The block size
28+
"strippedsize" : n, (numeric) The block size excluding witness data
29+
"weight" : n, (numeric) The block weight as defined in BIP 141
30+
"height" : n, (numeric) The block height or index
31+
"version" : n, (numeric) The block version
32+
"versionHex" : "hex", (string) The block version formatted in hexadecimal
33+
"merkleroot" : "hex", (string) The merkle root
34+
"tx" : [ (json array) The transaction ids
35+
"hex", (string) The transaction id
36+
...
37+
],
38+
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
39+
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
40+
"nonce" : n, (numeric) The nonce
41+
"bits" : "hex", (string) The bits
42+
"difficulty" : n, (numeric) The difficulty
43+
"chainwork" : "hex", (string) Expected number of hashes required to produce the chain up to this block (in hex)
44+
"nTx" : n, (numeric) The number of transactions in the block
45+
"signblock_witness_asm" : "str", (string) ASM of sign block witness data
46+
"signblock_witness_hex" : "hex", (string) Hex of sign block witness data
47+
"dynamic_parameters" : { (json object) Dynamic federation parameters in the block, if any
48+
"current" : { (json object) enforced dynamic federation parameters. The signblockscript is published for each block, while others are published only at epoch start
49+
"signblockscript" : "hex", (string) signblock script
50+
"max_block_witness" : n, (numeric) Maximum serialized size of the block witness stack
51+
"fedpegscript" : "hex", (string) fedpeg script
52+
"extension_space" : [ (json array) array of hex-encoded strings
53+
...
54+
]
55+
},
56+
"proposed" : { (json object) Proposed parameters. Uninforced. Must be published in full
57+
... same entries as current
58+
}
59+
},
60+
"previousblockhash" : "hex", (string, optional) The hash of the previous block (if available)
61+
"nextblockhash" : "hex" (string, optional) The hash of the next block (if available)
62+
}
63+
64+
Result (for verbosity = 2):
65+
{ (json object)
66+
..., Same output as verbosity = 1
67+
"tx" : [ (json array)
68+
{ (json object)
69+
..., The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result
70+
"fee" : n (numeric) The transaction fee in BTC, omitted if block undo data is not available
71+
},
72+
...
73+
]
74+
}
75+
76+
Result (for verbosity = 3):
77+
{ (json object)
78+
..., Same output as verbosity = 2
79+
"tx" : [ (json array)
80+
{ (json object)
81+
"vin" : [ (json array)
82+
{ (json object)
83+
..., The same output as verbosity = 2
84+
"prevout" : { (json object) (Only if undo information is available)
85+
"generated" : true|false, (boolean) Coinbase or not
86+
"height" : n, (numeric) The height of the prevout
87+
"value" : n, (numeric) The value in BTC
88+
"scriptPubKey" : { (json object)
89+
"asm" : "str", (string) The asm
90+
"hex" : "str", (string) The hex
91+
"address" : "str", (string, optional) The Bitcoin address (only if a well-defined address exists)
92+
"type" : "str" (string) The type (one of: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown)
93+
}
94+
}
95+
},
96+
...
97+
]
98+
},
99+
...
100+
]
101+
}
102+
103+
Examples:
104+
> elements-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
105+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: text/plain;' http://127.0.0.1:7041/
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
layout: doc
3+
name: getblockchaininfo
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblockchaininfo/
7+
---
8+
9+
getblockchaininfo
10+
11+
Returns an object containing various state info regarding blockchain processing.
12+
13+
Result:
14+
{ (json object)
15+
"chain" : "str", (string) current network name (main, test, signet, regtest)
16+
"blocks" : n, (numeric) the height of the most-work fully-validated chain. The genesis block has height 0
17+
"headers" : n, (numeric) the current number of headers we have validated
18+
"bestblockhash" : "str", (string) the hash of the currently best block
19+
"difficulty" : n, (numeric) the current difficulty
20+
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
21+
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
22+
"verificationprogress" : n, (numeric) estimate of verification progress [0..1]
23+
"initialblockdownload" : true|false, (boolean) (debug information) estimate of whether this node is in Initial Block Download mode
24+
"chainwork" : "hex", (string) total amount of work in active chain, in hexadecimal
25+
"size_on_disk" : n, (numeric) the estimated size of the block and undo files on disk
26+
"pruned" : true|false, (boolean) if the blocks are subject to pruning
27+
"current_params_root" : "hex", (string) the root of the currently active dynafed params
28+
"signblock_asm" : "str", (string) ASM of sign block challenge data from genesis block
29+
"signblock_hex" : "hex", (string) Hex of sign block challenge data from genesis block
30+
"current_signblock_asm" : "str", (string) ASM of sign block challenge data enforced on the next block
31+
"current_signblock_hex" : "hex", (string) Hex of sign block challenge data enforced on the next block
32+
"max_block_witness" : n, (numeric) maximum sized block witness serialized size for the next block
33+
"epoch_length" : n, (numeric) length of dynamic federations epoch, or signaling period
34+
"total_valid_epochs" : n, (numeric) number of epochs a given fedpscript is valid for, defined per chain
35+
"epoch_age" : n, (numeric) number of blocks into a dynamic federation epoch chain tip is. This number is between 0 to epoch_length-1
36+
"extension_space" : [ (json array) array of extension fields in dynamic blockheader
37+
...
38+
],
39+
"pruneheight" : n, (numeric, optional) lowest-height complete block stored (only present if pruning is enabled)
40+
"automatic_pruning" : true|false, (boolean, optional) whether automatic pruning is enabled (only present if pruning is enabled)
41+
"prune_target_size" : n, (numeric, optional) the target size used by pruning (only present if automatic pruning is enabled)
42+
"softforks" : { (json object) (DEPRECATED, returned only if config option -deprecatedrpc=softforks is passed) status of softforks
43+
"xxxx" : { (json object) name of the softfork
44+
"type" : "str", (string) one of "buried", "bip9"
45+
"height" : n, (numeric, optional) 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+
"bip9" : { (json object, optional) status of bip9 softforks (only for "bip9" type)
48+
"bit" : n, (numeric, optional) the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
49+
"start_time" : xxx, (numeric) the minimum median time past of a block at which the bit gains its meaning
50+
"timeout" : xxx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
51+
"min_activation_height" : n, (numeric) minimum height of blocks for which the rules may be enforced
52+
"status" : "str", (string) status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed")
53+
"since" : n, (numeric) height of the first block to which the status applies
54+
"status_next" : "str", (string) status of deployment at the next block
55+
"statistics" : { (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
56+
"period" : n, (numeric) the length in blocks of the signalling period
57+
"threshold" : n, (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
58+
"elapsed" : n, (numeric) the number of blocks elapsed since the beginning of the current period
59+
"count" : n, (numeric) the number of blocks with the version bit set in the current period
60+
"possible" : true|false (boolean, optional) returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
61+
},
62+
"signalling" : "str" (string) indicates blocks that signalled with a # and blocks that did not with a -
63+
}
64+
},
65+
...
66+
},
67+
"warnings" : "str" (string) any network and blockchain warnings
68+
}
69+
70+
Examples:
71+
> elements-cli getblockchaininfo
72+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:7041/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: doc
3+
name: getblockcount
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblockcount/
7+
---
8+
9+
getblockcount
10+
11+
Returns the height of the most-work fully-validated chain.
12+
The genesis block has height 0.
13+
14+
Result:
15+
n (numeric) The current block count
16+
17+
Examples:
18+
> elements-cli getblockcount
19+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:7041/
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: doc
3+
name: getblockfilter
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblockfilter/
7+
---
8+
9+
getblockfilter "blockhash" ( "filtertype" )
10+
11+
Retrieve a BIP 157 content filter for a particular block.
12+
13+
Arguments:
14+
1. blockhash (string, required) The hash of the block
15+
2. filtertype (string, optional, default="basic") The type name of the filter
16+
17+
Result:
18+
{ (json object)
19+
"filter" : "hex", (string) the hex-encoded filter data
20+
"header" : "hex" (string) the hex-encoded filter header
21+
}
22+
23+
Examples:
24+
> elements-cli getblockfilter "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" "basic"
25+
> 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:7041/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: doc
3+
name: getblockfrompeer
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblockfrompeer/
7+
---
8+
9+
getblockfrompeer "blockhash" peer_id
10+
11+
Attempt to fetch block from a given peer.
12+
13+
We must have the header for this block, e.g. using submitheader.
14+
Subsequent calls for the same block and a new peer will cause the response from the previous peer to be ignored.
15+
16+
Returns an empty JSON object if the request was successfully scheduled.
17+
18+
Arguments:
19+
1. blockhash (string, required) The block hash to try to fetch
20+
2. peer_id (numeric, required) The peer to fetch it from (see getpeerinfo for peer IDs)
21+
22+
Result:
23+
{} (empty JSON object)
24+
25+
Examples:
26+
> elements-cli getblockfrompeer "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 0
27+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockfrompeer", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 0]}' -H 'content-type: text/plain;' http://127.0.0.1:7041/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: doc
3+
name: getblockhash
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblockhash/
7+
---
8+
9+
getblockhash height
10+
11+
Returns hash of block in best-block-chain at height provided.
12+
13+
Arguments:
14+
1. height (numeric, required) The height index
15+
16+
Result:
17+
"hex" (string) The block hash
18+
19+
Examples:
20+
> elements-cli getblockhash 1000
21+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockhash", "params": [1000]}' -H 'content-type: text/plain;' http://127.0.0.1:7041/
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
layout: doc
3+
name: getblockheader
4+
elemversion: 23.3.1
5+
elemgroup: blockchain
6+
permalink: /en/doc/23.3.1/rpc/blockchain/getblockheader/
7+
---
8+
9+
getblockheader "blockhash" ( verbose )
10+
11+
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.
12+
If verbose is true, returns an Object with information about blockheader <hash>.
13+
14+
Arguments:
15+
1. blockhash (string, required) The block hash
16+
2. verbose (boolean, optional, default=true) true for a json object, false for the hex-encoded data
17+
18+
Result (for verbose = true):
19+
{ (json object)
20+
"hash" : "hex", (string) the block hash (same as provided)
21+
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
22+
"height" : n, (numeric) The block height or index
23+
"version" : n, (numeric) The block version
24+
"versionHex" : "hex", (string) The block version formatted in hexadecimal
25+
"merkleroot" : "hex", (string) The merkle root
26+
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
27+
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
28+
"nonce" : n, (numeric) The nonce
29+
"bits" : "hex", (string) The bits
30+
"difficulty" : n, (numeric) The difficulty
31+
"chainwork" : "hex", (string) Expected number of hashes required to produce the current chain
32+
"nTx" : n, (numeric) The number of transactions in the block
33+
"signblock_witness_asm" : "str", (string) ASM of sign block witness data
34+
"signblock_witness_hex" : "hex", (string) Hex of sign block witness data
35+
"dynamic_parameters" : { (json object) Dynamic federation parameters in the block, if any
36+
"current" : { (json object) enforced dynamic federation parameters. The signblockscript is published for each block, while others are published only at epoch start
37+
"signblockscript" : "hex", (string) signblock script
38+
"max_block_witness" : n, (numeric) Maximum serialized size of the block witness stack
39+
"fedpegscript" : "hex", (string) fedpeg script
40+
"extension_space" : [ (json array) array of hex-encoded strings
41+
...
42+
]
43+
},
44+
"proposed" : { (json object) Proposed parameters. Uninforced. Must be published in full
45+
... same entries as current
46+
}
47+
},
48+
"previousblockhash" : "hex", (string, optional) The hash of the previous block (if available)
49+
"nextblockhash" : "hex" (string, optional) The hash of the next block (if available)
50+
}
51+
52+
Result (for verbose=false):
53+
"hex" (string) A string that is serialized, hex-encoded data for block 'hash'
54+
55+
Examples:
56+
> elements-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
57+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: text/plain;' http://127.0.0.1:7041/

0 commit comments

Comments
 (0)