started upadting readme with new api/mempool example

master
moneroexamples 8 years ago
parent eb735a14dc
commit f4c72a3fc1

@ -383,6 +383,7 @@ Partial results shown:
#### api/mempool #### api/mempool
Return all txs in the mempool.
```bash ```bash
curl -w "\n" -X GET "http://139.162.32.245:8081/api/mempool" curl -w "\n" -X GET "http://139.162.32.245:8081/api/mempool"
@ -414,6 +415,17 @@ Partial results shown:
} }
``` ```
#### api/mempool?limit=<no_of_top_txs>
Return number of newest mempool txs, e.g., only 10.
```bash
curl -w "\n" -X GET "http://139.162.32.245:8081/api/mempool?limit=10"
```
Result analogical to the one above.
#### api/search/<block_number|tx_hash|block_hash> #### api/search/<block_number|tx_hash|block_hash>
```bash ```bash

@ -393,7 +393,7 @@ int main(int ac, const char* av[]) {
req.url_params.get("page") : "0"; req.url_params.get("page") : "0";
// default value for limit is some large number, so that // default value for limit is some large number, so that
// a call to api/mempool without any arguments return all // a call to api/mempool without any limit return all
// mempool txs // mempool txs
string limit = regex_search(req.raw_url, regex {"limit=\\d+"}) ? string limit = regex_search(req.raw_url, regex {"limit=\\d+"}) ?
req.url_params.get("limit") : "100000000"; req.url_params.get("limit") : "100000000";

Loading…
Cancel
Save