Skip to content

Commit 4e38954

Browse files
committed
fix: update transport config for holochain 0.6 kitsune2
- Switch from webrtc to quic network transport - Use irohTransport config instead of tx5Transport - Use http:// scheme for relay URL (iroh requires it) - Set signal_url to local bootstrap server - Increase dhtSync default timeout to 60s for kitsune2 gossip - Bump version to 0.19.1
1 parent 76844f4 commit 4e38954

6 files changed

Lines changed: 35 additions & 17 deletions

File tree

docs/tryorama.conductor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Install an application into the conductor.
132132
</td></tr>
133133
<tr><td>
134134

135-
[setNetworkConfig(createConductorOptions)](./tryorama.conductor.setnetworkconfig.md)
135+
[setNetworkConfig(createConductorOptions, signalingServerUrl)](./tryorama.conductor.setnetworkconfig.md)
136136

137137

138138
</td><td>

docs/tryorama.conductor.setnetworkconfig.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
**Signature:**
88

99
```typescript
10-
setNetworkConfig(createConductorOptions: NetworkConfig): void;
10+
setNetworkConfig(createConductorOptions: NetworkConfig, signalingServerUrl?: URL): void;
1111
```
1212

1313
## Parameters
@@ -41,6 +41,22 @@ createConductorOptions
4141
</td><td>
4242

4343

44+
</td></tr>
45+
<tr><td>
46+
47+
signalingServerUrl
48+
49+
50+
</td><td>
51+
52+
URL
53+
54+
55+
</td><td>
56+
57+
_(Optional)_
58+
59+
4460
</td></tr>
4561
</tbody></table>
4662
**Returns:**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@holochain/tryorama",
33
"description": "Toolset to manage Holochain conductors and facilitate running test scenarios",
4-
"version": "0.19.0",
4+
"version": "0.19.1",
55
"author": "Holochain Foundation",
66
"license": "MIT",
77
"keywords": [

ts/src/conductor-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const runLocalServices = async () => {
5151
.split(BOOTSTRAP_SERVER_STARTUP_STRING)[1]
5252
.split("#")[0];
5353
const bootstrapServerUrl = new URL(`http://${listeningAddress}`);
54-
const signalingServerUrl = new URL(`ws://${listeningAddress}`);
54+
const signalingServerUrl = new URL(`http://${listeningAddress}`);
5555
logger.verbose(`bootstrap server url: ${bootstrapServerUrl}`);
5656
logger.verbose(`signaling server url: ${signalingServerUrl}`);
5757
resolve({

ts/src/conductor.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,18 @@ type NetworkAdvancedK2GossipConfigYaml = Omit<
146146
"targetArcFactor" | "transportTimeoutS"
147147
>;
148148

149-
interface NetworkAdvancedTx5TransportConfigYaml {
150-
signalAllowPlainText: boolean;
151-
timeoutS: number;
149+
interface NetworkAdvancedIrohTransportConfigYaml {
150+
relayAllowPlainText: boolean;
152151
}
153152

154153
interface ConductorConfigYaml {
155154
network: {
156155
advanced: {
157156
k2Gossip: NetworkAdvancedK2GossipConfigYaml;
158-
tx5Transport: NetworkAdvancedTx5TransportConfigYaml;
157+
irohTransport: NetworkAdvancedIrohTransportConfigYaml;
159158
};
160159
target_arc_factor: number;
160+
signal_url?: string;
161161
};
162162
}
163163

@@ -200,7 +200,7 @@ export const createConductor = async (
200200
"transportTimeoutS",
201201
"targetArcFactor",
202202
]);
203-
conductor.setNetworkConfig(networkConfig);
203+
conductor.setNetworkConfig(networkConfig, signalingServerUrl);
204204
if (options?.startup !== false) {
205205
await conductor.startUp();
206206
}
@@ -245,7 +245,7 @@ export class Conductor {
245245
if (options?.bootstrapServerUrl) {
246246
args.push("--bootstrap", options.bootstrapServerUrl.href);
247247
}
248-
args.push("webrtc");
248+
args.push("quic");
249249
args.push(signalingServerUrl.href);
250250
defaultLogger.debug("spawning hc sandbox with args:", args);
251251
const createConductorProcess = spawn("hc", args);
@@ -273,7 +273,7 @@ export class Conductor {
273273
});
274274
}
275275

276-
setNetworkConfig(createConductorOptions: NetworkConfig) {
276+
setNetworkConfig(createConductorOptions: NetworkConfig, signalingServerUrl?: URL) {
277277
const conductorConfig = readFileSync(
278278
`${this.conductorDir}/${CONDUCTOR_CONFIG}`,
279279
"utf-8",
@@ -292,6 +292,9 @@ export class Conductor {
292292
}
293293
conductorConfigYaml.network.target_arc_factor =
294294
createConductorOptions.targetArcFactor ?? 1;
295+
if (signalingServerUrl) {
296+
conductorConfigYaml.network.signal_url = signalingServerUrl.href;
297+
}
295298
assert("advanced" in conductorConfigYaml.network);
296299
conductorConfigYaml.network.advanced = {
297300
k2Gossip: {
@@ -301,9 +304,8 @@ export class Conductor {
301304
initiateJitterMs: createConductorOptions.initiateJitterMs ?? 1_000,
302305
roundTimeoutMs: createConductorOptions.roundTimeoutMs ?? 5_000,
303306
},
304-
tx5Transport: {
305-
signalAllowPlainText: true,
306-
timeoutS: createConductorOptions.transportTimeoutS ?? 15,
307+
irohTransport: {
308+
relayAllowPlainText: true,
307309
},
308310
};
309311
const yamlDump = yaml.dump(conductorConfigYaml);

ts/src/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export const dhtSync = async (
172172
players: PlayerApp[],
173173
dnaHash: DnaHash,
174174
intervalMs = 500,
175-
timeoutMs = 40_000,
175+
timeoutMs = 60_000,
176176
) =>
177177
retryUntilCompleteOrTimeout(
178178
({ players, dnaHash }) => {
@@ -242,7 +242,7 @@ export const storageArc = async (
242242
dnaHash: DnaHash,
243243
storageArc: DhtArc,
244244
intervalMs = 500,
245-
timeoutMs = 40_000,
245+
timeoutMs = 60_000,
246246
) =>
247247
retryUntilCompleteOrTimeout(
248248
({ player, dnaHash, storageArc }) =>
@@ -331,7 +331,7 @@ export const integratedOpsCount = async (
331331
cellId: CellId,
332332
targetIntegratedOpsCount: number,
333333
intervalMs = 500,
334-
timeoutMs = 40_000,
334+
timeoutMs = 60_000,
335335
) =>
336336
retryUntilCompleteOrTimeout(
337337
async ({ player, cellId, targetIntegratedOpsCount }) => {

0 commit comments

Comments
 (0)