@hardkas/node-runner 0.7.3-alpha → 0.7.4-alpha
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/dist/index.js +15 -8
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4,10 +4,7 @@ import fs from "fs/promises";
|
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
6
|
import net from "net";
|
|
7
|
-
import {
|
|
8
|
-
checkKaspaRpcHealth,
|
|
9
|
-
waitForKaspaRpcReady
|
|
10
|
-
} from "@hardkas/kaspa-rpc";
|
|
7
|
+
import { checkKaspaRpcHealth, waitForKaspaRpcReady } from "@hardkas/kaspa-rpc";
|
|
11
8
|
var DEFAULT_IMAGE = "kaspanet/rusty-kaspad:v1.1.0";
|
|
12
9
|
var DEFAULT_CONTAINER_NAME = "hardkas-kaspad-simnet";
|
|
13
10
|
var DEFAULT_NETWORK = "simnet";
|
|
@@ -42,10 +39,14 @@ var DockerKaspadRunner = class {
|
|
|
42
39
|
try {
|
|
43
40
|
await execa("docker", ["version"]);
|
|
44
41
|
} catch (e) {
|
|
45
|
-
throw new Error(
|
|
42
|
+
throw new Error(
|
|
43
|
+
"Docker is not available. Please install Docker to run a real Kaspa node."
|
|
44
|
+
);
|
|
46
45
|
}
|
|
47
46
|
if (this.options.image.endsWith(":latest") && !this.options.allowFloatingImage) {
|
|
48
|
-
console.warn(
|
|
47
|
+
console.warn(
|
|
48
|
+
"\n \u26A0\uFE0F WARNING: Using a floating Docker tag (:latest) reduces reproducibility.\n"
|
|
49
|
+
);
|
|
49
50
|
}
|
|
50
51
|
const network = this.options.network;
|
|
51
52
|
let networkFlag = "";
|
|
@@ -116,7 +117,11 @@ var DockerKaspadRunner = class {
|
|
|
116
117
|
return this.status();
|
|
117
118
|
}
|
|
118
119
|
async ensurePortsAvailable() {
|
|
119
|
-
const ports = [
|
|
120
|
+
const ports = [
|
|
121
|
+
this.options.ports.rpc,
|
|
122
|
+
this.options.ports.borshRpc,
|
|
123
|
+
this.options.ports.jsonRpc
|
|
124
|
+
];
|
|
120
125
|
for (const port of ports) {
|
|
121
126
|
const available = await this.isPortAvailable(port);
|
|
122
127
|
if (!available) {
|
|
@@ -257,7 +262,9 @@ var DockerKaspadRunner = class {
|
|
|
257
262
|
const { stdout } = await execa("docker", [...args, this.options.containerName]);
|
|
258
263
|
return stdout;
|
|
259
264
|
} catch (e) {
|
|
260
|
-
throw new Error(
|
|
265
|
+
throw new Error(
|
|
266
|
+
`Could not get logs for container ${this.options.containerName}. Is it running?`
|
|
267
|
+
);
|
|
261
268
|
}
|
|
262
269
|
}
|
|
263
270
|
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hardkas/node-runner",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4-alpha",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"execa": "^9.5.2",
|
|
9
|
-
"@hardkas/
|
|
10
|
-
"@hardkas/
|
|
9
|
+
"@hardkas/kaspa-rpc": "0.7.4-alpha",
|
|
10
|
+
"@hardkas/core": "0.7.4-alpha"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"tsup": "^8.3.5",
|
|
14
14
|
"typescript": "^5.7.2",
|
|
15
15
|
"vitest": "^2.1.8",
|
|
16
|
-
"@hardkas/config": "0.7.
|
|
16
|
+
"@hardkas/config": "0.7.4-alpha"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Javier Rodriguez",
|