Add Fleet Torrent erasure extension with shard DHT and gossip.
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
Content-addressed shard DHT on seeder agents with subnet_primary_seeder election, cross-subnet fleet_torrent_gossip, BGP swarm magnets, C2 torrent manifest, and k-of-n peer fetch with C2 fallback.
This commit is contained in:
32
agent/deploy/fleet_torrent_seeder.go
Normal file
32
agent/deploy/fleet_torrent_seeder.go
Normal file
@@ -0,0 +1,32 @@
|
||||
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,
|
||||
}})
|
||||
}
|
||||
StartZeroServerReconnect(func() error {
|
||||
log.Printf("[fleet-torrent] zero-server reconnect attempt")
|
||||
return nil
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user