41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package policy
|
|
|
|
import (
|
|
"forge-mesh/internal/api/types"
|
|
)
|
|
|
|
// DefaultMiningProfile returns the standard tier order for new agents.
|
|
func DefaultMiningProfile(wallet string) types.MiningProfile {
|
|
if wallet == "" {
|
|
wallet = "WALLET_UNSET"
|
|
}
|
|
return types.MiningProfile{
|
|
ID: "default",
|
|
Name: "Default tier chain",
|
|
WalletAddress: wallet,
|
|
PolicyFromServer: true,
|
|
Tiers: []types.MiningTierSpec{
|
|
{Type: "oci", Duration: 5, Config: map[string]string{"image": "docker.io/xmrig/xmrig:latest"}},
|
|
{Type: "xmrig", Duration: 10, Config: map[string]string{"algo": "rx/0"}},
|
|
{Type: "gpu", Duration: 10, Config: map[string]string{"algo": "kawpow", "coin": "RVN"}},
|
|
{Type: "stratum", Duration: 0, Config: map[string]string{"algo": "rx/0"}},
|
|
},
|
|
}
|
|
}
|
|
|
|
// TierDisplayName maps tier type to a human label.
|
|
func TierDisplayName(tierType string) string {
|
|
switch tierType {
|
|
case "oci":
|
|
return "OCI podman"
|
|
case "xmrig":
|
|
return "Bundled xmrig"
|
|
case "gpu", "lolminer":
|
|
return "GPU lolMiner"
|
|
case "stratum":
|
|
return "Stratum direct"
|
|
default:
|
|
return tierType
|
|
}
|
|
}
|