Files
nym/nym-data-observatory
Jędrzej Stuczyński 28b22f6b22 upgrade axum to 0.8.9 (and side deps) (#6808)
* upgrade axum to 0.8.9 (and side deps)

Bumps axum 0.7.5 → 0.8.9, axum-extra 0.9.4 → 0.12.6,
axum-client-ip 0.6.1 → 1.3.1, axum-test 16.2.0 → 20.0.0,
utoipa-swagger-ui 8.1 → 9.0.2.

* warn upon using fallback ip

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: replace use of deprecated try_next()

* update console-subscriber to ensure single version of axum in the lock file

* removed unused axum-test dev-dep

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-05-22 15:39:33 +01:00
..
2025-12-02 21:27:22 +00:00
2025-12-02 21:27:22 +00:00
2025-12-02 21:27:22 +00:00
2025-12-02 21:27:22 +00:00
2025-12-02 21:27:22 +00:00
2025-12-02 21:27:22 +00:00

Nym Data Observatory

Collects data about the Nym network including:

  • Chain scraper - that parses blocks, transactions and messages on the Nyx chain
  • Price scraper - to get the NYM/USD token price from CoinGecko
  • Webhooks - trigger on messages or all messages to call with details

Running locally

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

make build-pg

4. Run with PostgreSQL

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

# In another terminal, run the application
NYM_DATA_OBSERVATORY_DB_URL=postgres://testuser:testpass@localhost:5433/nym_data_observatory_test \
NYM_DATA_OBSERVATORY_WEBHOOK_URL="https://webhook.site" \
NYM_DATA_OBSERVATORY_WEBHOOK_AUTH=1234 \
cargo run -- run

To start from a block add the env var: NYXD_SCRAPER_START_HEIGHT=19266184.

Deploying

Connect with psql to your local database:

CREATE USER nym_data_observatory WITH PASSWORD 'data-data-data';

CREATE DATABASE nym_data_observatory_data;
GRANT ALL ON DATABASE nym_data_observatory_data TO nym_data_observatory;

Then run:

cargo run -- init --db_url postgres://testuser:testpass@localhost:5433/nym_data_observatory_test

and then:

NYM_DATA_OBSERVATORY_DB_URL=postgres://testuser:testpass@localhost:5433/nym_data_observatory_test \
NYM_DATA_OBSERVATORY_WEBHOOK_URL="https://webhook.site" \
NYM_DATA_OBSERVATORY_WEBHOOK_AUTH=1234 \
cargo run -- run --websocket-url wss://rpc.nymtech.net/websocket --rpc-url https://rpc.nymtech.net

or just:

NYM_DATA_OBSERVATORY_DB_URL=postgres://testuser:testpass@localhost:5433/nym_data_observatory_test cargo run -- run --websocket-url wss://rpc.nymtech.net/websocket --rpc-url https://rpc.nymtech.net

If you want to watch for cosmwasm messages and send to a webhook:

NYM_DATA_OBSERVATORY_WEBHOOK_URL=https://webhook.site \
NYM_DATA_OBSERVATORY_DB_URL=postgres://testuser:testpass@localhost:5433/nym_data_observatory_test\
cargo run -- run --websocket-url wss://rpc.nymtech.net/websocket --rpc-url https://rpc.nymtech.net --start-block-height 20966360 --watch-for-chain-message-types "/cosmwasm.wasm.v1.MsgExecuteContract"

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

Also see README_SQLX.md.

Connection Refused

If you see "Connection refused" errors:

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