@constellation-network/node-pilot 0.0.1
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 +213 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +19 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +15 -0
- package/dist/checks/check-hardware.d.ts +3 -0
- package/dist/checks/check-hardware.js +50 -0
- package/dist/checks/check-initial-setup.d.ts +3 -0
- package/dist/checks/check-initial-setup.js +15 -0
- package/dist/checks/check-layers.d.ts +7 -0
- package/dist/checks/check-layers.js +87 -0
- package/dist/checks/check-network.d.ts +6 -0
- package/dist/checks/check-network.js +72 -0
- package/dist/checks/check-project.d.ts +6 -0
- package/dist/checks/check-project.js +108 -0
- package/dist/clm.d.ts +9 -0
- package/dist/clm.js +30 -0
- package/dist/commands/config/get.d.ts +9 -0
- package/dist/commands/config/get.js +37 -0
- package/dist/commands/config/set.d.ts +11 -0
- package/dist/commands/config/set.js +41 -0
- package/dist/commands/config.d.ts +6 -0
- package/dist/commands/config.js +65 -0
- package/dist/commands/info.d.ts +6 -0
- package/dist/commands/info.js +32 -0
- package/dist/commands/logs.d.ts +12 -0
- package/dist/commands/logs.js +28 -0
- package/dist/commands/restart.d.ts +6 -0
- package/dist/commands/restart.js +25 -0
- package/dist/commands/shutdown.d.ts +6 -0
- package/dist/commands/shutdown.js +18 -0
- package/dist/commands/status.d.ts +6 -0
- package/dist/commands/status.js +22 -0
- package/dist/commands/test.d.ts +6 -0
- package/dist/commands/test.js +13 -0
- package/dist/config-store.d.ts +109 -0
- package/dist/config-store.js +151 -0
- package/dist/helpers/config-helper.d.ts +14 -0
- package/dist/helpers/config-helper.js +39 -0
- package/dist/helpers/docker-helper.d.ts +7 -0
- package/dist/helpers/docker-helper.js +37 -0
- package/dist/helpers/env-templates.d.ts +4 -0
- package/dist/helpers/env-templates.js +33 -0
- package/dist/helpers/github-helper.d.ts +3 -0
- package/dist/helpers/github-helper.js +13 -0
- package/dist/helpers/key-file-helper.d.ts +9 -0
- package/dist/helpers/key-file-helper.js +136 -0
- package/dist/helpers/project-helper.d.ts +9 -0
- package/dist/helpers/project-helper.js +85 -0
- package/dist/helpers/prompt-helper.d.ts +8 -0
- package/dist/helpers/prompt-helper.js +135 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/info/cluster-info.d.ts +1 -0
- package/dist/info/cluster-info.js +16 -0
- package/dist/services/cluster-service.d.ts +9 -0
- package/dist/services/cluster-service.js +67 -0
- package/dist/services/fastforward-service.d.ts +14 -0
- package/dist/services/fastforward-service.js +84 -0
- package/dist/services/node-service.d.ts +10 -0
- package/dist/services/node-service.js +117 -0
- package/dist/services/shell-service.d.ts +9 -0
- package/dist/services/shell-service.js +53 -0
- package/dist/styles.d.ts +4 -0
- package/dist/styles.js +5 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.js +1 -0
- package/oclif.manifest.json +241 -0
- package/package.json +98 -0
- package/projects/hypergraph/Dockerfile +41 -0
- package/projects/hypergraph/docker-compose.yml +54 -0
- package/projects/hypergraph/entrypoint.sh +35 -0
- package/projects/hypergraph/layers/gl1.env +3 -0
- package/projects/hypergraph/networks/integrationnet.env +9 -0
- package/projects/hypergraph/networks/mainnet.env +8 -0
- package/projects/hypergraph/networks/testnet.env +9 -0
- package/projects/hypergraph/pilot.env +2 -0
- package/projects/hypergraph/scripts/docker-build.sh +7 -0
- package/projects/hypergraph/scripts/install-dependencies.sh +318 -0
- package/projects/hypergraph/scripts/install.sh +149 -0
- package/projects/scripts/docker-cleanup.sh +64 -0
@@ -0,0 +1,64 @@
|
|
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
|