monero-site
monero-site copied to clipboard
daemon-rpc: incorrect doc fixes
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'