Skip to content
Permalink
Browse files

Add circulating supply endpoint

  • Loading branch information...
Doy-lee committed Feb 12, 2019
1 parent ee5f69c commit 04eb6cb57806534e9265ef44e2fe065466848295
Showing with 18 additions and 1 deletion.
  1. +12 −0 README.md
  2. +6 −1 main.cpp
@@ -710,6 +710,18 @@ curl -w "\n" -X GET "http://127.0.0.1:8081/api/emission"

Emission only works when the emission monitoring thread is enabled.

#### api/circulating\_supply

```bash
curl -w "\n" -X GET "http://127.0.0.1:8081/api/circulating_supply"
```

```
15606500
```

Circulating supply only works when the emission monitoring thread is enabled.

#### api/version

```bash
@@ -6,6 +6,7 @@
#include "ext/crow/crow.h"
#include "src/CmdLineOptions.h"
#include "src/MicroCore.h"
#include "src/CurrentBlockchainStatus.h"

#include <fstream>
#include <regex>
@@ -730,10 +731,14 @@ main(int ac, const char* av[])
([&]() {

mylok::jsonresponse r{lokblocks.json_emission()};

return r;
});

CROW_ROUTE(app, "/api/circulating_supply") ([&]() {
std::string result = std::to_string(lokeg::CurrentBlockchainStatus::circulating_supply);
return std::move(result);
});

CROW_ROUTE(app, "/api/outputs").methods("GET"_method)
([&](const crow::request &req) {

0 comments on commit 04eb6cb

Please sign in to comment.
You can’t perform that action at this time.