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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user