@constellation-network/node-pilot 0.11.0 → 0.12.0-testnet
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 +10 -10
- package/dist/checks/check-hardware.js +12 -6
- package/dist/checks/check-network.js +4 -4
- package/dist/checks/check-project.js +12 -6
- package/dist/commands/info.js +3 -0
- package/dist/helpers/status-table-helper.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
- package/projects/hypergraph/Dockerfile +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g @constellation-network/node-pilot
|
|
|
21
21
|
$ cpilot COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ cpilot (--version|-v)
|
|
24
|
-
@constellation-network/node-pilot/0.
|
|
24
|
+
@constellation-network/node-pilot/0.12.0-testnet darwin-arm64 node-v22.15.0
|
|
25
25
|
$ cpilot --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ cpilot COMMAND
|
|
@@ -71,7 +71,7 @@ EXAMPLES
|
|
|
71
71
|
$ cpilot clean
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
_See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
74
|
+
_See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/clean.ts)_
|
|
75
75
|
|
|
76
76
|
## `cpilot config`
|
|
77
77
|
|
|
@@ -88,7 +88,7 @@ EXAMPLES
|
|
|
88
88
|
$ cpilot config
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
_See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
91
|
+
_See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/config.ts)_
|
|
92
92
|
|
|
93
93
|
## `cpilot config get [NAME]`
|
|
94
94
|
|
|
@@ -112,7 +112,7 @@ EXAMPLES
|
|
|
112
112
|
$ cpilot config get gl0:CL_PUBLIC_HTTP_PORT
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
_See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
115
|
+
_See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/config/get.ts)_
|
|
116
116
|
|
|
117
117
|
## `cpilot config set NAME VALUE`
|
|
118
118
|
|
|
@@ -135,7 +135,7 @@ EXAMPLES
|
|
|
135
135
|
$ cpilot config set gl0:CL_PUBLIC_HTTP_PORT 9000
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
_See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
138
|
+
_See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/config/set.ts)_
|
|
139
139
|
|
|
140
140
|
## `cpilot help [COMMAND]`
|
|
141
141
|
|
|
@@ -172,7 +172,7 @@ EXAMPLES
|
|
|
172
172
|
$ cpilot info
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
_See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
175
|
+
_See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/info.ts)_
|
|
176
176
|
|
|
177
177
|
## `cpilot logs LAYER`
|
|
178
178
|
|
|
@@ -198,7 +198,7 @@ EXAMPLES
|
|
|
198
198
|
$ cpilot logs
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
_See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
201
|
+
_See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/logs.ts)_
|
|
202
202
|
|
|
203
203
|
## `cpilot restart [LAYER]`
|
|
204
204
|
|
|
@@ -226,7 +226,7 @@ EXAMPLES
|
|
|
226
226
|
$ cpilot restart
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
_See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
229
|
+
_See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/restart.ts)_
|
|
230
230
|
|
|
231
231
|
## `cpilot shutdown`
|
|
232
232
|
|
|
@@ -243,7 +243,7 @@ EXAMPLES
|
|
|
243
243
|
$ cpilot shutdown
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
-
_See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
246
|
+
_See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/shutdown.ts)_
|
|
247
247
|
|
|
248
248
|
## `cpilot status`
|
|
249
249
|
|
|
@@ -257,5 +257,5 @@ DESCRIPTION
|
|
|
257
257
|
Display node status and configuration settings
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
_See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.
|
|
260
|
+
_See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.0-testnet/src/commands/status.ts)_
|
|
261
261
|
<!-- commandsstop -->
|
|
@@ -17,10 +17,13 @@ export const checkHardware = {
|
|
|
17
17
|
// Retrieve number of CPU cores
|
|
18
18
|
const numOfCores = os.availableParallelism();
|
|
19
19
|
let allPassed = true;
|
|
20
|
-
|
|
20
|
+
let allMinPassed = false;
|
|
21
|
+
const formatActual = (value, recommended, minimum, units = '') => {
|
|
21
22
|
const passed = Math.ceil(Number(value)) >= recommended;
|
|
23
|
+
const minPassed = Math.ceil(Number(value)) >= minimum;
|
|
22
24
|
allPassed = allPassed && passed;
|
|
23
|
-
|
|
25
|
+
allMinPassed = allMinPassed && minPassed;
|
|
26
|
+
return passed ? chalk.greenBright(value + units) : (minPassed ? chalk.yellowBright(value + units) : chalk.redBright(value + units));
|
|
24
27
|
};
|
|
25
28
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
26
29
|
const fc = (value) => chalk.white(value);
|
|
@@ -30,19 +33,22 @@ export const checkHardware = {
|
|
|
30
33
|
{ headerColor: 'white', value: 'ACTUAL' },
|
|
31
34
|
];
|
|
32
35
|
const rows = [
|
|
33
|
-
[fc("Disk size"), fc("240 GB"), formatActual(totalSpaceGB, 240, " GB")],
|
|
34
|
-
[fc("System memory"), fc("16 GB"), formatActual(totalMemoryGB, 16, " GB")],
|
|
35
|
-
[fc("CPU cores"), fc("8 cores"), formatActual(numOfCores, 8, " cores")],
|
|
36
|
+
[fc("Disk size"), fc("240 GB"), formatActual(totalSpaceGB, 240, 50, " GB")],
|
|
37
|
+
[fc("System memory"), fc("16 GB"), formatActual(totalMemoryGB, 16, 8, " GB")],
|
|
38
|
+
[fc("CPU cores"), fc("8 cores"), formatActual(numOfCores, 8, 4, " cores")],
|
|
36
39
|
];
|
|
37
40
|
clm.echo(ttyTable(header, rows).render() + "\n");
|
|
38
41
|
if (allPassed) {
|
|
39
42
|
clm.postStep(" ✅ System requirements check passed ✅\n");
|
|
40
43
|
await promptHelper.doYouWishToContinue();
|
|
41
44
|
}
|
|
42
|
-
else {
|
|
45
|
+
else if (allMinPassed) {
|
|
43
46
|
clm.warn("System recommendations not met. The validator node may not function properly.\n");
|
|
44
47
|
await promptHelper.doYouWishToContinue('n');
|
|
45
48
|
}
|
|
49
|
+
else {
|
|
50
|
+
clm.error("System requirements not met.\n");
|
|
51
|
+
}
|
|
46
52
|
configStore.setSystemInfo({ cores: numOfCores, disk: totalSpaceGB, memory: totalMemoryGB, platform: os.platform(), user: os.userInfo().username });
|
|
47
53
|
}
|
|
48
54
|
};
|
|
@@ -15,9 +15,9 @@ export const checkNetwork = {
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
async checkForExistingNodeIdInCluster() {
|
|
18
|
-
if
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
// if(configStore.hasProjectFlag('duplicateNodeIdChecked')) {
|
|
19
|
+
// return;
|
|
20
|
+
// }
|
|
21
21
|
clm.preStep('Checking for existing Node ID in cluster...');
|
|
22
22
|
const { nodeId } = configStore.getProjectInfo();
|
|
23
23
|
const clusterInfo = await clusterService.getClusterInfo();
|
|
@@ -28,7 +28,7 @@ export const checkNetwork = {
|
|
|
28
28
|
clm.warn('You need to shutdown your node from a previous installation before continuing.');
|
|
29
29
|
clm.error(`Or to change the node ID, configure the Key File: use ${chalk.cyan('cpilot config')}, and select ${chalk.cyan('Key File')}`);
|
|
30
30
|
}
|
|
31
|
-
configStore.setProjectFlag('duplicateNodeIdChecked', true);
|
|
31
|
+
// configStore.setProjectFlag('duplicateNodeIdChecked', true);
|
|
32
32
|
clm.postStep('✅ No duplicate Node found.');
|
|
33
33
|
},
|
|
34
34
|
async checkSeedList() {
|
|
@@ -10,9 +10,12 @@ import { clusterService } from "../services/cluster-service.js";
|
|
|
10
10
|
import { dockerService } from "../services/docker-service.js";
|
|
11
11
|
import { shellService } from "../services/shell-service.js";
|
|
12
12
|
import { checkNetwork } from "./check-network.js";
|
|
13
|
-
function getJavaMemoryOptions(mem) {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
function getJavaMemoryOptions(network, mem) {
|
|
14
|
+
if (network === 'testnet') {
|
|
15
|
+
const linuxOpt = (os.platform() === 'linux') ? ' -XX:+UseZGC' : '';
|
|
16
|
+
return `-Xms${mem}g -Xmx${mem}g -XX:+UnlockExperimentalVMOptions${linuxOpt} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heap_dumps/ -XX:+ExitOnOutOfMemoryError`;
|
|
17
|
+
}
|
|
18
|
+
return `-Xms1024M -Xmx${mem}g -Xss256K`;
|
|
16
19
|
}
|
|
17
20
|
export const checkProject = {
|
|
18
21
|
async checkJavaMemory() {
|
|
@@ -33,6 +36,7 @@ export const checkProject = {
|
|
|
33
36
|
configStore.setEnvLayerInfo(currentNetwork, layersToRun[0], { CL_DOCKER_JAVA_OPTS: '-Xms1024M -Xmx7G -Xss256K' });
|
|
34
37
|
}
|
|
35
38
|
else if (name === 'hypergraph') {
|
|
39
|
+
clm.preStep('Configuring Java memory for Hypergraph...');
|
|
36
40
|
// prompt to use all detected memory
|
|
37
41
|
let answer = await number({
|
|
38
42
|
default: xmx - 1,
|
|
@@ -44,8 +48,10 @@ export const checkProject = {
|
|
|
44
48
|
let subLayerMem = 0;
|
|
45
49
|
let mainLayerMem = 0;
|
|
46
50
|
if (currentNetwork === 'testnet') {
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
// Divide equally between layers with max of 10GB each
|
|
52
|
+
subLayerMem = layersToRun.length > 1 ? Math.floor(answer / layersToRun.length) : 0;
|
|
53
|
+
subLayerMem = Math.min(subLayerMem, 10);
|
|
54
|
+
mainLayerMem = Math.min(10, answer - subLayerMem);
|
|
49
55
|
}
|
|
50
56
|
else {
|
|
51
57
|
subLayerMem = layersToRun.length > 1 ? Math.floor(answer / 3) : 0;
|
|
@@ -56,7 +62,7 @@ export const checkProject = {
|
|
|
56
62
|
const network = type.toUpperCase();
|
|
57
63
|
const logMethod = type === currentNetwork ? clm.postStep : clm.debug;
|
|
58
64
|
logMethod(`${network}:: ${layersToRun[0]} memory allocation: ${mainLayerMem}GB`);
|
|
59
|
-
configStore.setEnvLayerInfo(type, layersToRun[0], { CL_DOCKER_JAVA_OPTS: getJavaMemoryOptions(mainLayerMem) });
|
|
65
|
+
configStore.setEnvLayerInfo(type, layersToRun[0], { CL_DOCKER_JAVA_OPTS: getJavaMemoryOptions(currentNetwork, mainLayerMem) });
|
|
60
66
|
if (subLayerMem) {
|
|
61
67
|
logMethod(`${network}:: ${layersToRun[1]} memory allocation: ${subLayerMem}GB`);
|
|
62
68
|
configStore.setEnvLayerInfo(type, layersToRun[1], { CL_DOCKER_JAVA_OPTS: `-Xms1024M -Xmx${subLayerMem}G -Xss256K` });
|
package/dist/commands/info.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
+
import packageJson from '../../package.json' with { type: 'json' };
|
|
2
3
|
import { checkNodePilot } from "../checks/check-pilot.js";
|
|
3
4
|
import { configStore } from "../config-store.js";
|
|
4
5
|
import { configHelper } from "../helpers/config-helper.js";
|
|
@@ -15,6 +16,8 @@ export default class Info extends Command {
|
|
|
15
16
|
const { CL_DOCKER_JAVA_OPTS } = configStore.getEnvLayerInfo(networkInfo.type, 'gl0');
|
|
16
17
|
// Project Name
|
|
17
18
|
configHelper.showEnvInfo('Project Name', projectInfo.name);
|
|
19
|
+
// Pilot Version
|
|
20
|
+
configHelper.showEnvInfo('Node Pilot Version', packageJson.version);
|
|
18
21
|
// External IP Address
|
|
19
22
|
configHelper.showEnvInfo('External IP Address', currentIpAddress);
|
|
20
23
|
// DAG Address
|
|
@@ -61,8 +61,8 @@ class CellFormatter {
|
|
|
61
61
|
return this.style(value, "cyan");
|
|
62
62
|
if (value === 'ReadyToJoin' || value === 'JoiningCluster')
|
|
63
63
|
return this.style(value, "yellow", "bold");
|
|
64
|
-
if (value
|
|
65
|
-
return this.style(value, "yellow"
|
|
64
|
+
if (value.startsWith('Start'))
|
|
65
|
+
return this.style(value, "yellow");
|
|
66
66
|
if (value.startsWith('Ready'))
|
|
67
67
|
return this.style(value, "green");
|
|
68
68
|
return this.style(value, "white");
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constellation-network/node-pilot",
|
|
3
3
|
"description": "An easy deployment and monitoring tool for Constellation nodes.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0-testnet",
|
|
5
5
|
"author": "Frank Fox",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cpilot": "bin/run.js"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"version": "oclif readme && git add README.md",
|
|
22
22
|
"start": "./bin/dev.js",
|
|
23
23
|
"debug": "DEBUG=true ./bin/dev.js",
|
|
24
|
-
"pub": "npm publish --access public"
|
|
24
|
+
"pub": "npm publish --access public --tag testnet"
|
|
25
25
|
},
|
|
26
26
|
"types": "dist/index.d.ts",
|
|
27
27
|
"engines": {
|
|
@@ -39,7 +39,7 @@ COPY dist/gl0.jar /app/jars/gl0.jar
|
|
|
39
39
|
#COPY ./health-check /health-check
|
|
40
40
|
#RUN chmod +x /health-check/bin/run.sh
|
|
41
41
|
#RUN chmod +x /health-check/bin/hydrate.sh
|
|
42
|
-
RUN npm install -g "@constellation-network/node-pilot-health-check@0.0.
|
|
42
|
+
RUN npm install -g "@constellation-network/node-pilot-health-check@0.0.26"
|
|
43
43
|
|
|
44
44
|
# Add entrypoint
|
|
45
45
|
COPY ./entrypoint.sh /app/entrypoint.sh
|