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
  1. brunoerg commented at 5:49 PM on April 5, 2022: member

    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.

  2. DrahtBot added the label Docs on Apr 5, 2022
  3. 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.

  4. 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.json there aren't any specifications of the fields, only the message: https://github.com/bitcoin/bitcoin/blob/d2e04196b676d544157a53b98d37d8d12a59a961/doc/REST-interface.md?plain=1#L132

    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

  5. 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>

  6. docs: update `/rest/chaininfo` doc referring to RPC help b941dec0a9
  7. doc: cleanups to mempool rest endpoints 1d95b5c783
  8. brunoerg force-pushed on Apr 19, 2022
  9. brunoerg renamed this:
    docs: update `/rest/chaininfo` doc according to `getblockchaininfo`
    docs: update /rest/chaininfo doc referring to RPC help
    on Apr 19, 2022
  10. brunoerg commented at 12:26 AM on April 19, 2022: member

    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.

  11. jonatack approved
  12. jonatack commented at 8:17 AM on April 19, 2022: member

    ACK 1d95b5c78368575c8885a5bf659cdb4d6261f124

  13. MarcoFalke merged this on Apr 19, 2022
  14. MarcoFalke closed this on Apr 19, 2022

  15. sidhujag referenced this in commit add84e0b20 on Apr 19, 2022
  16. luke-jr referenced this in commit 970b4e2394 on May 21, 2022
  17. DrahtBot locked this on Apr 19, 2023
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me