Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openwiki/.claims/operations/development-testing.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"pageVersion": "sha256:25aed5e762c87c1ef262de1d2333450a438e198d97d001157b355b083ac2c90d",
"pageVersion": "sha256:afa6b86843a0dbff84c4a1aa8c43c020a270101a5e166d4b484580cc1e271535",
"claims": [
{
"id": "claim_9b265d25c6ea46ffb5cbb15403e8cd85",
Expand Down
2 changes: 1 addition & 1 deletion openwiki/.claims/quickstart.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"pageVersion": "sha256:b7b0a5bb668206318b939146dde62f60bf4efec366c71a5366aed2ae07bcc716",
"pageVersion": "sha256:984a8acd4470194459c1d20515d0ba0e18c04525a2b1397e445f47ed6e2258f0",
"claims": [
{
"id": "claim_29b96b61359846dd9149060c8b57d3a3",
Expand Down
4 changes: 2 additions & 2 deletions openwiki/.page-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions openwiki/operations/development-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 10 additions & 6 deletions openwiki/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>` 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';
Expand All @@ -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('<hub id>', { 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
Expand Down