Miner Agent Local API
This document describes the local FastAPI diagnostics API exposed by miner-agent.
Security Recommendation
These endpoints are for local diagnostics and operations. Do not expose them publicly without network controls.
Basic Information
- Default address:
http://127.0.0.1:8080 - Port control: Determined by
miner_clientconfig
Endpoint Overview
| Method | Path | Purpose |
|---|---|---|
GET | /healthz | Process liveness |
GET | /readyz | Readiness based on registration, heartbeat recency, and challenge state |
GET | /v1/miner/status | Current settings and in-memory agent state |
GET | /v1/miner/identity | Public view of the persisted identity |
POST | /v1/miner/register | Trigger one registration attempt |
POST | /v1/miner/heartbeat | Trigger one heartbeat attempt |
POST | /v1/miner/challenge | Trigger one challenge flow with default purpose reverify |
Liveness Check
Check if the process is running:
curl http://127.0.0.1:8080/healthz
Response:
{
"status": "ok"
}
Readiness Check
Check if the node is ready:
curl -i http://127.0.0.1:8080/readyz
Healthy response:
{
"status": "ready",
"registered": true,
"verified": true,
"last_error": null
}
Degraded response (HTTP 503):
{
"status": "degraded",
"registered": false,
"verified": false,
"last_error": "register failed: ..."
}
Status and Identity
# View status
curl http://127.0.0.1:8080/v1/miner/status
# View identity
curl http://127.0.0.1:8080/v1/miner/identity
statusreturns masked settings, registration state, verification state, recent responses, latest probe snapshot, and latest erroridentityhides private keys and returns only public identity fields
Manual Control
Manually trigger registration, heartbeat, or challenge:
curl -X POST http://127.0.0.1:8080/v1/miner/register
curl -X POST http://127.0.0.1:8080/v1/miner/heartbeat
curl -X POST http://127.0.0.1:8080/v1/miner/challenge