API Reference

The HashRelay server exposes a REST API under /api/v1 on the management port (default 8080, set by [server.api].port). The web admin UI is served from the same port.

Authentication

Log in with admin credentials to obtain a JWT, then send it as a bearer token on subsequent requests. Token lifetime is set by [server.api].jwt_expiry.

Authorization: Bearer <JWT>

System

GET /api/v1/system/status

{
  "version": "0.2.1",
  "uptime_seconds": 86400,
  "client_count": 12,
  "active_connections": 348,
  "total_bytes_relayed": 1073741824
}

Pools

GET /api/v1/pools

POST /api/v1/pools

{ "name": "F2Pool-BTC", "coin": "BTC", "host": "stratum.f2pool.com", "port": 3333 }

PUT /api/v1/pools/{id}

DELETE /api/v1/pools/{id}

Port Mappings

GET /api/v1/port-mappings

POST /api/v1/port-mappings

{ "local_port": 13333, "pool_id": 1, "client_id": "client_01" }

Statistics

GET /api/v1/stats/overview

{
  "total_miners": 1024,
  "total_hashrate_th": 500.4,
  "shares_accepted_1h": 14400,
  "shares_rejected_1h": 72
}

GET /api/v1/stats/timeseries

Query params: metric, interval, from, to