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:
@@ -74,9 +74,21 @@ func (f *FleetHandler) PostPlayStrainCard(w http.ResponseWriter, r *http.Request
|
||||
if card.ID == "" {
|
||||
card.ID = stored.ID
|
||||
}
|
||||
if inHospice, err := f.db.IsStrainInHospice(strategy.NormalizeStrainID(card.SpreadStrain)); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
} else if inHospice {
|
||||
http.Error(w, "strain is in hospice — play-card disabled (museum archive)", http.StatusConflict)
|
||||
return
|
||||
}
|
||||
|
||||
result, err := f.ws.PlayStrainCard(agentID, card)
|
||||
if err != nil {
|
||||
_ = (&OathLedgerBridge{DB: f.db, Hub: f.ws}).Record(
|
||||
AuthUsername(r), db.OathStrainCardPlay, agentID, card.SpreadStrain, db.OathOutcomeFail,
|
||||
map[string]interface{}{"card_id": cardID, "persona": card.Persona},
|
||||
map[string]interface{}{"error": err.Error(), "card_id": cardID},
|
||||
)
|
||||
writeJSON(w, map[string]interface{}{
|
||||
"success": false,
|
||||
"error": err.Error(),
|
||||
@@ -100,6 +112,22 @@ func (f *FleetHandler) PostPlayStrainCard(w http.ResponseWriter, r *http.Request
|
||||
"queued": result.Queued,
|
||||
"transport": result.Transport,
|
||||
})
|
||||
_ = (&OathLedgerBridge{DB: f.db, Hub: f.ws}).Record(
|
||||
AuthUsername(r), db.OathStrainCardPlay, agentID, card.SpreadStrain, db.OathOutcomeSuccess,
|
||||
map[string]interface{}{
|
||||
"card_id": cardID,
|
||||
"persona": card.Persona,
|
||||
"root": card.RootAgentID,
|
||||
},
|
||||
map[string]interface{}{
|
||||
"card_id": cardID,
|
||||
"play_id": result.PlayID,
|
||||
"persona": card.Persona,
|
||||
"sent": result.Sent,
|
||||
"queued": result.Queued,
|
||||
"transport": result.Transport,
|
||||
},
|
||||
)
|
||||
|
||||
writeJSON(w, map[string]interface{}{
|
||||
"success": true,
|
||||
|
||||
Reference in New Issue
Block a user