Skip to content

Commit 297e340

Browse files
authored
Merge pull request #2336
daemon-rpc: docs for undocumented endpoints
2 parents 730c767 + e290e6e commit 297e340

1 file changed

Lines changed: 129 additions & 0 deletions

File tree

resources/developer-guides/daemon-rpc.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the m
5858
* [/get_hashes.bin](#get_hashesbin)
5959
* [/get_o_indexes.bin](#get_o_indexesbin)
6060
* [/get_outs.bin](#get_outsbin)
61+
* [/get_output_distribution.bin](#get_output_distributionbin)
6162
* [/get_transactions](#get_transactions)
6263
* [/get_alt_blocks_hashes](#get_alt_blocks_hashes)
6364
* [/is_key_image_spent](#is_key_image_spent)
@@ -86,6 +87,8 @@ Note: "@atomic-units" refer to the smallest fraction of 1 XMR according to the m
8687
* [/get_outs](#get_outs)
8788
* [/update](#update)
8889
* [/pop_blocks](#pop_blocks)
90+
* [/get_transaction_pool_hashes](#get_transaction_pool_hashes)
91+
* [/get_public_nodes](#get_public_nodes)
8992

9093

9194
---
@@ -1908,6 +1911,39 @@ $ curl http://127.0.0.1:18081/get_o_indexes.bin --data-binary '{"txid":"d6e48158
19081911
--->
19091912

19101913

1914+
### **/get_output_distribution.bin**
1915+
1916+
Get outputs. Binary request version of [get_output_distribution](#get_output_distribution).
1917+
1918+
Alias: *None*.
1919+
1920+
Inputs:
1921+
1922+
* *credits* - unsigned int; If payment for RPC is enabled, the number of credits available to the requesting client. Otherwise, 0.
1923+
* *top_hash* - string; If payment for RPC is enabled, the hash of the highest block in the chain. Otherwise, empty.
1924+
* *amounts* - array of unsigned int; amounts to look for
1925+
* *cumulative* - boolean; (optional, default is `false`) States if the result should be cumulative (`true`) or not (`false`)
1926+
* *from_height* - unsigned int; (optional, default is 0) starting height to check from
1927+
* *to_height* - unsigned int; (optional, default is 0) ending height to check up to
1928+
* *binary* - boolean; (optional, default is `true`); Must be `true`.
1929+
* *compress* - unsigned int; (optional, default is `false`) Respond with compressed data.
1930+
1931+
Outputs:
1932+
1933+
* *credits* - unsigned int; If payment for RPC is enabled, the number of credits available to the requesting client. Otherwise, 0.
1934+
* *distributions* - array of structure distribution as follows:
1935+
* *amount* - unsigned int
1936+
* *base* - unsigned int
1937+
* *binary* - boolean; Always `true`.
1938+
* *compress* - unsigned int; `true` if compressed data, `false` otherwise.
1939+
* *distribution* - array of unsigned int; This field exists instead of *compressed_data* if the *compress* option was not used.
1940+
* *compressed_data* - array of unsigned int; This field exists instead of *distribution* if the *compress* option was used.
1941+
* *start_height* - unsigned int
1942+
* *status* - string; General RPC error code. "OK" means everything looks good.
1943+
* *top_hash* - string; If payment for RPC is enabled, the hash of the highest block in the chain. Otherwise, empty.
1944+
* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced and thus handles the RPC locally (`false`)
1945+
1946+
19111947
### **/get_transactions**
19121948

19131949
Look up one or more transactions by hash.
@@ -3075,3 +3111,96 @@ $ curl http://127.0.0.1:18081/pop_blocks -d '{"nblocks":6}' -H 'Content-Type: ap
30753111
"untrusted": false
30763112
}
30773113
```
3114+
3115+
3116+
### **/get_transaction_pool_hashes**
3117+
3118+
Get hashes from transaction pool.
3119+
3120+
Alias: *None*.
3121+
3122+
Inputs: *None*.
3123+
3124+
Outputs:
3125+
3126+
* *credits* - unsigned int; If payment for RPC is enabled, the number of credits available to the requesting client. Otherwise, 0.
3127+
* *status* - string; General RPC error code. "OK" means everything looks good.
3128+
* *top_hash* - string; If payment for RPC is enabled, the hash of the highest block in the chain. Otherwise, empty.
3129+
* *tx_hashes* - array of strings; This is an array of transaction hashes in hexadecimal string form.
3130+
* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced and thus handles the RPC locally (`false`)
3131+
3132+
Example:
3133+
3134+
```
3135+
$ curl http://127.0.0.1:18081/get_transaction_pool_hashes -H 'Content-Type: application/json'
3136+
3137+
{
3138+
"credits": 0,
3139+
"status": "OK",
3140+
"top_hash": "",
3141+
"tx_hashes": ["e27bb84f1cf1f47a79578d3bb1f47a81745a4c5a5551622b4e924eb0b83f960d","b9f76e686f389e126ada5caf47034c57adeef671d8b899cba1ead606c868f819"],
3142+
"untrusted": false
3143+
}
3144+
```
3145+
3146+
3147+
### **/get_public_nodes**
3148+
3149+
Get public peer information.
3150+
3151+
Alias: *None*.
3152+
3153+
Inputs:
3154+
3155+
* *gray* - boolean; (Optional; defaults to `false`) Include gray peers.
3156+
* *white* - boolean; (Optional; defaults to `true`) Include white peers.
3157+
* *include_blocked* - boolean; (Optional; defaults to `false`) Include blocked peers.
3158+
3159+
Outputs:
3160+
3161+
* *status* - string; General RPC error code. "OK" means everything looks good.
3162+
* *whites* - array of `public_node` structures defined as follows:
3163+
* *host* - string; The node's IP address. This includes IPv4, IPv6, Onion, and i2p addresses.
3164+
* *last_seen* - unsigned int; UNIX timestamp of the last time the node was seen.
3165+
* *rpc_credits_per_hash* - unsigned int; If payment for RPC is enabled, the number of credits the node is requesting per hash. Otherwise, 0.
3166+
* *rpc_port* - unsigned int; RPC port number of the node.
3167+
* *gray* - array of `public_node` structures; This is an array structures containing node information on gray peers. See *white* above.
3168+
* *untrusted* - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced and thus handles the RPC locally (`false`)
3169+
3170+
Example:
3171+
3172+
```
3173+
$ curl http://127.0.0.1:18081/get_public_nodes -d '{"gray":true}' -H 'Content-Type: application/json'
3174+
3175+
{
3176+
"gray": [{
3177+
"host": "142.93.132.1",
3178+
"last_seen": 0,
3179+
"rpc_credits_per_hash": 0,
3180+
"rpc_port": 18089
3181+
},{
3182+
"host": "193.142.4.2",
3183+
"last_seen": 0,
3184+
"rpc_credits_per_hash": 0,
3185+
"rpc_port": 19084
3186+
}],
3187+
"status": "OK",
3188+
"untrusted": false,
3189+
"white": [{
3190+
"host": "70.52.75.3",
3191+
"last_seen": 1722812577,
3192+
"rpc_credits_per_hash": 0,
3193+
"rpc_port": 18081
3194+
},{
3195+
"host": "::ffff:207.180.221.220",
3196+
"last_seen": 1722872337,
3197+
"rpc_credits_per_hash": 0,
3198+
"rpc_port": 18089
3199+
},{
3200+
"host": "zbjkbsxc5munw3qusl7j2hpcmikhqocdf4pqhnhtpzw5nt5jrmofptid.onion:18083",
3201+
"last_seen": 1720186288,
3202+
"rpc_credits_per_hash": 0,
3203+
"rpc_port": 18089
3204+
}]
3205+
}
3206+
```

0 commit comments

Comments
 (0)