@constellation-network/node-pilot 0.0.7 → 0.0.9
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 +26 -18
- package/bin/dev.js +1 -6
- package/bin/run.js +1 -1
- package/dist/base-command.d.ts +9 -0
- package/dist/base-command.js +20 -0
- package/dist/checks/check-dependencies.d.ts +1 -0
- package/dist/checks/check-dependencies.js +44 -0
- package/dist/checks/check-hardware.js +3 -3
- package/dist/checks/check-initial-setup.js +6 -4
- package/dist/checks/check-layers.js +7 -7
- package/dist/checks/check-network.d.ts +3 -0
- package/dist/checks/check-network.js +92 -9
- package/dist/checks/check-node-ctl.d.ts +5 -0
- package/dist/checks/check-node-ctl.js +88 -0
- package/dist/checks/check-project.js +33 -13
- package/dist/checks/check-wallet.d.ts +3 -0
- package/dist/checks/check-wallet.js +37 -0
- package/dist/clm.d.ts +1 -0
- package/dist/clm.js +4 -1
- package/dist/commands/config/get.d.ts +6 -0
- package/dist/commands/config/get.js +57 -11
- package/dist/commands/config/set.d.ts +0 -1
- package/dist/commands/config/set.js +13 -11
- package/dist/commands/config.js +17 -22
- package/dist/commands/info.js +3 -2
- package/dist/commands/logs.d.ts +2 -1
- package/dist/commands/logs.js +12 -6
- package/dist/commands/restart.d.ts +5 -2
- package/dist/commands/restart.js +25 -5
- package/dist/commands/shutdown.js +3 -3
- package/dist/commands/status.js +8 -0
- package/dist/commands/test.d.ts +1 -0
- package/dist/commands/test.js +35 -5
- package/dist/config-store.d.ts +50 -34
- package/dist/config-store.js +80 -32
- package/dist/helpers/config-helper.js +2 -2
- package/dist/helpers/env-templates.d.ts +4 -3
- package/dist/helpers/env-templates.js +28 -20
- package/dist/helpers/key-file-helper.d.ts +2 -0
- package/dist/helpers/key-file-helper.js +52 -17
- package/dist/helpers/project-helper.d.ts +3 -2
- package/dist/helpers/project-helper.js +86 -35
- package/dist/helpers/prompt-helper.d.ts +0 -2
- package/dist/helpers/prompt-helper.js +15 -66
- package/dist/services/archiver-service.d.ts +17 -0
- package/dist/services/archiver-service.js +104 -0
- package/dist/services/cluster-service.d.ts +10 -5
- package/dist/services/cluster-service.js +46 -36
- package/dist/services/docker-service.d.ts +9 -0
- package/dist/services/docker-service.js +53 -0
- package/dist/services/fastforward-service.js +12 -6
- package/dist/services/get-random-node.d.ts +2 -0
- package/dist/services/get-random-node.js +16 -0
- package/dist/{helpers/github-helper.d.ts → services/github-service.d.ts} +1 -1
- package/dist/{helpers/github-helper.js → services/github-service.js} +1 -1
- package/dist/services/node-service.d.ts +4 -0
- package/dist/services/node-service.js +29 -14
- package/dist/services/shell-service.d.ts +3 -1
- package/dist/services/shell-service.js +32 -6
- package/dist/test.d.ts +1 -0
- package/dist/test.js +50 -0
- package/dist/types.d.ts +42 -3
- package/install-dependencies.sh +98 -0
- package/oclif.manifest.json +31 -4
- package/package.json +12 -8
- package/projects/hypergraph/Dockerfile +27 -18
- package/projects/hypergraph/docker-compose.yml +14 -12
- package/projects/hypergraph/networks/integrationnet/gl0.env +4 -0
- package/projects/hypergraph/networks/integrationnet/gl1.env +4 -0
- package/projects/hypergraph/networks/integrationnet/network.env +8 -0
- package/projects/hypergraph/networks/integrationnet/source-nodes.env +9 -0
- package/projects/hypergraph/networks/mainnet/gl0.env +4 -0
- package/projects/hypergraph/networks/mainnet/gl1.env +4 -0
- package/projects/hypergraph/networks/mainnet/network.env +8 -0
- package/projects/hypergraph/networks/mainnet/source-nodes.env +9 -0
- package/projects/hypergraph/networks/testnet/gl0.env +5 -0
- package/projects/hypergraph/networks/testnet/gl1.env +4 -0
- package/projects/hypergraph/networks/testnet/network.env +8 -0
- package/projects/hypergraph/networks/testnet/source-nodes.env +9 -0
- package/projects/hypergraph/scripts/check-version.sh +31 -0
- package/projects/hypergraph/scripts/docker-build.sh +12 -1
- package/projects/hypergraph/scripts/install-dependencies.sh +3 -3
- package/projects/hypergraph/scripts/install.sh +34 -31
- package/projects/hypergraph/seedlist +268 -0
- package/scripts/autoheal.sh +8 -0
- package/scripts/services/io.constellationnetwork.nodepilot.Updater.plist +16 -0
- package/scripts/services/node-pilot-autoheal.service +14 -0
- package/scripts/services/node-pilot-updater-hypergraph.service +15 -0
- package/scripts/updater.sh +13 -0
- package/dist/helpers/docker-helper.d.ts +0 -7
- package/dist/helpers/docker-helper.js +0 -37
- package/projects/hypergraph/layers/gl1.env +0 -3
- package/projects/hypergraph/networks/integrationnet.env +0 -9
- package/projects/hypergraph/networks/mainnet.env +0 -8
- package/projects/hypergraph/networks/testnet.env +0 -9
- package/projects/scripts/docker-cleanup.sh +0 -64
@@ -1,37 +0,0 @@
|
|
1
|
-
import { clm } from "../clm.js";
|
2
|
-
import { configStore } from "../config-store.js";
|
3
|
-
import { shellService } from "../services/shell-service.js";
|
4
|
-
import { projectHelper } from "./project-helper.js";
|
5
|
-
export const dockerHelper = {
|
6
|
-
async dockerBuild() {
|
7
|
-
if (shellService.existsScript('scripts/docker-build.sh')) {
|
8
|
-
clm.preStep('Building the node container...');
|
9
|
-
await shellService.runCommand('bash scripts/docker-build.sh');
|
10
|
-
}
|
11
|
-
},
|
12
|
-
async dockerDown() {
|
13
|
-
await run('down');
|
14
|
-
},
|
15
|
-
async dockerRestart() {
|
16
|
-
await run('restart');
|
17
|
-
},
|
18
|
-
async dockerUp() {
|
19
|
-
// If docker is already running, stop it
|
20
|
-
if (await this.isRunning()) {
|
21
|
-
await this.dockerDown();
|
22
|
-
}
|
23
|
-
await projectHelper.generateLayerEnvFiles();
|
24
|
-
// const userId = await shellService.runCommandWithOutput('echo "$(id -u):$(id -g)"')
|
25
|
-
// console.log('Setting DOCKER_USER_ID to', userId);
|
26
|
-
// configStore.setDockerEnvInfo({ DOCKER_USER_ID: userId });
|
27
|
-
await run('up -d');
|
28
|
-
},
|
29
|
-
async isRunning() {
|
30
|
-
return shellService.runCommand('docker ps | grep entrypoint.sh', undefined, true).then(() => true).catch(() => false);
|
31
|
-
}
|
32
|
-
};
|
33
|
-
function run(command, layers) {
|
34
|
-
const { layersToRun } = configStore.getProjectInfo();
|
35
|
-
const args = (layers || layersToRun).map(l => `--profile ${l}`).join(' ');
|
36
|
-
return shellService.runCommand(`docker compose ${args} ${command}`, configStore.getDockerEnvInfo());
|
37
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
CL_APP_ENV="integrationnet"
|
2
|
-
CL_COLLATERAL=0
|
3
|
-
CL_L0_PEER_HTTP_PORT="9000"
|
4
|
-
CL_L0_PEER_HTTP_HOST="13.52.205.240"
|
5
|
-
CL_L0_PEER_ID="e2f4496e5872682d7a55aa06e507a58e96b5d48a5286bfdff7ed780fa464d9e789b2760ecd840f4cb3ee6e1c1d81b2ee844c88dbebf149b1084b7313eb680714"
|
6
|
-
CL_GLOBAL_L0_PEER_HTTP_PORT="9000"
|
7
|
-
CL_GLOBAL_L0_PEER_HOST="13.52.205.240"
|
8
|
-
CL_GLOBAL_L0_PEER_ID="e2f4496e5872682d7a55aa06e507a58e96b5d48a5286bfdff7ed780fa464d9e789b2760ecd840f4cb3ee6e1c1d81b2ee844c88dbebf149b1084b7313eb680714"
|
9
|
-
|
@@ -1,8 +0,0 @@
|
|
1
|
-
CL_APP_ENV="mainnet"
|
2
|
-
CL_COLLATERAL=25000000000000
|
3
|
-
CL_L0_PEER_HTTP_PORT="9000"
|
4
|
-
CL_L0_PEER_HTTP_HOST="52.53.46.33"
|
5
|
-
CL_L0_PEER_ID="e0c1ee6ec43510f0e16d2969a7a7c074a5c8cdb477c074fe9c32a9aad8cbc8ff1dff60bb81923e0db437d2686a9b65b86c403e6a21fa32b6acc4e61be4d70925"
|
6
|
-
CL_GLOBAL_L0_PEER_HTTP_PORT="9000"
|
7
|
-
CL_GLOBAL_L0_PEER_HOST="52.53.46.33"
|
8
|
-
CL_GLOBAL_L0_PEER_ID="e0c1ee6ec43510f0e16d2969a7a7c074a5c8cdb477c074fe9c32a9aad8cbc8ff1dff60bb81923e0db437d2686a9b65b86c403e6a21fa32b6acc4e61be4d70925"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
CL_APP_ENV="testnet"
|
2
|
-
CL_COLLATERAL=0
|
3
|
-
CL_L0_PEER_HTTP_PORT="9000"
|
4
|
-
CL_L0_PEER_HTTP_HOST="52.8.132.193"
|
5
|
-
CL_L0_PEER_ID="e2f4496e5872682d7a55aa06e507a58e96b5d48a5286bfdff7ed780fa464d9e789b2760ecd840f4cb3ee6e1c1d81b2ee844c88dbebf149b1084b7313eb680714"
|
6
|
-
CL_GLOBAL_L0_PEER_HTTP_PORT="9000"
|
7
|
-
CL_GLOBAL_L0_PEER_HOST="52.8.132.193"
|
8
|
-
CL_GLOBAL_L0_PEER_ID="e2f4496e5872682d7a55aa06e507a58e96b5d48a5286bfdff7ed780fa464d9e789b2760ecd840f4cb3ee6e1c1d81b2ee844c88dbebf149b1084b7313eb680714"
|
9
|
-
|
@@ -1,64 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -e
|
3
|
-
|
4
|
-
echo "Stopping and removing service containers..."
|
5
|
-
|
6
|
-
cleanup_container() {
|
7
|
-
local name=$1
|
8
|
-
local vol=$2
|
9
|
-
docker stop $name 2>/dev/null || true
|
10
|
-
docker rm -f $name 2>/dev/null || true
|
11
|
-
docker volume rm ${vol} 2>/dev/null || true
|
12
|
-
}
|
13
|
-
|
14
|
-
cleanup() {
|
15
|
-
cleanup_container gl0 gl0-data
|
16
|
-
cleanup_container gl1 gl1-data
|
17
|
-
cleanup_container dl1 dl1-data
|
18
|
-
cleanup_container ml0 ml0-data
|
19
|
-
cleanup_container cl1 cl1-data
|
20
|
-
}
|
21
|
-
|
22
|
-
cleanup
|
23
|
-
|
24
|
-
export CLEANUP_PID=$!
|
25
|
-
# 8. Remove the network with better error handling and retry logic
|
26
|
-
echo "Removing tessellation-network network..."
|
27
|
-
while true; do
|
28
|
-
output=$(docker network rm tessellation-network 2>&1) || true
|
29
|
-
if [[ $output == *"not found"* ]]; then
|
30
|
-
echo "Network removed successfully"
|
31
|
-
break
|
32
|
-
elif [[ $output != *"has active endpoints"* ]]; then
|
33
|
-
# If the error message is not present, break the loop
|
34
|
-
echo "Network removed successfully or encountered a different error. Output below"
|
35
|
-
echo $output
|
36
|
-
break
|
37
|
-
fi
|
38
|
-
echo "Network has active endpoints, retrying in 1 second..."
|
39
|
-
sleep 1
|
40
|
-
done
|
41
|
-
|
42
|
-
echo "Waiting for cleanup to finish..."
|
43
|
-
wait $CLEANUP_PID
|
44
|
-
|
45
|
-
# 3. Find and kill any lingering processes binding to tessellation ports
|
46
|
-
|
47
|
-
# TODO: Update this to use new port offsets
|
48
|
-
check_port_binds() {
|
49
|
-
if [ "$CHECK_PORT_BINDS" == "true" ]; then
|
50
|
-
echo "Checking for lingering processes on common ports... -- this requires sudo"
|
51
|
-
for base_port in 9000 9001 9002 9010 9011 9012; do
|
52
|
-
for prefix in "" "1" "2"; do
|
53
|
-
port="${prefix}${base_port}"
|
54
|
-
pid=$(sudo lsof -i:$port -t 2>/dev/null || true)
|
55
|
-
if [ -n "$pid" ]; then
|
56
|
-
echo "Found process $pid on port $port"
|
57
|
-
return 0
|
58
|
-
fi
|
59
|
-
done
|
60
|
-
done
|
61
|
-
fi
|
62
|
-
}
|
63
|
-
|
64
|
-
check_port_binds
|