Files
nym/nym-statistics-api
durch 4e5ccf7926 fix: provide all API URLs for automatic failover in endpoint rotation
Previously, when rotating API endpoints, only a single URL was provided to the
HTTP client, defeating the purpose of having multiple URLs for resilience.

Changes:
- NymApiTopologyProvider now provides all URLs in rotated order when switching endpoints
- NymApisClient similarly provides all URLs starting from the working endpoint
- Added clarifying comments for broadcast/exhaustive query methods where single URLs are intentionally used
- This enables the HTTP client's built-in failover mechanism while maintaining endpoint rotation behavior

The fix ensures that if the primary endpoint fails, the client can automatically
failover to alternative endpoints without manual intervention, improving overall
network resilience.
2025-08-29 13:37:45 +02:00
..
2025-05-28 10:23:11 +02:00
2025-05-28 10:23:11 +02:00
2025-05-28 10:23:11 +02:00

Nym-statistics-api

A simple API to collect and store statistics sent by nym-vpn-client.

Build instructions

The statistics API is backed by a PostgreSQL database so you'll need a PostgreSQL server running if you want to add migrations or add/modify SQL queries. I recommend https://postgresapp.com on MacOS, very easy to use. If you're on another OS, it's up to you.

Assuming your database is running at postgresql://user:password@host:port/database_name you'll likely need to run the following :

DATABASE_URL="postgresql://user:password@host:port/database_name"

# if you don't have an existing datase
sqlx database create --database-url $DATABASE_URL
sqlx migrate run --database-url $DATABASE_URL

# reset it if you messed with migrations while developping
sqlx database reset --database-url $DATABASE_URL

# or just run new migrations
sqlx migrate run --database-url $DATABASE_URL

# then prepare queries for offline build mode
cargo sqlx prepare --database-url $DATABASE_URL

This should allow cargo build without having any postgreSQL server running. Be sure to add the .sqlx directory to version control