Files
minerops/README.md
T

3.2 KiB

MinerOps

MinerOps is a self-hosted mining fleet operations console for tracking, repairing, locating, and controlling WhatsMiner ASICs.

Current deployment

Main pages

  • /dashboard - fleet dashboard and repair summary
  • /repairs - repair queue, notes, parts used, history, CSV export
  • /locations - room/rack/shelf location map
  • /system-health - app, database, table size, route, and retention health

Repair workflow

  1. Open /repairs.
  2. Find the miner by MAC, IP, model, serial, or problem.
  3. Add repair notes.
  4. Select parts used and quantity.
  5. Update repair status.
  6. Use History to edit or delete mistaken entries.
  7. Mark Ready to Shelf or use Move to Shelf.
  8. Return the miner to an open shelf position on /locations.

Repair statuses

  • Open
  • Diagnosing
  • Waiting Parts
  • In Progress
  • Testing
  • Ready to Shelf
  • Needs Follow-up
  • Completed
  • Failed
  • Cancelled

Retention

Retention is currently scheduled in dry-run mode.

Current intended policy:

  • Raw status snapshots: 30 days
  • Hourly rollups: 1 year or longer
  • Daily rollups: long term
  • Repair, location, and MAC history: permanent

Verify /system-health before switching retention to apply mode.

Common commands

Health check:

pct exec 306 -- bash -lc "curl -s http://127.0.0.1:8000/api/health"

Rebuild backend:

pct exec 306 -- bash -lc "cd /opt/minerops && docker compose build backend || docker-compose build backend" pct exec 306 -- bash -lc "cd /opt/minerops && docker compose up -d --force-recreate backend || docker-compose up -d --force-recreate backend"

Check logs:

pct exec 306 -- bash -lc "docker logs minerops-backend --since 30m"

Git status:

pct exec 306 -- bash -lc "cd /opt/minerops && git status --short"

Safe local development

Development uses a separate Compose project, database volume, Redis volume, and localhost-only backend port. It does not reuse the production .env file. Scheduled scanning and real miner power/reboot controls are disabled.

First-time setup:

./scripts/dev-env-init.sh
docker compose --env-file .env.dev -f compose.dev.yaml up -d --build

Verify the environment:

docker compose --env-file .env.dev -f compose.dev.yaml ps
curl --fail --silent http://127.0.0.1:18000/api/health

Run the disposable clean-database baseline:

./scripts/test-dev-baseline.sh

The baseline uses a separate Compose project and port, verifies migrations, schema, pages, retention rollups, and safety interlocks, then deletes only its own temporary volumes.

Stop development services without deleting their data:

docker compose --env-file .env.dev -f compose.dev.yaml down

The generated .env.dev file is mode 0600 and ignored by Git. To use a different local port, change MINEROPS_DEV_PORT in .env.dev.

Safety notes

  • Do not commit .env.
  • Do not commit backups, logs, database dumps, imports, or runtime data.
  • Do not enable scanning or real miner controls in the development environment.
  • Check /system-health after major changes.
  • Commit and push after each stable working change.