Miner Agent Overview
This document describes the positioning, capabilities, and core concepts of miner-agent.
Positioning
miner-agent is the node-side control-plane agent for decentralized miner deployments.
It is intended to run beside the model runtime and dcgm-exporter. In the Compose topology generated by miner-cli, the agent is configured through the miner_client block.
What It Does
On startup, miner-agent:
- Loads
${MINER_HOME}/config.json - Generates a new node identity and wallet identity when no config exists
- Starts a FastAPI diagnostics server
- Calls the miner registration endpoint
- Sends an initial heartbeat
- Repeats heartbeat on a fixed interval
- Pulls and answers challenges when registration or heartbeat responses require it
Heartbeat Collection
On every heartbeat, it collects:
- Host CPU and memory snapshot
- GPU inventory from
nvidia-smi, with DCGM fallback - Runtime
/health - Runtime
/v1/models - Optional runtime
/load - GPU metrics from DCGM
/metrics
What It Does Not Do
Important Boundaries
miner-agent does NOT:
- Start, stop, or supervise the model runtime (handled by
miner-clivia Docker Compose) - Scheduling, billing, revenue settlement, or model routing
- Only reports local node state and answers control-plane verification challenges
Identity Model
Identity persistence path: ${MINER_HOME}/config.json
Persisted fields:
node_idnode_key_typenode_public_keynode_private_keywallet_key_typewallet_public_keywallet_private_keywallet_addresscreated_at
Identity Details
| Item | Description |
|---|---|
node_id | Derived from Ed25519 public key, uses libp2p-style Peer ID |
| Signing | Challenge and control-plane payloads use Ed25519 node private key |
wallet_address | Derived from secp256k1 keypair, uses EVM-style address |
| Directory permissions | Best-effort 0700 |
| File permissions | Best-effort 0600 |
Identity Persistence
Docker deployments must persist ${MINER_HOME}. Losing this file creates a new node identity.
Background Loop
After identity initialization, the agent starts one background loop. Each iteration:
- Waits for
MINER_HEARTBEAT_INTERVAL_SECONDS - Registers again if not registered
- Sends heartbeat
- Handles challenge if required by control plane
HTTP failures are recorded in memory state and exposed through the local status API.