@holochain/hc-spin 0.600.2-rc.0 → 0.600.3-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.
- package/.envrc +1 -0
- package/CHANGELOG.md +9 -2
- package/README.md +1 -1
- package/dist/main/index.js +16 -21
- package/package.json +1 -1
- package/src/main/index.ts +15 -21
- package/src/main/validateArgs.ts +3 -8
package/.envrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
use flake
|
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
4
4
|
|
|
5
5
|
## \[Unreleased\]
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
## 2026-02-13: v0.600.3-rc.0
|
|
8
|
+
|
|
9
9
|
### Changed
|
|
10
|
+
- Holochain is now run with the iroh transport. The argument `--signaling-url` has been replaced with `--relay-url`.
|
|
10
11
|
### Removed
|
|
12
|
+
- Removed CLI option `--transport` as holochain is run with `quic` iroh transport.
|
|
13
|
+
|
|
14
|
+
## 2026-01-22: v0.600.2-rc.0
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Added a CLI option `--transport` to choose between `quic` and `webrtc`. `quic` is used in combination with the iroh transport in Holochain, `webrtc` with tx5. The default transport in Holochain is iroh, so the default for hc-spin is `quic`. If no transport option is passed in on the command line, `quic` is used.
|
|
11
18
|
|
|
12
19
|
## 2026-01-22: v0.600.1-rc.0
|
|
13
20
|
|
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ Options:
|
|
|
50
50
|
--network-seed <string> Install the app with a specific network seed.
|
|
51
51
|
--ui-path <path> Path to the folder containing the index.html of the webhapp's UI.
|
|
52
52
|
--ui-port <number> Port pointing to a localhost dev server that serves your UI assets.
|
|
53
|
-
--
|
|
53
|
+
--relay-url <url> Url of the relay server to use. By default, hc spin spins up a local development relay server for you
|
|
54
54
|
but this argument allows you to specify a custom one.
|
|
55
55
|
--open-devtools Automatically open the devtools on startup.
|
|
56
56
|
-h, --help display help for command
|
package/dist/main/index.js
CHANGED
|
@@ -12439,11 +12439,10 @@ function validateCliArgs(cliArgs, cliOpts, appDataRootDir) {
|
|
|
12439
12439
|
networkSeed: cliOpts.networkSeed,
|
|
12440
12440
|
targetArcFactor: cliOpts.targetArcFactor,
|
|
12441
12441
|
uiSource: cliOpts.uiPath ? { type: "path", path: cliOpts.uiPath } : cliOpts.uiPort ? { type: "port", port: cliOpts.uiPort } : { type: "path", path: path.join(appDataRootDir, "apps", appId, "ui") },
|
|
12442
|
-
|
|
12442
|
+
relayUrl: cliOpts.relayUrl,
|
|
12443
12443
|
bootstrapUrl: cliOpts.bootstrapUrl,
|
|
12444
12444
|
happOrWebhappPath: isHapp ? { type: "happ", path: happOrWebhappPath } : { type: "webhapp", path: happOrWebhappPath },
|
|
12445
|
-
openDevtools: cliOpts.openDevtools ? true : false
|
|
12446
|
-
transport: cliOpts.transport || "quic"
|
|
12445
|
+
openDevtools: cliOpts.openDevtools ? true : false
|
|
12447
12446
|
};
|
|
12448
12447
|
}
|
|
12449
12448
|
async function createHappWindow(uiSource, appId, agentNum, appPort, appAuthToken, appDataRootDir) {
|
|
@@ -12586,12 +12585,9 @@ cli.name("hc-spin").description("CLI to run Holochain apps during development.")
|
|
|
12586
12585
|
"--ui-port <number>",
|
|
12587
12586
|
"Port pointing to a localhost dev server that serves your UI assets."
|
|
12588
12587
|
).option(
|
|
12589
|
-
"--
|
|
12590
|
-
"Url of the
|
|
12591
|
-
).option("--open-devtools", "Automatically open the devtools on startup.")
|
|
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
|
-
);
|
|
12588
|
+
"--relay-url <url>",
|
|
12589
|
+
"Url of the relay server to use. By default, hc spin spins up a local development relay server for you but this argument allows you to specify a custom one."
|
|
12590
|
+
).option("--open-devtools", "Automatically open the devtools on startup.");
|
|
12595
12591
|
cli.parse();
|
|
12596
12592
|
const rl = require("readline").createInterface({
|
|
12597
12593
|
input: process.stdin,
|
|
@@ -12664,33 +12660,33 @@ const handleSignZomeCall = async (e, request) => {
|
|
|
12664
12660
|
};
|
|
12665
12661
|
return signedZomeCall;
|
|
12666
12662
|
};
|
|
12667
|
-
async function startLocalServices(
|
|
12663
|
+
async function startLocalServices() {
|
|
12668
12664
|
const localServicesHandle = childProcess__namespace.spawn("kitsune2-bootstrap-srv");
|
|
12669
12665
|
return new Promise((resolve) => {
|
|
12670
12666
|
let bootStrapUrl;
|
|
12671
|
-
let
|
|
12667
|
+
let relayUrl;
|
|
12672
12668
|
let bootstrapRunning = false;
|
|
12673
|
-
let
|
|
12669
|
+
let relayRunning = false;
|
|
12674
12670
|
localServicesHandle.stdout.pipe(split()).on("data", async (line) => {
|
|
12675
12671
|
console.log(`[hc-spin] | [kitsune2-bootstrap-srv]: ${line}`);
|
|
12676
12672
|
if (line.includes("#kitsune2_bootstrap_srv#listening#")) {
|
|
12677
12673
|
const hostAndPort = line.split("#kitsune2_bootstrap_srv#listening#")[1].split("#")[0];
|
|
12678
12674
|
bootStrapUrl = `http://${hostAndPort}`;
|
|
12679
|
-
|
|
12675
|
+
relayUrl = `http://${hostAndPort}`;
|
|
12680
12676
|
}
|
|
12681
12677
|
if (line.includes("#kitsune2_bootstrap_srv#running#")) {
|
|
12682
12678
|
bootstrapRunning = true;
|
|
12683
|
-
|
|
12679
|
+
relayRunning = true;
|
|
12684
12680
|
}
|
|
12685
|
-
if (bootstrapRunning &&
|
|
12686
|
-
resolve([bootStrapUrl,
|
|
12681
|
+
if (bootstrapRunning && relayRunning && bootStrapUrl && relayUrl)
|
|
12682
|
+
resolve([bootStrapUrl, relayUrl]);
|
|
12687
12683
|
});
|
|
12688
12684
|
localServicesHandle.stderr.pipe(split()).on("data", async (line) => {
|
|
12689
12685
|
console.log(`[hc-spin] | [hc run-local-services] ERROR: ${line}`);
|
|
12690
12686
|
});
|
|
12691
12687
|
});
|
|
12692
12688
|
}
|
|
12693
|
-
async function spawnSandboxes(nAgents, happPath, bootStrapUrl,
|
|
12689
|
+
async function spawnSandboxes(nAgents, happPath, bootStrapUrl, relayUrl, appId, networkSeed, targetArcFactor) {
|
|
12694
12690
|
const generateArgs = [
|
|
12695
12691
|
"sandbox",
|
|
12696
12692
|
"--piped",
|
|
@@ -12715,7 +12711,7 @@ async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId,
|
|
|
12715
12711
|
if (targetArcFactor !== void 0) {
|
|
12716
12712
|
generateArgs.push("--target-arc-factor", targetArcFactor.toString());
|
|
12717
12713
|
}
|
|
12718
|
-
generateArgs.push("--bootstrap", bootStrapUrl,
|
|
12714
|
+
generateArgs.push("--bootstrap", bootStrapUrl, "quic", relayUrl);
|
|
12719
12715
|
let readyConductors = 0;
|
|
12720
12716
|
const portsInfo = {};
|
|
12721
12717
|
const sandboxPaths = [];
|
|
@@ -12759,14 +12755,13 @@ electron.app.whenReady().then(async () => {
|
|
|
12759
12755
|
happTargetDir
|
|
12760
12756
|
);
|
|
12761
12757
|
}
|
|
12762
|
-
const [bootstrapUrl,
|
|
12758
|
+
const [bootstrapUrl, relayUrl] = await startLocalServices();
|
|
12763
12759
|
const [sandboxHandle, sandboxPaths, portsInfo] = await spawnSandboxes(
|
|
12764
12760
|
CLI_OPTS.numAgents,
|
|
12765
12761
|
happTargetDir ? happTargetDir : CLI_OPTS.happOrWebhappPath.path,
|
|
12766
12762
|
CLI_OPTS.bootstrapUrl ? CLI_OPTS.bootstrapUrl : bootstrapUrl,
|
|
12767
|
-
CLI_OPTS.
|
|
12763
|
+
CLI_OPTS.relayUrl ? CLI_OPTS.relayUrl : relayUrl,
|
|
12768
12764
|
CLI_OPTS.appId,
|
|
12769
|
-
CLI_OPTS.transport,
|
|
12770
12765
|
CLI_OPTS.networkSeed,
|
|
12771
12766
|
CLI_OPTS.targetArcFactor
|
|
12772
12767
|
);
|
package/package.json
CHANGED
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 {
|
|
24
|
+
import { validateCliArgs } from './validateArgs';
|
|
25
25
|
import { createHappWindow, loadHappWindow } from './windows';
|
|
26
26
|
|
|
27
27
|
const rustUtils = require('@holochain/hc-spin-rust-utils');
|
|
@@ -63,14 +63,10 @@ cli
|
|
|
63
63
|
'Port pointing to a localhost dev server that serves your UI assets.',
|
|
64
64
|
)
|
|
65
65
|
.option(
|
|
66
|
-
'--
|
|
67
|
-
'Url of the
|
|
66
|
+
'--relay-url <url>',
|
|
67
|
+
'Url of the relay server to use. By default, hc spin spins up a local development relay 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.')
|
|
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
|
-
);
|
|
69
|
+
.option('--open-devtools', 'Automatically open the devtools on startup.');
|
|
74
70
|
|
|
75
71
|
cli.parse();
|
|
76
72
|
// console.log('Got CLI opts: ', cli.opts());
|
|
@@ -175,26 +171,26 @@ const handleSignZomeCall = async (
|
|
|
175
171
|
return signedZomeCall;
|
|
176
172
|
};
|
|
177
173
|
|
|
178
|
-
async function startLocalServices(
|
|
174
|
+
async function startLocalServices(): Promise<[string, string]> {
|
|
179
175
|
const localServicesHandle = childProcess.spawn('kitsune2-bootstrap-srv');
|
|
180
176
|
return new Promise((resolve) => {
|
|
181
177
|
let bootStrapUrl;
|
|
182
|
-
let
|
|
178
|
+
let relayUrl;
|
|
183
179
|
let bootstrapRunning = false;
|
|
184
|
-
let
|
|
180
|
+
let relayRunning = false;
|
|
185
181
|
localServicesHandle.stdout.pipe(split()).on('data', async (line: string) => {
|
|
186
182
|
console.log(`[hc-spin] | [kitsune2-bootstrap-srv]: ${line}`);
|
|
187
183
|
if (line.includes('#kitsune2_bootstrap_srv#listening#')) {
|
|
188
184
|
const hostAndPort = line.split('#kitsune2_bootstrap_srv#listening#')[1].split('#')[0];
|
|
189
185
|
bootStrapUrl = `http://${hostAndPort}`;
|
|
190
|
-
|
|
186
|
+
relayUrl = `http://${hostAndPort}`;
|
|
191
187
|
}
|
|
192
188
|
if (line.includes('#kitsune2_bootstrap_srv#running#')) {
|
|
193
189
|
bootstrapRunning = true;
|
|
194
|
-
|
|
190
|
+
relayRunning = true;
|
|
195
191
|
}
|
|
196
|
-
if (bootstrapRunning &&
|
|
197
|
-
resolve([bootStrapUrl,
|
|
192
|
+
if (bootstrapRunning && relayRunning && bootStrapUrl && relayUrl)
|
|
193
|
+
resolve([bootStrapUrl, relayUrl]);
|
|
198
194
|
});
|
|
199
195
|
localServicesHandle.stderr.pipe(split()).on('data', async (line: string) => {
|
|
200
196
|
console.log(`[hc-spin] | [hc run-local-services] ERROR: ${line}`);
|
|
@@ -211,9 +207,8 @@ async function spawnSandboxes(
|
|
|
211
207
|
nAgents: number,
|
|
212
208
|
happPath: string,
|
|
213
209
|
bootStrapUrl: string,
|
|
214
|
-
|
|
210
|
+
relayUrl: string,
|
|
215
211
|
appId: string,
|
|
216
|
-
transport: Transport,
|
|
217
212
|
networkSeed?: string,
|
|
218
213
|
targetArcFactor?: number,
|
|
219
214
|
): Promise<
|
|
@@ -244,7 +239,7 @@ async function spawnSandboxes(
|
|
|
244
239
|
if (targetArcFactor !== undefined) {
|
|
245
240
|
generateArgs.push('--target-arc-factor', targetArcFactor.toString());
|
|
246
241
|
}
|
|
247
|
-
generateArgs.push('--bootstrap', bootStrapUrl,
|
|
242
|
+
generateArgs.push('--bootstrap', bootStrapUrl, 'quic', relayUrl);
|
|
248
243
|
|
|
249
244
|
let readyConductors = 0;
|
|
250
245
|
const portsInfo: Record<number, PortsInfo> = {};
|
|
@@ -306,15 +301,14 @@ app.whenReady().then(async () => {
|
|
|
306
301
|
);
|
|
307
302
|
}
|
|
308
303
|
|
|
309
|
-
const [bootstrapUrl,
|
|
304
|
+
const [bootstrapUrl, relayUrl] = await startLocalServices();
|
|
310
305
|
|
|
311
306
|
const [sandboxHandle, sandboxPaths, portsInfo] = await spawnSandboxes(
|
|
312
307
|
CLI_OPTS.numAgents,
|
|
313
308
|
happTargetDir ? happTargetDir : CLI_OPTS.happOrWebhappPath.path,
|
|
314
309
|
CLI_OPTS.bootstrapUrl ? CLI_OPTS.bootstrapUrl : bootstrapUrl,
|
|
315
|
-
CLI_OPTS.
|
|
310
|
+
CLI_OPTS.relayUrl ? CLI_OPTS.relayUrl : relayUrl,
|
|
316
311
|
CLI_OPTS.appId,
|
|
317
|
-
CLI_OPTS.transport,
|
|
318
312
|
CLI_OPTS.networkSeed,
|
|
319
313
|
CLI_OPTS.targetArcFactor,
|
|
320
314
|
);
|
package/src/main/validateArgs.ts
CHANGED
|
@@ -11,10 +11,9 @@ export type CliOpts = {
|
|
|
11
11
|
targetArcFactor?: number;
|
|
12
12
|
uiPath?: string;
|
|
13
13
|
uiPort?: number;
|
|
14
|
-
|
|
14
|
+
relayUrl?: string;
|
|
15
15
|
bootstrapUrl?: string;
|
|
16
16
|
openDevtools?: boolean;
|
|
17
|
-
transport?: Transport;
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
export type CliOptsValidated = {
|
|
@@ -24,15 +23,12 @@ export type CliOptsValidated = {
|
|
|
24
23
|
networkSeed: string | undefined;
|
|
25
24
|
targetArcFactor: number | undefined;
|
|
26
25
|
uiSource: UISource;
|
|
27
|
-
|
|
26
|
+
relayUrl: string | undefined;
|
|
28
27
|
bootstrapUrl: string | undefined;
|
|
29
28
|
happOrWebhappPath: HappOrWebhappPath;
|
|
30
29
|
openDevtools: boolean;
|
|
31
|
-
transport: Transport;
|
|
32
30
|
};
|
|
33
31
|
|
|
34
|
-
export type Transport = 'quic' | 'webrtc';
|
|
35
|
-
|
|
36
32
|
export type HappOrWebhappPath = {
|
|
37
33
|
type: 'happ' | 'webhapp';
|
|
38
34
|
path: string;
|
|
@@ -102,12 +98,11 @@ export function validateCliArgs(
|
|
|
102
98
|
: cliOpts.uiPort
|
|
103
99
|
? { type: 'port', port: cliOpts.uiPort }
|
|
104
100
|
: { type: 'path', path: path.join(appDataRootDir, 'apps', appId, 'ui') },
|
|
105
|
-
|
|
101
|
+
relayUrl: cliOpts.relayUrl,
|
|
106
102
|
bootstrapUrl: cliOpts.bootstrapUrl,
|
|
107
103
|
happOrWebhappPath: isHapp
|
|
108
104
|
? { type: 'happ', path: happOrWebhappPath }
|
|
109
105
|
: { type: 'webhapp', path: happOrWebhappPath },
|
|
110
106
|
openDevtools: cliOpts.openDevtools ? true : false,
|
|
111
|
-
transport: cliOpts.transport || 'quic',
|
|
112
107
|
};
|
|
113
108
|
}
|