@leofcoin/launch-chain 0.4.23 → 0.4.25
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/README.md +31 -1
- package/exports/cli.js +13 -1
- package/exports/index.js +2 -2
- package/exports/validator-cli.js +1 -0
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -19,6 +19,35 @@ const { chain, endpoints, mode } = await launch(
|
|
|
19
19
|
|
|
20
20
|
## command line
|
|
21
21
|
|
|
22
|
+
Requires Node.js 24.15.0 or newer. The default native WebRTC backend is
|
|
23
|
+
`@vandeurenglenn/wrtc` 0.7.2 or newer.
|
|
24
|
+
|
|
25
|
+
### automatic peer transports
|
|
26
|
+
|
|
27
|
+
Launch-chain 0.4.25 requires chain 1.10.17 and lib 1.3.15, using published
|
|
28
|
+
peernet 3 / swarm 0.10. Peers discover an available WebTransport relay through
|
|
29
|
+
their configured star; clients do not need a relay URL, shared secret or TLS
|
|
30
|
+
configuration. WebRTC and circuit fallback remain available when no relay is
|
|
31
|
+
advertised. HTTP/3 needs reachable UDP and a correctly configured public star.
|
|
32
|
+
Node's HTTP/3 backend also needs the optional native QUIC package's installation
|
|
33
|
+
hook. This repository approves its exact reviewed version in `allowScripts`.
|
|
34
|
+
Standalone installations using npm's script-blocking policy must review/approve
|
|
35
|
+
that native package as well; the launcher never bypasses that policy.
|
|
36
|
+
|
|
37
|
+
The star operator must also deploy swarm 0.10. Its `npm start` starts the star
|
|
38
|
+
and relay together, creates the private relay secret, and discovers an existing
|
|
39
|
+
matching Let's Encrypt certificate. Multiple certificate names require a one-time
|
|
40
|
+
hostname selection. This does not issue certificates or change DNS/firewalls.
|
|
41
|
+
See the [relay operator guide](https://github.com/netpeer/swarm/blob/main/docs/webtransport-relay.md).
|
|
42
|
+
|
|
43
|
+
This dependency update does not change the Peach genesis, protocol version,
|
|
44
|
+
account identities, passwords or data directory. Do not delete existing stores.
|
|
45
|
+
Stop the existing process before upgrading and restart using the same data root.
|
|
46
|
+
|
|
47
|
+
For development, after building, `npm run test:package -w @leofcoin/launch-chain`
|
|
48
|
+
checks a clean tarball install, npm CLI entry and real-genesis offline startup
|
|
49
|
+
using temporary storage. It is not proof of public peer sync or validator finality.
|
|
50
|
+
|
|
22
51
|
No monorepo checkout or global install is required:
|
|
23
52
|
|
|
24
53
|
```sh
|
|
@@ -122,13 +151,14 @@ no prebuild are provided since the esm switch, everything is written with the br
|
|
|
122
151
|
### rollup
|
|
123
152
|
|
|
124
153
|
```js
|
|
125
|
-
external: ['@koush/wrtc', '@leofcoin/endpoints/ws', '@leofcoin/endpoints/http']
|
|
154
|
+
external: ['@vandeurenglenn/wrtc', '@koush/wrtc', '@leofcoin/endpoints/ws', '@leofcoin/endpoints/http']
|
|
126
155
|
```
|
|
127
156
|
|
|
128
157
|
### webpack
|
|
129
158
|
|
|
130
159
|
```js
|
|
131
160
|
externals: {
|
|
161
|
+
'@vandeurenglenn/wrtc': false,
|
|
132
162
|
'@koush/wrtc': false,
|
|
133
163
|
'@leofcoin/endpoints/ws': false,
|
|
134
164
|
'@leofcoin/endpoints/http': false
|
package/exports/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { realpathSync } from 'node:fs';
|
|
3
4
|
import { homedir } from 'node:os';
|
|
4
5
|
import { resolve, isAbsolute, relative } from 'node:path';
|
|
5
6
|
import { pathToFileURL } from 'node:url';
|
|
@@ -177,7 +178,18 @@ const runCli = async (args = process.argv.slice(2)) => {
|
|
|
177
178
|
// explicitly closed interactive shell terminate predictably.
|
|
178
179
|
setTimeout(() => process.exit(0), 100);
|
|
179
180
|
};
|
|
180
|
-
|
|
181
|
+
// npm's bin entry and macOS temporary directories can both be symlinks. Node
|
|
182
|
+
// canonicalizes import.meta.url, so compare it with the canonical argv path too.
|
|
183
|
+
const isCliEntry = () => {
|
|
184
|
+
try {
|
|
185
|
+
return Boolean(process.argv[1]) && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href;
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// Imported from an eval/embedding process whose argv is not a file path.
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
if (isCliEntry()) {
|
|
181
193
|
runCli().catch((error) => {
|
|
182
194
|
process.stderr.write(`leofcoin: ${error?.message ?? error}\n`);
|
|
183
195
|
process.exitCode = 1;
|
package/exports/index.js
CHANGED
|
@@ -111,7 +111,7 @@ const launch = async (input = {}, password) => {
|
|
|
111
111
|
else if (options.mode === 'direct') {
|
|
112
112
|
const node = new Node({ network: options.network, stars: options.stars, networkVersion: options.networkVersion, root: options.root }, password);
|
|
113
113
|
await node.ready;
|
|
114
|
-
await nodeConfig({ network: options.network, networkVersion: options.networkVersion });
|
|
114
|
+
await nodeConfig({ network: options.network, networkVersion: options.networkVersion, root: options.root });
|
|
115
115
|
chain = new Chain({ network: options.network, stars: options.stars, networkVersion: options.networkVersion });
|
|
116
116
|
await chain.ready;
|
|
117
117
|
if (options.ws) {
|
|
@@ -140,7 +140,7 @@ const launch = async (input = {}, password) => {
|
|
|
140
140
|
else {
|
|
141
141
|
const node = new Node({ network: options.network, stars: options.stars, networkVersion: options.networkVersion, root: options.root }, password);
|
|
142
142
|
await node.ready;
|
|
143
|
-
await nodeConfig({ network: options.network, networkVersion: options.networkVersion });
|
|
143
|
+
await nodeConfig({ network: options.network, networkVersion: options.networkVersion, root: options.root });
|
|
144
144
|
chain = new Chain({ network: options.network, stars: options.stars, networkVersion: options.networkVersion });
|
|
145
145
|
await chain.ready;
|
|
146
146
|
if (options.ws) {
|
package/exports/validator-cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/launch-chain",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"type": "module",
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "rollup -c",
|
|
29
|
-
"test": "node --test test/*.test.js"
|
|
29
|
+
"test": "node --test test/*.test.js",
|
|
30
|
+
"test:package": "node test/standalone-install.js"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|
|
@@ -41,13 +42,16 @@
|
|
|
41
42
|
},
|
|
42
43
|
"homepage": "https://github.com/leofcoin/monorepo/tree/main/packages/launch-chain#readme",
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@leofcoin/addresses": "^1.0.
|
|
45
|
-
"@leofcoin/chain": "^1.10.
|
|
45
|
+
"@leofcoin/addresses": "^1.0.64",
|
|
46
|
+
"@leofcoin/chain": "^1.10.17",
|
|
46
47
|
"@leofcoin/endpoint-clients": "^0.3.16",
|
|
47
48
|
"@leofcoin/endpoints": "^0.4.9",
|
|
48
|
-
"@leofcoin/lib": "^1.3.
|
|
49
|
+
"@leofcoin/lib": "^1.3.15",
|
|
49
50
|
"@leofcoin/networks": "^1.1.30",
|
|
50
|
-
"@vandeurenglenn/wrtc": "^0.
|
|
51
|
+
"@vandeurenglenn/wrtc": "^0.7.2"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=24.15.0"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@rollup/plugin-typescript": "^12.3.0",
|