GoLang Miner management with restful control
Find a file
snider e3122bb41e feat(ui): Add notifications, loading states, mobile support, and inline editing
- Add notification service with toast component for success/error/warning/info messages
- Add API status banner showing when backend is unavailable with retry button
- Add loading spinners to all async action buttons (start/stop/install/delete)
- Add mobile responsive drawer sidebar with hamburger menu
- Add responsive styles for workers table, profiles grid, and miners grid
- Add inline profile editing with save/cancel functionality
- Add unit tests for notification service, toast component, and sidebar (36 tests passing)
- Fix broken app.spec.ts test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 00:04:57 +00:00
.claude feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
.github/workflows feat: Add Wails desktop app with cross-platform GitHub Actions build 2025-12-30 01:55:14 +00:00
.playwright-mcp feat: Add SQLite persistence, enhanced dashboard UI, and comprehensive E2E tests 2025-12-30 00:03:30 +00:00
cmd feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
docs feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
miner feat: Add OpenCL GPU support for ProgPowZ, ETChash, and Blake3DCR 2025-12-30 23:01:16 +00:00
pkg feat: Add OpenCL GPU support for ProgPowZ, ETChash, and Blake3DCR 2025-12-30 23:01:16 +00:00
site-docs feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
ui feat(ui): Add notifications, loading states, mobile support, and inline editing 2025-12-31 00:04:57 +00:00
.coderabbit.yaml Complete Go 1.24 package with CLI, tests, and configuration 2025-11-08 16:52:16 +00:00
.gitignore chore: Update gitignore for build artifacts 2025-12-30 19:44:59 +00:00
.goreleaser.yaml feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
AGENTS.md adds miner-cli, a miner management and lifecycle tool 2025-11-09 01:02:31 +00:00
CLAUDE.md feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
docker-compose.p2p.yml feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
Dockerfile.node feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
go.mod feat: Implement logging functionality for miners with log buffer and retrieval endpoint 2025-12-29 22:10:45 +00:00
go.sum feat: Implement logging functionality for miners with log buffer and retrieval endpoint 2025-12-29 22:10:45 +00:00
LICENSE Complete Go 1.24 package with CLI, tests, and configuration 2025-11-08 16:52:16 +00:00
Makefile feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00
mkdocs.yml feat: Add SQLite persistence, enhanced dashboard UI, and comprehensive E2E tests 2025-12-30 00:03:30 +00:00
openapi-3.json adds miner-cli, a miner management and lifecycle tool 2025-11-09 01:02:31 +00:00
README.md feat: Rebrand xmrig to miner and vendor XMRig ecosystem 2025-12-30 19:43:02 +00:00

Mining

Go Version GoDoc Go Report Card codecov Release License: EUPL-1.2

GoLang Miner management with embedable RESTful control - A modern, modular package for managing cryptocurrency miners.

miner-ctrl serve --host localhost --port 9090 --namespace /api/v1/mining
<script type="module" src="./mbe-mining-dashboard.js"></script>
<mde-mining-dashboard miner-name="xmrig" wallet="..." pool="..." api-base-url="http://localhost:9090/api/v1/mining"></mde-mining-dashboard>
image

Overview

Mining is a Go package designed to provide comprehensive miner management capabilities. It can be used both as a standalone CLI tool and as a module/plugin in other Go projects. The package offers:

  • Miner Lifecycle Management: Start, stop, and monitor miners
  • Status Tracking: Real-time status and hash rate monitoring
  • CLI Interface: Easy-to-use command-line interface built with Cobra
  • Modular Design: Import as a package in your own projects
  • RESTful Ready: Designed for integration with RESTful control systems

Features

  • Start and stop miners programmatically
  • Monitor miner status and performance
  • Track hash rates
  • List all active miners
  • CLI for easy management
  • Designed as a reusable Go module
  • Comprehensive test coverage
  • Standards-compliant configuration (CodeRabbit, GoReleaser)

Installation

As a CLI Tool

go install github.com/Snider/Mining/cmd/mining@latest

As a Go Module

go get github.com/Snider/Mining

Usage

CLI Commands

The miner-ctrl provides the following commands:

miner-ctrl completion  Generate the autocompletion script for the specified shell
miner-ctrl doctor      Check and refresh the status of installed miners
miner-ctrl help        Help about any command
miner-ctrl install     Install or update a miner
miner-ctrl list        List running and available miners
miner-ctrl serve       Start the mining service and interactive shell
miner-ctrl start       Start a new miner
miner-ctrl status      Get status of a running miner
miner-ctrl stop        Stop a running miner
miner-ctrl uninstall   Uninstall a miner
miner-ctrl update      Check for updates to installed miners

For more details on any command, use miner-ctrl [command] --help.

RESTful API Endpoints

When running the miner-ctrl serve command, the following RESTful API endpoints are exposed (default base path /api/v1/mining):

  • GET /api/v1/mining/info - Get cached miner installation information and system details.
  • POST /api/v1/mining/doctor - Perform a live check on all available miners to verify their installation status, version, and path.
  • POST /api/v1/mining/update - Check if any installed miners have a new version available for download.
  • GET /api/v1/mining/miners - Get a list of all running miners.
  • GET /api/v1/mining/miners/available - Get a list of all available miners.
  • POST /api/v1/mining/miners/:miner_name - Start a new miner with the given configuration.
  • POST /api/v1/mining/miners/:miner_name/install - Install a new miner or update an existing one.
  • DELETE /api/v1/mining/miners/:miner_name/uninstall - Remove all files for a specific miner.
  • DELETE /api/v1/mining/miners/:miner_name - Stop a running miner by its name.
  • GET /api/v1/mining/miners/:miner_name/stats - Get statistics for a running miner.
  • GET /api/v1/mining/swagger/*any - Serve Swagger UI for API documentation.

Swagger documentation is typically available at http://<host>:<port>/api/v1/mining/swagger/index.html.

Development

Prerequisites

  • Go 1.24 or higher
  • Make (optional, for using Makefile targets)

Build

# Build the CLI
go build -o miner-ctrl ./cmd/mining

# Run tests
go test ./...

# Run tests with coverage
go test -cover ./...

Project Structure

.
├── cmd/
│   └── mining/          # CLI application
│       ├── main.go      # CLI entry point
│       └── cmd/         # Cobra commands
├── pkg/
│   └── mining/          # Core mining package
│       ├── mining.go    # Main package code
│       └── mining_test.go
├── main.go              # Demo/development main
├── .coderabbit.yaml     # CodeRabbit configuration
├── .goreleaser.yaml     # GoReleaser configuration
├── .gitignore
├── go.mod
├── LICENSE
└── README.md

Configuration

CodeRabbit

The project uses CodeRabbit for automated code reviews. Configuration is in .coderabbit.yaml.

GoReleaser

Releases are managed with GoReleaser. Configuration is in .goreleaser.yaml. To create a release:

# Tag a version
git tag -a v0.1.0 -m "Release v0.1.0"
git push origin v0.1.0

# GoReleaser will automatically build and publish

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the EUPL-1.2 License - see the LICENSE file for details.

Acknowledgments

Support

For issues, questions, or contributions, please open an issue on GitHub.