Cloudflare Workers Gun.js-compatible peer with a stats dashboard and persistent Durable Object storage.
npm install
npm run devDashboard at the Wrangler dev URL, usually http://localhost:8787.
Gun clients should use the /gun peer endpoint:
const gun = Gun({
peers: ["https://your-worker.example.com/gun"],
});npm run buildnpm run deploy/- dashboard/gun- Gun-compatible WebSocket peer endpoint/api/stats- dashboard stats/api/peers- mesh peer list (GET public, POST/DELETE needPEERS_EDIT_TOKENwhen set)/api/peers/verify- probe a gun peer url (POST, no auth)/api/peers/reconnect- force server-side mesh reconnect (POST, same auth as peer edits)/api/graph/souls- node index (limit,cursor,prefix,q,sort=updated)/api/graph/node- structured node inspector (soul)/api/graph/subgraph- nodes + reference edges for the explorer (roots,prefix,depth,maxNodes)/explorer.html- graph explorer UI/health- health check
The old Node server used Gun Radisk with file: "data". Cloudflare Workers do
not provide a persistent local filesystem for that model, so this version stores
Gun graph nodes in Durable Object storage instead. Each write is acknowledged
after the graph merge is stored, and reads are served from the Durable Object.