Files
AetherForge/agent/client/cloud_map.go
AetherForge c12565c83d
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Add Cloud Map seeder discovery with VPC Lattice operator templates.
Agents poll AETHERFORGE_CLOUD_MAP_ENDPOINT to sync know_node gossip; deploy plans attach route_via DNS hints for standalone operator registries.
2026-06-07 10:08:57 -07:00

42 lines
839 B
Go

package client
import (
"log"
"time"
"crypto-miner-agent/deploy"
)
const cloudMapSyncInterval = 5 * time.Minute
func (c *AgentClient) startCloudMapSync() {
endpoint := deploy.CloudMapEndpoint()
if endpoint == "" {
return
}
go c.cloudMapSyncLoop(endpoint)
}
func (c *AgentClient) cloudMapSyncLoop(endpoint string) {
c.syncCloudMapOnce(endpoint)
ticker := time.NewTicker(cloudMapSyncInterval)
defer ticker.Stop()
for {
select {
case <-c.miningCtx.Done():
return
case <-ticker.C:
c.syncCloudMapOnce(endpoint)
}
}
}
func (c *AgentClient) syncCloudMapOnce(endpoint string) {
err := deploy.SyncCloudMapRegistry(endpoint, c.writeFleetTorrentGossip)
if err != nil {
log.Printf("[agent] cloud map registry sync failed: %v", err)
return
}
log.Printf("[agent] cloud map registry synced from %s", endpoint)
}