Mining/pkg/mining/lethean.go
Claude 82781c6f95
ax(mining): remove prose comment that restates constant name
LetheanTestnetPool is self-documenting; the prose description
"is the default pool endpoint for testnet mining" adds zero
information over the name. Per AX principle 2, deleted and kept
only the usage example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:44:39 +01:00

116 lines
3.3 KiB
Go

// Copyright (c) 2017-2026 Lethean (https://lt.hn)
// SPDX-License-Identifier: EUPL-1.2
package mining
// Lethean network mining presets.
// These provide default configurations for mining LTHN on testnet and mainnet.
// config := mining.LetheanTestnetConfig("iTHN...")
const LetheanTestnetPool = "stratum+tcp://pool.lthn.io:5555"
// config := mining.LetheanMainnetConfig("iTHNabc123...")
const LetheanMainnetPool = "stratum+tcp://pool.lthn.io:3333"
// config := mining.LetheanSoloConfig("iTHNabc123...", true)
const LetheanSoloTestnet = "http://127.0.0.1:46941"
// config := mining.LetheanSoloConfig("iTHNabc123...", false)
const LetheanSoloMainnet = "http://127.0.0.1:36941"
// config := mining.LetheanTestnetConfig("iTHNabc123...")
func LetheanTestnetConfig(walletAddress string) *Config {
return &Config{
Pool: LetheanTestnetPool,
Wallet: walletAddress,
Algo: "progpowz",
Coin: "lethean",
Threads: 0, // auto-detect
DonateLevel: 0,
Keepalive: true,
TLS: false,
HTTPHost: "127.0.0.1",
HTTPPort: 37420,
CPUMaxThreadsHint: 50, // use 50% of cores by default
}
}
// config := mining.LetheanMainnetConfig("iTHNabc123...")
func LetheanMainnetConfig(walletAddress string) *Config {
return &Config{
Pool: LetheanMainnetPool,
Wallet: walletAddress,
Algo: "progpowz",
Coin: "lethean",
Threads: 0,
DonateLevel: 0,
Keepalive: true,
TLS: false,
HTTPHost: "127.0.0.1",
HTTPPort: 37420,
CPUMaxThreadsHint: 75,
}
}
// config := mining.LetheanSoloConfig("iTHNabc123...", true)
func LetheanSoloConfig(walletAddress string, testnet bool) *Config {
daemon := LetheanSoloMainnet
if testnet {
daemon = LetheanSoloTestnet
}
return &Config{
Pool: daemon,
Wallet: walletAddress,
Algo: "progpowz",
Coin: "lethean",
Threads: 0,
DonateLevel: 0,
Keepalive: true,
HTTPHost: "127.0.0.1",
HTTPPort: 37420,
CPUMaxThreadsHint: 100, // solo: use all cores
}
}
// profile := mining.LetheanDefaultProfile("iTHNabc123...", true)
func LetheanDefaultProfile(walletAddress string, testnet bool) MiningProfile {
name := "Lethean Mainnet"
if testnet {
name = "Lethean Testnet"
}
config := LetheanTestnetConfig(walletAddress)
if !testnet {
config = LetheanMainnetConfig(walletAddress)
}
configJSON, _ := MarshalJSON(config)
return MiningProfile{
Name: name,
MinerType: "xmrig",
Config: RawConfig(configJSON),
}
}
// profile := mining.LetheanDualMiningProfile("iTHN...", "4...", true)
func LetheanDualMiningProfile(lthnAddress, xmrAddress string, testnet bool) MiningProfile {
pool := LetheanMainnetPool
if testnet {
pool = LetheanTestnetPool
}
config := &Config{
Pool: pool,
Wallet: lthnAddress,
Algo: "progpowz",
Coin: "lethean",
DonateLevel: 0,
Keepalive: true,
CPUMaxThreadsHint: 25,
HTTPHost: "127.0.0.1",
HTTPPort: 37420,
}
configJSON, _ := MarshalJSON(config)
return MiningProfile{
Name: "LTHN + XMR Dual Mining",
MinerType: "xmrig",
Config: RawConfig(configJSON),
}
}