Files
nym/nym-node-status-api/nym-node-status-api
Mark Sinclair fb0b55d540 Node Status API: remove sqlite support (#6004)
* ns-api: remove sqlite support

ns-api: add env var to skip migrations for local dev

ns-api: tidy up imports

ns-api: fix deserialisation fo node descriptions

update dockerfile

update README

fix up README and example env

ns-api: bump major version to 4

ns-api: add more geoip data and new performance field in dvpn responses

* ns-api: polyfill dVPN probe outcomes to make compatible with existing clients

* Use explicit transaction for testrun status change (#6046)

* Use explicit transaction for testrun status change

* Improve run scripts

* Skip locked rows

* bump version 4.0.2

* Fix build.rs

* Fix up .sqlx queries

* Bump agent version and change dockerfile to run the agent in a loop

* Make time between agents configurable by env var SLEEP_TIME

* Update entrypoint.sh

* Update Dockerfile with full path

* Force bigint to avoid postgres numeric cast

* Add override args to agent entry point, bump agent version and NS API version

---------

Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
Co-authored-by: dynco-nym <173912580+dynco-nym@users.noreply.github.com>
2025-09-19 17:00:54 +01:00
..
2025-02-28 14:01:33 +01:00

Node Status API

This is a standalone service that can be run by anyone to monitor the status of nodes in the Nym network.

Wellknown instances

Below is a list of wellknown public instances:

Quick Start with PostgreSQL

1. Install Prerequisites

# Install sqlx-cli if not already installed
make sqlx-cli

2. Prepare PostgreSQL for Development

# This will:
# - Start PostgreSQL in Docker
# - Run migrations
# - Generate SQLx offline query cache
# - Stop the database
make prepare-pg

3. Build with PostgreSQL

# Build with PostgreSQL feature
make build-pg

# Or manually:
cargo build

4. Run with PostgreSQL

# Start PostgreSQL for development (keeps running)
make dev-db

# In another terminal, run the application
DATABASE_URL=postgres://testuser:testpass@localhost:5433/nym_node_status_api_test \
cargo run

Makefile Targets

make help              # Show all available targets
make prepare           # Setup PostgreSQL and prepare SQLx cache
make dev-db            # Start PostgreSQL for development
make test-db           # Run tests with PostgreSQL
make build             # Build with PostgreSQL
make psql              # Connect to running PostgreSQL
make clean             # Clean build artifacts
make clean-db          # Stop database and clean volumes

Environment Variables

See .env.example for all configuration options. Key variable:

# For PostgreSQL:
DATABASE_URL=postgres://testuser:testpass@localhost:5433/nym_node_status_api_test

Troubleshooting

SQLx Offline Mode

If you see "no cached data for this query" errors:

  1. Ensure PostgreSQL is running: make dev-db
  2. Run: make test-db-prepare

Connection Refused

If you see "Connection refused" errors:

  1. Check Docker is running: docker ps
  2. Check PostgreSQL container: docker ps | grep nym_node_status_api_postgres_test
  3. Restart database: make test-db-down && make dev-db