monero-project / monero-site

https://getmonero.org
BSD 3-Clause "New" or "Revised" License
275 stars 384 forks source link

daemon-rpc: incorrect doc fixes #2337

Open hinto-janai opened 1 month ago

hinto-janai commented 1 month ago

What

Fixes incorrect documentation for daemon RPC calls; requires review into monerod.

Fixes

Table of fixes in this PR, originally tracked here: https://github.com/Cuprate/cuprate/issues/159.

Route/endpoint Link Notes
get_miner_data get_miner_data, rpc/core_rpc_server_commands_defs.h @ 1012 difficulty field is noted as unsigned int, although it is actually a JSON string containing an unsigned int in hex form. Other documentation describes these hex int strings as string.
calc_pow calc_pow, cryptonote_basic/blobdatatype.h @ 39 Type used to describe block_data is blobdata. This is a monerod-specific type alias to std::string. Documentation should explain that it is a hex-encoded string of a block.
/get_outs.bin get_outs.bin, rpc/core_rpc_server_commands_defs.h @ 538..544 Documentation mentions non-existent field: amount
/send_raw_transaction send_raw_transaction, rpc/core_rpc_server_commands_defs.h @ 629..663 Documentation mentions non-existent field: not_rct
/mining_status mining_status, core_rpc_server_commands_defs.h @ 857..873 Documentation notates numbers as int instead of unsigned int. These are unsigned int both in code and elsewhere in documentation.
/get_transaction_pool get_transaction_pool, rpc/core_rpc_server_commands_defs.h @ 1524 Missing documentation for weight field, should be unsigned int; <DESCRIPTION>
flush_txpool flush_txpool Empty "" transaction in example causes error
get_block get_block Documentation states for tx_hashes field: "If there are no other transactions, this will be an empty list." This is not true, monerod's serializer will omit fields completely if the container is empty. The tx_hashes in the json field will exist, however.

Simple proof for get_block:

curl \
    http://127.0.0.1:18081/json_rpc \
    -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":0}}' \
    -H 'Content-Type: application/json'
netlify[bot] commented 1 month ago

Deploy Preview for barolo-time-757cf9 ready!

Built without sensitive environment variables

Name Link
Latest commit 80274d1f0b6446cac624dbfecb165b4aeb8dbd29
Latest deploy log https://app.netlify.com/sites/barolo-time-757cf9/deploys/66b174280b4eba0008249a48
Deploy Preview https://deploy-preview-2337--barolo-time-757cf9.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.