Appearance
swarm-mode
FreshSource: BIBLE.md (Phase 12 Phase 7, swarm-mode 7 routes)
Multiple Ghost Engine instances across different machines coordinated through a central controller. Each instance manages its own browsers and accounts. They coordinate campaigns: one in Dallas, one in Miami, one on a VPS. Geographic diversity physically impossible from a single machine.
Architecture
flowchart TD C[Central controller] --> I1[Instance: Dallas laptop] C --> I2[Instance: Miami desktop] C --> I3[Instance: VPS in Frankfurt] C --> I4[Instance: Mac Studio] I1 -- heartbeat --> C I2 -- heartbeat --> C I3 -- heartbeat --> C I4 -- heartbeat --> C C --> A[Aggregated dashboard]
Routes (7)
| Method | Route | What |
|---|---|---|
| POST | /swarm/register | Register an instance |
| GET | /swarm/instances | List active instances |
| POST | /swarm/heartbeat | Instance check-in |
| POST | /swarm/dispatch | Load-balanced job dispatch |
| POST | /swarm/assign-accounts | Assign accounts to specific instance |
| GET | /swarm/topology | Network topology view |
| GET | /swarm/aggregate-stats | Cross-instance stats |
Heartbeat
Each instance sends a heartbeat every 30 seconds with its status:
json
{
"instanceId": "ge-dallas-laptop",
"host": "192.168.1.10",
"uptime": 12345,
"activeBrowsers": 2,
"accountsAssigned": 12,
"jobsInQueue": 3,
"healthScore": 95
}Account assignment
Accounts are pinned to specific instances based on geo. A "Dallas" account always runs on the Dallas instance so its IP and timing stay coherent.