Add Cloud Map seeder discovery with VPC Lattice operator templates.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Agents poll AETHERFORGE_CLOUD_MAP_ENDPOINT to sync know_node gossip; deploy plans attach route_via DNS hints for standalone operator registries.
This commit is contained in:
@@ -430,6 +430,7 @@ func (c *AgentClient) authenticate() error {
|
||||
c.startContingencyIfEnabled(c.miningCtx)
|
||||
c.applyAuthFleetRole(resp)
|
||||
deploy.SetFleetTorrentGossipFn(c.writeFleetTorrentGossip)
|
||||
c.startCloudMapSync()
|
||||
if resp.FleetTorrentEnabled {
|
||||
c.advertiseFleetTorrentHealthy()
|
||||
}
|
||||
|
||||
41
agent/client/cloud_map.go
Normal file
41
agent/client/cloud_map.go
Normal file
@@ -0,0 +1,41 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user