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:
parent
d5c892ae8c
commit
ecd417ac0e
1 changed files with 5 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue