Internally, /rest/chaininfo gets the infos from getblockchaininfo and I just realized the documentation of it in REST-interface.md is outdated compared to the getblockchaininfo RPC one. This PR removes the documentation of the fields and adds a reference to the RPC help.
docs: update /rest/chaininfo doc referring to RPC help #24776
pull brunoerg wants to merge 2 commits into bitcoin:master from brunoerg:2022-04-rest-doc-improv changing 1 files +4 −14-
brunoerg commented at 5:49 PM on April 5, 2022: member
- DrahtBot added the label Docs on Apr 5, 2022
-
laanwj commented at 6:49 PM on April 13, 2022: member
Concept ACK. Though, if it's the same, at some point we might as well say 'see
bitcoin-cli help getblockchaininfo' to avoid duplicating information that may out of date soon again. -
brunoerg commented at 10:59 AM on April 14, 2022: member
at some point we might as well say 'see bitcoin-cli help getblockchaininfo' to avoid duplicating information that may out of date soon again.
I agree
For
/rest/mempool/info.jsonthere aren't any specifications of the fields, only the message: https://github.com/bitcoin/bitcoin/blob/d2e04196b676d544157a53b98d37d8d12a59a961/doc/REST-interface.md?plain=1#L132Should we follow this pattern for other endpoints to avoid out of date fields? If so, I can use this PR to remove it and add
Refer to the getblockchaininfo RPC for documentation of the fields.@laanwj -
jonatack commented at 8:00 PM on April 18, 2022: member
Concept ACK.
we might as well say 'see bitcoin-cli help getblockchaininfo' to avoid duplicating information that may out of date soon again.
Agree, and it looks like getblockchaininfo will be updated soon for a deprecation. Maybe something like the following diff:
<details><summary>diff</summary><p>
diff --git a/doc/REST-interface.md b/doc/REST-interface.md index c359725faf..f11624fd28 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -82,17 +82,7 @@ Given a height: returns hash of block in best-block-chain at height provided. Returns various state info regarding block chain processing. Only supports JSON as output format. -* chain : (string) current network name (main, test, signet, regtest) -* blocks : (numeric) the current number of blocks processed in the server -* headers : (numeric) the current number of headers we have validated -* bestblockhash : (string) the hash of the currently best block -* difficulty : (numeric) the current difficulty -* mediantime : (numeric) the median time of the 11 blocks before the most recent block on the blockchain -* verificationprogress : (numeric) estimate of verification progress [0..1] -* chainwork : (string) total amount of work in active chain, in hexadecimal -* pruned : (boolean) if the blocks are subject to pruning -* pruneheight : (numeric) highest block available -* softforks : (array) status of softforks in progress +Refer to the `getblockchaininfo` RPC help for details. #### Query UTXO set `GET /rest/getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>` @@ -127,13 +117,13 @@ $ curl localhost:18332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff76 #### Memory pool `GET /rest/mempool/info.json` -Returns various information about the TX mempool. +Returns various information about the transaction mempool. Only supports JSON as output format. -Refer to the `getmempoolinfo` RPC for documentation of the fields. +Refer to the `getmempoolinfo` RPC help for details. `GET /rest/mempool/contents.json` -Returns transactions in the TX mempool. +Returns the transactions in the mempool. Only supports JSON as output format.</p></details>
-
docs: update `/rest/chaininfo` doc referring to RPC help b941dec0a9
-
doc: cleanups to mempool rest endpoints 1d95b5c783
- brunoerg force-pushed on Apr 19, 2022
- brunoerg renamed this:
docs: update `/rest/chaininfo` doc according to `getblockchaininfo`
docs: update /rest/chaininfo doc referring to RPC help
on Apr 19, 2022 - jonatack approved
-
jonatack commented at 8:17 AM on April 19, 2022: member
ACK 1d95b5c78368575c8885a5bf659cdb4d6261f124
- MarcoFalke merged this on Apr 19, 2022
- MarcoFalke closed this on Apr 19, 2022
- sidhujag referenced this in commit add84e0b20 on Apr 19, 2022
- luke-jr referenced this in commit 970b4e2394 on May 21, 2022
- DrahtBot locked this on Apr 19, 2023