ax(mining): replace prose description on Miner interface with usage examples

AX Principle 2: comments show HOW with real values, not WHAT the type signature already says.
The 12-line prose block restated what the interface methods communicate directly.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 10:52:05 +01:00
parent d5c892ae8c
commit ecd417ac0e
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -12,23 +12,11 @@ const (
LowResHistoryRetention = 24 * time.Hour
)
// Miner defines the standard interface for a cryptocurrency miner.
// The interface is logically grouped into focused capabilities:
//
// Lifecycle - Installation and process management:
// - Install, Uninstall, Start, Stop
//
// Stats - Performance metrics collection:
// - GetStats
//
// Info - Miner identification and installation details:
// - GetType, GetName, GetPath, GetBinaryPath, CheckInstallation, GetLatestVersion
//
// History - Hashrate history management:
// - GetHashrateHistory, AddHashratePoint, ReduceHashrateHistory
//
// IO - Interactive input/output:
// - GetLogs, WriteStdin
// miner, err := factory.Create("xmrig")
// if err := miner.Install(); err != nil { return err }
// if err := miner.Start(&Config{Algo: "rx/0", Pool: "stratum+tcp://pool.example.com:3333"}); err != nil { return err }
// stats, err := miner.GetStats(ctx)
// defer miner.Stop()
type Miner interface {
// Lifecycle operations
Install() error