Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Ship Lambda/EventBridge templates and a token-gated policy snapshot endpoint so agents can poll hospice, vaccination lanes, and genesis version when C2 is down, preferring EventBridge relay over 30m reconnect.
33 lines
891 B
Go
33 lines
891 B
Go
package deploy
|
|
|
|
import (
|
|
"log"
|
|
|
|
"crypto-miner-agent/config"
|
|
)
|
|
|
|
var fleetTorrentGossipFn func([]FleetGossipRecord)
|
|
|
|
// SetFleetTorrentGossipFn injects WS gossip broadcast for seeder shard fan-out (client wires at runtime).
|
|
func SetFleetTorrentGossipFn(fn func([]FleetGossipRecord)) {
|
|
fleetTorrentGossipFn = fn
|
|
}
|
|
|
|
// StartFleetTorrentSeederService announces healthy status and enables zero-server reconnect for seeders.
|
|
func StartFleetTorrentSeederService(cfg config.RuntimeConfig) {
|
|
if !config.FleetTorrentEnabled(cfg) {
|
|
return
|
|
}
|
|
log.Printf("[fleet-torrent] seeder service active primary=%v", cfg.SubnetPrimarySeeder)
|
|
if fleetTorrentGossipFn != nil {
|
|
fleetTorrentGossipFn([]FleetGossipRecord{{
|
|
Kind: FleetGossipHealthy,
|
|
Healthy: true,
|
|
}})
|
|
}
|
|
StartZeroServerPolicyMode(cfg, func() error {
|
|
log.Printf("[fleet-torrent] zero-server reconnect attempt")
|
|
return nil
|
|
})
|
|
}
|