@constellation-network/node-pilot 0.12.2 → 0.12.4-devnet
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-project.js +21 -3
- package/dist/commands/status.js +2 -1
- package/dist/services/migration-service.js +16 -3
- package/dist/services/shell-service.js +1 -1
- package/install-java-21.sh +80 -0
- package/oclif.manifest.json +1 -1
- package/package.json +3 -2
- package/projects/hypergraph/docker-compose.yml +4 -0
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.12.
|
|
24
|
+
@constellation-network/node-pilot/0.12.4-devnet 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.12.
|
|
74
|
+
_See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
91
|
+
_See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
115
|
+
_See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
138
|
+
_See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
175
|
+
_See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
201
|
+
_See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
229
|
+
_See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
246
|
+
_See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/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.12.
|
|
260
|
+
_See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.12.4-devnet/src/commands/status.ts)_
|
|
261
261
|
<!-- commandsstop -->
|
|
@@ -10,10 +10,28 @@ 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
|
+
/*
|
|
14
|
+
* -Xms12g \
|
|
15
|
+
-Xmx12g \
|
|
16
|
+
-XX:+UseZGC \
|
|
17
|
+
-XX:+ZGenerational \
|
|
18
|
+
-XX:ZAllocationSpikeTolerance=5 \
|
|
19
|
+
-XX:ZCollectionInterval=10 \
|
|
20
|
+
-XX:ConcGCThreads=4 \
|
|
21
|
+
-XX:ParallelGCThreads=8 \
|
|
22
|
+
-XX:+UseStringDeduplication \
|
|
23
|
+
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
|
|
24
|
+
--add-opens=java.base/java.util=ALL-UNNAMED \
|
|
25
|
+
--add-opens=java.base/java.security=ALL-UNNAMED \
|
|
26
|
+
-XX:+HeapDumpOnOutOfMemoryError \
|
|
27
|
+
-XX:HeapDumpPath=./heap_dumps/ \
|
|
28
|
+
-XX:+ExitOnOutOfMemoryError
|
|
29
|
+
*/
|
|
13
30
|
function getJavaMemoryOptions(network, mem) {
|
|
14
31
|
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`;
|
|
32
|
+
const linuxOpt = (os.platform() === 'linux') ? ' -XX:+UseZGC -XX:+ZGenerational -XX:ZAllocationSpikeTolerance=5 -XX:ZCollectionInterval=10' : '';
|
|
33
|
+
// return `-Xms${mem}g -Xmx${mem}g -XX:+UnlockExperimentalVMOptions${linuxOpt} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heap_dumps/ -XX:+ExitOnOutOfMemoryError`;
|
|
34
|
+
return `-Xms${mem}g -Xmx${mem}g${linuxOpt} -XXConveyGCThreads=4 -XXParallelGCThreads=8 -XX:+UseStringDeduplication --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED`;
|
|
17
35
|
}
|
|
18
36
|
return `-Xms1024M -Xmx${mem}g -Xss256K`;
|
|
19
37
|
}
|
|
@@ -62,7 +80,7 @@ export const checkProject = {
|
|
|
62
80
|
const network = type.toUpperCase();
|
|
63
81
|
const logMethod = type === currentNetwork ? clm.postStep : clm.debug;
|
|
64
82
|
logMethod(`${network}:: ${layersToRun[0]} memory allocation: ${mainLayerMem}GB`);
|
|
65
|
-
configStore.setEnvLayerInfo(type, layersToRun[0], { CL_DOCKER_JAVA_OPTS: getJavaMemoryOptions(
|
|
83
|
+
configStore.setEnvLayerInfo(type, layersToRun[0], { CL_DOCKER_JAVA_OPTS: getJavaMemoryOptions(type, mainLayerMem) });
|
|
66
84
|
if (subLayerMem) {
|
|
67
85
|
logMethod(`${network}:: ${layersToRun[1]} memory allocation: ${subLayerMem}GB`);
|
|
68
86
|
configStore.setEnvLayerInfo(type, layersToRun[1], { CL_DOCKER_JAVA_OPTS: `-Xms1024M -Xmx${subLayerMem}G -Xss256K` });
|
package/dist/commands/status.js
CHANGED
|
@@ -7,6 +7,7 @@ import { checkNodePilot } from "../checks/check-pilot.js";
|
|
|
7
7
|
import { checkProject } from "../checks/check-project.js";
|
|
8
8
|
import { checkWallet } from "../checks/check-wallet.js";
|
|
9
9
|
import { keyFileHelper } from "../helpers/key-file-helper.js";
|
|
10
|
+
import { migrationService } from "../services/migration-service.js";
|
|
10
11
|
export default class Status extends Command {
|
|
11
12
|
// eslint-disable-next-line no-warning-comments
|
|
12
13
|
// TODO add -f flag to continuously monitor status
|
|
@@ -16,7 +17,7 @@ export default class Status extends Command {
|
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
export async function checkInstallationAndConfigurationStatus() {
|
|
19
|
-
|
|
20
|
+
migrationService.runMigrations();
|
|
20
21
|
await checkInitialSetup.firstTimeRun();
|
|
21
22
|
await checkProject.projectInstallation();
|
|
22
23
|
await checkProject.checkJavaMemory();
|
|
@@ -2,10 +2,13 @@ import semver from "semver";
|
|
|
2
2
|
import packageJson from '../../package.json' with { type: 'json' };
|
|
3
3
|
import { clm } from "../clm.js";
|
|
4
4
|
import { configStore } from "../config-store.js";
|
|
5
|
+
import shell from "shelljs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
5
8
|
export const migrationService = {
|
|
6
9
|
runMigrations() {
|
|
7
10
|
const migrations = {
|
|
8
|
-
'0.
|
|
11
|
+
'0.12.2': m0122,
|
|
9
12
|
// add more migrations as needed
|
|
10
13
|
};
|
|
11
14
|
const { version = '0.0.0' } = configStore.getProjectInfo();
|
|
@@ -29,7 +32,17 @@ export const migrationService = {
|
|
|
29
32
|
configStore.setProjectInfo({ version: currentVersion.toString() });
|
|
30
33
|
}
|
|
31
34
|
};
|
|
32
|
-
function
|
|
33
|
-
clm.step('Running migration 0.
|
|
35
|
+
function m0122() {
|
|
36
|
+
clm.step('Running migration 0.12.2...');
|
|
34
37
|
configStore.setProjectFlag('javaMemoryChecked', false);
|
|
38
|
+
installJava21();
|
|
39
|
+
}
|
|
40
|
+
function installJava21() {
|
|
41
|
+
const pilotDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), `../..`);
|
|
42
|
+
clm.debug(`Running install-java-21.sh from ${pilotDir}`);
|
|
43
|
+
const result = shell.exec('bash install-java-21.sh', { cwd: pilotDir });
|
|
44
|
+
if (result.code > 0) {
|
|
45
|
+
console.log(result.stderr);
|
|
46
|
+
clm.error(`Failed to install dependencies. Please try again after resolving any errors.`);
|
|
47
|
+
}
|
|
35
48
|
}
|
|
@@ -60,7 +60,7 @@ export const shellService = {
|
|
|
60
60
|
if (env) {
|
|
61
61
|
nodeEnv = { ...env, ...process.env };
|
|
62
62
|
}
|
|
63
|
-
clm.debug(`START Running command: "${command}" in directory: "${projectDir}"`);
|
|
63
|
+
clm.debug(`START Running command: "${command}" in directory: "${projectDir}"`); // with env: ${JSON.stringify(nodeEnv)}`);
|
|
64
64
|
return new Promise((resolve, reject) => {
|
|
65
65
|
shell.exec(command, { async: true, cwd: projectDir, env: nodeEnv, silent }, (code, stdout, stderr) => {
|
|
66
66
|
if (code === 0) {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Break on any error
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
check_java_home() {
|
|
8
|
+
# echo "Checking if JAVA_HOME env is set"
|
|
9
|
+
|
|
10
|
+
if [ -z "$JAVA_HOME" ] || ! grep -q 'JAVA_HOME' "$HOME/.bashrc"; then
|
|
11
|
+
JAVA_HOME_LINE='export JAVA_HOME="$(dirname "$(dirname "$(readlink -f "$(which java)")")")"'
|
|
12
|
+
echo "JAVA_HOME is not set. Attempting to set automatically"
|
|
13
|
+
echo "Please ensure the following line is in your ~/.bashrc or ~/.zshrc file:"
|
|
14
|
+
echo "Script will attempt to now add it for you and run it, but this only adds to .bashrc"
|
|
15
|
+
echo $JAVA_HOME_LINE
|
|
16
|
+
echo "$JAVA_HOME_LINE" >> $HOME/.bashrc
|
|
17
|
+
echo "Adding JAVA_HOME to current environment"
|
|
18
|
+
eval $JAVA_HOME_LINE
|
|
19
|
+
echo "JAVA_HOME is now set to: $JAVA_HOME"
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
# Check and install Java 21
|
|
25
|
+
check_java() {
|
|
26
|
+
# echo "Checking for Java 21..."
|
|
27
|
+
if command -v java >/dev/null 2>&1; then
|
|
28
|
+
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
|
|
29
|
+
# echo "Found Java version: $java_version"
|
|
30
|
+
if [[ "$java_version" == 21* ]] || [[ "$java_version" == 1.21* ]]; then
|
|
31
|
+
echo "✅ Java 21 is installed."
|
|
32
|
+
return 0
|
|
33
|
+
else
|
|
34
|
+
echo "⚠️ Java is installed but not version 21. Will attempt to install Java 21."
|
|
35
|
+
fi
|
|
36
|
+
else
|
|
37
|
+
echo "⚠️ Java not found. Will attempt to install Java 21."
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
case "$(uname)" in
|
|
42
|
+
Linux)
|
|
43
|
+
if command -v apt >/dev/null 2>&1; then
|
|
44
|
+
echo "Installing Java 21 using apt..."
|
|
45
|
+
sudo apt install -y openjdk-21-jdk
|
|
46
|
+
elif command -v yum >/dev/null 2>&1; then
|
|
47
|
+
echo "Installing Java 21 using yum..."
|
|
48
|
+
sudo yum install -y java-21-openjdk-devel
|
|
49
|
+
else
|
|
50
|
+
echo "⚠️ Unsupported Linux distribution. Please install Java 21 manually."
|
|
51
|
+
return 1
|
|
52
|
+
fi
|
|
53
|
+
;;
|
|
54
|
+
Darwin)
|
|
55
|
+
if command -v brew >/dev/null 2>&1; then
|
|
56
|
+
echo "Installing Java 21 using Homebrew..."
|
|
57
|
+
brew tap adoptopenjdk/openjdk
|
|
58
|
+
brew install --cask adoptopenjdk21
|
|
59
|
+
else
|
|
60
|
+
echo "⚠️ Homebrew not found. Please install Java 21 manually."
|
|
61
|
+
return 1
|
|
62
|
+
fi
|
|
63
|
+
;;
|
|
64
|
+
MINGW*|MSYS*|CYGWIN*)
|
|
65
|
+
echo "On Windows, please install Java 21 manually from https://adoptopenjdk.net/"
|
|
66
|
+
return 1
|
|
67
|
+
;;
|
|
68
|
+
*)
|
|
69
|
+
echo "⚠️ Unsupported OS: $(uname). Please install Java 21 manually."
|
|
70
|
+
return 1
|
|
71
|
+
;;
|
|
72
|
+
esac
|
|
73
|
+
|
|
74
|
+
echo "✅ Java 21 installation complete."
|
|
75
|
+
return 0
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
check_java
|
|
80
|
+
check_java_home
|
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.12.
|
|
4
|
+
"version": "0.12.4-devnet",
|
|
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 devnet"
|
|
25
25
|
},
|
|
26
26
|
"types": "dist/index.d.ts",
|
|
27
27
|
"engines": {
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"dist",
|
|
70
70
|
"oclif.manifest.json",
|
|
71
71
|
"install-dependencies.sh",
|
|
72
|
+
"install-java-21.sh",
|
|
72
73
|
"projects",
|
|
73
74
|
"scripts",
|
|
74
75
|
"README.md",
|
|
@@ -9,6 +9,10 @@ services:
|
|
|
9
9
|
# - /var/run/docker.sock:/var/run/docker.sock
|
|
10
10
|
gl0:
|
|
11
11
|
image: constellationnetwork/tessellation${CL_DOCKER_CORE_REPO:-}:${DOCKER_IMAGE_VERSION:-latest}
|
|
12
|
+
deploy:
|
|
13
|
+
resources:
|
|
14
|
+
limits:
|
|
15
|
+
memory: ${GL0_MEMORY_LIMIT:-0}
|
|
12
16
|
networks:
|
|
13
17
|
- tessellation-network
|
|
14
18
|
restart: unless-stopped
|