Skip to content

Conversation

@brunoerg
Copy link
Contributor

@brunoerg brunoerg commented Apr 5, 2022

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.

@DrahtBot DrahtBot added the Docs label Apr 5, 2022
@laanwj
Copy link
Member

laanwj commented Apr 13, 2022

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
Copy link
Contributor Author

brunoerg commented Apr 14, 2022

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.json there aren't any specifications of the fields, only the message:

Refer to the `getmempoolinfo` RPC for documentation of the fields.

Should 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
Copy link
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:

diff

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.

@brunoerg brunoerg force-pushed the 2022-04-rest-doc-improv branch from cff4fb3 to 1d95b5c Compare April 19, 2022 00:23
@brunoerg brunoerg changed the title docs: update /rest/chaininfo doc according to getblockchaininfo docs: update /rest/chaininfo doc referring to RPC help Apr 19, 2022
@brunoerg
Copy link
Contributor Author

Thanks, @laanwj and @jonatack. Just updated this PR (and its description) to remove the documentation of the fields and add a reference to the RPC help.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 1d95b5c

@maflcko maflcko merged commit ff78833 into bitcoin:master Apr 19, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 19, 2022
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request May 21, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants