daemon-rpc.md 82.9 KB
Newer Older
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
```

Example without input to set the default categories:

```
$ curl -X POST http://127.0.0.1:18081/set_log_categories -H 'Content-Type: application/json'

{
  "categories": "*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO",
  "status": "OK"
}
```


### **/get_transaction_pool**

Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory.

Alias: *None*.

Inputs: *None*.

Outputs:

* *spent_key_images* - List of spent output key images:
  * *id_hash* - string; Key image.
  * *txs_hashes* - string list; tx hashes of the txes (usually one) spending that key image.
* *status* - string; General RPC error code. "OK" means everything looks good.
el00ruobuob's avatar
el00ruobuob committed
2029
* *transactions* - List of transactions in the mempool are not in a block on the main chain at the moment:
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
  * *blob_size* - unsigned int; The size of the full transaction blob.
  * *double_spend_seen* - boolean; States if this transaction has been seen as double spend.
  * *do_not_relay*; boolean; States if this transaction should not be relayed
  * *fee* - unsigned int; The amount of the mining fee included in the transaction, in @atomic-units.
  * *id_hash* - string; The transaction ID hash.
  * *kept_by_block* - boolean; States if the tx was included in a block at least once (`true`) or not (`false`).
  * *last_failed_height* - unsigned int; If the transaction validation has previously failed, this tells at what height that occured.
  * *last_failed_id_hash* - string; Like the previous, this tells the previous transaction ID hash.
  * *last_relayed_time* - unsigned int; Last unix time at which the transaction has been relayed.
  * *max_used_block_height* - unsigned int; Tells the height of the most recent block with an output used in this transaction.
  * *max_used_block_hash* - string; Tells the hash of the most recent block with an output used in this transaction.
  * *receive_time* - unsigned int; The Unix time that the transaction was first seen on the network by the node.
  * *relayed* - boolean; States if this transaction has been relayed
  * *tx_blob* - unsigned int; Hexadecimal blob represnting the transaction.
  * *tx_json* - json string; JSON structure of all information in the transaction:
    * *version* - Transaction version
    * *unlock_time* - If not 0, this tells when a transaction output is spendable.
    * *vin* - List of inputs into transaction:
      * *key* - The public key of the previous output spent in this transaction.
        * *amount* - The amount of the input, in @atomic-units.
        * *key_offsets* - A list of integer offets to the input.
        * *k_image* - The key image for the given input
    * *vout* - List of outputs from transaction:
      * *amount* - Amount of transaction output, in @atomic-units.
      * *target* - Output destination information:
        * *key* - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output.
    * *extra* - Usually called the "transaction ID" but can be used to include any random 32 bytes.
    * *rct_signatures* - Ring signatures:
      * *type*
      * *txnFee*
      * *ecdhInfo* - array of Diffie Helman Elipctic curves structures as follows:
        * *mask* - String
        * *amount* - String
      * *outPk*
    * *rctsig_prunable*
      * *rangeSigs* - array of structures as follows:
        * *asig*
        * *Ci*
      * *MGs* - array of structures as follows:
        * *ss* - array of arrays of two strings.
        * *cc* - String

Example (Note: Some lists in the returned information have been truncated for display reasons):

```
$ curl -X POST http://127.0.0.1:18081/get_transaction_pool -H 'Content-Type: application/json'

{
  "spent_key_images": [{
    "id_hash": "a2af919609db4ff5ab8d4ba18502e647d521760e1cbc30288f06fa87bf9a0c1c",
    "txs_hashes": ["1ee6a4873b638711795fc3b0b73fc7146505a09a7f4749534fd408d571a273cf"]
  },{
    "id_hash": "02d5f6559e9bca5ae5a335130aeeb05df2db518ab9837fa64ebbab276c100792",
    "txs_hashes": ["531aacc0ceb8514cdde5f104285202ccc3e969c77584e3c6fa614c987c583965"]
  },
  ...],
  "status": "OK",
  "transactions": [{
    "blob_size": 13193,
    "do_not_relay": false,
    "double_spend_seen": false,
    "fee": 9694360000,
    "id_hash": "f8fb875cfc9e2e59bcf96a42474c79e01d50b69e6548d445d45984f7db66e50f",
    "kept_by_block": false,
    "last_failed_height": 0,
    "last_failed_id_hash": "0000000000000000000000000000000000000000000000000000000000000000",
    "last_relayed_time": 1525615049,
    "max_used_block_height": 1564924,
    "max_used_block_id_hash": "4bae7856979f46c7de31f3fb58cac36d4dfd2765bf33f876edf33d0e05ebb4a7",
    "receive_time": 1525615049,
    "relayed": true,
    "tx_blob": " ... ",
    "tx_json": "{\n  \"version\": 2, \n  \"unlock_time\": 0, \n  \"vin\": [ {\n      \"key\": {\n        \"amount\": 0, \n        \"key_offsets\": [ 2630347, 594429, 1047509, 758973, 464501, 61971, 22268\n        ], \n        \"k_image\": \"0731363c58dd4492f031fa20c82fe6ddcb9cc070d73938afe8a5f7f77897f8b4\"\n      }\n    }\n  ], \n  \"vout\": [ {\n      \"amount\": 0, \n      \"target\": {\n        \"key\": \"f3b3dd09483616e343b9866eed50a0ce01d5c0d0f2612ce2c4d0e9cce5c218cd\"\n      }\n    }, {\n      \"amount\": 0, \n      \"target\": {\n        \"key\": \"9796f2d477a696b6282bf3cb1a41cefba0c4604eedcc2e7a44904d7033643e0e\"\n      }\n    }\n  ], \n  \"extra\": [ 1, 25, 228, 80, 5, 214, 117, 150, 9, 125, 98, 17, 113, 208, 89, 223, 242, 227, 188, 197, 141, 190, 135, 140, 152, 117, 240, 150, 21, 93, 62, 108, 124\n  ], \n  \"rct_signatures\": {\n    \"type\": 1, \n    \"txnFee\": 9694360000, \n    \"ecdhInfo\": [ {\n        \"mask\": \"645f06a2816aecf83d5041c3320eb31092b994fb2733bb74c8c47e288d452c04\", \n        \"amount\": \"3908f14d39dcb3831331cb255eeadc5b0aea0143645b9cd3034abf613995740d\"\n      }, {\n        \"mask\": \"0785b5df0a994b14d59da810503a022721d8f629720f526e15bd848ad3c2c509\", \n        \"amount\": \"fbd81cf2368dcd742905ded5287457030467aaf5bc9939e13f1d6bf8d4c8ca09\"\n      }], \n    \"outPk\": [ \"c19f5fa052859126e0eed0e3c860aadab049677b2b3dd14cc74d02f92f1d013f\", \"1581ef6368de1608ea366566b88272db220479cf215f6d88d7b60ec221d11e0a\"]\n  }, \n  \"rctsig_prunable\": {\n    \"rangeSigs\": [ {\n        \"asig\": \" ... \", \n        \"Ci\": \" .. \"\n      }, {\n        \"asig\": \" ... \", \n        \"Ci\": \" ... \"\n      }], \n    \"MGs\": [ {\n        \"ss\": [ [ \"218a10a29e0f66e5a324af67b7734708a8a4cc8f16b28acd8cda538aaa495a02\", \"b368b4e956df5808c5c257f0dc3f7eff8c28463d0bb20759d19977fa02d6f205\"], [ \"f741d2c96bc23b362b4155a03fb6f1351ab5bf4445a43b3e52ba776f526af305\", \"a10ad1ee80dce3f311dd3dc141803daeecaa4d2a25a390cd9c35e4161b7c9e0c\"],
    ...], \n        \"cc\": \"e93801b707261ca76e146fdf2085abae71ad9203a00edc843c74f4ead8a39601\"\n      }]\n  }\n}"
  },
  ...]
}
```


### **/get_transaction_pool_hashes.bin**

Get hashes from transaction pool. Binary request.

Alias: *None*.

Inputs: *None*.

Outputs:

* *status* - string; General RPC error code. "OK" means everything looks good.
* *tx_hashes* - binary array of transaction hashes.
* *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 (`false`).

Example:

```
$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_hashes.bin -H 'Content-Type: application/json'

{
  "status": "OK",
  "tx_hashes": " ... ",
  "untrusted": false
}
```


### **/get_transaction_pool_stats**

Get the transaction pool statistics.

Alias: *None*.

Inputs: *None*.

Outputs:

* *pool_stats* - Structure as follows:
  * *bytes_max* - unsigned int; Max transaction size in pool
  * *bytes_med* - unsigned int; Median transaction size in pool
  * *bytes_min* - unsigned int; Min transaction size in pool
  * *bytes_total* - unsigned int; total size of all transactions in pool
  * *histo* - structure *txpool_histo* as follows:
    * *txs* - unsigned int; number of transactions
    * *bytes* - unsigned int; size in bytes.
  * *histo_98pc* unsigned int; the time 98% of txes are "younger" than
  * *num_10m* unsigned int; number of transactions in pool for more than 10 minutes
  * *num_double_spends* unsigned int; number of double spend transactions
  * *num_failing* unsigned int; number of failing transactions
  * *num_not_relayed* unsigned int; number of non-relayed transactions
  * *oldest* unsigned int; unix time of the oldest transaction in the pool
  * *txs_total* unsigned int; total number of transactions.
* *status* - string; General RPC error code. "OK" means everything looks good.
* *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 (`false`).

Example:

```
$ curl -X POST http://127.0.0.1:18081/get_transaction_pool_stats -H 'Content-Type: application/json'

{
  "pool_stats": {
    "bytes_max": 47222,
    "bytes_med": 13290,
    "bytes_min": 13092,
    "bytes_total": 449511,
    "fee_total": 289715320000,
    "histo": "\t▒'▒5▒4▒\/▒▒▒$3",
    "histo_98pc": 0,
    "num_10m": 18,
    "num_double_spends": 1,
    "num_failing": 17,
    "num_not_relayed": 0,
    "oldest": 1525457001,
    "txs_total": 26
  },
  "status": "OK",
  "untrusted": false
}
```


### **/stop_daemon**

Send a command to the daemon to safely disconnect and shut down.

Alias: *None*.

Inputs: *None*.

Outputs:

* *status* - string; General RPC error code. "OK" means everything looks good.

Example:

```
$ curl -X POST http://127.0.0.1:18081/stop_daemon -H 'Content-Type: application/json'

{
  "status": "OK"
}
```


### **/get_info (not JSON)**

This method is a convenient backward support and should not be used anymore. See [get_info](#get_info) JSON RPC for details.

Alias:

* */getinfo*
* *get_info*


### **/get_limit**

Get daemon bandwidth limits.

Alias: *None*.

Inputs: *None*.

Outputs:

* *limit_down* - unsigned int; Download limit in kBytes per second
* *limit_up* - unsigned int; Upload limit in kBytes per second
* *status* - string; General RPC error code. "OK" means everything looks good.
* *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 (`false`).

Example:

```
$ curl -X POST http://127.0.0.1:18081/get_limit -H 'Content-Type: application/json'

{
  "limit_down": 8192,
  "limit_up": 128,
  "status": "OK",
  "untrusted": false
}
```


### **/set_limit**

Set daemon bandwidth limits.

Alias: *None*.

Inputs:

* *limit_down* - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit)
* *limit_up* - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit)

Outputs:

* *limit_down* - unsigned int; Download limit in kBytes per second
* *limit_up* - unsigned int; Upload limit in kBytes per second
* *status* - string; General RPC error code. "OK" means everything looks good.

Example:

```
$ curl -X POST http://127.0.0.1:18081/set_limit -d '{"limit_down": 1024}' -H 'Content-Type: application/json'

{
  "limit_down": 1024,
  "limit_up": 128,
  "status": "OK"
}
```


### **/out_peers**

Limit number of Outgoing peers.

Alias: *None*.

Inputs:

* *out_peers* - unsigned int; Max number of outgoing peers

Outputs:

* *status* - string; General RPC error code. "OK" means everything looks good.

Example:

```
$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"out_peers": 3232235535}' -H 'Content-Type: application/json'

{
  "status": "OK"
}
```


### **/in_peers**

Limit number of Incoming peers.

Alias: *None*.

Inputs:

* *in_peers* - unsigned int; Max number of incoming peers

Outputs:

* *status* - string; General RPC error code. "OK" means everything looks good.

Example:

```
$ curl -X POST http://127.0.0.1:18081/out_peers -d '{"in_peers": 3232235535}' -H 'Content-Type: application/json'

{
  "status": "OK"
}
```


### **/start_save_graph**

Obsolete. Conserved here for reference.

Alias: *None*.

Inputs: *None*.

Outputs:

* *status* - string; General RPC error code. "OK" means everything looks good.

Example:

```
$ curl -X POST http://127.0.0.1:18081/start_save_graph -H 'Content-Type: application/json'

{
  "status": "OK"
}
```


### **/stop_save_graph**

Obsolete. Conserved here for reference.

Alias: *None*.

Inputs: *None*.

Outputs:

* *status* - string; General RPC error code. "OK" means everything looks good.

Example:

```
$ curl -X POST http://127.0.0.1:18081/stop_save_graph -H 'Content-Type: application/json'

{
  "status": "OK"
}
```


### **/get_outs**

Get outputs.

Alias: *None*.

Inputs:

* *outputs* array of *get_outputs_out* structure as follows:
  * *amount* - unsigned int;
  * *index* - unsigned int;

Outputs:

* *outs* - array of structure *outkey* as follows:
  * *height* - unsigned int; block height of the output
  * *key* - String; the public key of the output
  * *mask* - String
  * *txid* - String; transaction id
  * *unlocked* - boolean; States if output is locked (`false`) or not (`true`)
* *status* - string; General RPC error code. "OK" means everything looks good.
* *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 (`false`).


### **/update**

Update daemon.

Alias: *None*.

Inputs:

* *command* - String; command to use, either `check` or `download`
* *path* - String; Optional, path where to download the update.

Outputs:

* *auto_uri* - string;
* *hash* - string;
* *path* - String; path to download the update
* *status* - string; General RPC error code. "OK" means everything looks good.
* *update* - boolean; States if an update is available to download (`true`) or not (`false`)
* *user_uri* - string;
* *version* - string; Version available for download.

Example:

```
$ curl -X POST http://127.0.0.1:18081/update -d '{"command":"check"}' -H 'Content-Type: application/json'

{
  "auto_uri": "",
  "hash": "",
  "path": "",
  "status": "OK",
  "update": false,
  "user_uri": "",
  "version": ""
}
```
For faster browsing, not all history is shown. View entire blame