fix: hyperbee-chat runnable sample, hyperswarm doc table, ignore *-storage

- hyperbee-chat: repair Corestore/core init (was literal \n); use Hyperswarm update event
- hyperswarm.md: fix status() return column; clarify server emits connection/update events
- .gitignore: test-projects/**/*-storage/ for local corestore data

Made-with: Cursor
This commit is contained in:
Hermes Agent
2026-04-20 03:20:37 -04:00
parent 633f68bcac
commit e64a1c9383
3 changed files with 7 additions and 11 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ await swarm.suspend() // Pause
| leavePeer(pubKey) | void | Stop direct attempts |
| flush() | Promise | Await DHT + conns |
| listen() | Promise | Start server |
| status(topic) | PeerDiscovery | null | Get discovery |
| status(topic) | PeerDiscovery \| null | Get discovery |
| destroy() | Promise | Cleanup |
@@ -171,7 +171,7 @@ When the DHT emits a new duplex:
1. **Destroyed / suspended** swarms destroy the stream immediately (`ERR_DESTROYED`).
2. **Duplicate remotePublicKey** handling compares `rawBytesRead/Written` and Noise initiator tie-break (`b4a.compare(conn.publicKey, conn.remotePublicKey) > 0` vs `conn.isInitiator`) to decide whether to keep the new socket or nuke it as `ERR_DUPLICATE`.
3. On success, increments `stats.connects.server.opened`, registers the connection in `connections` + `_allConnections`, tags `peerInfo.client = false`, emits `**connection`** then `**update**`, and on `close` may **ban** peers when `shouldBan(getStreamError(conn))`.
3. On success, increments `stats.connects.server.opened`, registers the connection in `connections` + `_allConnections`, tags `peerInfo.client = false`, emits **`connection`** then **`update`**, and on `close` may **ban** peers when `shouldBan(getStreamError(conn))`.
### Why this matters for Hypercore replication