@constellation-network/node-pilot 0.22.0-intnet → 0.23.0-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 +11 -11
- package/dist/checks/check-project.js +1 -0
- package/dist/services/cluster-service.d.ts +5 -5
- package/dist/services/cluster-service.js +15 -4
- package/dist/services/delegated-staking-service.d.ts +2 -19
- package/dist/services/fastforward-service.js +12 -11
- package/dist/types.d.ts +27 -0
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
- package/projects/hypergraph/Dockerfile +1 -1
- package/projects/custom/pilot.json +0 -9
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.
|
|
24
|
+
@constellation-network/node-pilot/0.23.0-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.
|
|
75
|
+
_See code: [src/commands/clean.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
92
|
+
_See code: [src/commands/config.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
116
|
+
_See code: [src/commands/config/get.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
139
|
+
_See code: [src/commands/config/set.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
176
|
+
_See code: [src/commands/info.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
202
|
+
_See code: [src/commands/logs.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
226
|
+
_See code: [src/commands/restart.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
243
|
+
_See code: [src/commands/shutdown.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
257
|
+
_See code: [src/commands/status.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-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.
|
|
274
|
+
_See code: [src/commands/uninstall.ts](https://github.com/Constellation-Labs/node-pilot/blob/v0.23.0-testnet/src/commands/uninstall.ts)_
|
|
275
275
|
<!-- commandsstop -->
|
|
@@ -79,6 +79,7 @@ export const checkProject = {
|
|
|
79
79
|
configStore.setProjectFlag('javaMemoryChecked', true);
|
|
80
80
|
},
|
|
81
81
|
async hasVersionChanged() {
|
|
82
|
+
clm.debug('Checking for network version change...');
|
|
82
83
|
const clusterVersion = await clusterService.getReleaseVersion();
|
|
83
84
|
const rInfo = await configHelper.getReleaseInfo();
|
|
84
85
|
return !rInfo || (rInfo.version !== clusterVersion);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ClusterConsensusInfo, ClusterInfo, NodeInfo, TessellationLayer } from "../types.js";
|
|
1
|
+
import { ClusterConsensusInfo, ClusterInfo, NodeInfo, NodeParamsDto, TessellationLayer } from "../types.js";
|
|
2
2
|
export declare const clusterService: {
|
|
3
3
|
fastForwardSnapshot(): Promise<void>;
|
|
4
4
|
getClusterInfo(layer?: TessellationLayer): Promise<ClusterInfo[]>;
|
|
5
5
|
getClusterNodeInfo(layer?: TessellationLayer): Promise<NodeInfo>;
|
|
6
6
|
getLatestConsensusInfo(layer?: TessellationLayer): Promise<ClusterConsensusInfo>;
|
|
7
7
|
getLayer0(): "gl0" | "ml0";
|
|
8
|
-
getNodeParams(id: string): Promise<
|
|
9
|
-
getReleaseVersion(): Promise<
|
|
8
|
+
getNodeParams(id: string): Promise<NodeParamsDto>;
|
|
9
|
+
getReleaseVersion(): Promise<string>;
|
|
10
10
|
getSourceNodeInfo(layer: TessellationLayer): Promise<NodeInfo>;
|
|
11
11
|
getSourceNodeLatestOrdinal(layer: TessellationLayer): Promise<number>;
|
|
12
12
|
getSourceNodeOrdinalHash(layer: TessellationLayer, ordinal: number): Promise<string>;
|
|
13
|
-
makeClusterRequestGet(path: string, layer?: TessellationLayer, params?: string): Promise<
|
|
13
|
+
makeClusterRequestGet<T>(path: string, layer?: TessellationLayer, params?: string): Promise<T>;
|
|
14
14
|
makeClusterRequestPost(path: string, body: string, layer?: TessellationLayer): Promise<any>;
|
|
15
|
-
makeRandomSourceNodeRequest(path: string, layer?: TessellationLayer): Promise<
|
|
15
|
+
makeRandomSourceNodeRequest<T>(path: string, layer?: TessellationLayer): Promise<T>;
|
|
16
16
|
makeSourceNodeRequest(path: string, layer: TessellationLayer): Promise<any>;
|
|
17
17
|
postNodeParams(body: string, layer?: TessellationLayer): Promise<string>;
|
|
18
18
|
};
|
|
@@ -60,7 +60,12 @@ export const clusterService = {
|
|
|
60
60
|
return this.makeClusterRequestGet(`node-params/${id}`, 'gl0');
|
|
61
61
|
},
|
|
62
62
|
async getReleaseVersion() {
|
|
63
|
-
|
|
63
|
+
clm.debug('Getting release version...');
|
|
64
|
+
return this.makeRandomSourceNodeRequest('node/info').then(i => i.version)
|
|
65
|
+
.catch(() => {
|
|
66
|
+
clm.debug(`Failed to get random source node. Attempting cluster node...`);
|
|
67
|
+
return this.makeClusterRequestGet('node/info').then(i => i.version);
|
|
68
|
+
});
|
|
64
69
|
},
|
|
65
70
|
async getSourceNodeInfo(layer) {
|
|
66
71
|
return this.makeRandomSourceNodeRequest('node/info', layer);
|
|
@@ -76,7 +81,9 @@ export const clusterService = {
|
|
|
76
81
|
const { type } = configStore.getNetworkInfo();
|
|
77
82
|
const envLayerInfo = configStore.getEnvLayerInfo(type, layer);
|
|
78
83
|
if (envLayerInfo.CL_LB) {
|
|
79
|
-
|
|
84
|
+
const url = `${envLayerInfo.CL_LB}/${path}${params}`;
|
|
85
|
+
clm.debug(`makeClusterRequestGet ${url}`);
|
|
86
|
+
return fetch(url)
|
|
80
87
|
.then(res => {
|
|
81
88
|
if (res.ok) {
|
|
82
89
|
return res.json();
|
|
@@ -88,8 +95,12 @@ export const clusterService = {
|
|
|
88
95
|
throw new Error('Error');
|
|
89
96
|
})
|
|
90
97
|
.catch(() => {
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
if (!params) {
|
|
99
|
+
return this.makeClusterRequestGet(path, layer, '?sticky=false');
|
|
100
|
+
}
|
|
101
|
+
// clm.debug(`Failed to get cluster GET from ${envLayerInfo.CL_LB}/${path}. Attempting source node...`);
|
|
102
|
+
// return this.makeRandomSourceNodeRequest(path, layer);
|
|
103
|
+
throw new Error(`Unable to connect to cluster at ${envLayerInfo.CL_LB}/${path}`);
|
|
93
104
|
});
|
|
94
105
|
}
|
|
95
106
|
return this.makeSourceNodeRequest(path, layer);
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
+
import { NodeParams } from "../types.js";
|
|
1
2
|
export declare const delegatedStakingService: {
|
|
2
3
|
configureNodeParams(): Promise<void>;
|
|
3
4
|
generateNodeParamPayload(rewardFraction: number, name: string, description: string, lastRef: {
|
|
4
5
|
hash: string;
|
|
5
6
|
ordinal: number;
|
|
6
7
|
}): Promise<string>;
|
|
7
|
-
getNodeParams(): Promise<
|
|
8
|
-
description: string;
|
|
9
|
-
lastRef: {
|
|
10
|
-
hash: string;
|
|
11
|
-
ordinal: number;
|
|
12
|
-
};
|
|
13
|
-
name: string;
|
|
14
|
-
rewardFraction: number;
|
|
15
|
-
reward?: undefined;
|
|
16
|
-
} | {
|
|
17
|
-
description: string;
|
|
18
|
-
lastRef: {
|
|
19
|
-
hash: string;
|
|
20
|
-
ordinal: number;
|
|
21
|
-
};
|
|
22
|
-
name: string;
|
|
23
|
-
reward: number;
|
|
24
|
-
rewardFraction?: undefined;
|
|
25
|
-
}>;
|
|
8
|
+
getNodeParams(): Promise<NodeParams>;
|
|
26
9
|
};
|
|
@@ -54,19 +54,20 @@ export class FastforwardService {
|
|
|
54
54
|
clm.postStep(`✅ Fastforward to snapshot ${chalk.bold(ordinal)} completed.`);
|
|
55
55
|
}
|
|
56
56
|
async fetchLatestSnapshot() {
|
|
57
|
+
const processResult = (d) => {
|
|
58
|
+
const { ordinal } = d[0].value;
|
|
59
|
+
clm.debug('fetchLatestSnapshot - ' + chalk.cyan(ordinal));
|
|
60
|
+
return [ordinal, d[0], d[1]];
|
|
61
|
+
};
|
|
57
62
|
const url = `${this.lbUrl}/global-snapshots/latest/combined?source_node=true&sticky=false`;
|
|
58
|
-
clm.debug('Fetching latest snapshot
|
|
63
|
+
clm.debug('Fetching latest snapshot from a source node: ' + chalk.cyan(url));
|
|
59
64
|
return fetch(url)
|
|
60
|
-
.then(res =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.then(data => {
|
|
67
|
-
const { ordinal } = data[0].value;
|
|
68
|
-
clm.debug('fetchLatestSnapshot - ' + chalk.cyan(ordinal));
|
|
69
|
-
return [ordinal, data[0], data[1]];
|
|
65
|
+
.then(res => res.json())
|
|
66
|
+
.then(processResult)
|
|
67
|
+
.catch(() => {
|
|
68
|
+
const url = `${this.lbUrl}/global-snapshots/latest/combined?sticky=false`;
|
|
69
|
+
clm.debug('FALLBACK: Fetching latest snapshot from cluster: ' + chalk.cyan(url));
|
|
70
|
+
return fetch(url).then(res => res.json()).then(processResult);
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
async fetchSnapshot(ordinal) {
|
package/dist/types.d.ts
CHANGED
|
@@ -51,3 +51,30 @@ export type NodeDiagnosticInfo = {
|
|
|
51
51
|
state: string;
|
|
52
52
|
version: string;
|
|
53
53
|
};
|
|
54
|
+
export type NodeParamsDto = {
|
|
55
|
+
"lastRef": {
|
|
56
|
+
"hash": string;
|
|
57
|
+
"ordinal": number;
|
|
58
|
+
};
|
|
59
|
+
"latest": {
|
|
60
|
+
"value": {
|
|
61
|
+
"delegatedStakeRewardParameters": {
|
|
62
|
+
"rewardFraction": number;
|
|
63
|
+
};
|
|
64
|
+
"nodeMetadataParameters": {
|
|
65
|
+
"description": string;
|
|
66
|
+
"name": string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type NodeParams = {
|
|
72
|
+
description: string;
|
|
73
|
+
lastRef: {
|
|
74
|
+
hash: string;
|
|
75
|
+
ordinal: number;
|
|
76
|
+
};
|
|
77
|
+
name: string;
|
|
78
|
+
reward?: number;
|
|
79
|
+
rewardFraction?: number;
|
|
80
|
+
};
|
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.
|
|
4
|
+
"version": "0.23.0-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 --tag
|
|
24
|
+
"pub": "npm publish --access public --tag testnet"
|
|
25
25
|
},
|
|
26
26
|
"types": "dist/index.d.ts",
|
|
27
27
|
"engines": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"dist",
|
|
70
70
|
"oclif.manifest.json",
|
|
71
71
|
"install-dependencies.sh",
|
|
72
|
-
"projects",
|
|
72
|
+
"projects/hypergraph",
|
|
73
73
|
"scripts",
|
|
74
74
|
"README.md",
|
|
75
75
|
"LICENSE",
|
|
@@ -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.
|
|
42
|
+
RUN npm install -g "@constellation-network/node-pilot-health-check@0.0.39"
|
|
43
43
|
|
|
44
44
|
# Add entrypoint
|
|
45
45
|
COPY ./entrypoint.sh /app/entrypoint.sh
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "custom",
|
|
3
|
-
"projects": [
|
|
4
|
-
{ "name": "hg-intnet-1", "network": "intnet", "key": "key1.p12", "layers": "gl0" },
|
|
5
|
-
{ "name": "hg-intnet-2", "network": "intnet", "key": "key2.p12", "layers": "gl0" },
|
|
6
|
-
{ "name": "hg-intnet-3", "network": "intnet", "key": "key3.p12", "layers": "gl0" }
|
|
7
|
-
]
|
|
8
|
-
}
|
|
9
|
-
|