@constellation-network/node-pilot 0.11.1 → 0.12.1-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 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.11.1 darwin-arm64 node-v22.15.0
24
+ @constellation-network/node-pilot/0.12.1-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.11.1/src/commands/clean.ts)_
74
+ _See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/config.ts)_
91
+ _See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/config/get.ts)_
115
+ _See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/config/set.ts)_
138
+ _See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/info.ts)_
175
+ _See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/logs.ts)_
201
+ _See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/restart.ts)_
229
+ _See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/shutdown.ts)_
246
+ _See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-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.11.1/src/commands/status.ts)_
260
+ _See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.1-testnet/src/commands/status.ts)_
261
261
  <!-- commandsstop -->
@@ -17,32 +17,39 @@ export const checkHardware = {
17
17
  // Retrieve number of CPU cores
18
18
  const numOfCores = os.availableParallelism();
19
19
  let allPassed = true;
20
- const formatActual = (value, recommended, units = '') => {
20
+ let allMinPassed = true;
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
- return passed ? chalk.greenBright(value + units) : chalk.redBright(value + units);
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);
27
30
  const header = [
28
31
  { headerColor: 'white', value: 'HARDWARE' },
29
32
  { headerColor: 'white', value: 'RECOMMENDED' },
33
+ { headerColor: 'white', value: 'MINIMUM' },
30
34
  { headerColor: 'white', value: 'ACTUAL' },
31
35
  ];
32
36
  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")],
37
+ [fc("Disk size"), fc("240 GB"), fc("50 GB"), formatActual(totalSpaceGB, 240, 45, " GB")],
38
+ [fc("System memory"), fc("16 GB"), fc("8 GB"), formatActual(totalMemoryGB, 16, 8, " GB")],
39
+ [fc("CPU cores"), fc("8 cores"), fc("4 cores"), formatActual(numOfCores, 8, 4, " cores")],
36
40
  ];
37
41
  clm.echo(ttyTable(header, rows).render() + "\n");
38
42
  if (allPassed) {
39
43
  clm.postStep(" ✅ System requirements check passed ✅\n");
40
44
  await promptHelper.doYouWishToContinue();
41
45
  }
42
- else {
46
+ else if (allMinPassed) {
43
47
  clm.warn("System recommendations not met. The validator node may not function properly.\n");
44
48
  await promptHelper.doYouWishToContinue('n');
45
49
  }
50
+ else {
51
+ clm.error("System requirements not met.\n");
52
+ }
46
53
  configStore.setSystemInfo({ cores: numOfCores, disk: totalSpaceGB, memory: totalMemoryGB, platform: os.platform(), user: os.userInfo().username });
47
54
  }
48
55
  };
@@ -15,9 +15,9 @@ export const checkNetwork = {
15
15
  }
16
16
  },
17
17
  async checkForExistingNodeIdInCluster() {
18
- if (configStore.hasProjectFlag('duplicateNodeIdChecked')) {
19
- return;
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() {
@@ -36,6 +36,7 @@ export const checkProject = {
36
36
  configStore.setEnvLayerInfo(currentNetwork, layersToRun[0], { CL_DOCKER_JAVA_OPTS: '-Xms1024M -Xmx7G -Xss256K' });
37
37
  }
38
38
  else if (name === 'hypergraph') {
39
+ clm.preStep('Configuring Java memory for Hypergraph...');
39
40
  // prompt to use all detected memory
40
41
  let answer = await number({
41
42
  default: xmx - 1,
@@ -47,8 +48,10 @@ export const checkProject = {
47
48
  let subLayerMem = 0;
48
49
  let mainLayerMem = 0;
49
50
  if (currentNetwork === 'testnet') {
50
- subLayerMem = layersToRun.length > 1 ? Math.floor(answer / 2) : 0;
51
- mainLayerMem = answer - subLayerMem;
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);
52
55
  }
53
56
  else {
54
57
  subLayerMem = layersToRun.length > 1 ? Math.floor(answer / 3) : 0;
@@ -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 === 'Restarting')
65
- return this.style(value, "yellow", "bold");
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");
@@ -340,5 +340,5 @@
340
340
  ]
341
341
  }
342
342
  },
343
- "version": "0.11.1"
343
+ "version": "0.12.1-testnet"
344
344
  }
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.11.1",
4
+ "version": "0.12.1-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.25"
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