Complete private Monero miner control stack.
Implement Windows agent with RandomX mining and WebSocket fleet reporting, wire dashboard settings into the builder with saved exe paths, and add project README.
This commit is contained in:
30
agent/config/builtin.go
Normal file
30
agent/config/builtin.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
// Default stub used for local development builds. The Miner Builder replaces this file.
|
||||
func GetBuiltinConfig() BuiltinConfig {
|
||||
return BuiltinConfig{
|
||||
WorkerName: "dev-worker",
|
||||
ServerURL: "http://127.0.0.1:8989",
|
||||
Wallet: "",
|
||||
Threads: 4,
|
||||
CPUPriority: "below_normal",
|
||||
MiningMode: "always",
|
||||
SilentMode: false,
|
||||
RunAs: "user",
|
||||
AutoStart: false,
|
||||
BuildID: "dev",
|
||||
BuiltAt: time.Now(),
|
||||
PoolHost: "pool.supportxmr.com",
|
||||
PoolPort: 3333,
|
||||
PoolTLS: true,
|
||||
PoolPass: "x",
|
||||
MaxCPUUsage: 80,
|
||||
MinFreeRAM: 1024,
|
||||
IdleThresholdPct: 20,
|
||||
IdleDurationMinutes: 5,
|
||||
ScheduleStart: "21:00",
|
||||
ScheduleEnd: "06:00",
|
||||
}
|
||||
}
|
||||
70
agent/config/config.go
Normal file
70
agent/config/config.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const Version = "1.0.0"
|
||||
|
||||
// BuiltinConfig holds compile-time settings generated by the Miner Builder.
|
||||
type BuiltinConfig struct {
|
||||
WorkerName string
|
||||
ServerURL string
|
||||
Wallet string
|
||||
Threads int
|
||||
CPUPriority string
|
||||
MiningMode string
|
||||
SilentMode bool
|
||||
RunAs string
|
||||
AutoStart bool
|
||||
BuildID string
|
||||
BuiltAt time.Time
|
||||
PoolHost string
|
||||
PoolPort int
|
||||
PoolTLS bool
|
||||
PoolPass string
|
||||
MaxCPUUsage int
|
||||
MinFreeRAM int
|
||||
IdleThresholdPct int
|
||||
IdleDurationMinutes int
|
||||
ScheduleStart string
|
||||
ScheduleEnd string
|
||||
}
|
||||
|
||||
// RuntimeConfig is the resolved configuration used by the agent.
|
||||
type RuntimeConfig struct {
|
||||
BuiltinConfig
|
||||
AgentID string
|
||||
}
|
||||
|
||||
func Load() RuntimeConfig {
|
||||
b := GetBuiltinConfig()
|
||||
if b.Threads <= 0 {
|
||||
b.Threads = 4
|
||||
}
|
||||
if b.CPUPriority == "" {
|
||||
b.CPUPriority = "below_normal"
|
||||
}
|
||||
if b.MiningMode == "" {
|
||||
b.MiningMode = "always"
|
||||
}
|
||||
if b.MaxCPUUsage <= 0 {
|
||||
b.MaxCPUUsage = 80
|
||||
}
|
||||
if b.MinFreeRAM <= 0 {
|
||||
b.MinFreeRAM = 1024
|
||||
}
|
||||
if b.IdleThresholdPct <= 0 {
|
||||
b.IdleThresholdPct = 20
|
||||
}
|
||||
if b.IdleDurationMinutes <= 0 {
|
||||
b.IdleDurationMinutes = 5
|
||||
}
|
||||
if b.ScheduleStart == "" {
|
||||
b.ScheduleStart = "21:00"
|
||||
}
|
||||
if b.ScheduleEnd == "" {
|
||||
b.ScheduleEnd = "06:00"
|
||||
}
|
||||
return RuntimeConfig{BuiltinConfig: b}
|
||||
}
|
||||
Reference in New Issue
Block a user