@holochain/hc-spin 0.601.0 → 0.700.0-dev.1
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 +6 -17
- package/README.md +6 -6
- package/dist/main/index.js +14 -14
- package/docs/DEVSETUP.md +12 -0
- package/flake.lock +49 -31
- package/flake.nix +1 -1
- package/package.json +3 -3
- package/src/main/index.ts +17 -4
- package/src/main/validateArgs.ts +17 -0
package/.envrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
use flake
|
package/CHANGELOG.md
CHANGED
|
@@ -4,29 +4,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
4
4
|
|
|
5
5
|
## \[Unreleased\]
|
|
6
6
|
|
|
7
|
-
## 2026-
|
|
8
|
-
|
|
9
|
-
### Changed
|
|
10
|
-
|
|
11
|
-
- Bumped to holochain 0.6.1
|
|
12
|
-
|
|
13
|
-
## 2026-02-13: v0.600.3-rc.0
|
|
7
|
+
## 2026-02-13: v0.700.0-dev.1
|
|
14
8
|
|
|
15
9
|
### Changed
|
|
16
10
|
- Holochain is now run with the iroh transport. The argument `--signaling-url` has been replaced with `--relay-url`.
|
|
17
|
-
### Removed
|
|
18
|
-
- Removed CLI option `--transport` as holochain is run with `quic` iroh transport.
|
|
19
|
-
|
|
20
|
-
## 2026-01-22: v0.600.2-rc.0
|
|
21
11
|
|
|
12
|
+
## 2026-01-13: v0.700.0-dev.0
|
|
22
13
|
### Changed
|
|
23
|
-
-
|
|
14
|
+
- Updated to holochain 0.7.0-dev.7
|
|
24
15
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- Bumped to holochain 0.6.1-rc.0
|
|
16
|
+
## 2025-11-20: v0.600.0
|
|
17
|
+
### Added
|
|
18
|
+
- A new argument `--force-admin-ports` takes a comma-separated list of port numbers, to force generated conductors to use specific admin ports. [#50](https://github.com/holochain/hc-spin/pull/50)
|
|
30
19
|
|
|
31
20
|
## 2025-11-06: v0.600.0-rc.0
|
|
32
21
|
|
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@ CLI to run Holochain apps in development mode.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
To install the latest version compatible with **holochain 0.
|
|
7
|
+
To install the latest version compatible with **holochain 0.6.x**:
|
|
8
8
|
|
|
9
|
-
⚠️ Requires `@holochain/client 0.
|
|
9
|
+
⚠️ Requires `@holochain/client 0.20.0` or newer ⚠️
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install --save-dev @holochain/hc-spin@">=0.
|
|
12
|
+
npm install --save-dev @holochain/hc-spin@">=0.600.0 <0.700.0"
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
To install the latest version compatible with **holochain 0.5.x**:
|
|
@@ -20,12 +20,12 @@ To install the latest version compatible with **holochain 0.5.x**:
|
|
|
20
20
|
npm install --save-dev @holochain/hc-spin@">=0.500.0 <0.600.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
To install the latest version compatible with **holochain 0.
|
|
23
|
+
To install the latest version compatible with **holochain 0.4.x**:
|
|
24
24
|
|
|
25
|
-
⚠️ Requires `@holochain/client 0.
|
|
25
|
+
⚠️ Requires `@holochain/client 0.18.0` or newer ⚠️
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
npm install --save-dev @holochain/hc-spin@">=0.
|
|
28
|
+
npm install --save-dev @holochain/hc-spin@">=0.400.0 <0.500.0"
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Usage (holochain 0.6)
|
package/dist/main/index.js
CHANGED
|
@@ -12439,7 +12439,7 @@ 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
12445
|
openDevtools: cliOpts.openDevtools ? true : false
|
|
@@ -12563,7 +12563,7 @@ function setLinkOpenHandlers(browserWindow) {
|
|
|
12563
12563
|
}
|
|
12564
12564
|
const rustUtils = require("@holochain/hc-spin-rust-utils");
|
|
12565
12565
|
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(
|
|
12566
|
+
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
12567
|
"<path>",
|
|
12568
12568
|
"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
12569
|
).option(
|
|
@@ -12585,8 +12585,8 @@ cli.name("hc-spin").description("CLI to run Holochain apps during development.")
|
|
|
12585
12585
|
"--ui-port <number>",
|
|
12586
12586
|
"Port pointing to a localhost dev server that serves your UI assets."
|
|
12587
12587
|
).option(
|
|
12588
|
-
"--
|
|
12589
|
-
"Url of the
|
|
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
12590
|
).option("--open-devtools", "Automatically open the devtools on startup.");
|
|
12591
12591
|
cli.parse();
|
|
12592
12592
|
const rl = require("readline").createInterface({
|
|
@@ -12664,29 +12664,29 @@ async function startLocalServices() {
|
|
|
12664
12664
|
const localServicesHandle = childProcess__namespace.spawn("kitsune2-bootstrap-srv");
|
|
12665
12665
|
return new Promise((resolve) => {
|
|
12666
12666
|
let bootStrapUrl;
|
|
12667
|
-
let
|
|
12667
|
+
let relayUrl;
|
|
12668
12668
|
let bootstrapRunning = false;
|
|
12669
|
-
let
|
|
12669
|
+
let relayRunning = false;
|
|
12670
12670
|
localServicesHandle.stdout.pipe(split()).on("data", async (line) => {
|
|
12671
12671
|
console.log(`[hc-spin] | [kitsune2-bootstrap-srv]: ${line}`);
|
|
12672
12672
|
if (line.includes("#kitsune2_bootstrap_srv#listening#")) {
|
|
12673
12673
|
const hostAndPort = line.split("#kitsune2_bootstrap_srv#listening#")[1].split("#")[0];
|
|
12674
12674
|
bootStrapUrl = `http://${hostAndPort}`;
|
|
12675
|
-
|
|
12675
|
+
relayUrl = `http://${hostAndPort}`;
|
|
12676
12676
|
}
|
|
12677
12677
|
if (line.includes("#kitsune2_bootstrap_srv#running#")) {
|
|
12678
12678
|
bootstrapRunning = true;
|
|
12679
|
-
|
|
12679
|
+
relayRunning = true;
|
|
12680
12680
|
}
|
|
12681
|
-
if (bootstrapRunning &&
|
|
12682
|
-
resolve([bootStrapUrl,
|
|
12681
|
+
if (bootstrapRunning && relayRunning && bootStrapUrl && relayUrl)
|
|
12682
|
+
resolve([bootStrapUrl, relayUrl]);
|
|
12683
12683
|
});
|
|
12684
12684
|
localServicesHandle.stderr.pipe(split()).on("data", async (line) => {
|
|
12685
12685
|
console.log(`[hc-spin] | [hc run-local-services] ERROR: ${line}`);
|
|
12686
12686
|
});
|
|
12687
12687
|
});
|
|
12688
12688
|
}
|
|
12689
|
-
async function spawnSandboxes(nAgents, happPath, bootStrapUrl,
|
|
12689
|
+
async function spawnSandboxes(nAgents, happPath, bootStrapUrl, relayUrl, appId, networkSeed, targetArcFactor) {
|
|
12690
12690
|
const generateArgs = [
|
|
12691
12691
|
"sandbox",
|
|
12692
12692
|
"--piped",
|
|
@@ -12711,7 +12711,7 @@ async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId,
|
|
|
12711
12711
|
if (targetArcFactor !== void 0) {
|
|
12712
12712
|
generateArgs.push("--target-arc-factor", targetArcFactor.toString());
|
|
12713
12713
|
}
|
|
12714
|
-
generateArgs.push("--bootstrap", bootStrapUrl, "
|
|
12714
|
+
generateArgs.push("--bootstrap", bootStrapUrl, "quic", relayUrl);
|
|
12715
12715
|
let readyConductors = 0;
|
|
12716
12716
|
const portsInfo = {};
|
|
12717
12717
|
const sandboxPaths = [];
|
|
@@ -12755,12 +12755,12 @@ electron.app.whenReady().then(async () => {
|
|
|
12755
12755
|
happTargetDir
|
|
12756
12756
|
);
|
|
12757
12757
|
}
|
|
12758
|
-
const [bootstrapUrl,
|
|
12758
|
+
const [bootstrapUrl, relayUrl] = await startLocalServices();
|
|
12759
12759
|
const [sandboxHandle, sandboxPaths, portsInfo] = await spawnSandboxes(
|
|
12760
12760
|
CLI_OPTS.numAgents,
|
|
12761
12761
|
happTargetDir ? happTargetDir : CLI_OPTS.happOrWebhappPath.path,
|
|
12762
12762
|
CLI_OPTS.bootstrapUrl ? CLI_OPTS.bootstrapUrl : bootstrapUrl,
|
|
12763
|
-
CLI_OPTS.
|
|
12763
|
+
CLI_OPTS.relayUrl ? CLI_OPTS.relayUrl : relayUrl,
|
|
12764
12764
|
CLI_OPTS.appId,
|
|
12765
12765
|
CLI_OPTS.networkSeed,
|
|
12766
12766
|
CLI_OPTS.targetArcFactor
|
package/docs/DEVSETUP.md
CHANGED
|
@@ -25,3 +25,15 @@ yarn build
|
|
|
25
25
|
```bash
|
|
26
26
|
yarn start <path to .webhapp file>
|
|
27
27
|
```
|
|
28
|
+
|
|
29
|
+
## Upgrade hc-spin to a new holochain version
|
|
30
|
+
|
|
31
|
+
0. Update the flake.nix file if necessary and run `nix flake update`.
|
|
32
|
+
1. Upgrade the upstream `@holochain/hc-spin-rust-utils` package [in this repo](https://github.com/holochain/hc-spin-rust-utils), following the instructions in its README. This may involve manual testing of a locally built `@holochain/hc-spin-rust-utils` here in the hc-spin repo. In that case, make sure to have entered nix shell with `nix develop` before testing, such that the correct holochain binary is being used by hc-spin.
|
|
33
|
+
2. Once the new `@holochain/hc-spin-rust-utils` package has been upgraded and released, update it accordingly in the `package.json` file.
|
|
34
|
+
3. Update `@holochain/client` in the `package.json` file to the appropriate version.
|
|
35
|
+
4. Check whether any code changes are necessary after updating the packages. Once the code has been adapted, test it with `yarn start <path to .webhapp file>`.
|
|
36
|
+
5. If testing succeeds, update the `version` field in `package.json`.
|
|
37
|
+
6. Make any changes as necessary to the README. The README is what is shown on npmjs.org as the package description so it should be up to date.
|
|
38
|
+
7. Build the hc-spin binary with `yarn build`.
|
|
39
|
+
8. And finally publish it with `npm publish`.
|
package/flake.lock
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"nodes": {
|
|
3
3
|
"crane": {
|
|
4
4
|
"locked": {
|
|
5
|
-
"lastModified":
|
|
6
|
-
"narHash": "sha256-
|
|
5
|
+
"lastModified": 1766194365,
|
|
6
|
+
"narHash": "sha256-4AFsUZ0kl6MXSm4BaQgItD0VGlEKR3iq7gIaL7TjBvc=",
|
|
7
7
|
"owner": "ipetkov",
|
|
8
8
|
"repo": "crane",
|
|
9
|
-
"rev": "
|
|
9
|
+
"rev": "7d8ec2c71771937ab99790b45e6d9b93d15d9379",
|
|
10
10
|
"type": "github"
|
|
11
11
|
},
|
|
12
12
|
"original": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"nixpkgs-lib": "nixpkgs-lib"
|
|
21
21
|
},
|
|
22
22
|
"locked": {
|
|
23
|
-
"lastModified":
|
|
24
|
-
"narHash": "sha256-
|
|
23
|
+
"lastModified": 1765835352,
|
|
24
|
+
"narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
|
|
25
25
|
"owner": "hercules-ci",
|
|
26
26
|
"repo": "flake-parts",
|
|
27
|
-
"rev": "
|
|
27
|
+
"rev": "a34fae9c08a15ad73f295041fec82323541400a9",
|
|
28
28
|
"type": "github"
|
|
29
29
|
},
|
|
30
30
|
"original": {
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"hc-scaffold": {
|
|
37
37
|
"flake": false,
|
|
38
38
|
"locked": {
|
|
39
|
-
"lastModified":
|
|
40
|
-
"narHash": "sha256-
|
|
39
|
+
"lastModified": 1764163563,
|
|
40
|
+
"narHash": "sha256-KigJ3h25yNJfeQunPm5QYFPtLSk6nU3IEEvZY8w01Vo=",
|
|
41
41
|
"owner": "holochain",
|
|
42
42
|
"repo": "scaffolding",
|
|
43
|
-
"rev": "
|
|
43
|
+
"rev": "87e997a7361d4aa7c1bb96261483ebba50223bd0",
|
|
44
44
|
"type": "github"
|
|
45
45
|
},
|
|
46
46
|
"original": {
|
|
47
47
|
"owner": "holochain",
|
|
48
|
-
"ref": "v0.600.
|
|
48
|
+
"ref": "v0.600.1",
|
|
49
49
|
"repo": "scaffolding",
|
|
50
50
|
"type": "github"
|
|
51
51
|
}
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
"holochain": {
|
|
54
54
|
"flake": false,
|
|
55
55
|
"locked": {
|
|
56
|
-
"lastModified":
|
|
57
|
-
"narHash": "sha256-
|
|
56
|
+
"lastModified": 1769992510,
|
|
57
|
+
"narHash": "sha256-hYq8p1BiPR+AdiOgeOPV+Gz+aTs2t5yu3V8lBGctBkE=",
|
|
58
58
|
"owner": "holochain",
|
|
59
59
|
"repo": "holochain",
|
|
60
|
-
"rev": "
|
|
60
|
+
"rev": "5194f7af4f71db22dd22dc37cf8c1e68d0b6d628",
|
|
61
61
|
"type": "github"
|
|
62
62
|
},
|
|
63
63
|
"original": {
|
|
64
64
|
"owner": "holochain",
|
|
65
|
-
"ref": "holochain-0.
|
|
65
|
+
"ref": "holochain-0.7.0-dev.10",
|
|
66
66
|
"repo": "holochain",
|
|
67
67
|
"type": "github"
|
|
68
68
|
}
|
|
@@ -76,19 +76,20 @@
|
|
|
76
76
|
"kitsune2": "kitsune2",
|
|
77
77
|
"lair-keystore": "lair-keystore",
|
|
78
78
|
"nixpkgs": "nixpkgs",
|
|
79
|
+
"playground": "playground",
|
|
79
80
|
"rust-overlay": "rust-overlay"
|
|
80
81
|
},
|
|
81
82
|
"locked": {
|
|
82
|
-
"lastModified":
|
|
83
|
-
"narHash": "sha256-
|
|
83
|
+
"lastModified": 1770384077,
|
|
84
|
+
"narHash": "sha256-9llOslhUNN0VN1EM57NDB5AByRgztxChw3DaytgcGjU=",
|
|
84
85
|
"owner": "holochain",
|
|
85
86
|
"repo": "holonix",
|
|
86
|
-
"rev": "
|
|
87
|
+
"rev": "b6587f0dbbb68de2d69d526e35a3efe7d311f2c4",
|
|
87
88
|
"type": "github"
|
|
88
89
|
},
|
|
89
90
|
"original": {
|
|
90
91
|
"owner": "holochain",
|
|
91
|
-
"ref": "main
|
|
92
|
+
"ref": "main",
|
|
92
93
|
"repo": "holonix",
|
|
93
94
|
"type": "github"
|
|
94
95
|
}
|
|
@@ -96,16 +97,16 @@
|
|
|
96
97
|
"kitsune2": {
|
|
97
98
|
"flake": false,
|
|
98
99
|
"locked": {
|
|
99
|
-
"lastModified":
|
|
100
|
-
"narHash": "sha256
|
|
100
|
+
"lastModified": 1770115587,
|
|
101
|
+
"narHash": "sha256-bF/7ERAfd41zEfzoUBKKyxuQU3c0QUi2Fc8MpM+hnEs=",
|
|
101
102
|
"owner": "holochain",
|
|
102
103
|
"repo": "kitsune2",
|
|
103
|
-
"rev": "
|
|
104
|
+
"rev": "31b84100151a1eccaf7ed3e0037d27f77b5d7cdb",
|
|
104
105
|
"type": "github"
|
|
105
106
|
},
|
|
106
107
|
"original": {
|
|
107
108
|
"owner": "holochain",
|
|
108
|
-
"ref": "
|
|
109
|
+
"ref": "main",
|
|
109
110
|
"repo": "kitsune2",
|
|
110
111
|
"type": "github"
|
|
111
112
|
}
|
|
@@ -129,11 +130,11 @@
|
|
|
129
130
|
},
|
|
130
131
|
"nixpkgs": {
|
|
131
132
|
"locked": {
|
|
132
|
-
"lastModified":
|
|
133
|
-
"narHash": "sha256-
|
|
133
|
+
"lastModified": 1766201043,
|
|
134
|
+
"narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=",
|
|
134
135
|
"owner": "nixos",
|
|
135
136
|
"repo": "nixpkgs",
|
|
136
|
-
"rev": "
|
|
137
|
+
"rev": "b3aad468604d3e488d627c0b43984eb60e75e782",
|
|
137
138
|
"type": "github"
|
|
138
139
|
},
|
|
139
140
|
"original": {
|
|
@@ -145,11 +146,11 @@
|
|
|
145
146
|
},
|
|
146
147
|
"nixpkgs-lib": {
|
|
147
148
|
"locked": {
|
|
148
|
-
"lastModified":
|
|
149
|
-
"narHash": "sha256-
|
|
149
|
+
"lastModified": 1765674936,
|
|
150
|
+
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
|
|
150
151
|
"owner": "nix-community",
|
|
151
152
|
"repo": "nixpkgs.lib",
|
|
152
|
-
"rev": "
|
|
153
|
+
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
|
|
153
154
|
"type": "github"
|
|
154
155
|
},
|
|
155
156
|
"original": {
|
|
@@ -158,6 +159,23 @@
|
|
|
158
159
|
"type": "github"
|
|
159
160
|
}
|
|
160
161
|
},
|
|
162
|
+
"playground": {
|
|
163
|
+
"flake": false,
|
|
164
|
+
"locked": {
|
|
165
|
+
"lastModified": 1756729856,
|
|
166
|
+
"narHash": "sha256-xJnIfcIyLRTXsf+N8OOMnqzRkx2gT/DSta7qCm8yU7Y=",
|
|
167
|
+
"owner": "darksoil-studio",
|
|
168
|
+
"repo": "holochain-playground",
|
|
169
|
+
"rev": "5e858641de8ac6113cfa6b47ea1350762a629a61",
|
|
170
|
+
"type": "github"
|
|
171
|
+
},
|
|
172
|
+
"original": {
|
|
173
|
+
"owner": "darksoil-studio",
|
|
174
|
+
"ref": "main",
|
|
175
|
+
"repo": "holochain-playground",
|
|
176
|
+
"type": "github"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
161
179
|
"root": {
|
|
162
180
|
"inputs": {
|
|
163
181
|
"flake-parts": [
|
|
@@ -179,11 +197,11 @@
|
|
|
179
197
|
]
|
|
180
198
|
},
|
|
181
199
|
"locked": {
|
|
182
|
-
"lastModified":
|
|
183
|
-
"narHash": "sha256-
|
|
200
|
+
"lastModified": 1766371695,
|
|
201
|
+
"narHash": "sha256-W7CX9vy7H2Jj3E8NI4djHyF8iHSxKpb2c/7uNQ/vGFU=",
|
|
184
202
|
"owner": "oxalica",
|
|
185
203
|
"repo": "rust-overlay",
|
|
186
|
-
"rev": "
|
|
204
|
+
"rev": "d81285ba8199b00dc31847258cae3c655b605e8c",
|
|
187
205
|
"type": "github"
|
|
188
206
|
},
|
|
189
207
|
"original": {
|
package/flake.nix
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/hc-spin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"holochainVersion": "0.
|
|
3
|
+
"version": "0.700.0-dev.1",
|
|
4
|
+
"holochainVersion": "0.7.0-dev.7",
|
|
5
5
|
"description": "CLI to run Holochain apps during development.",
|
|
6
6
|
"author": "matthme",
|
|
7
7
|
"homepage": "https://developer.holochain.org",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@electron-toolkit/preload": "^3.0.0",
|
|
37
37
|
"@electron-toolkit/utils": "^3.0.0",
|
|
38
38
|
"@holochain/client": "^0.20.0",
|
|
39
|
-
"@holochain/hc-spin-rust-utils": "0.
|
|
39
|
+
"@holochain/hc-spin-rust-utils": "0.700.0-dev.0",
|
|
40
40
|
"@msgpack/msgpack": "^2.8.0",
|
|
41
41
|
"bufferutil": "4.0.8",
|
|
42
42
|
"commander": "11.1.0",
|
package/src/main/index.ts
CHANGED
|
@@ -66,6 +66,10 @@ cli
|
|
|
66
66
|
'--relay-url <url>',
|
|
67
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(
|
|
70
|
+
'--force-admin-ports <ports>',
|
|
71
|
+
'A comma-separated list of port numbers for the holochain conductors to bind to their admin interfaces. By default, hc spin picks any available ports.',
|
|
72
|
+
)
|
|
69
73
|
.option('--open-devtools', 'Automatically open the devtools on startup.');
|
|
70
74
|
|
|
71
75
|
cli.parse();
|
|
@@ -211,11 +215,17 @@ async function spawnSandboxes(
|
|
|
211
215
|
appId: string,
|
|
212
216
|
networkSeed?: string,
|
|
213
217
|
targetArcFactor?: number,
|
|
218
|
+
forceAdminPorts?: number[],
|
|
214
219
|
): Promise<
|
|
215
220
|
[childProcess.ChildProcessWithoutNullStreams, Array<string>, Record<number, PortsInfo>]
|
|
216
221
|
> {
|
|
217
|
-
const generateArgs = [
|
|
218
|
-
|
|
222
|
+
const generateArgs = ['sandbox'];
|
|
223
|
+
|
|
224
|
+
if (forceAdminPorts !== undefined && forceAdminPorts.length > 0) {
|
|
225
|
+
generateArgs.push('--force-admin-ports', forceAdminPorts.join(','));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
generateArgs.push(
|
|
219
229
|
'--piped',
|
|
220
230
|
'generate',
|
|
221
231
|
'--num-sandboxes',
|
|
@@ -223,7 +233,8 @@ async function spawnSandboxes(
|
|
|
223
233
|
'--app-id',
|
|
224
234
|
appId,
|
|
225
235
|
'--run',
|
|
226
|
-
|
|
236
|
+
);
|
|
237
|
+
|
|
227
238
|
let appPorts = '';
|
|
228
239
|
for (let i = 1; i <= nAgents; i++) {
|
|
229
240
|
const appPort = await getPort();
|
|
@@ -240,6 +251,7 @@ async function spawnSandboxes(
|
|
|
240
251
|
generateArgs.push('--target-arc-factor', targetArcFactor.toString());
|
|
241
252
|
}
|
|
242
253
|
generateArgs.push('--bootstrap', bootStrapUrl, 'quic', relayUrl);
|
|
254
|
+
// console.log('GENERATE ARGS: ', generateArgs);
|
|
243
255
|
|
|
244
256
|
let readyConductors = 0;
|
|
245
257
|
const portsInfo: Record<number, PortsInfo> = {};
|
|
@@ -293,7 +305,7 @@ app.whenReady().then(async () => {
|
|
|
293
305
|
if (CLI_OPTS.happOrWebhappPath.type === 'webhapp') {
|
|
294
306
|
happTargetDir = path.join(DATA_ROOT_DIR, 'apps', CLI_OPTS.appId);
|
|
295
307
|
const uiTargetDir = path.join(happTargetDir, 'ui');
|
|
296
|
-
await rustUtils.
|
|
308
|
+
await rustUtils.unpackAndSaveWebhapp(
|
|
297
309
|
CLI_OPTS.happOrWebhappPath.path,
|
|
298
310
|
CLI_OPTS.appId,
|
|
299
311
|
uiTargetDir,
|
|
@@ -311,6 +323,7 @@ app.whenReady().then(async () => {
|
|
|
311
323
|
CLI_OPTS.appId,
|
|
312
324
|
CLI_OPTS.networkSeed,
|
|
313
325
|
CLI_OPTS.targetArcFactor,
|
|
326
|
+
CLI_OPTS.forceAdminPorts,
|
|
314
327
|
);
|
|
315
328
|
|
|
316
329
|
const lairUrls: string[] = [];
|
package/src/main/validateArgs.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type CliOpts = {
|
|
|
14
14
|
relayUrl?: string;
|
|
15
15
|
bootstrapUrl?: string;
|
|
16
16
|
openDevtools?: boolean;
|
|
17
|
+
forceAdminPorts?: string;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export type CliOptsValidated = {
|
|
@@ -27,6 +28,7 @@ export type CliOptsValidated = {
|
|
|
27
28
|
bootstrapUrl: string | undefined;
|
|
28
29
|
happOrWebhappPath: HappOrWebhappPath;
|
|
29
30
|
openDevtools: boolean;
|
|
31
|
+
forceAdminPorts: number[] | undefined;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export type HappOrWebhappPath = {
|
|
@@ -87,6 +89,20 @@ export function validateCliArgs(
|
|
|
87
89
|
const holochainPath = cliOpts.holochainPath;
|
|
88
90
|
const numAgents = cliOpts.numAgents ? cliOpts.numAgents : 2;
|
|
89
91
|
|
|
92
|
+
let forceAdminPorts: number[] | undefined;
|
|
93
|
+
if (cliOpts.forceAdminPorts !== undefined) {
|
|
94
|
+
forceAdminPorts = cliOpts.forceAdminPorts.split(',').map((portStr) => {
|
|
95
|
+
const portInt = parseInt(portStr);
|
|
96
|
+
|
|
97
|
+
if (Number.isNaN(portInt)) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
`The --force-admin-ports must be a comma-separated list of valid port numbers, but got: ${cliOpts.forceAdminPorts}`,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
return portInt;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
90
106
|
return {
|
|
91
107
|
appId,
|
|
92
108
|
holochainPath,
|
|
@@ -104,5 +120,6 @@ export function validateCliArgs(
|
|
|
104
120
|
? { type: 'happ', path: happOrWebhappPath }
|
|
105
121
|
: { type: 'webhapp', path: happOrWebhappPath },
|
|
106
122
|
openDevtools: cliOpts.openDevtools ? true : false,
|
|
123
|
+
forceAdminPorts,
|
|
107
124
|
};
|
|
108
125
|
}
|