@nosana/node 1.1.2-rc → 1.1.4-rc
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/dist/package.json +1 -1
- package/dist/src/NodeManager/configs/configs.d.ts +1 -0
- package/dist/src/NodeManager/configs/configs.js +1 -0
- package/dist/src/NodeManager/monitoring/log/console/ConsoleLogger.js +5 -4
- package/dist/src/NodeManager/node/api/ApiHandler.js +0 -5
- package/dist/src/NodeManager/node/balance/balanceHandler.js +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { MultiBar, Presets, SingleBar } from 'cli-progress';
|
|
|
4
4
|
import { log } from '../NodeLog.js';
|
|
5
5
|
import { convertFromBytes } from '../../../utils/convertFromBytes.js';
|
|
6
6
|
import { formatTime } from '../../../utils/formatTime.js';
|
|
7
|
+
import { configs } from '../../../configs/configs.js';
|
|
7
8
|
export const consoleLogging = (() => {
|
|
8
9
|
let instance = null;
|
|
9
10
|
return () => {
|
|
@@ -47,7 +48,7 @@ export class ConsoleLogger {
|
|
|
47
48
|
if (isNode && this.taskManagerActive) {
|
|
48
49
|
this.spinner.succeed(renderBase + ' Exited');
|
|
49
50
|
}
|
|
50
|
-
this.spinner = ora(log.log).start();
|
|
51
|
+
this.spinner = ora({ text: log.log, interval: configs().spinnerInterval }).start();
|
|
51
52
|
}
|
|
52
53
|
if (this.kill) {
|
|
53
54
|
if (log.type == 'kill-success') {
|
|
@@ -83,7 +84,7 @@ export class ConsoleLogger {
|
|
|
83
84
|
this.expiry = log.payload?.expiry;
|
|
84
85
|
const startTime = Date.now();
|
|
85
86
|
const renderBar = (duration = 0) => `${renderBase} ${chalk.bgYellow.black.bold(` ⏱ Duration: ${formatTime(duration)} `)} ${chalk.reset('')} ${chalk.bgBlue.black.bold(` ⚡ Max Duration: ${formatTime(this.expiry ?? 0)} `)}`;
|
|
86
|
-
this.spinner = ora(renderBar(0)).start();
|
|
87
|
+
this.spinner = ora({ text: renderBar(0), interval: configs().spinnerInterval }).start();
|
|
87
88
|
this.taskManagerRunInterval = setInterval(() => {
|
|
88
89
|
if (this.taskManagerActive) {
|
|
89
90
|
const duration = (Date.now() - startTime) / 1000;
|
|
@@ -113,7 +114,7 @@ export class ConsoleLogger {
|
|
|
113
114
|
log.type == 'process') {
|
|
114
115
|
this.benchmarking = true;
|
|
115
116
|
this.pending = true;
|
|
116
|
-
this.spinner = ora(chalk.green(`${chalk.bgGreen.bold(' Checking Specs ')}`)).start();
|
|
117
|
+
this.spinner = ora({ text: chalk.green(`${chalk.bgGreen.bold(' Checking Specs ')}`), interval: configs().spinnerInterval }).start();
|
|
117
118
|
return;
|
|
118
119
|
}
|
|
119
120
|
if (this.benchmarking) {
|
|
@@ -289,7 +290,7 @@ export class ConsoleLogger {
|
|
|
289
290
|
if (log.pending?.isPending) {
|
|
290
291
|
this.pending = true;
|
|
291
292
|
this.expecting = log.pending?.expecting;
|
|
292
|
-
this.spinner = ora(log.log).start();
|
|
293
|
+
this.spinner = ora({ text: log.log, interval: configs().spinnerInterval }).start();
|
|
293
294
|
}
|
|
294
295
|
else {
|
|
295
296
|
console.log(log.log);
|
|
@@ -152,11 +152,6 @@ export class ApiHandler {
|
|
|
152
152
|
this.api.post('/job/:jobId/group/:group/operation/:opId/stop', stopOperationHandler);
|
|
153
153
|
this.api.post('/job/:jobId/group/:group/stop', stopGroupOperationHandler);
|
|
154
154
|
this.api.post('/job/:jobId/stop', postServiceStopRoute);
|
|
155
|
-
// Deprecated routes
|
|
156
|
-
this.api.get('/job-result/:jobId', getJobResultsRoute);
|
|
157
|
-
this.api.get('/service/url/:jobId', getServiceUrlRoute);
|
|
158
|
-
this.api.post('/job-definition/:jobId', postJobDefinitionRoute);
|
|
159
|
-
this.api.post('/service/stop/:jobId', postServiceStopRoute);
|
|
160
155
|
}
|
|
161
156
|
async listen() {
|
|
162
157
|
if (this.server) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ora from 'ora';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
+
import { configs } from '../../configs/configs';
|
|
3
4
|
const MINIMUM_SOL_BALANCE = 0.005;
|
|
4
5
|
const SOLANA_DECIMAL = 1e9;
|
|
5
6
|
export class BalanceHandler {
|
|
@@ -41,7 +42,7 @@ export class BalanceHandler {
|
|
|
41
42
|
if (!wait) {
|
|
42
43
|
throw new Error(insufficentSolMessage);
|
|
43
44
|
}
|
|
44
|
-
const spinner = ora(chalk.yellow(insufficentSolMessage)).start();
|
|
45
|
+
const spinner = ora({ text: chalk.yellow(insufficentSolMessage), interval: configs().spinnerInterval }).start();
|
|
45
46
|
await this.waitForSufficentSol();
|
|
46
47
|
spinner.succeed();
|
|
47
48
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosana/node",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4-rc",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@nosana/node",
|
|
9
|
-
"version": "1.1.
|
|
9
|
+
"version": "1.1.4-rc",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@coral-xyz/anchor": "^0.28.1-beta.1",
|