@holochain/hc-spin 0.600.1-rc.0 → 0.600.2-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12442,7 +12442,8 @@ function validateCliArgs(cliArgs, cliOpts, appDataRootDir) {
12442
12442
  singalingUrl: cliOpts.signalingUrl,
12443
12443
  bootstrapUrl: cliOpts.bootstrapUrl,
12444
12444
  happOrWebhappPath: isHapp ? { type: "happ", path: happOrWebhappPath } : { type: "webhapp", path: happOrWebhappPath },
12445
- openDevtools: cliOpts.openDevtools ? true : false
12445
+ openDevtools: cliOpts.openDevtools ? true : false,
12446
+ transport: cliOpts.transport || "quic"
12446
12447
  };
12447
12448
  }
12448
12449
  async function createHappWindow(uiSource, appId, agentNum, appPort, appAuthToken, appDataRootDir) {
@@ -12563,7 +12564,7 @@ function setLinkOpenHandlers(browserWindow) {
12563
12564
  }
12564
12565
  const rustUtils = require("@holochain/hc-spin-rust-utils");
12565
12566
  const cli = new commander.Command();
12566
- cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`${"0.600.0"} (built for holochain ${"0.6.0"})`).argument(
12567
+ cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`${"0.600.2-rc.0"} (built for holochain ${"0.6.1-rc.0"})`).argument(
12567
12568
  "<path>",
12568
12569
  "Path to .webhapp or .happ file to launch. If a .happ file is passed, either a UI path must be specified via --ui-path or a port pointing to a localhost server via --ui-port"
12569
12570
  ).option(
@@ -12587,7 +12588,10 @@ cli.name("hc-spin").description("CLI to run Holochain apps during development.")
12587
12588
  ).option(
12588
12589
  "--signaling-url <url>",
12589
12590
  "Url of the signaling server to use. By default, hc spin spins up a local development signaling server for you but this argument allows you to specify a custom one."
12590
- ).option("--open-devtools", "Automatically open the devtools on startup.");
12591
+ ).option("--open-devtools", "Automatically open the devtools on startup.").option(
12592
+ "--transport <quic|webrtc>",
12593
+ "Configure network transport. Defaults to quic, compatible with the iroh transport used in in Holochain by default. Set to `webrtc` for tx5 transport."
12594
+ );
12591
12595
  cli.parse();
12592
12596
  const rl = require("readline").createInterface({
12593
12597
  input: process.stdin,
@@ -12660,7 +12664,7 @@ const handleSignZomeCall = async (e, request) => {
12660
12664
  };
12661
12665
  return signedZomeCall;
12662
12666
  };
12663
- async function startLocalServices() {
12667
+ async function startLocalServices(transport) {
12664
12668
  const localServicesHandle = childProcess__namespace.spawn("kitsune2-bootstrap-srv");
12665
12669
  return new Promise((resolve) => {
12666
12670
  let bootStrapUrl;
@@ -12672,7 +12676,7 @@ async function startLocalServices() {
12672
12676
  if (line.includes("#kitsune2_bootstrap_srv#listening#")) {
12673
12677
  const hostAndPort = line.split("#kitsune2_bootstrap_srv#listening#")[1].split("#")[0];
12674
12678
  bootStrapUrl = `http://${hostAndPort}`;
12675
- signalUrl = `ws://${hostAndPort}`;
12679
+ signalUrl = transport === "quic" ? `http://${hostAndPort}` : `ws://${hostAndPort}`;
12676
12680
  }
12677
12681
  if (line.includes("#kitsune2_bootstrap_srv#running#")) {
12678
12682
  bootstrapRunning = true;
@@ -12686,7 +12690,7 @@ async function startLocalServices() {
12686
12690
  });
12687
12691
  });
12688
12692
  }
12689
- async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId, networkSeed, targetArcFactor) {
12693
+ async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId, transport, networkSeed, targetArcFactor) {
12690
12694
  const generateArgs = [
12691
12695
  "sandbox",
12692
12696
  "--piped",
@@ -12711,7 +12715,7 @@ async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId,
12711
12715
  if (targetArcFactor !== void 0) {
12712
12716
  generateArgs.push("--target-arc-factor", targetArcFactor.toString());
12713
12717
  }
12714
- generateArgs.push("--bootstrap", bootStrapUrl, "webrtc", signalUrl);
12718
+ generateArgs.push("--bootstrap", bootStrapUrl, transport, signalUrl);
12715
12719
  let readyConductors = 0;
12716
12720
  const portsInfo = {};
12717
12721
  const sandboxPaths = [];
@@ -12755,13 +12759,14 @@ electron.app.whenReady().then(async () => {
12755
12759
  happTargetDir
12756
12760
  );
12757
12761
  }
12758
- const [bootstrapUrl, signalingUrl] = await startLocalServices();
12762
+ const [bootstrapUrl, signalingUrl] = await startLocalServices(CLI_OPTS.transport);
12759
12763
  const [sandboxHandle, sandboxPaths, portsInfo] = await spawnSandboxes(
12760
12764
  CLI_OPTS.numAgents,
12761
12765
  happTargetDir ? happTargetDir : CLI_OPTS.happOrWebhappPath.path,
12762
12766
  CLI_OPTS.bootstrapUrl ? CLI_OPTS.bootstrapUrl : bootstrapUrl,
12763
12767
  CLI_OPTS.singalingUrl ? CLI_OPTS.singalingUrl : signalingUrl,
12764
12768
  CLI_OPTS.appId,
12769
+ CLI_OPTS.transport,
12765
12770
  CLI_OPTS.networkSeed,
12766
12771
  CLI_OPTS.targetArcFactor
12767
12772
  );
package/flake.lock CHANGED
@@ -36,16 +36,16 @@
36
36
  "hc-scaffold": {
37
37
  "flake": false,
38
38
  "locked": {
39
- "lastModified": 1764163563,
40
- "narHash": "sha256-KigJ3h25yNJfeQunPm5QYFPtLSk6nU3IEEvZY8w01Vo=",
39
+ "lastModified": 1769104114,
40
+ "narHash": "sha256-Ebh8YW7J4VRAwhK9XQDf98nWAIvciddzdx7LbhZiwdI=",
41
41
  "owner": "holochain",
42
42
  "repo": "scaffolding",
43
- "rev": "87e997a7361d4aa7c1bb96261483ebba50223bd0",
43
+ "rev": "6749c80d54306e4c1ad5831ce2dbdbb9a283ee0c",
44
44
  "type": "github"
45
45
  },
46
46
  "original": {
47
47
  "owner": "holochain",
48
- "ref": "v0.600.1",
48
+ "ref": "v0.600.1-rc.0",
49
49
  "repo": "scaffolding",
50
50
  "type": "github"
51
51
  }
@@ -79,11 +79,11 @@
79
79
  "rust-overlay": "rust-overlay"
80
80
  },
81
81
  "locked": {
82
- "lastModified": 1769045727,
83
- "narHash": "sha256-sYGlDJ6pNt3n+Tu5F86Lsr8ki+TfGMRGeSrDz+MSv+w=",
82
+ "lastModified": 1769121828,
83
+ "narHash": "sha256-o1GUUg9FUADcTOU4gzDDtiuJo61PyrQHCn0e64HRJYU=",
84
84
  "owner": "holochain",
85
85
  "repo": "holonix",
86
- "rev": "7b46630e1bd47b25d1f6385d8e921435f453c1a7",
86
+ "rev": "3e2a4b96b177aaaa233fd744ba82bfe308e85635",
87
87
  "type": "github"
88
88
  },
89
89
  "original": {
@@ -96,16 +96,16 @@
96
96
  "kitsune2": {
97
97
  "flake": false,
98
98
  "locked": {
99
- "lastModified": 1767421208,
100
- "narHash": "sha256-hPIesp4R8/8sA+Qqw1ECgsgCOKlyX5coGR+7QDoavWw=",
99
+ "lastModified": 1768402558,
100
+ "narHash": "sha256-v7uEmcVGC6tDjrkEZHMJa9DdXnqXwwVxJx9GkZq9P/U=",
101
101
  "owner": "holochain",
102
102
  "repo": "kitsune2",
103
- "rev": "77471c1fb4b6f926609bf82152dc97e26457b4d9",
103
+ "rev": "2b809bcf0bff3d493cd5ba230677240432fff58a",
104
104
  "type": "github"
105
105
  },
106
106
  "original": {
107
107
  "owner": "holochain",
108
- "ref": "v0.4.0-dev.2",
108
+ "ref": "2b809bcf0bff3d493cd5ba230677240432fff58a",
109
109
  "repo": "kitsune2",
110
110
  "type": "github"
111
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/hc-spin",
3
- "version": "0.600.1-rc.0",
3
+ "version": "0.600.2-rc.0",
4
4
  "holochainVersion": "0.6.1-rc.0",
5
5
  "description": "CLI to run Holochain apps during development.",
6
6
  "author": "matthme",
package/src/main/index.ts CHANGED
@@ -21,7 +21,7 @@ import path from 'path';
21
21
  import split from 'split';
22
22
 
23
23
  import { menu } from './menu';
24
- import { validateCliArgs } from './validateArgs';
24
+ import { Transport, validateCliArgs } from './validateArgs';
25
25
  import { createHappWindow, loadHappWindow } from './windows';
26
26
 
27
27
  const rustUtils = require('@holochain/hc-spin-rust-utils');
@@ -66,7 +66,11 @@ cli
66
66
  '--signaling-url <url>',
67
67
  'Url of the signaling server to use. By default, hc spin spins up a local development signaling server for you but this argument allows you to specify a custom one.',
68
68
  )
69
- .option('--open-devtools', 'Automatically open the devtools on startup.');
69
+ .option('--open-devtools', 'Automatically open the devtools on startup.')
70
+ .option(
71
+ '--transport <quic|webrtc>',
72
+ 'Configure network transport. Defaults to quic, compatible with the iroh transport used in in Holochain by default. Set to `webrtc` for tx5 transport.',
73
+ );
70
74
 
71
75
  cli.parse();
72
76
  // console.log('Got CLI opts: ', cli.opts());
@@ -171,7 +175,7 @@ const handleSignZomeCall = async (
171
175
  return signedZomeCall;
172
176
  };
173
177
 
174
- async function startLocalServices(): Promise<[string, string]> {
178
+ async function startLocalServices(transport: Transport): Promise<[string, string]> {
175
179
  const localServicesHandle = childProcess.spawn('kitsune2-bootstrap-srv');
176
180
  return new Promise((resolve) => {
177
181
  let bootStrapUrl;
@@ -183,7 +187,7 @@ async function startLocalServices(): Promise<[string, string]> {
183
187
  if (line.includes('#kitsune2_bootstrap_srv#listening#')) {
184
188
  const hostAndPort = line.split('#kitsune2_bootstrap_srv#listening#')[1].split('#')[0];
185
189
  bootStrapUrl = `http://${hostAndPort}`;
186
- signalUrl = `ws://${hostAndPort}`;
190
+ signalUrl = transport === 'quic' ? `http://${hostAndPort}` : `ws://${hostAndPort}`;
187
191
  }
188
192
  if (line.includes('#kitsune2_bootstrap_srv#running#')) {
189
193
  bootstrapRunning = true;
@@ -209,6 +213,7 @@ async function spawnSandboxes(
209
213
  bootStrapUrl: string,
210
214
  signalUrl: string,
211
215
  appId: string,
216
+ transport: Transport,
212
217
  networkSeed?: string,
213
218
  targetArcFactor?: number,
214
219
  ): Promise<
@@ -239,8 +244,7 @@ async function spawnSandboxes(
239
244
  if (targetArcFactor !== undefined) {
240
245
  generateArgs.push('--target-arc-factor', targetArcFactor.toString());
241
246
  }
242
- generateArgs.push('--bootstrap', bootStrapUrl, 'webrtc', signalUrl);
243
- // console.log('GENERATE ARGS: ', generateArgs);
247
+ generateArgs.push('--bootstrap', bootStrapUrl, transport, signalUrl);
244
248
 
245
249
  let readyConductors = 0;
246
250
  const portsInfo: Record<number, PortsInfo> = {};
@@ -302,7 +306,7 @@ app.whenReady().then(async () => {
302
306
  );
303
307
  }
304
308
 
305
- const [bootstrapUrl, signalingUrl] = await startLocalServices();
309
+ const [bootstrapUrl, signalingUrl] = await startLocalServices(CLI_OPTS.transport);
306
310
 
307
311
  const [sandboxHandle, sandboxPaths, portsInfo] = await spawnSandboxes(
308
312
  CLI_OPTS.numAgents,
@@ -310,6 +314,7 @@ app.whenReady().then(async () => {
310
314
  CLI_OPTS.bootstrapUrl ? CLI_OPTS.bootstrapUrl : bootstrapUrl,
311
315
  CLI_OPTS.singalingUrl ? CLI_OPTS.singalingUrl : signalingUrl,
312
316
  CLI_OPTS.appId,
317
+ CLI_OPTS.transport,
313
318
  CLI_OPTS.networkSeed,
314
319
  CLI_OPTS.targetArcFactor,
315
320
  );
@@ -14,6 +14,7 @@ export type CliOpts = {
14
14
  signalingUrl?: string;
15
15
  bootstrapUrl?: string;
16
16
  openDevtools?: boolean;
17
+ transport?: Transport;
17
18
  };
18
19
 
19
20
  export type CliOptsValidated = {
@@ -27,8 +28,11 @@ export type CliOptsValidated = {
27
28
  bootstrapUrl: string | undefined;
28
29
  happOrWebhappPath: HappOrWebhappPath;
29
30
  openDevtools: boolean;
31
+ transport: Transport;
30
32
  };
31
33
 
34
+ export type Transport = 'quic' | 'webrtc';
35
+
32
36
  export type HappOrWebhappPath = {
33
37
  type: 'happ' | 'webhapp';
34
38
  path: string;
@@ -104,5 +108,6 @@ export function validateCliArgs(
104
108
  ? { type: 'happ', path: happOrWebhappPath }
105
109
  : { type: 'webhapp', path: happOrWebhappPath },
106
110
  openDevtools: cliOpts.openDevtools ? true : false,
111
+ transport: cliOpts.transport || 'quic',
107
112
  };
108
113
  }