Commit graph

52 commits

Author SHA1 Message Date
snider
95ae55e4fa feat: Add rate limiter with cleanup and custom error types
Rate Limiter:
- Extract rate limiting to pkg/mining/ratelimiter.go with proper lifecycle
- Add Stop() method to gracefully shutdown cleanup goroutine
- Add RateLimiter.Middleware() for Gin integration
- Add ClientCount() for monitoring
- Fix goroutine leak in previous inline implementation

Custom Errors:
- Add pkg/mining/errors.go with MiningError type
- Define error codes: MINER_NOT_FOUND, INSTALL_FAILED, TIMEOUT, etc.
- Add predefined error constructors (ErrMinerNotFound, ErrStartFailed, etc.)
- Support error chaining with WithCause, WithDetails, WithSuggestion
- Include HTTP status codes and retry policies

Service:
- Add Service.Stop() method for graceful cleanup
- Update CLI commands to use context.Background() for Manager methods

Tests:
- Add comprehensive tests for RateLimiter (token bucket, multi-IP, refill)
- Add comprehensive tests for MiningError (codes, status, retryable)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:56:26 +00:00
snider
749dd76f9c fix: Update tests to handle autostart behavior
- TestStartMiner_Ugly: Add algorithm to config for consistent instance naming,
  ensuring duplicate detection works correctly
- TestListMiners_Good: Account for autostarted miners by checking delta instead
  of absolute count
- TestListMiners: Renamed from TestListMinersEmpty since autostart may add miners
- Add defer manager.Stop() to all tests in mining_test.go for proper cleanup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:17:14 +00:00
snider
b454bbd6d6 feat: Add context propagation, state sync, and tests
- Add context.Context to ManagerInterface methods (StartMiner, StopMiner, UninstallMiner)
- Add WebSocket state sync on client connect (sends current miner states)
- Add EventStateSync event type and SetStateProvider method
- Add manager lifecycle tests (idempotent stop, context cancellation, shutdown timeout)
- Add database tests (initialization, hashrate storage, stats)
- Add EventHub tests (creation, broadcast, client count, state provider)
- Update all test files for new context-aware API

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:10:39 +00:00
snider
0c8b2d999b feat: Add rate limiting, race condition fix, and shutdown improvements
- Add rate limiting middleware (10 req/s with burst of 20)
- Add atomic UpdateMinersConfig to fix config race conditions
- Add WebSocket connection limits (max 100 connections)
- Add graceful shutdown timeout (10s max wait for goroutines)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:51:48 +00:00
snider
9e98f58795 feat(api): Add X-Request-ID middleware for request tracing
- Add requestIDMiddleware that generates/propagates request IDs
- Accepts X-Request-ID from incoming requests or generates new one
- Sets request ID in response header and gin context
- Update CORS to allow/expose X-Request-ID header

Enables request tracing across logs for debugging.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:39:42 +00:00
snider
2e59604825 feat(api): Add structured API error responses with codes and suggestions
- Add APIError struct with code, message, details, suggestion, retryable
- Add error code constants (MINER_NOT_FOUND, PROFILE_NOT_FOUND, etc.)
- Add respondWithError helper with automatic suggestions per error type
- Update miner not found and profile not found errors to use new format
- Fix .gitignore to not match pkg/mining directory

Improves DX by providing machine-readable error codes and actionable suggestions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:38:25 +00:00
snider
d61a8aff8b refactor: Remove unused code and fix nil dereference issues
- Remove unused exported functions from pkg/database (session tracking,
  bulk hashrate inserts, various query helpers)
- Remove unused exported functions from pkg/node (identity management,
  bundle operations, controller methods)
- Make internal-only functions unexported in config_manager.go and database.go
- Remove unused EventProfile* constants from events.go
- Add GetCommit() and GetBuildDate() to expose version.go variables
- Fix potential nil dereference issues flagged by Qodana:
  - Add nil checks for GetIdentity() in controller.go, transport.go, worker.go
  - Add nil checks for GetPeer() in peer_test.go
  - Add nil checks in worker_test.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:24:12 +00:00
snider
757526e60e feat: Add WebSocket events, simulation mode, and redesigned Miners page
WebSocket Real-Time Events:
- Add EventHub for broadcasting miner events to connected clients
- New event types: miner.starting/started/stopping/stopped/stats/error
- WebSocket endpoint at /ws/events with auto-reconnect support
- Angular WebSocketService with RxJS event streams and fallback to polling

Simulation Mode (miner-ctrl simulate):
- SimulatedMiner generates realistic hashrate data for UI development
- Supports presets: cpu-low, cpu-medium, cpu-high, gpu-ethash, gpu-kawpow
- Features: variance, sine-wave fluctuation, 30s ramp-up, 98% share rate
- XMRig-compatible stats format for full UI compatibility
- NewManagerForSimulation() skips autostart of real miners

Miners Page Redesign:
- Featured cards for installed/recommended miners with gradient styling
- "Installed" (green) and "Recommended" (gold) ribbon badges
- Placeholder cards for 8 planned miners with "Coming Soon" badges
- Algorithm badges, GitHub links, and license info for each miner
- Planned miners: T-Rex, lolMiner, Rigel, BzMiner, SRBMiner, TeamRedMiner, GMiner, NBMiner

Chart Improvements:
- Hybrid data approach: live in-memory data while active, database historical when inactive
- Smoother transitions between data sources

Documentation:
- Updated DEVELOPMENT.md with simulation mode usage
- Updated ARCHITECTURE.md with WebSocket, simulation, and supported miners table

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 07:11:41 +00:00
snider
ce5c5034bf fix: Allow removing stopped miners from manager
Previously, StopMiner would fail if the miner was already stopped
(crashed or killed externally), leaving it stuck in the workers list.

Now the miner is always removed from the manager, even if Stop()
returns "miner is not running". This allows cleaning up dead workers.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 04:41:47 +00:00
snider
5d124df47b fix: Update CORS config to use valid http origin for Wails
The wails:// scheme is not supported by gin-contrib/cors v1.7.6
which requires origins to be http://, https://, or *.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 04:09:11 +00:00
snider
0735445eb0 fix: Address code review issues and fix miner start deadlock
- Remove deprecated GetDB() function that exposed raw DB pointer
- Fix GetLatestHashrate to distinguish sql.ErrNoRows from real errors
- Document async saves in PeerRegistry mutation methods
- Fix deadlock in XMRig/TTMiner Start() by moving CheckInstallation
  call before acquiring the main lock (Go RWMutex doesn't allow
  recursive locking)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 03:51:05 +00:00
snider
0e810438cd fix: Add NewNodeManagerWithPaths for testing isolation
The xdg library caches paths, so setting XDG environment variables
in tests doesn't work when there's already an identity file at the
default path. Added NewNodeManagerWithPaths constructor similar to
NewPeerRegistryWithPath to allow tests to use isolated temp directories.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 03:25:43 +00:00
snider
b24a3f00d6 fix: Add timeouts, atomic writes, and thread safety improvements
- Add 30s context timeout for database transactions in hashrate.go
- Add helper function for parsing SQLite timestamps with error logging
- Implement atomic file writes (temp + rename) for profile_manager.go,
  config_manager.go, and peer.go to prevent corruption on crash
- Add 5s timeout for stats collection per miner in manager.go
- Add 5s timeout for stdin writes in miner.go
- Clean up config file on failed miner start in xmrig_start.go
- Implement debounced saves (5s) for peer registry to reduce disk I/O
- Fix CheckInstallation data race in xmrig.go and ttminer.go by adding
  proper mutex protection around shared field updates
- Add 10s handshake timeout for WebSocket connections in transport.go
- Update peer_test.go to call Close() before reload to flush changes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:55:30 +00:00
snider
74bbf14de4 fix: Address networking, memory leak, and segfault issues from code review
Networking/Protocol fixes:
- Add HTTP server timeouts (Read/Write/Idle/ReadHeader) in service.go
- Fix CORS address parsing to use net.SplitHostPort safely
- Add request body size limit middleware (1MB max)
- Enforce MaxConns limit in WebSocket upgrade handler
- Fix WebSocket origin validation to only allow localhost
- Add read/write deadlines to WebSocket connections

Memory leak fixes:
- Add sync.Once to Manager.Stop() to prevent double-close panic
- Fix controller pending map leak by closing response channel
- Add memory reallocation for hashrate history slices when oversized
- Fix LogBuffer to truncate long lines and force reallocation on trim
- Add process wait timeout to prevent goroutine leaks on zombie processes
- Drain HTTP response body on copy error to allow connection reuse

Segfault/panic prevention:
- Add nil check in GetTotalHashrate for stats pointer
- Fix hashrate history slice reallocation to prevent capacity bloat

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:26:46 +00:00
snider
8b5d446ffe fix: Complete race condition fixes and add config synchronization
- Add sync.RWMutex to config_manager.go for file operation synchronization
- Add deprecation warning to unsafe GetDB() function in database.go
- Fix UninstallMiner map modification during iteration in manager.go
- Add server readiness verification via TCP dial in service.go
- Add mutex-protected httpClient getter/setter in xmrig.go
- Update GetLatestVersion to use synchronized HTTP client in ttminer.go
- Update MockMiner in service_test.go to match context-aware GetStats interface

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:02:57 +00:00
snider
1351dc7562 fix: Address race conditions and network blocking issues
Critical fixes:
- Release mutex before HTTP calls in GetStats() to prevent blocking
- Fix m.cmd race between Stop() and Wait() goroutine by capturing locally
- Add context support to GetStats() for proper request cancellation

High priority fixes:
- Add existence check in collectMinerStats() before operating on miners
- Add mutex-protected httpClient getter/setter for thread-safe test mocking

Changes:
- Miner interface now requires context.Context for GetStats()
- Stats HTTP requests timeout after 5 seconds (was 30s client default)
- All callers updated to pass context (service uses request context)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:55:24 +00:00
snider
9592971678 fix: Address CodeRabbit review findings
- Create api/swagger.md page to properly document Swagger UI access
  instead of linking raw swagger.json in mkdocs nav
- Fix Stop() state management: properly set Running=false and cmd=nil
  on all exit paths, wait for process termination to avoid zombies

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:28:01 +00:00
snider
f2afdeeb82 fix: Address medium severity code quality issues
- Fix deprecated strings.Title usage with golang.org/x/text/cases
- Replace log.Fatalf in service startup with channel-based error handling
- Add graceful SIGTERM before SIGKILL in Stop() for proper cleanup
- Add mutex protection for LogBuffer access in GetLogs()
- Add instance name sanitization with regex to prevent injection
- Add error logging in updateInstallationCache for failed operations

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:15:35 +00:00
snider
68c0033c55 fix: Address high severity security and reliability issues
Security:
- Configure CORS to only allow local origins (localhost, 127.0.0.1, wails://)
- Add CLI args validation for TTMiner to block shell metacharacters
- Add HTTPPort validation (must be 1024-65535)

Reliability:
- Manager.Stop() now stops all running miners before shutdown
- Close stdin pipe on Start() error to prevent resource leak (xmrig, ttminer)
- Fix node_service query parameter parsing (was dead code)

Feature:
- Add TTMiner support in service layer (install, update check, info cache)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:02:23 +00:00
snider
006dd3712e fix: Address critical security and concurrency issues
Security fixes:
- Remove hardcoded wallet address from CLI defaults (start.go, serve.go)
  Pool and wallet are now required flags or must be provided explicitly
- Change file permissions from 0644 to 0600 for sensitive config files
  Affects: xmrig config, profiles, settings, config cache
- Fix path traversal in untar() - now returns error instead of silently skipping

Concurrency fix:
- Fix race condition in GetStats() - was using RLock while writing m.FullStats
  Changed to Lock/Unlock in both xmrig_stats.go and ttminer_stats.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 00:50:06 +00:00
snider
bec2accf1a feat: Add OpenCL GPU support for ProgPowZ, ETChash, and Blake3DCR
Implement GPU mining backends for three new algorithms:

- ProgPowZ (Zano): DAG-based ProgPow variant with 512 parents, dynamic
  program generation per period
- ETChash (Ethereum Classic): Standard Ethash with 256 parents and
  ECIP-1099 epoch calculation for post-block 11.7M
- Blake3DCR (Decred): Simple Blake3 hash kernel with no DAG requirement,
  processing 180-byte block headers

Each implementation includes OpenCL kernels, GPU runners, thread
generators, and build system integration. Also adds fast modulo
optimization to ETCCache for GPU kernel performance.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:01:16 +00:00
snider
b1aced8341 feat: Add stratum integration and mining support for new algorithms
- Stratum protocol integration for ETChash, ProgPowZ, Blake3DCR
- EthStratumClient selection for DAG-based algorithms
- Nonce offset handling for all new algorithm families
- AutoClient support for new algorithm detection
- Coin definitions for ETC, ETH, ZANO, DCR

Worker integration:
- CPU worker support for Blake3DCR mining
- GPU worker stubs for ETChash, ProgPowZ, Blake3
- Proper algorithm family handling in CpuWorker/OclWorker

Go CLI integration:
- Updated xmrig_start.go with coin field support
- Improved pool configuration for new algorithms

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:56:19 +00:00
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
snider
876253f194 feat: Add dual CPU+GPU mining support with separate pools/algos
- Add GPU config fields: GPUEnabled, GPUPool, GPUWallet, GPUAlgo, CUDA, OpenCL
- XMRig config now supports separate pool/algo for GPU vs CPU mining
- CPU can mine RandomX while GPU mines KawPow on different pools
- Add xmrig_gpu_test.go with tests for dual, GPU-only, and CPU-only configs
- Make getXMRigConfigPath a variable for test overriding

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 17:23:59 +00:00
snider
ab47bae0a3 feat: Add CPU throttling, settings manager, and multi-miner tests
- Add CPUMaxThreadsHint, priority, pause-on-active/battery to XMRig config
- Create SettingsManager for app preferences (window state, miner defaults)
- Add settings API to desktop app service (GetSettings, SaveWindowState, etc)
- Create throttle_test.go with multi-miner CPU usage verification tests
- Create settings_manager_test.go with concurrent access tests
- Desktop app now remembers window size between launches

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:35:02 +00:00
snider
b9f9143336 feat: Add avg difficulty per share statistic to dashboard
- Add AvgDifficulty and DiffCurrent fields to PerformanceMetrics
- Calculate avg difficulty as HashesTotal/SharesGood in XMRig stats
- Add difficulty data to TT-Miner stats using pool difficulty
- Display "Avg Diff" stat in stats panel with k/M/G/T formatting
- Add WriteStdin to MockMiner for test interface compliance

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:41:26 +00:00
snider
f10e7a16e2 feat: Add stdin console commands, SQLite persistence, and P2P enhancements
- Add stdin pipe support for sending console commands to running miners (XMRig/TT-Miner)
- Add base64 encoding for log transport to preserve ANSI escape codes
- Add SQLite database for persistent hashrate history storage
- Enhance P2P worker to handle remote miner commands (start/stop/stats/logs)
- Add console UI page with ANSI-to-HTML rendering and command input
- Add E2E tests for navigation, UI elements, and miner start flow
- Update Dockerfile to use Go 1.24 with GOTOOLCHAIN=auto

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:30:19 +00:00
snider
e0c9c92244 feat: Implement logging functionality for miners with log buffer and retrieval endpoint 2025-12-29 22:10:45 +00:00
snider
9a781ae3f0 feat: Add multi-node P2P mining management system
Implement secure peer-to-peer communication between Mining CLI instances
for remote control of mining rigs. Uses Borg library for encryption
(SMSG, STMF, TIM) and Poindexter for KD-tree based peer selection.

Features:
- Node identity management with X25519 keypairs
- Peer registry with multi-factor optimization (ping/hops/geo/score)
- WebSocket transport with SMSG encryption
- Controller/Worker architecture for remote operations
- TIM/STIM encrypted bundles for profile/miner deployment
- CLI commands: node, peer, remote
- REST API endpoints for node/peer/remote operations
- Docker support for P2P testing with multiple nodes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:49:33 +00:00
snider
8460b8f3be feat: Add multi-miner dashboard support and TT-Miner implementation
Dashboard:
- Add aggregate stats across all running miners (total hashrate, shares)
- Add workers table with per-miner stats, efficiency, and controls
- Show hashrate bars and efficiency badges for each worker
- Support stopping individual workers or all at once

TT-Miner:
- Implement Install, Start, GetStats, CheckInstallation, Uninstall
- Add TT-Miner to Manager's StartMiner and ListAvailableMiners
- Support GPU-specific config options (devices, intensity, cliArgs)

Chart:
- Improve styling with WA-Pro theme variables
- Add hashrate unit formatting (H/s, kH/s, MH/s)
- Better tooltip and axis styling

Also:
- Fix XMRig download URLs (linux-static-x64, windows-x64)
- Add Playwright E2E testing infrastructure
- Add XMR pool research documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:48:20 +00:00
Snider
7d6e6e9c42 feat: Add stats bar component to display miner performance metrics and update dashboard layout 2025-12-11 15:22:58 +00:00
Snider
a3ff0bbdaf feat: Optimize saveProfiles method by removing unnecessary read lock 2025-12-11 14:08:02 +00:00
Snider
0d412e6faa feat: Add setup wizard and profile management components with styling 2025-12-10 22:17:38 +00:00
Snider
8f888a3749 feat: Refactor dashboard layout and integrate admin panel functionality 2025-12-07 18:31:27 +00:00
Snider
816f860b73 feat: Enhance mining configuration management and API documentation 2025-12-07 16:26:18 +00:00
Snider
2576d4bc1b feat: Update server configuration and add XMRig miner management functionality 2025-12-07 15:14:30 +00:00
google-labs-jules[bot]
6412362ea6 feat: Add comprehensive docstrings to the mining package
This commit adds comprehensive Go docstrings to the `pkg/mining` package,
including `mining.go`, `manager.go`, `manager_interface.go`, and `xmrig.go`.

The docstrings cover all public types, interfaces, functions, and methods,
and include examples where appropriate to illustrate usage.

This change improves the developer experience by making the code easier to
understand and use.
2025-11-14 14:32:57 +00:00
google-labs-jules[bot]
e107920b16 feat: add _Good, _Bad, _Ugly tests
Refactors the existing test suite to use a `_Good`, `_Bad`, and `_Ugly` testing structure. This new format improves the clarity and organization of the tests by distinguishing between happy path scenarios (_Good), expected failures (_Bad), and edge cases (_Ugly).

In addition to reorganizing the existing tests, this change also introduces new `_Bad` test cases to `xmrig_test.go` to cover previously untested failure modes, such as a missing miner binary and an unreachable API. This improves the overall quality and robustness of the test suite.
2025-11-13 21:24:25 +00:00
google-labs-jules[bot]
0533a9fb9c fix(ui): Correct UI build and server configuration
Corrected the build script in `ui/package.json` to correctly bundle the Angular application. Also updated `pkg/mining/service.go` to serve the correct bundled JavaScript file.

Verified the backend server is running and accessible by testing the Swagger UI endpoint.
2025-11-13 19:49:58 +00:00
google-labs-jules[bot]
c74f360dd0 feat(mining): Increase test coverage for service and manager
Added tests for GetMiner and ListMiners in the manager, and for the GetInfo and Doctor endpoints in the service. This increases the overall test coverage of the pkg/mining package.
2025-11-13 19:23:33 +00:00
google-labs-jules[bot]
1e2fa7a85a feat(mining): Increase test coverage for manager
Added tests for StartMiner and StopMiner in the manager, increasing test coverage for the pkg/mining package.

Refactored the findMinerBinary function to fall back to the system PATH, making the application more robust and easier to test.
2025-11-13 19:17:07 +00:00
google-labs-jules[bot]
baf732b999 feat: Increase test coverage for pkg/mining
This commit introduces a number of new tests for the `pkg/mining` package,
increasing the overall test coverage from 8.2% to 41.4%.

The following changes were made:

- Added tests for the `XMRigMiner` struct, including its methods for
  installation, starting, stopping, and getting stats.
- Added tests for the `Service` layer, including the API endpoints for
  listing, starting, stopping, and getting stats for miners.
- Added tests for the `Manager`, including starting and stopping multiple
  miners, collecting stats, and getting hashrate history.
- Introduced a `ManagerInterface` to decouple the `Service` layer from the
  concrete `Manager` implementation, facilitating testing with mocks.
- Fixed a failing test on Windows by creating a Windows-compatible
  dummy executable.
- Improved encapsulation in tests by adding and using getter methods for
  private fields.
2025-11-10 00:55:35 +00:00
google-labs-jules[bot]
5fd7b4b40a feat: Increase test coverage for pkg/mining
This commit introduces a number of new tests for the `pkg/mining` package,
increasing the overall test coverage from 8.2% to 40.7%.

The following changes were made:

- Added tests for the `XMRigMiner` struct, including its methods for
  installation, starting, stopping, and getting stats.
- Added tests for the `Service` layer, including the API endpoints for
  listing, starting, stopping, and getting stats for miners.
- Added tests for the `Manager`, including starting and stopping multiple
  miners, collecting stats, and getting hashrate history.
- Introduced a `ManagerInterface` to decouple the `Service` layer from the
  concrete `Manager` implementation, facilitating testing with mocks.
- Fixed a failing test on Windows by creating a Windows-compatible
  dummy executable.
2025-11-10 00:45:35 +00:00
google-labs-jules[bot]
0f8f61071e feat: Increase test coverage for pkg/mining
This commit introduces a number of new tests for the `pkg/mining` package,
increasing the overall test coverage from 8.2% to 40.7%.

The following changes were made:

- Added tests for the `XMRigMiner` struct, including its methods for
  installation, starting, stopping, and getting stats.
- Added tests for the `Service` layer, including the API endpoints for
  listing, starting, stopping, and getting stats for miners.
- Added tests for the `Manager`, including starting and stopping multiple
  miners, collecting stats, and getting hashrate history.
- Introduced a `ManagerInterface` to decouple the `Service` layer from the
  concrete `Manager` implementation, facilitating testing with mocks.
2025-11-10 00:06:35 +00:00
Snider
fdac15ba43 windows build fix 2025-11-09 19:13:48 +00:00
Snider
6fd424f562 should add the custom element compile js file to the release. 2025-11-09 19:06:05 +00:00
Snider
9093ce16e9 adds a system log entry on miner start CryptoCurrency Miner started: %s (Binary: %s) because it's rude to not say hello to the OS's AV. 2025-11-09 05:35:40 +00:00
Snider
dc0eae0888 creates <mde-mining-dashboard> custom html element, for miner control and stats display. 2025-11-09 04:41:07 +00:00
Snider
a043a09d22 adds historial hashrate data that reduces from 10s res to 1m res after a rolling 5m window. 2025-11-09 04:08:10 +00:00
Snider
6ac80d211a Add logOutput field to control stdout/stderr logging and update miner management 2025-11-09 03:10:55 +00:00