* Squashing all the changes initial router started expanding the API initial empty openapi/swagger populated build-info endpoint wip: populating rest of swagger missing swagger data + using closure capture for immutable state running the api as a proper task in gateway 'run' fixing some version/feature clashes refactored routes structures initial host information endpoint expanded on gateway-related endpoints signing host information moved all models to separate crate unified http api client routes unification + node api client new generic cache and refresher nym-api caching node self described information removed old cache type temporarily wired up NymContractCache to NodeDescriptionProvider caching self reported host info clients using self-described gateway information fixed request timeouts for wasm fixed wasm builds post rebase fixes cargo fmt brought in wg routes into nym-node router added ErrorResponse for wireguard routes basic swagger support for wg endpoints turns out swagger can be happy with strongly typed requests output type support for wg routes using concrete error type for nym node request error fixed the registration test landing page configurability increased configurability fixed build and lints of other crates added default user-agent to http-api-client reduced severity of gateway details lookup failure changed default http port from 80 to 8080 nym-api using new default port for queries added health endpoint nym-api trying multiple ports for the client using camelcase for node status corrected health endpoint description restored and revamped 'force_tls' flag to filter all gateways that support the wss protocol fixed 'pub_key' path param in open api schema derived Debug on 'NymNodeDescription' ensuring valid public ips added init and run flags to set hostname and public ips fixed listening address being pushed to public ip fixed the positional local flag logging remote ip address of the request updated helper function to query for described gateways enabled tls in gateway client removed hack-opts from mix fetch additional changes after rebasing against origin/develop * clippy * wasm-related target locking * more clippy, but this time in tests
Network Explorer API
An API that provides data for the Network Explorer.
Features:
- geolocates mixnodes using https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
- calculates how many nodes are in each country
- proxies mixnode API requests to add HTTPS
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