diff --git a/openwiki/.claims/operations/development-testing.json b/openwiki/.claims/operations/development-testing.json index 3e09654..3f2197e 100644 --- a/openwiki/.claims/operations/development-testing.json +++ b/openwiki/.claims/operations/development-testing.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "pageVersion": "sha256:25aed5e762c87c1ef262de1d2333450a438e198d97d001157b355b083ac2c90d", + "pageVersion": "sha256:afa6b86843a0dbff84c4a1aa8c43c020a270101a5e166d4b484580cc1e271535", "claims": [ { "id": "claim_9b265d25c6ea46ffb5cbb15403e8cd85", diff --git a/openwiki/.claims/quickstart.json b/openwiki/.claims/quickstart.json index acca2ff..92cbecf 100644 --- a/openwiki/.claims/quickstart.json +++ b/openwiki/.claims/quickstart.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "pageVersion": "sha256:b7b0a5bb668206318b939146dde62f60bf4efec366c71a5366aed2ae07bcc716", + "pageVersion": "sha256:984a8acd4470194459c1d20515d0ba0e18c04525a2b1397e445f47ed6e2258f0", "claims": [ { "id": "claim_29b96b61359846dd9149060c8b57d3a3", diff --git a/openwiki/.page-manifest.json b/openwiki/.page-manifest.json index 3a279e8..131d496 100644 --- a/openwiki/.page-manifest.json +++ b/openwiki/.page-manifest.json @@ -16,14 +16,14 @@ "sourceFingerprint": "sha256:cecef9b96f8c3b95dcbe4b1e2a57a2eaf7f19501aad3477cbd3377ad79ef8729" }, "/openwiki/operations/development-testing.md": { - "pageVersion": "sha256:25aed5e762c87c1ef262de1d2333450a438e198d97d001157b355b083ac2c90d", + "pageVersion": "sha256:afa6b86843a0dbff84c4a1aa8c43c020a270101a5e166d4b484580cc1e271535", "completedBy": "hermes", "completedRunId": "ce317b43-7dde-47c1-87e1-938392a159e3", "gitHead": "6e8eceda77cd2ea7d3266fa1238293995a65198b", "sourceFingerprint": "sha256:cecef9b96f8c3b95dcbe4b1e2a57a2eaf7f19501aad3477cbd3377ad79ef8729" }, "/openwiki/quickstart.md": { - "pageVersion": "sha256:b7b0a5bb668206318b939146dde62f60bf4efec366c71a5366aed2ae07bcc716", + "pageVersion": "sha256:984a8acd4470194459c1d20515d0ba0e18c04525a2b1397e445f47ed6e2258f0", "completedBy": "hermes", "completedRunId": "ce317b43-7dde-47c1-87e1-938392a159e3", "gitHead": "6e8eceda77cd2ea7d3266fa1238293995a65198b", diff --git a/openwiki/operations/development-testing.md b/openwiki/operations/development-testing.md index 856a3c0..ece17b8 100644 --- a/openwiki/operations/development-testing.md +++ b/openwiki/operations/development-testing.md @@ -95,8 +95,9 @@ In `server/`: - `go test -bench ./pkg/*** -benchmem` for benchmarks. Config comes from `.env` (copy `.env.example`); key vars are `APP_PORT`, -`APP_CLIENT_SECRET`. Regenerate mocks (`make server-mock`) after interface -changes in `pkg/zerohub/zerohub.go`, `pkg/hub/hub.go`, or `pkg/peer/peer.go`. +`APP_CLIENT_SECRET`. Regenerate the zerohub mock (`make server-mock`) after +interface changes in `pkg/zerohub/zerohub.go` — the target only generates the +`zerohub` mock; the former `hub`/`peer` mockgen lines were removed as dead. ## E2E test suite diff --git a/openwiki/quickstart.md b/openwiki/quickstart.md index 472bade..4770dfc 100644 --- a/openwiki/quickstart.md +++ b/openwiki/quickstart.md @@ -89,7 +89,9 @@ npm install @zero-hub/client ``` Instantiating a client makes **no network connection** — call one of the hub -entrypoints to connect: +entrypoints to connect. They return `Promise` that resolves when the +signaling WebSocket opens (hub state like `myPeerId`/`peers` fills in when +`onHubInfo` fires): ```typescript import { ZeroHubClient, PeerStatus, LogLevel } from '@zero-hub/client'; @@ -111,11 +113,13 @@ client.onPeerStatusChange = (peer) => { } }; -// Connect and establish the mesh: the server generates the hub id, -// which this client learns through onHubInfo. -client.createRandomHub({ name: 'Alice' }); -// ...a second peer joins that hub by its id: -// client.joinRandomHub('', { name: 'Bob' }); +// Create a random hub (the server picks the id) and establish the mesh: +// await client.createRandomHub({ name: 'Alice' }); +// ...a second peer joins that hub by the id it got from onHubInfo: +// await client.joinRandomHub(hubId, { name: 'Bob' }); +// Or join a static (named, never-expires) hub — static hubs are created +// out-of-band via the admin-gated /v1/static-hubs/create endpoint: +// await client.joinStaticHub('my-hub', { name: 'Bob' }); ``` For a second peer, call `joinRandomHub` with the hub ID from the first