Mining/site-docs/cli/examples.md
snider 69376b886f feat: Rebrand xmrig to miner and vendor XMRig ecosystem
Complete rebranding of all components:
- Core miner: xmrig -> miner (binary, version.h, CMakeLists.txt)
- Proxy: xmrig-proxy -> miner-proxy
- CUDA plugin: xmrig-cuda -> miner-cuda
- Heatmap: xmrig-nonces-heatmap -> miner-nonces-heatmap
- Go CLI wrapper: miner-cli -> miner-ctrl

Vendored XMRig ecosystem into miner/ directory:
- miner/core - XMRig CPU/GPU miner
- miner/proxy - Stratum proxy
- miner/cuda - NVIDIA CUDA plugin
- miner/heatmap - Nonce visualization tool
- miner/config - Configuration UI
- miner/deps - Pre-built dependencies

Updated dev fee to use project wallet with opt-out (kMinimumDonateLevel=0)
Updated branding to Lethean (domain, copyright, version 0.1.0)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:43:02 +00:00

3.3 KiB

CLI Examples

Practical examples for common tasks.

Quick Start

Start Mining with XMRig

# Install XMRig
miner-ctrl install xmrig

# Start mining with a profile
miner-ctrl start --profile "My Profile"

# Or with direct parameters
miner-ctrl start xmrig --pool pool.example.com:3333 --wallet 4xxx...

Monitor Mining Status

# Check status of all miners
miner-ctrl status

# Watch status continuously
watch -n 5 miner-ctrl status

Profile Management

Create and Use Profiles

# List existing profiles
miner-ctrl profile list

# Start a miner from profile
miner-ctrl start --profile "Monero Mining"

Multi-Node Operations

Set Up a Controller Node

# Initialize as controller
miner-ctrl node init --name "control-center" --role controller

# Start the P2P server
miner-ctrl node serve --listen :9091

Set Up a Worker Node

# Initialize as worker
miner-ctrl node init --name "rig-alpha" --role worker

# Start accepting connections
miner-ctrl node serve --listen :9091

Connect and Manage Peers

# On controller: add a worker
miner-ctrl peer add --address 192.168.1.100:9091 --name "rig-alpha"

# List all peers
miner-ctrl peer list

# Ping a peer
miner-ctrl peer ping abc123

Remote Mining Commands

# Get stats from all remote miners
miner-ctrl remote status

# Start miner on remote peer
miner-ctrl remote start abc123 --profile "My Profile"

# Stop miner on remote peer
miner-ctrl remote stop abc123 xmrig-456

# Get logs from remote miner
miner-ctrl remote logs abc123 xmrig-456 --lines 50

Server Operations

Run the Dashboard

# Start with defaults (port 9090)
miner-ctrl serve

# Custom port
miner-ctrl serve --port 8080

# Disable autostart
miner-ctrl serve --no-autostart

System Health Check

# Run diagnostics
miner-ctrl doctor

Output:

System Check
============
Platform: linux
CPU: AMD Ryzen 9 5950X
Cores: 32
Memory: 64 GB

Miner Status
============
✓ xmrig v6.25.0 installed
✗ tt-miner not installed

Recommendations
===============
- Enable huge pages for better performance

Scripting Examples

Bash Script: Auto-restart on Failure

#!/bin/bash
PROFILE="My Profile"

while true; do
    miner-ctrl start --profile "$PROFILE"
    sleep 10

    # Check if still running
    if ! miner-ctrl status | grep -q "running"; then
        echo "Miner stopped, restarting..."
        continue
    fi

    sleep 60
done

Monitor Hashrate via API

#!/bin/bash
while true; do
    curl -s http://localhost:9090/api/v1/mining/miners | \
        jq -r '.[] | "\(.name): \(.full_stats.hashrate.total[0] // 0) H/s"'
    sleep 10
done

Docker Examples

Run with Docker Compose

# docker-compose.yml
version: '3.8'
services:
  mining-dashboard:
    image: mining-cli:latest
    command: serve --port 9090
    ports:
      - "9090:9090"
    volumes:
      - mining-data:/root/.local/share/lethean-desktop
      - mining-config:/root/.config/lethean-desktop

volumes:
  mining-data:
  mining-config:
docker-compose up -d

Multi-Node Docker Setup

# Start controller
docker run -d --name controller \
    -p 9090:9090 -p 9091:9091 \
    mining-cli node serve

# Start workers
docker run -d --name worker1 \
    -p 9092:9091 \
    mining-cli node serve