@constellation-network/node-pilot 0.18.9-testnet → 0.18.10-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.18.9-testnet darwin-arm64 node-v22.15.0
24
+ @constellation-network/node-pilot/0.18.10-testnet darwin-arm64 node-v22.15.0
25
25
  $ cpilot --help [COMMAND]
26
26
  USAGE
27
27
  $ cpilot COMMAND
@@ -72,7 +72,7 @@ EXAMPLES
72
72
  $ cpilot clean
73
73
  ```
74
74
 
75
- _See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/clean.ts)_
75
+ _See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/clean.ts)_
76
76
 
77
77
  ## `cpilot config`
78
78
 
@@ -89,7 +89,7 @@ EXAMPLES
89
89
  $ cpilot config
90
90
  ```
91
91
 
92
- _See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/config.ts)_
92
+ _See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/config.ts)_
93
93
 
94
94
  ## `cpilot config get [NAME]`
95
95
 
@@ -113,7 +113,7 @@ EXAMPLES
113
113
  $ cpilot config get gl0:CL_PUBLIC_HTTP_PORT
114
114
  ```
115
115
 
116
- _See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/config/get.ts)_
116
+ _See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/config/get.ts)_
117
117
 
118
118
  ## `cpilot config set NAME VALUE`
119
119
 
@@ -136,7 +136,7 @@ EXAMPLES
136
136
  $ cpilot config set gl0:CL_PUBLIC_HTTP_PORT 9000
137
137
  ```
138
138
 
139
- _See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/config/set.ts)_
139
+ _See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/config/set.ts)_
140
140
 
141
141
  ## `cpilot help [COMMAND]`
142
142
 
@@ -173,7 +173,7 @@ EXAMPLES
173
173
  $ cpilot info
174
174
  ```
175
175
 
176
- _See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/info.ts)_
176
+ _See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/info.ts)_
177
177
 
178
178
  ## `cpilot logs LAYER`
179
179
 
@@ -199,7 +199,7 @@ EXAMPLES
199
199
  $ cpilot logs
200
200
  ```
201
201
 
202
- _See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/logs.ts)_
202
+ _See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/logs.ts)_
203
203
 
204
204
  ## `cpilot restart [LAYER]`
205
205
 
@@ -223,7 +223,7 @@ EXAMPLES
223
223
  $ cpilot restart
224
224
  ```
225
225
 
226
- _See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/restart.ts)_
226
+ _See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/restart.ts)_
227
227
 
228
228
  ## `cpilot shutdown`
229
229
 
@@ -240,7 +240,7 @@ EXAMPLES
240
240
  $ cpilot shutdown
241
241
  ```
242
242
 
243
- _See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/shutdown.ts)_
243
+ _See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/shutdown.ts)_
244
244
 
245
245
  ## `cpilot status`
246
246
 
@@ -254,7 +254,7 @@ DESCRIPTION
254
254
  Display node status and configuration settings
255
255
  ```
256
256
 
257
- _See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/status.ts)_
257
+ _See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/status.ts)_
258
258
 
259
259
  ## `cpilot uninstall`
260
260
 
@@ -271,5 +271,5 @@ EXAMPLES
271
271
  $ cpilot uninstall
272
272
  ```
273
273
 
274
- _See code: [src/commands/uninstall.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.9-testnet/src/commands/uninstall.ts)_
274
+ _See code: [src/commands/uninstall.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.18.10-testnet/src/commands/uninstall.ts)_
275
275
  <!-- commandsstop -->
@@ -11,6 +11,7 @@ export default class Uninstall extends Command {
11
11
  '<%= config.bin %> <%= command.id %>',
12
12
  ];
13
13
  async run() {
14
+ await promptHelper.shutdownNodeIfRunning();
14
15
  const user = os.userInfo().username;
15
16
  clm.warn(`You are about to uninstall Node Pilot for ${chalk.cyan(user)}.\nThis will also remove all the data and logs from your validator node.`);
16
17
  await promptHelper.doYouWishToContinue();
@@ -28,7 +28,6 @@ export class PilotManager {
28
28
  async applyNewProjectStore(name, type) {
29
29
  const { appDir, projects } = this.pilotStore.getItem('pilot');
30
30
  const projectDir = path.join(appDir, name);
31
- console.log('applyNewProjectStore', name, projectDir);
32
31
  if (projects.includes(name)) {
33
32
  if (fs.existsSync(projectDir)) {
34
33
  const answer = await input({
@@ -60,7 +59,6 @@ export class PilotManager {
60
59
  }
61
60
  getActiveProject() {
62
61
  const { project } = this.pilotStore.getItem('pilot');
63
- console.log('getActiveProject', project, typeof project);
64
62
  return project;
65
63
  }
66
64
  getAppDir() {
@@ -75,7 +75,6 @@ export const projectHelper = {
75
75
  // TODO: verify all required env variables are present
76
76
  },
77
77
  async installEmbedded(embeddedName, projectName, projectType) {
78
- console.log('installEmbedded', embeddedName, projectName, projectType);
79
78
  const projectFolder = path.resolve(path.dirname(fileURLToPath(import.meta.url)), `../../projects/${embeddedName}`);
80
79
  if (!fs.existsSync(projectFolder)) {
81
80
  clm.error(`Project folder not found: ${projectFolder}`);
@@ -96,14 +95,6 @@ export const projectHelper = {
96
95
  this.importEnvFiles();
97
96
  },
98
97
  async installProject(name, type, projectFolder) {
99
- if (!pilotManager.hasProjects()) {
100
- // On first install, copy scripts
101
- const scriptsFolder = path.resolve(path.dirname(fileURLToPath(import.meta.url)), `../../scripts`);
102
- const projectDir = path.join(pilotManager.getAppDir(), 'scripts');
103
- clm.debug(`Installing node pilot scripts from ${scriptsFolder} to ${projectDir}`);
104
- fs.mkdirSync(projectDir, { recursive: true });
105
- fs.cpSync(scriptsFolder, projectDir, { recursive: true });
106
- }
107
98
  await pilotManager.applyNewProjectStore(name, type);
108
99
  const { projectDir } = configStore.getProjectInfo();
109
100
  clm.debug(`Installing project from ${projectFolder} to ${projectDir}`);
@@ -392,5 +392,5 @@
392
392
  ]
393
393
  }
394
394
  },
395
- "version": "0.18.9-testnet"
395
+ "version": "0.18.10-testnet"
396
396
  }
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.18.9-testnet",
4
+ "version": "0.18.10-testnet",
5
5
  "author": "Frank Fox",
6
6
  "bin": {
7
7
  "cpilot": "bin/run.js"
package/dist/test.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/test.js DELETED
@@ -1,50 +0,0 @@
1
- import * as crypto from "node:crypto";
2
- // convert base64 to hex
3
- const val = 'MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgeYLAOmnJ6FYQ3Uddr6lq5PEVgoiAdWIJ89x6fx3n8JihRANCAASNoaVq/vT5k5Akdzjv8ifybl9icGnMKRpeyZhOxTMnwxGjxANTuKLfUGWUOEngV6HaWGxgkXTU/VXRma+mu0hD';
4
- // const val = 'MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgKy/2tKuoO5V0iXJmTlaWPl9PeDo8TO5ZD+JmD3pOlzihRANCAASffXYMsILTOYSM4pEuBiYO1RR/hfuO+k4WvnNup21HT7CGThWfRjIemS3QDMHncK0Shsy43nb6kD9Fo8DTKpI6';
5
- const der = Buffer.from(val, 'base64').toString('hex');
6
- console.log(der);
7
- // convert DER to PEM
8
- const ecKey = crypto.createPrivateKey({
9
- encoding: "base64",
10
- format: "der",
11
- key: val,
12
- type: "pkcs8",
13
- });
14
- console.log(ecKey.export({ 'format': 'jwk' }));
15
- // Generate an RSA key pair
16
- const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
17
- modulusLength: 2048, // Recommended key size
18
- privateKeyEncoding: {
19
- format: 'der', // DER encoding for binary output
20
- type: 'pkcs8' // PKCS#8 format
21
- },
22
- publicKeyEncoding: {
23
- format: 'der',
24
- type: 'spki' // SubjectPublicKeyInfo
25
- }
26
- });
27
- // The 'privateKey' variable now holds a Buffer containing the PKCS#8 DER private key.
28
- // To get the Base64 encoded string:
29
- const privateKeyBase64 = privateKey.toString('base64');
30
- console.log('PKCS#8 DER Private Key (Base64):');
31
- console.log(privateKeyBase64);
32
- // openssl pkcs8 -inform DER -in privatekey.der -outform PEM -out privatekey.pem
33
- // openssl pkcs8 -inform DER -in privatekey.der -nocrypt -out privatekey.pem -traditional
34
- async function createP256Pkcs8DerBase64PrivateKey() {
35
- // Generate an ECDSA key pair with the P-256 named curve
36
- const keyPair = await crypto.subtle.generateKey({
37
- name: 'ECDSA',
38
- namedCurve: 'P-256',
39
- }, true, // extractable
40
- ['sign', 'verify']);
41
- // Export the private key in PKCS#8 DER format
42
- const privateKeyDerBuffer = await crypto.subtle.exportKey('pkcs8', // format
43
- keyPair.privateKey);
44
- console.log('PKCS#8 DER Private Key (DER Buffer): ' + Buffer.from(privateKeyDerBuffer).toString('hex'));
45
- // Convert the DER buffer to a Base64 encoded string
46
- const privateKeyBase64 = Buffer.from(privateKeyDerBuffer).toString('base64');
47
- console.log('PKCS#8 DER Private Key (Base64):' + privateKeyBase64);
48
- return privateKeyBase64;
49
- }
50
- await createP256Pkcs8DerBase64PrivateKey();
@@ -1,11 +0,0 @@
1
- [Unit]
2
- Description=Constellation Node Pilot Updater Service
3
- After=default.target
4
-
5
- [Service]
6
- ExecStart=/bin/bash -lc "echo $HOME : $(which node) >> /home/ubuntu/service.log"
7
- Restart=always
8
- RestartSec=5m
9
-
10
- [Install]
11
- WantedBy=default.target