- Create miner/README.md documenting standalone C++ mining tools - Update miner/core and miner/proxy READMEs with EUPL-1.2 license - Add GitHub Actions workflow for multi-platform miner releases - Add Makefile targets: build-miner, build-miner-core, build-miner-proxy - Update main README with standalone miner usage instructions The miner/ directory contains standalone CPU/GPU miner and stratum proxy that can be used independently without the GUI. Pre-built binaries will be published alongside Go releases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .github | ||
| cmake | ||
| doc | ||
| res | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| CMakeLists.txt | ||
| CODE_REVIEW_FINDINGS.md | ||
| CODE_REVIEW_TODO.md | ||
| LICENSE | ||
| package.json | ||
| PARALLEL_CODE_REVIEW.md | ||
| README.md | ||
| README_TESTING.md | ||
| TODO.md | ||
Miner
High-performance, cross-platform CPU/GPU cryptocurrency miner supporting RandomX, KawPow, CryptoNight, GhostRider, ETChash, ProgPowZ, and Blake3 algorithms.
Features
Mining Backends
- CPU (x86/x64/ARMv7/ARMv8/RISC-V)
- OpenCL for AMD GPUs
- CUDA for NVIDIA GPUs via external CUDA plugin
Supported Algorithms
| Algorithm | Variants | CPU | GPU |
|---|---|---|---|
| RandomX | rx/0, rx/wow, rx/arq, rx/graft, rx/sfx, rx/keva | Yes | Yes |
| CryptoNight | cn/0-2, cn-lite, cn-heavy, cn-pico | Yes | Yes |
| GhostRider | gr | Yes | No |
| Argon2 | chukwa, chukwa2, ninja | Yes | No |
| KawPow | kawpow | No | Yes |
| ETChash | etchash, ethash | No | Yes |
| ProgPowZ | progpowz | No | Yes |
| Blake3 | blake3 | Yes | Yes |
Quick Start
Download
Pre-built binaries are available from Releases.
Usage
# Basic CPU mining to a pool
./miner -o pool.example.com:3333 -u YOUR_WALLET -p x
# With JSON config (recommended)
./miner -c config.json
# Enable GPU mining
./miner -c config.json --opencl --cuda
# Benchmark mode
./miner --bench=1M
# Show all options
./miner --help
Configuration
The recommended way to configure the miner is via JSON config file:
{
"autosave": true,
"cpu": true,
"opencl": false,
"cuda": false,
"pools": [
{
"url": "stratum+tcp://pool.example.com:3333",
"user": "YOUR_WALLET",
"pass": "x",
"keepalive": true
}
]
}
Building from Source
Dependencies
Linux (Ubuntu/Debian):
sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
Linux (Fedora/RHEL):
sudo dnf install git cmake gcc gcc-c++ libuv-devel openssl-devel hwloc-devel
macOS:
brew install cmake libuv openssl hwloc
Windows:
- Visual Studio 2019 or later
- CMake 3.10+
- vcpkg for dependencies
Build Commands
mkdir build && cd build
# Standard build
cmake ..
cmake --build . --config Release
# With GPU support
cmake .. -DWITH_OPENCL=ON -DWITH_CUDA=ON
# Static binary
cmake .. -DBUILD_STATIC=ON
# Debug build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG_LOG=ON
# Minimal build (reduce binary size)
cmake .. -DWITH_KAWPOW=OFF -DWITH_GHOSTRIDER=OFF -DWITH_ARGON2=OFF
CMake Options
| Option | Default | Description |
|---|---|---|
WITH_HWLOC |
ON | Hardware topology support |
WITH_RANDOMX |
ON | RandomX algorithms |
WITH_ARGON2 |
ON | Argon2 algorithms |
WITH_KAWPOW |
ON | KawPow (GPU only) |
WITH_ETCHASH |
ON | ETChash/Ethash (GPU only) |
WITH_PROGPOWZ |
ON | ProgPowZ (GPU only) |
WITH_BLAKE3DCR |
ON | Blake3 for Decred |
WITH_GHOSTRIDER |
ON | GhostRider algorithm |
WITH_OPENCL |
ON | AMD GPU support |
WITH_CUDA |
ON | NVIDIA GPU support |
WITH_HTTP |
ON | HTTP API |
WITH_TLS |
ON | SSL/TLS support |
WITH_ASM |
ON | Assembly optimizations |
WITH_MSR |
ON | MSR mod for CPU tuning |
BUILD_STATIC |
OFF | Static binary |
BUILD_TESTS |
OFF | Build unit tests |
HTTP API
When built with -DWITH_HTTP=ON, the miner exposes a REST API:
| Endpoint | Method | Description |
|---|---|---|
/1/summary |
GET | Mining statistics |
/1/threads |
GET | Per-thread details |
/1/config |
GET | Current configuration |
/1/config |
PUT | Update configuration |
Example:
curl http://127.0.0.1:8080/1/summary
Performance Optimization
Huge Pages (Linux)
# Temporary
sudo sysctl -w vm.nr_hugepages=1280
# Permanent
echo "vm.nr_hugepages=1280" | sudo tee -a /etc/sysctl.conf
# 1GB pages (best performance)
sudo ./scripts/enable_1gb_pages.sh
MSR Mod (Intel/AMD CPUs)
The miner can automatically apply MSR tweaks for better RandomX performance. Requires root/admin privileges.
sudo ./miner -c config.json
Testing
# Build with tests
cmake .. -DBUILD_TESTS=ON
cmake --build .
# Run tests
ctest --output-on-failure
License
Copyright (c) 2025 Lethean https://lethean.io
Licensed under the European Union Public License 1.2 (EUPL-1.2).