You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Setup.md accuracy fixes and architecture context (#70)
* docs: Setup.md accuracy fixes and architecture context
Reconciled with the merged Sui Documentation Style Guide pass (#68).
- Add "Architecture at a glance" and "Prerequisites" sections so the doc
surfaces the multi-service stack (Sui RPC, relayer, Seal key servers,
Walrus publisher/aggregator) and the running-relayer prerequisite.
- Fix stale factory name: createMessagingGroupsClient ->
createSuiStackMessagingClient.
- Session-key tiers: Tier 1 references @mysten/dapp-kit, Tier 2 drops
dapp-kit framing, Tier 3 renamed Consumer-managed; add DEK-cache-TTL note.
- Split packageConfig shape (factory nested vs manual flat).
- Add "Where to go next" cross-links.
Style follows the guide: sentence-case headings, Testnet/Mainnet, "through",
no horizontal rules, no inline bold labels.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: apply review feedback on Setup.md
- Drop Where-to-go-next footer nav (inline suggestion).
- Capitalize Localnet in prose (style-guide audit).
- Tier 1 heading to sentence case; move signer list to body.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/sui-stack-messaging/Setup.md
+57-25Lines changed: 57 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,35 @@
3
3
4
4
This SDK follows the [MystenLabs TS SDK building guidelines](https://sdk.mystenlabs.com/sui/sdk-building). It uses the client extension pattern: you extend a base Sui client with messaging, groups, and Seal extensions.
5
5
6
-
## Quick setup with `createMessagingGroupsClient()`
6
+
## Architecture at a glance
7
7
8
-
This helper 'factory' function handles all three extensions automatically:
8
+
The SDK is one client in a system that talks to four independent services. Encryption is end-to-end, so none of them see plaintext.
| Sui RPC (fullnode / gRPC) | Chain reads and transaction submission | Public endpoint or your own |
13
+
| Relayer | Accepts ciphertext, indexes membership, serves messages back | You run it. No public canonical relayer exists, so fork the reference at [`relayer/`](../../relayer/). See [Relayer](./Relayer.md). |
14
+
| Seal key servers | Threshold-encrypt and decrypt DEKs | Mysten Labs operates the canonical allowlist; you reference their objectIds in `seal.serverConfigs`. See [Seal docs](https://github.com/MystenLabs/seal). |
15
+
| Walrus publisher and aggregator (optional, attachments only) | Stores encrypted file bytes | Public Testnet endpoints, your own, or skip them entirely and talk to Walrus through the [`@mysten/walrus`](https://www.npmjs.com/package/@mysten/walrus) SDK (see [Extending](./Extending.md)). |
16
+
17
+
## Prerequisites
18
+
19
+
Before writing SDK code, confirm:
20
+
21
+
- A running relayer reachable from your app. For development, see [`relayer/README.md`](../../relayer/README.md); for production, fork the reference and operate your own.
22
+
- Seal `serverConfigs`, the canonical key-server object IDs for your network. See [Seal docs](https://github.com/MystenLabs/seal) for the current allowlist.
23
+
- A Sui RPC URL for the right network (Testnet, Mainnet, or Localnet).
24
+
- (Optional) A Walrus publisher and aggregator if you need attachments, or commit to the `@mysten/walrus` SDK path (see [Attachments](./Attachments.md), [Extending](./Extending.md)).
25
+
26
+
## Quick setup with `createSuiStackMessagingClient()`
27
+
28
+
This factory function composes all three extensions for you:
|`ttlMin`| 10 | Session-key TTL in minutes; also sets the DEK cache TTL |
158
+
|`refreshBufferMs`| 60000 | Refresh this many ms before expiry |
159
+
|`mvrName`| (none) | MVR name for Seal package resolution |
160
+
161
+
Tier 3's variant excludes these options; its DEK cache falls back to the 10-minute default regardless of your `SessionKey`'s own TTL.
138
162
139
163
#### Encryption options
140
164
@@ -146,14 +170,16 @@ encryption: {
146
170
147
171
### `relayer` (required)
148
172
149
-
Either provide a URL for the built-in HTTP transport or a custom transport instance:
173
+
The relayer must be running and reachable before any message operation succeeds. `sendMessage`, `getMessages`, `subscribe`, and friends all go through it. No public canonical relayer exists, so see [`relayer/README.md`](../../relayer/README.md) to spin up the reference for development, or fork it for production.
174
+
175
+
Either provide a URL for the built-in HTTP transport, or supply a custom transport instance:
150
176
151
177
```typescript
152
178
// Built-in HTTP transport
153
179
relayer: {
154
180
relayerUrl: 'https://your-relayer.example.com',
155
181
pollingIntervalMs: 3000, // default
156
-
timeout: 30000, // default
182
+
timeout: 30_000, // default (ms)
157
183
onError: (err) =>console.error(err),
158
184
}
159
185
@@ -163,7 +189,7 @@ relayer: {
163
189
}
164
190
```
165
191
166
-
See [Relayer](./Relayer.md) for the `RelayerTransport` interface.
192
+
See [Relayer](./Relayer.md) for the wire protocol and `RelayerTransport` interface.
When omitted, `sendMessage` cannot include files and received attachment metadata is not resolvable. See [Attachments](./Attachments.md).
213
+
When omitted, `sendMessage` cannot include files and received attachment metadata is not resolvable. See [Attachments](./Attachments.md), and [Extending](./Extending.md) for non-HTTP and `@mysten/walrus`-SDK adapters.
188
214
189
215
### `packageConfig` (optional)
190
216
191
-
Auto-detected for Testnet and Mainnet. Required for localnet or custom deployments:
217
+
Auto-detected for Testnet and Mainnet. Required for Localnet or custom deployments. The shape differs between the factory and the manual chain.
218
+
219
+
Factory (`createSuiStackMessagingClient`):
192
220
193
221
```typescript
194
222
packageConfig: {
195
223
messaging: {
196
-
originalPackageId: '0x...', // First published package ID (type names, BCS, Seal)
197
-
latestPackageId: '0x...', // Current package ID (moveCall targets)
224
+
originalPackageId: '0x...', // First published: type names, BCS, Seal namespace
Manual (`suiStackMessaging({...})`): a flat `SuiStackMessagingPackageConfig`, just the four messaging fields above. The `permissionedGroups` config is passed separately into `suiGroups({ packageConfig })` within the same `$extend` call.
237
+
208
238
### `suinsConfig` (optional)
209
239
210
240
Auto-detected for Testnet and Mainnet. Only needed for SuiNS reverse lookup operations (`setSuinsReverseLookup`, `unsetSuinsReverseLookup`).
211
241
212
242
### `seal` (factory only)
213
243
214
-
When using `createMessagingGroupsClient`, pass either a pre-built `SealClient` or Seal config options:
244
+
When using `createSuiStackMessagingClient`, pass either a pre-built `SealClient` or Seal config options:
215
245
216
246
```typescript
217
247
// Config options (SealClient created internally)
@@ -226,6 +256,8 @@ seal: {
226
256
seal: existingSealClient,
227
257
```
228
258
259
+
In the manual chain you construct the `SealClient` directly inside the `$extend``register` callback (see the example above).
260
+
229
261
## Sub-modules
230
262
231
263
The `client.messaging` object exposes several sub-modules:
0 commit comments