From ecd417ac0ef892c9ab69ef2817202484aa1de23b Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 10:52:05 +0100 Subject: [PATCH] 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 --- pkg/mining/mining.go | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/pkg/mining/mining.go b/pkg/mining/mining.go index fd9ba68..d82eba5 100644 --- a/pkg/mining/mining.go +++ b/pkg/mining/mining.go @@ -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