Skip to content

JohnnyFFM/pocx_miner_gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PoCX Miner GUI

A Windows Forms graphical user interface for the PoCX mining client.

Status

WORK IN PROGRESS - Core infrastructure is complete, but the UI integration is not yet finished.

Completed Components

  • MinerProcess.cs - Subprocess management for pocx_miner.exe with YAML config generation
  • SettingsManager.cs - User settings persistence (chains, plot dirs, CPU settings, etc.)
  • DeviceManager.cs - CPU detection via WMI
  • ProgressParser.cs - Output parsing for miner logs (ready for structured output when implemented)
  • AddressValidator.cs - Address format validation (Base58, Bech32)
  • Settings infrastructure - Complete application settings schema

TODO

  • MinerForm.cs - Needs integration with MinerProcess, SettingsManager, and ProgressParser
  • UI Controls - Wire up Start/Stop buttons, configuration tabs, output display
  • Testing - End-to-end testing with actual pocx_miner executable

Architecture

This GUI is a wrapper around the pocx_miner Rust command-line tool. It:

  1. Provides a user-friendly interface for configuring mining parameters
  2. Generates YAML configuration files for pocx_miner
  3. Launches and manages the miner subprocess
  4. Parses output and displays mining status in real-time
  5. Persists user settings between sessions

Building

Prerequisites

  • Windows OS (Windows 7+)
  • .NET Framework 4.5.2 or higher
  • Visual Studio 2015+ or MSBuild
  • pocx_miner.exe (from the pocx workspace)

Using Visual Studio

  1. Open PoCXMinerGUI.sln
  2. Restore NuGet packages:
    • Tools > NuGet Package Manager > Restore NuGet Packages
  3. Build Solution (F6)
  4. Run (F5)

Using MSBuild

cd pocx_miner_gui
msbuild PoCXMinerGUI.csproj /p:Configuration=Release

Dependencies

  • YamlDotNet 11.2.1 - YAML configuration file parsing and generation
  • NBitcoin 7.0.36 - Address validation (Base58Check and Bech32 encoders)
  • System.Management - WMI for CPU detection

Configuration

The GUI manages a YAML configuration file for pocx_miner with the following structure:

chains:
  - name: "primary_pool"
    base_url: "http://pool.example.com:8080"
    api_path: "/pocx"
    accounts:
      - account: "your_account_id"

plot_dirs:
  - "/path/to/plots1"
  - "/path/to/plots2"

cpu_threads: 8
cpu_worker_task_count: 4
hdd_reader_thread_count: 4
hdd_use_direct_io: true
show_progress: true
show_drive_stats: true
timeout: 5000
get_mining_info_interval: 3000

User Settings

The GUI stores minimal settings in Windows registry/AppData. All mining configuration is stored in miner_config.yaml.

Application settings (Windows registry):

  • ConfigFilePath - Path to miner_config.yaml file (default: miner_config.yaml)
  • MinerExecutablePath - Path to pocx_miner.exe (default: pocx_miner.exe)
  • WindowState/WindowLocation/WindowSize - Window position persistence

Mining configuration (miner_config.yaml):

  • All chains, plot directories, CPU/HDD settings, timeouts, etc.

Class Overview

MinerProcess

Manages the pocx_miner subprocess:

  • Launches pocx_miner.exe with reference to miner_config.yaml
  • Captures stdout/stderr streams
  • Provides events for output and process exit
  • No temp file generation - uses existing miner_config.yaml directly

MinerConfig / ChainConfig

Data models for miner configuration:

  • MinerConfig - Top-level configuration with chains, plot dirs, settings
  • ChainConfig - Individual chain/pool configuration with name, URL, accounts

SettingsManager

Handles configuration and settings persistence:

  • LoadConfig(path) - Loads MinerConfig from miner_config.yaml file
  • SaveConfig(config, path) - Saves MinerConfig to miner_config.yaml file
  • LoadWindowSettings(form) / SaveWindowSettings(form) - Window position
  • GetConfigPath() / SetConfigPath(path) - Config file path
  • LoadMinerPath() / SaveMinerPath(path) - Miner executable path

DeviceManager

Hardware detection utilities:

  • DetectCPUs() - Returns list of CPU devices with thread counts
  • GetTotalLogicalProcessors() - Total threads across all CPUs
  • GetRecommendedThreadCount() - Recommended mining thread count
  • GetSystemInfo() - Formatted system information string

ProgressParser

Parses miner output:

  • ParseLine(line) - Parses a single line of output
  • Events: DeadlineFound, NewBlock, ChainStatusChanged, PlotsLoaded
  • Ready for structured output markers when pocx_miner implements them

AddressValidator

Address format validation:

  • DetectFormat(address) - Returns Base58, Bech32, or Unknown
  • IsValidAddress(address) - Validates checksum
  • GetValidationMessage(address) - Human-readable validation result

Future Enhancements

Short-term

  1. Complete MinerForm.cs UI integration
  2. Add error handling and user feedback
  3. Implement configuration management UI (add/edit/remove chains)
  4. Real-time mining statistics display

Long-term

  1. Mining statistics charts and graphs
  2. Historical deadline tracking
  3. System resource monitoring
  4. Auto-update functionality (via GitHub releases)
  5. System tray support for background mining

Note on Output Parsing

The current ProgressParser is designed to work with the existing log output format from pocx_miner. When pocx_miner implements structured progress output (similar to plotter's --line-progress with markers like #TOTAL, #HASH_DELTA, etc.), the parser will be updated to handle those markers for more accurate progress tracking.

Reference Project

This GUI follows the same architecture as pocx_plotter_gui, which is a complete and working reference implementation. Key patterns borrowed:

  • Subprocess management with async I/O
  • Settings persistence via application settings
  • Device detection via WMI
  • Progress parsing with event-based updates
  • YAML configuration generation

Development

See CLAUDE.md for detailed development guidelines and architecture documentation.

License

Part of the PoCX project. See main repository for license information.

About

A user friendly GUI for PoCX Mining

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages