Files
nym/explorer-api
Dinko Zdravac cc983963d4 Fully functional network scores (#5048)
* Compile & copy wg probe

* Node status agent WIP

* Enable debug logging

* Agent submits results
- add clap to agent
- agent runs network probe
- /submit endpoint on NS API

* Build clients with timeouts

* Update logging and dev scripts

* Replace /blaclisted endpoint

* Testruns fully functional
- task that queues testruns periodically
- testruns read/write in DB

* Probe scores fully working
- testruns are assigned on API
- submit updates testruns correctly on NS API side
- agent registers with API
- agent submits results correctly

* Clippy fixes

* PR feedback

* Clippy again

* PR feedback

* Run clippy earlier in CI

* Make refresh delay configurable in server & agent
2024-10-28 17:31:43 +01:00
..
2024-08-28 11:39:49 +02:00
2023-08-23 16:17:07 +02:00
2024-10-17 08:51:39 +02:00
2023-08-23 16:17:07 +02:00

Network Explorer API

An API that provides data for the Network Explorer.

Features:

Development

Several environment variables are required. They can be provisioned via a .env file. For convenience a .env.dev is provided, just copy its content into .env.

Follow the steps to setup the geoip database.

GeoIP db install/update

A geoip database needs to be installed.

We use https://github.com/maxmind/geoipupdate to automatically download and update GeoLite2 binary database. For convenience we run it as a docker container.

At the root of the repo, inside the docker-compose.yml, there is a docker service geoipupdate for it.

Supposed you provided an .env file with all the environment variables listed in .env.sample-dev (found at the root), simply run the service through docker:

docker compose up -d geoipupdate

Running this command will automatically install (and update) the db file inside the directory path provided by GEOIP_DB_DIRECTORY env variable.

Running

When starting the explorer-api, supply the environment variable GEOIP_DB_PATH, pointing to the GeoLite2 binary database file. It should be previously installed thanks to geoipupdate service.

Note: As mentioned above the explorer-api binary reads the provided .env file.

Run as a service and reverse proxy with nginx to add https with Lets Encrypt.

Setup nginx to inject the request IP to the header X-Real-IP.

TODO / Known Issues

TODO

  • record the number of mixnodes on a given date and write to a file for later retrieval
  • dependency injection
  • tests