@nosana/node 1.1.81 → 1.1.82
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/.env +1 -1
- package/dist/package.json +6 -6
- package/dist/packages/job-runtime/src/api/middlewares/verifyJobOwnerSignature.d.ts +0 -4
- package/dist/packages/job-runtime/src/api/middlewares/verifyJobOwnerSignature.js +1 -7
- package/dist/packages/job-runtime/src/api/middlewares/verifyWSSignatures.js +1 -2
- package/dist/packages/job-runtime/src/api/types.d.ts +5 -17
- package/dist/src/NodeManager/node/api/middlewares/ws/verifyWSJobOwnerSignatureMiddleware.js +1 -2
- package/dist/src/NodeManager/node/balance/balanceHandler.js +3 -5
- package/dist/src/NodeManager/node/job/JobRegistry.d.ts +0 -8
- package/dist/src/NodeManager/node/job/JobRegistry.js +1 -52
- package/dist/src/NodeManager/node/job/jobHandler.d.ts +6 -0
- package/dist/src/NodeManager/node/job/jobHandler.js +26 -42
- package/dist/src/NodeManager/node/market/marketAccess.d.ts +1 -1
- package/dist/src/NodeManager/node/market/marketAccess.js +4 -13
- package/dist/src/NodeManager/node/run/runHandler.d.ts +1 -2
- package/dist/src/NodeManager/node/run/runHandler.js +8 -38
- package/dist/src/NodeManager/node/stake/StakeHandler.d.ts +2 -2
- package/dist/src/NodeManager/node/stake/StakeHandler.js +8 -19
- package/dist/src/NodeManager/node/utils/subscription.d.ts +7 -3
- package/dist/src/NodeManager/node/utils/subscription.js +28 -5
- package/dist/src/NodeManager/sdk/index.js +27 -45
- package/npm-shrinkwrap.json +66 -65
- package/package.json +6 -6
package/dist/.env
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
BACKEND_SOLANA_ADDRESS=7rFPFnxjXHC2sfDy3qrDa9pEb4j49oivMuV7e8sYDPmB
|
|
2
2
|
FRP_SERVER_IMAGE=registry.hub.docker.com/nosana/frpc:v1.0.45
|
|
3
|
-
JOB_RUNTIME_IMAGE="nosana/job-runtime:v0.2.
|
|
3
|
+
JOB_RUNTIME_IMAGE="nosana/job-runtime:v0.2.5"
|
|
4
4
|
RESOURCE_MANAGER_IMAGE=registry.hub.docker.com/nosana/resource-manager:v1.1.19
|
|
5
5
|
FRP_SERVER_PORT=7000
|
|
6
6
|
MIN_DISK_SPACE=25
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosana/node",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.82",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nosana-node": "./dist/src/index.js"
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@inquirer/prompts": "^4.3.0",
|
|
78
|
-
"@nosana/kit": "^2.
|
|
79
|
-
"@nosana/pools-program": "^2.
|
|
80
|
-
"@nosana/rewards-program": "^2.
|
|
81
|
-
"@nosana/ssh": "^2.
|
|
82
|
-
"@nosana/types": "^2.
|
|
78
|
+
"@nosana/kit": "^2.24.3",
|
|
79
|
+
"@nosana/pools-program": "^2.24.3",
|
|
80
|
+
"@nosana/rewards-program": "^2.24.3",
|
|
81
|
+
"@nosana/ssh": "^2.24.3",
|
|
82
|
+
"@nosana/types": "^2.24.3",
|
|
83
83
|
"@solana/kit": "^8.3.0",
|
|
84
84
|
"chalk": "^5.3.0",
|
|
85
85
|
"cli-progress": "^3.12.0",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type Address } from '@solana/kit';
|
|
2
1
|
import { RequestHandler } from 'express';
|
|
3
2
|
import { JobRuntimeDeps } from '../types.js';
|
|
4
3
|
/**
|
|
@@ -8,6 +7,3 @@ import { JobRuntimeDeps } from '../types.js';
|
|
|
8
7
|
* keys.
|
|
9
8
|
*/
|
|
10
9
|
export declare function createVerifyJobOwnerSignatureMiddleware(deps: JobRuntimeDeps): RequestHandler;
|
|
11
|
-
/** The owner's public key bytes, which the validator checks a signature
|
|
12
|
-
* against. Throws for a string that is not an address. */
|
|
13
|
-
export declare function ownerKey(project: Address): Uint8Array;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getAddressEncoder } from '@solana/kit';
|
|
2
1
|
/**
|
|
3
2
|
* REST auth: the `authorization` header must be signed by the job's owner
|
|
4
3
|
* (`job.project`), resolved onchain, over this job's address — a header signed
|
|
@@ -18,7 +17,7 @@ export function createVerifyJobOwnerSignatureMiddleware(deps) {
|
|
|
18
17
|
res.status(400).send(`Could not find job with id ${jobId}`);
|
|
19
18
|
return;
|
|
20
19
|
}
|
|
21
|
-
if (!deps.auth.validateHeaders(req.headers,
|
|
20
|
+
if (!deps.auth.validateHeaders(req.headers, job.project, {
|
|
22
21
|
key: 'authorization',
|
|
23
22
|
expiry: job.timeout,
|
|
24
23
|
expected_message: jobId,
|
|
@@ -32,8 +31,3 @@ export function createVerifyJobOwnerSignatureMiddleware(deps) {
|
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
|
-
/** The owner's public key bytes, which the validator checks a signature
|
|
36
|
-
* against. Throws for a string that is not an address. */
|
|
37
|
-
export function ownerKey(project) {
|
|
38
|
-
return new Uint8Array(getAddressEncoder().encode(project));
|
|
39
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ownerKey } from './verifyJobOwnerSignature.js';
|
|
2
1
|
import { closeWith } from '../wsClose.js';
|
|
3
2
|
/**
|
|
4
3
|
* WS auth: the subscribe message's `header` must be signed by the job's owner
|
|
@@ -18,7 +17,7 @@ export async function verifyWSJobOwnerSignature(deps, ws, headers, body, nextFun
|
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
19
|
try {
|
|
21
|
-
if (deps.auth.validate(headers,
|
|
20
|
+
if (deps.auth.validate(headers, job.project, {
|
|
22
21
|
expected_message: jobId,
|
|
23
22
|
})) {
|
|
24
23
|
await nextFunction(ws, headers, body);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { EventEmitter } from 'events';
|
|
2
|
-
import type { IncomingHttpHeaders } from 'http';
|
|
3
2
|
import type { Duplex } from 'stream';
|
|
4
3
|
import type WebSocket from 'ws';
|
|
5
4
|
import type { Request } from 'express';
|
|
6
|
-
import type { Address, Flow, FlowState } from '@nosana/kit';
|
|
5
|
+
import type { Address, Flow, FlowState, NosanaAuthorization } from '@nosana/kit';
|
|
7
6
|
/**
|
|
8
7
|
* The job-facing API surface, extracted behind ports so the same routes,
|
|
9
8
|
* middlewares and WebSocket protocol can be served by any composition host.
|
|
@@ -22,21 +21,10 @@ export interface JobAccountView {
|
|
|
22
21
|
export interface JobChainResolver {
|
|
23
22
|
get(jobAddress: string): Promise<JobAccountView | null>;
|
|
24
23
|
}
|
|
25
|
-
/** Signature validation
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
* and return whether the signature verifies. */
|
|
30
|
-
export interface AuthValidator {
|
|
31
|
-
validate(authHeader: string, publicKey: Uint8Array, options?: {
|
|
32
|
-
expected_message?: string;
|
|
33
|
-
}): boolean;
|
|
34
|
-
validateHeaders(headers: IncomingHttpHeaders, publicKey: Uint8Array, options: {
|
|
35
|
-
key: string;
|
|
36
|
-
expiry: number;
|
|
37
|
-
expected_message?: string;
|
|
38
|
-
}): boolean;
|
|
39
|
-
}
|
|
24
|
+
/** Signature validation: the kit's `validate` and `validateHeaders`.
|
|
25
|
+
* Validation-only — the server side never generates headers, so no wallet is
|
|
26
|
+
* required. */
|
|
27
|
+
export type AuthValidator = Pick<NosanaAuthorization, 'validate' | 'validateHeaders'>;
|
|
40
28
|
/** The job's flow records, read-only (the node's `NodeRepository`). */
|
|
41
29
|
export interface FlowReader {
|
|
42
30
|
getFlow(id: string): Flow | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { address, validate } from '@nosana/kit';
|
|
2
|
-
import { getAddressEncoder } from '@solana/kit';
|
|
3
2
|
import { getKit } from '../../../../sdk/index.js';
|
|
4
3
|
export async function verifyWSJobOwnerSignatureMiddleware(ws, headers, body, nextFunction) {
|
|
5
4
|
const kit = getKit();
|
|
@@ -15,7 +14,7 @@ export async function verifyWSJobOwnerSignatureMiddleware(ws, headers, body, nex
|
|
|
15
14
|
return;
|
|
16
15
|
}
|
|
17
16
|
try {
|
|
18
|
-
if (validate(headers,
|
|
17
|
+
if (validate(headers, job.project, { expected_message: jobId })) {
|
|
19
18
|
await nextFunction(ws, headers, body);
|
|
20
19
|
}
|
|
21
20
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import ora from 'ora';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
const MINIMUM_SOL_BALANCE = 0.005;
|
|
4
|
-
const SOLANA_DECIMAL = 1e9;
|
|
5
4
|
export class BalanceHandler {
|
|
6
5
|
constructor(kit) {
|
|
7
6
|
this.kit = kit;
|
|
@@ -13,7 +12,7 @@ export class BalanceHandler {
|
|
|
13
12
|
}
|
|
14
13
|
async balance() {
|
|
15
14
|
try {
|
|
16
|
-
this.balances.sol =
|
|
15
|
+
this.balances.sol = (await this.kit.solana.getBalanceInfo(this.address)).uiAmount;
|
|
17
16
|
const nos = await this.kit.nos.getBalanceInfo(this.address);
|
|
18
17
|
this.balances.nos = nos.tokenAccount ? nos : undefined;
|
|
19
18
|
return true;
|
|
@@ -27,8 +26,7 @@ export class BalanceHandler {
|
|
|
27
26
|
return new Promise((resolve) => {
|
|
28
27
|
balancePollingInterval = setInterval(async () => {
|
|
29
28
|
if (await this.balance()) {
|
|
30
|
-
|
|
31
|
-
if (solBalance > MINIMUM_SOL_BALANCE) {
|
|
29
|
+
if (this.balances.sol > MINIMUM_SOL_BALANCE) {
|
|
32
30
|
resolve(true);
|
|
33
31
|
}
|
|
34
32
|
}
|
|
@@ -36,7 +34,7 @@ export class BalanceHandler {
|
|
|
36
34
|
}).finally(() => clearInterval(balancePollingInterval));
|
|
37
35
|
}
|
|
38
36
|
async check(wait = false) {
|
|
39
|
-
const solBalance = this.balances.sol
|
|
37
|
+
const solBalance = this.balances.sol;
|
|
40
38
|
if (solBalance < MINIMUM_SOL_BALANCE) {
|
|
41
39
|
const insufficentSolMessage = `SOL balance ${solBalance} should be 0.005 or higher. Send some SOL to your node address ${this.address} `;
|
|
42
40
|
if (!wait) {
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { type Job, type NosanaClient } from '@nosana/kit';
|
|
2
|
-
/**
|
|
3
|
-
* Whether a submit failed because the run is already closed onchain: there is
|
|
4
|
-
* nothing left to submit, and nothing to retry. The kit wraps what
|
|
5
|
-
* @solana/kit throws (a NosanaError keeps it as `details`), which keeps the
|
|
6
|
-
* error it was caused by (`cause`): a failed simulation by the instruction
|
|
7
|
-
* error, with the transaction's logs. Each error down that chain is looked at.
|
|
8
|
-
*/
|
|
9
|
-
export declare function isRunClosedError(error: unknown): boolean;
|
|
10
2
|
export declare class JobRegistry {
|
|
11
3
|
private static instance;
|
|
12
4
|
private registry;
|
|
@@ -1,56 +1,5 @@
|
|
|
1
|
-
import { address } from '@nosana/kit';
|
|
2
|
-
import { isSolanaError, SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE, } from '@solana/kit';
|
|
1
|
+
import { address, isRunClosedError } from '@nosana/kit';
|
|
3
2
|
import chalk from 'chalk';
|
|
4
|
-
/**
|
|
5
|
-
* Anchor's AccountNotInitialized, as a custom program error: the program was
|
|
6
|
-
* handed an account that is not there, the run once it is closed.
|
|
7
|
-
*/
|
|
8
|
-
const ACCOUNT_NOT_INITIALIZED = 3012;
|
|
9
|
-
/**
|
|
10
|
-
* What a closed run reads as in an error's message, or in the logs of the
|
|
11
|
-
* transaction it failed: Anchor's AccountNotInitialized (in its logs, and as
|
|
12
|
-
* the old SDK put it), the old SDK's fetch of an account that is not there,
|
|
13
|
-
* the kit's finish finding no run for the job, and @solana/kit's fetch of an
|
|
14
|
-
* account that is not there (as NODE_ENV=production words it too).
|
|
15
|
-
*/
|
|
16
|
-
const RUN_CLOSED_MESSAGES = [
|
|
17
|
-
'AccountNotInitialized',
|
|
18
|
-
'The program expected this account to be already initialized',
|
|
19
|
-
'Account does not exist or has no data',
|
|
20
|
-
'No job run account found',
|
|
21
|
-
'Account not found at address',
|
|
22
|
-
`Solana error #${SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND};`,
|
|
23
|
-
];
|
|
24
|
-
const isRunClosedMessage = (message) => RUN_CLOSED_MESSAGES.some((closed) => message.includes(closed));
|
|
25
|
-
/**
|
|
26
|
-
* Whether a submit failed because the run is already closed onchain: there is
|
|
27
|
-
* nothing left to submit, and nothing to retry. The kit wraps what
|
|
28
|
-
* @solana/kit throws (a NosanaError keeps it as `details`), which keeps the
|
|
29
|
-
* error it was caused by (`cause`): a failed simulation by the instruction
|
|
30
|
-
* error, with the transaction's logs. Each error down that chain is looked at.
|
|
31
|
-
*/
|
|
32
|
-
export function isRunClosedError(error) {
|
|
33
|
-
const seen = new Set();
|
|
34
|
-
for (let current = error; current != null && !seen.has(current);) {
|
|
35
|
-
seen.add(current);
|
|
36
|
-
if (isSolanaError(current, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM) &&
|
|
37
|
-
current.context.code === ACCOUNT_NOT_INITIALIZED) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
if (isSolanaError(current, SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND))
|
|
41
|
-
return true;
|
|
42
|
-
if (isSolanaError(current, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE) &&
|
|
43
|
-
current.context.logs?.some(isRunClosedMessage)) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
if (isRunClosedMessage(current instanceof Error ? current.message : String(current))) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
const { cause, details } = current;
|
|
50
|
-
current = cause ?? details;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
3
|
export class JobRegistry {
|
|
55
4
|
constructor() {
|
|
56
5
|
this.registry = new Map();
|
|
@@ -56,6 +56,12 @@ export declare class JobHandler {
|
|
|
56
56
|
* working a job that has already ended onchain.
|
|
57
57
|
*/
|
|
58
58
|
private pollForAccountChanges;
|
|
59
|
+
/**
|
|
60
|
+
* The job as it is onchain, passed on as a notification would be: a queued
|
|
61
|
+
* job is not looked up as running. Not when `current` finds the job
|
|
62
|
+
* stopped, or replaced by the next job, while the request was out.
|
|
63
|
+
*/
|
|
64
|
+
private readAccount;
|
|
59
65
|
private stopPollingForAccountChanges;
|
|
60
66
|
private stopListeningForAccountChanges;
|
|
61
67
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
|
-
import { address,
|
|
3
|
-
import { parseBase64RpcAccount } from '@solana/kit';
|
|
2
|
+
import { address, isRunClosedError, } from '@nosana/kit';
|
|
4
3
|
import { IpfsClientSingleton } from '../../../ipfs/IpfsClient.js';
|
|
5
4
|
import { applyLoggingProxyToClass } from '../../../../packages/common/src/index.js';
|
|
6
|
-
import { outcomeOnlyResult, StopReasons
|
|
7
|
-
import {
|
|
5
|
+
import { outcomeOnlyResult, StopReasons } from '../../../../packages/job-runtime/src/host/index.js';
|
|
6
|
+
import { JobRegistry } from './JobRegistry.js';
|
|
8
7
|
import { JobRuntimeSession } from './JobRuntimeSession.js';
|
|
9
8
|
import { reportError } from '../../monitoring/reportError.js';
|
|
10
9
|
import { watch } from '../utils/subscription.js';
|
|
@@ -13,26 +12,6 @@ import { watch } from '../utils/subscription.js';
|
|
|
13
12
|
* exit before the node finishes the job on what the sidecar last wrote.
|
|
14
13
|
*/
|
|
15
14
|
const STOP_GRACE_MS = 5 * 60 * 1000;
|
|
16
|
-
/** An IPFS hash onchain, or null where none is set yet (all zeros). */
|
|
17
|
-
function ipfsHashOrNull(bytes) {
|
|
18
|
-
const array = Array.from(bytes);
|
|
19
|
-
return array.every((byte) => byte === 0) ? null : solBytesArrayToIpfsHash(array);
|
|
20
|
-
}
|
|
21
|
-
/** A job account, as the kit's jobs.get answers it. */
|
|
22
|
-
function toJob(account) {
|
|
23
|
-
const { address, data } = JobsClient.decodeJobAccount(account);
|
|
24
|
-
const { discriminator: _, ...job } = data;
|
|
25
|
-
return {
|
|
26
|
-
...job,
|
|
27
|
-
address,
|
|
28
|
-
ipfsJob: ipfsHashOrNull(job.ipfsJob),
|
|
29
|
-
ipfsResult: ipfsHashOrNull(job.ipfsResult),
|
|
30
|
-
price: Number(job.price),
|
|
31
|
-
timeEnd: Number(job.timeEnd),
|
|
32
|
-
timeStart: Number(job.timeStart),
|
|
33
|
-
timeout: Number(job.timeout),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
15
|
/**
|
|
37
16
|
* The node's side of a job: claiming it, watching it onchain, and finishing
|
|
38
17
|
* it with its result. The job itself runs in its runtime sidecar, which the
|
|
@@ -142,17 +121,16 @@ export class JobHandler {
|
|
|
142
121
|
const jobAddress = address(this.jobId());
|
|
143
122
|
const subscription = new AbortController();
|
|
144
123
|
this.accountSubscription = subscription;
|
|
145
|
-
void watch((abortSignal) => this.kit.
|
|
146
|
-
.accountNotifications(jobAddress, { encoding: 'base64', commitment: 'confirmed' })
|
|
147
|
-
.subscribe({ abortSignal }), ({ value }) => {
|
|
148
|
-
const job = toJob(parseBase64RpcAccount(jobAddress, value));
|
|
124
|
+
void watch((abortSignal) => this.kit.jobs.watch(jobAddress, { abortSignal }), (job) => {
|
|
149
125
|
if (job.state >= 2) {
|
|
150
126
|
this.finishing = true;
|
|
151
127
|
this.accountEmitter.emit('stopped', job);
|
|
152
128
|
return;
|
|
153
129
|
}
|
|
154
130
|
this.accountEmitter.emit('changed', job);
|
|
155
|
-
}, subscription.signal
|
|
131
|
+
}, subscription.signal,
|
|
132
|
+
// what the job came to while there was no subscription
|
|
133
|
+
() => this.readAccount(jobAddress, () => this.accountSubscription === subscription));
|
|
156
134
|
}
|
|
157
135
|
/**
|
|
158
136
|
* The subscription alone is not enough: a websocket can drop a
|
|
@@ -163,18 +141,7 @@ export class JobHandler {
|
|
|
163
141
|
const jobAddress = address(this.jobId());
|
|
164
142
|
const interval = setInterval(async () => {
|
|
165
143
|
try {
|
|
166
|
-
|
|
167
|
-
const jobAccount = await this.kit.jobs.get(jobAddress, false);
|
|
168
|
-
// stopped or replaced by the next job while the request was out
|
|
169
|
-
if (this.accountPollInterval !== interval)
|
|
170
|
-
return;
|
|
171
|
-
if (jobAccount.state >= 2) {
|
|
172
|
-
this.stopPollingForAccountChanges();
|
|
173
|
-
this.finishing = true;
|
|
174
|
-
this.accountEmitter.emit('stopped', jobAccount);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
this.accountEmitter.emit('changed', jobAccount);
|
|
144
|
+
await this.readAccount(jobAddress, () => this.accountPollInterval === interval);
|
|
178
145
|
}
|
|
179
146
|
catch {
|
|
180
147
|
// an RPC failure says nothing about the job, the next poll retries
|
|
@@ -182,6 +149,23 @@ export class JobHandler {
|
|
|
182
149
|
}, 60000);
|
|
183
150
|
this.accountPollInterval = interval;
|
|
184
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* The job as it is onchain, passed on as a notification would be: a queued
|
|
154
|
+
* job is not looked up as running. Not when `current` finds the job
|
|
155
|
+
* stopped, or replaced by the next job, while the request was out.
|
|
156
|
+
*/
|
|
157
|
+
async readAccount(jobAddress, current) {
|
|
158
|
+
const jobAccount = await this.kit.jobs.get(jobAddress, false);
|
|
159
|
+
if (!current())
|
|
160
|
+
return;
|
|
161
|
+
if (jobAccount.state >= 2) {
|
|
162
|
+
this.stopPollingForAccountChanges();
|
|
163
|
+
this.finishing = true;
|
|
164
|
+
this.accountEmitter.emit('stopped', jobAccount);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this.accountEmitter.emit('changed', jobAccount);
|
|
168
|
+
}
|
|
185
169
|
stopPollingForAccountChanges() {
|
|
186
170
|
if (this.accountPollInterval) {
|
|
187
171
|
clearInterval(this.accountPollInterval);
|
|
@@ -219,7 +203,7 @@ export class JobHandler {
|
|
|
219
203
|
error_type: 'jobRuntimeStart',
|
|
220
204
|
error_name: error instanceof Error ? error.name : 'Error',
|
|
221
205
|
error_message: this.formatErrorDetails(error),
|
|
222
|
-
error_stack: error instanceof Error ?
|
|
206
|
+
error_stack: error instanceof Error ? error.stack ?? '' : '',
|
|
223
207
|
});
|
|
224
208
|
return false;
|
|
225
209
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isTransactionPartialSigner } from '@nosana/kit';
|
|
2
2
|
import { HostManager } from './hostManager.js';
|
|
3
3
|
/**
|
|
4
4
|
* The host-manager builds the access-key transaction, co-signs it with the
|
|
@@ -26,17 +26,8 @@ export class MarketAccessHandler {
|
|
|
26
26
|
if (!feePayer || !isTransactionPartialSigner(feePayer)) {
|
|
27
27
|
throw new Error('The node wallet cannot sign the access key transaction');
|
|
28
28
|
}
|
|
29
|
-
const transaction =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// format keeps only inside the message.
|
|
33
|
-
const lifetimeConstraint = await getTransactionLifetimeConstraintFromCompiledTransactionMessage(getCompiledTransactionMessageDecoder().decode(transaction.messageBytes));
|
|
34
|
-
const [signatures] = await feePayer.signTransactions([
|
|
35
|
-
{ ...transaction, lifetimeConstraint },
|
|
36
|
-
]);
|
|
37
|
-
return getBase64EncodedWireTransaction({
|
|
38
|
-
...transaction,
|
|
39
|
-
signatures: { ...transaction.signatures, ...signatures },
|
|
40
|
-
});
|
|
29
|
+
const transaction = await this.kit.solana.deserializeTransaction(txBase64);
|
|
30
|
+
const signed = await this.kit.solana.signTransactionWithSigners(transaction, [feePayer]);
|
|
31
|
+
return this.kit.solana.serializeTransaction(signed);
|
|
41
32
|
}
|
|
42
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NosanaClient, Run } from '@nosana/kit';
|
|
2
2
|
import type { NodeRepository } from '../../repository/NodeRepository.js';
|
|
3
3
|
export declare class RunHandler {
|
|
4
4
|
private kit;
|
|
@@ -25,7 +25,6 @@ export declare class RunHandler {
|
|
|
25
25
|
startRunMonitoring(callback: Function): Promise<Run>;
|
|
26
26
|
stopRunMonitoring(): void;
|
|
27
27
|
/** The run accounts of this node: their discriminator, and the node. */
|
|
28
|
-
private runFilters;
|
|
29
28
|
stop(): Promise<void>;
|
|
30
29
|
clean(): Promise<void>;
|
|
31
30
|
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import { JobsClient } from '@nosana/kit';
|
|
2
|
-
import { getBase58Decoder, parseBase64RpcAccount, } from '@solana/kit';
|
|
3
1
|
import { watch } from '../utils/subscription.js';
|
|
4
|
-
/** Where a run account keeps its node. */
|
|
5
|
-
const RUN_NODE_OFFSET = 40n;
|
|
6
|
-
/** A run account, as the kit's jobs.runs answers it. */
|
|
7
|
-
function toRun(account) {
|
|
8
|
-
const { address, data } = JobsClient.decodeRunAccount(account);
|
|
9
|
-
const { discriminator: _, ...run } = data;
|
|
10
|
-
return { address, ...run, time: Number(run.time) };
|
|
11
|
-
}
|
|
12
2
|
export class RunHandler {
|
|
13
3
|
constructor(kit,
|
|
14
4
|
/** Holds the last job the node submitted, whose run is not one to take. */
|
|
@@ -72,19 +62,18 @@ export class RunHandler {
|
|
|
72
62
|
// accounts made for this node
|
|
73
63
|
const subscription = new AbortController();
|
|
74
64
|
this.runSubscription = subscription;
|
|
75
|
-
void watch((abortSignal) => this.kit.
|
|
76
|
-
.programNotifications(this.kit.config.programs.jobsAddress, {
|
|
77
|
-
encoding: 'base64',
|
|
78
|
-
commitment: 'confirmed',
|
|
79
|
-
filters: this.runFilters(),
|
|
80
|
-
})
|
|
81
|
-
.subscribe({ abortSignal }), ({ value }) => {
|
|
82
|
-
const run = toRun(parseBase64RpcAccount(value.pubkey, value.account));
|
|
65
|
+
void watch((abortSignal) => this.kit.jobs.watchRuns({ node: this.address }, { abortSignal }), (run) => {
|
|
83
66
|
if (this.isFinished(run))
|
|
84
67
|
return;
|
|
85
68
|
this.setRun(run);
|
|
86
69
|
resolve(run);
|
|
87
|
-
}, subscription.signal
|
|
70
|
+
}, subscription.signal,
|
|
71
|
+
// a run made while there was no subscription
|
|
72
|
+
async () => {
|
|
73
|
+
const run = await this.checkRun();
|
|
74
|
+
if (run)
|
|
75
|
+
resolve(run);
|
|
76
|
+
});
|
|
88
77
|
// Set interval to check run status every 5 minutes
|
|
89
78
|
this.getRunsInterval = setInterval(async () => {
|
|
90
79
|
let run;
|
|
@@ -128,25 +117,6 @@ export class RunHandler {
|
|
|
128
117
|
this.runSubscription = undefined;
|
|
129
118
|
}
|
|
130
119
|
/** The run accounts of this node: their discriminator, and the node. */
|
|
131
|
-
runFilters() {
|
|
132
|
-
const base58 = getBase58Decoder();
|
|
133
|
-
return [
|
|
134
|
-
{
|
|
135
|
-
memcmp: {
|
|
136
|
-
offset: 0n,
|
|
137
|
-
bytes: base58.decode(JobsClient.RUN_ACCOUNT_DISCRIMINATOR),
|
|
138
|
-
encoding: 'base58',
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
memcmp: {
|
|
143
|
-
offset: RUN_NODE_OFFSET,
|
|
144
|
-
bytes: this.address,
|
|
145
|
-
encoding: 'base58',
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
120
|
async stop() {
|
|
151
121
|
this.stopRunMonitoring();
|
|
152
122
|
/**
|
|
@@ -11,8 +11,8 @@ export declare class StakeHandler {
|
|
|
11
11
|
/** Creates the node's NOS token account, when it has none yet. */
|
|
12
12
|
createAta(): Promise<void>;
|
|
13
13
|
/**
|
|
14
|
-
* Only
|
|
15
|
-
*
|
|
14
|
+
* Only a stake the kit finds none of is a missing one; any other failure is
|
|
15
|
+
* thrown, so the node never creates a stake it may already have.
|
|
16
16
|
*/
|
|
17
17
|
nodeHasStakingAccount(): Promise<boolean>;
|
|
18
18
|
/**
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { RewardsClient, } from '@nosana/kit';
|
|
3
|
-
import { isSolanaError, SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND } from '@solana/kit';
|
|
4
2
|
import { SECONDS_PER_DAY, sleep } from '../../utils/utils.js';
|
|
5
3
|
const NO_STAKE_AMOUNT = 0;
|
|
6
4
|
function toStake(account) {
|
|
@@ -32,18 +30,18 @@ export class StakeHandler {
|
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
/**
|
|
35
|
-
* Only
|
|
36
|
-
*
|
|
33
|
+
* Only a stake the kit finds none of is a missing one; any other failure is
|
|
34
|
+
* thrown, so the node never creates a stake it may already have.
|
|
37
35
|
*/
|
|
38
36
|
async nodeHasStakingAccount() {
|
|
39
37
|
try {
|
|
40
|
-
|
|
38
|
+
const stake = await this.kit.stake.find(this.address);
|
|
39
|
+
if (!stake)
|
|
40
|
+
return false;
|
|
41
|
+
this.stake = toStake(stake);
|
|
41
42
|
return true;
|
|
42
43
|
}
|
|
43
44
|
catch (error) {
|
|
44
|
-
if (isSolanaError(error, SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
45
|
throw new Error(`error getting node staking account: ${error}`);
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -120,18 +118,9 @@ export class StakeHandler {
|
|
|
120
118
|
* yet: one already there can't be entered again.
|
|
121
119
|
*/
|
|
122
120
|
async enterRewardsInstructions() {
|
|
123
|
-
|
|
124
|
-
const [stake, reward, reflection] = await Promise.all([
|
|
125
|
-
this.kit.stake.getAddress(this.address),
|
|
126
|
-
this.kit.solana.pda(['reward', this.address], rewards),
|
|
127
|
-
this.kit.solana.pda(['reflection'], rewards),
|
|
128
|
-
]);
|
|
129
|
-
const account = await RewardsClient.fetchMaybeRewardAccount(this.kit.solana.rpc, reward);
|
|
130
|
-
if (account.exists)
|
|
121
|
+
if (await this.kit.rewards.find(this.address))
|
|
131
122
|
return [];
|
|
132
|
-
return [
|
|
133
|
-
RewardsClient.getEnterInstruction({ reflection, stake, reward, authority: this.kit.wallet }, { programAddress: rewards }),
|
|
134
|
-
];
|
|
123
|
+
return [await this.kit.rewards.enter()];
|
|
135
124
|
}
|
|
136
125
|
getStakeActionQuerytext(market) {
|
|
137
126
|
const minStakeForMarket = Number(market?.nodeXnosMinimum) || 0;
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* Hands each notification of an RPC subscription to `onNotification` until
|
|
3
3
|
* `signal` aborts. A websocket that drops ends a @solana/kit subscription
|
|
4
4
|
* with an error, where the old web3.js connection subscribed again by
|
|
5
|
-
* itself: this subscribes again, a moment later, the same way
|
|
6
|
-
*
|
|
5
|
+
* itself: this subscribes again, a moment later, the same way, and gives up
|
|
6
|
+
* on a subscription that does not come up in time, to try again. Whatever
|
|
7
|
+
* happened onchain while there was no subscription went unseen, so
|
|
8
|
+
* `onSubscribed` runs after each subscription, for the caller to read the
|
|
9
|
+
* chain; what it throws is passed over, like a notification `onNotification`
|
|
10
|
+
* can't read.
|
|
7
11
|
*/
|
|
8
|
-
export declare function watch<T>(subscribe: (abortSignal: AbortSignal) => Promise<AsyncIterable<T>>, onNotification: (notification: T) => void, signal: AbortSignal): Promise<void>;
|
|
12
|
+
export declare function watch<T>(subscribe: (abortSignal: AbortSignal) => Promise<AsyncIterable<T>>, onNotification: (notification: T) => void, signal: AbortSignal, onSubscribed?: () => unknown): Promise<void>;
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
/** How long a dropped subscription waits before it subscribes again. */
|
|
2
2
|
const RESUBSCRIBE_DELAY_MS = 5_000;
|
|
3
|
+
/** How long a subscription is given to come up before it is tried again. */
|
|
4
|
+
const SUBSCRIBE_TIMEOUT_MS = 30_000;
|
|
3
5
|
/**
|
|
4
6
|
* Hands each notification of an RPC subscription to `onNotification` until
|
|
5
7
|
* `signal` aborts. A websocket that drops ends a @solana/kit subscription
|
|
6
8
|
* with an error, where the old web3.js connection subscribed again by
|
|
7
|
-
* itself: this subscribes again, a moment later, the same way
|
|
8
|
-
*
|
|
9
|
+
* itself: this subscribes again, a moment later, the same way, and gives up
|
|
10
|
+
* on a subscription that does not come up in time, to try again. Whatever
|
|
11
|
+
* happened onchain while there was no subscription went unseen, so
|
|
12
|
+
* `onSubscribed` runs after each subscription, for the caller to read the
|
|
13
|
+
* chain; what it throws is passed over, like a notification `onNotification`
|
|
14
|
+
* can't read.
|
|
9
15
|
*/
|
|
10
|
-
export async function watch(subscribe, onNotification, signal) {
|
|
16
|
+
export async function watch(subscribe, onNotification, signal, onSubscribed) {
|
|
11
17
|
while (!signal.aborted) {
|
|
12
18
|
try {
|
|
13
|
-
|
|
19
|
+
const notifications = await subscribeInTime(subscribe, signal);
|
|
20
|
+
void Promise.resolve()
|
|
21
|
+
.then(onSubscribed)
|
|
22
|
+
.catch(() => undefined);
|
|
23
|
+
for await (const notification of notifications) {
|
|
14
24
|
try {
|
|
15
25
|
onNotification(notification);
|
|
16
26
|
}
|
|
17
|
-
catch {
|
|
27
|
+
catch {
|
|
28
|
+
// a notification the caller can't read
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
31
|
}
|
|
20
32
|
catch {
|
|
@@ -35,3 +47,14 @@ export async function watch(subscribe, onNotification, signal) {
|
|
|
35
47
|
});
|
|
36
48
|
}
|
|
37
49
|
}
|
|
50
|
+
/** The subscription, unless it takes longer than SUBSCRIBE_TIMEOUT_MS. */
|
|
51
|
+
async function subscribeInTime(subscribe, signal) {
|
|
52
|
+
const timeout = new AbortController();
|
|
53
|
+
const timer = setTimeout(() => timeout.abort(new Error('the subscription did not come up in time')), SUBSCRIBE_TIMEOUT_MS);
|
|
54
|
+
try {
|
|
55
|
+
return await subscribe(AbortSignal.any([signal, timeout.signal]));
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
clearTimeout(timer);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import os from 'os';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { generateKeyPairSync } from 'crypto';
|
|
5
3
|
import chalk from 'chalk';
|
|
6
|
-
import { createNosanaClient, createWalletFromBase58, createWalletFromBytes, } from '@nosana/kit';
|
|
4
|
+
import { createNosanaClient, createWalletFromBase58, createWalletFromBytes, generateWalletToFile, loadWalletFromFile, } from '@nosana/kit';
|
|
7
5
|
import { colors } from '../utils/utils.js';
|
|
8
6
|
import { OUTPUT_EVENTS } from '../../output-formatter/outputEvents.js';
|
|
9
7
|
import { outputFormatSelector } from '../../output-formatter/outputFormatSelector.js';
|
|
10
8
|
import { HostManager } from '../node/market/hostManager.js';
|
|
9
|
+
/** One SOL, in lamports: what a devnet airdrop asks for. */
|
|
11
10
|
const LAMPORTS_PER_SOL = 1_000_000_000;
|
|
12
11
|
let kit;
|
|
13
|
-
/**
|
|
14
|
-
* A wallet from its secret, as the node has always taken it: a keyfile's
|
|
15
|
-
* JSON byte array, or a base58 secret key (`SOLANA_WALLET`).
|
|
16
|
-
*/
|
|
17
|
-
async function walletFromSecret(secret) {
|
|
18
|
-
const trimmed = secret.trim();
|
|
19
|
-
return trimmed.startsWith('[')
|
|
20
|
-
? createWalletFromBytes(Uint8Array.from(JSON.parse(trimmed)))
|
|
21
|
-
: createWalletFromBase58(trimmed);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A new keypair's 64-byte secret key, seed then public key: the layout the
|
|
25
|
-
* Solana CLI and the node's keyfiles have always used.
|
|
26
|
-
*/
|
|
27
|
-
function generateSecretKey() {
|
|
28
|
-
const { privateKey, publicKey } = generateKeyPairSync('ed25519');
|
|
29
|
-
const seed = privateKey.export({ format: 'der', type: 'pkcs8' }).subarray(-32);
|
|
30
|
-
const key = publicKey.export({ format: 'der', type: 'spki' }).subarray(-32);
|
|
31
|
-
return Uint8Array.from([...seed, ...key]);
|
|
32
|
-
}
|
|
33
12
|
export async function setSDK(network, rpc, keyfile, options) {
|
|
34
13
|
const formatter = outputFormatSelector(options.format);
|
|
35
14
|
const createNewKeyfile = (filePath) => {
|
|
36
15
|
formatter.output(OUTPUT_EVENTS.CREATE_KEYFILE, { keyfile: keyfile });
|
|
37
|
-
|
|
38
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
39
|
-
fs.writeFileSync(filePath, secret);
|
|
40
|
-
return secret;
|
|
16
|
+
return generateWalletToFile(filePath);
|
|
41
17
|
};
|
|
42
|
-
// `SOLANA_WALLET` wins over the keyfile
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
// `SOLANA_WALLET` wins over the keyfile: a base58 secret key, or a keyfile's
|
|
19
|
+
// JSON byte array.
|
|
20
|
+
let wallet;
|
|
21
|
+
const secret = process.env.SOLANA_WALLET?.trim();
|
|
22
|
+
if (secret) {
|
|
23
|
+
wallet = secret.startsWith('[')
|
|
24
|
+
? await createWalletFromBytes(JSON.parse(secret))
|
|
25
|
+
: await createWalletFromBase58(secret);
|
|
26
|
+
}
|
|
27
|
+
else if (keyfile) {
|
|
45
28
|
if (keyfile[0] === '~') {
|
|
46
29
|
keyfile = keyfile.replace('~', os.homedir());
|
|
47
30
|
}
|
|
48
|
-
if (fs.existsSync(keyfile)) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
31
|
+
if (!fs.existsSync(keyfile)) {
|
|
32
|
+
wallet = await createNewKeyfile(keyfile);
|
|
33
|
+
}
|
|
34
|
+
else if (fs.readFileSync(keyfile, 'utf8') === '') {
|
|
35
|
+
formatter.output(OUTPUT_EVENTS.EMPTY_KEYFILE, { keyfile: keyfile });
|
|
36
|
+
fs.rmSync(keyfile);
|
|
37
|
+
wallet = await createNewKeyfile(keyfile);
|
|
55
38
|
}
|
|
56
39
|
else {
|
|
57
|
-
|
|
40
|
+
formatter.output(OUTPUT_EVENTS.READ_KEYFILE, { keyfile: keyfile });
|
|
41
|
+
wallet = await loadWalletFromFile(keyfile);
|
|
58
42
|
}
|
|
59
43
|
}
|
|
60
44
|
let rpcEndpoint = rpc;
|
|
61
|
-
if (!rpc && network === 'mainnet' &&
|
|
45
|
+
if (!rpc && network === 'mainnet' && wallet) {
|
|
62
46
|
try {
|
|
63
47
|
const rpcFromHostManager = await HostManager.getRpcUrl();
|
|
64
48
|
if (typeof rpcFromHostManager === 'string') {
|
|
@@ -79,23 +63,21 @@ export async function setSDK(network, rpc, keyfile, options) {
|
|
|
79
63
|
logLevel: 'error',
|
|
80
64
|
...(rpcEndpoint ? { solana: { rpcEndpoint } } : {}),
|
|
81
65
|
...(options.api ? { api: { apiKey: options.api } } : {}),
|
|
82
|
-
...(
|
|
66
|
+
...(wallet ? { wallet } : {}),
|
|
83
67
|
});
|
|
84
68
|
if (network) {
|
|
85
69
|
formatter.output(OUTPUT_EVENTS.OUTPUT_NETWORK, { network });
|
|
86
70
|
}
|
|
87
71
|
if (keyfile && kit.wallet) {
|
|
88
72
|
const address = kit.wallet.address;
|
|
89
|
-
const solBalance =
|
|
73
|
+
const solBalance = await kit.solana.getBalanceInfo(address);
|
|
90
74
|
const nosBalance = await kit.nos.getBalanceInfo(address);
|
|
91
75
|
formatter.output(OUTPUT_EVENTS.OUTPUT_WALLET, { publicKey: address });
|
|
92
76
|
formatter.output(OUTPUT_EVENTS.OUTPUT_BALANCES, {
|
|
93
77
|
nos: nosBalance.tokenAccount ? nosBalance.uiAmount.toString() : '0',
|
|
94
|
-
sol: solBalance
|
|
78
|
+
sol: solBalance.uiAmount,
|
|
95
79
|
});
|
|
96
|
-
if (options.airdrop &&
|
|
97
|
-
network.includes('devnet') &&
|
|
98
|
-
solBalance < 0.01 * LAMPORTS_PER_SOL) {
|
|
80
|
+
if (options.airdrop && network.includes('devnet') && solBalance.uiAmount < 0.01) {
|
|
99
81
|
console.log('\nNot enough SOL, requesting airdrop');
|
|
100
82
|
try {
|
|
101
83
|
await kit.solana.airdrop({ recipient: address, amount: LAMPORTS_PER_SOL });
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosana/node",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.82",
|
|
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.82",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"workspaces": [
|
|
12
12
|
"packages/*"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@inquirer/prompts": "^4.3.0",
|
|
16
|
-
"@nosana/kit": "^2.
|
|
17
|
-
"@nosana/pools-program": "^2.
|
|
18
|
-
"@nosana/rewards-program": "^2.
|
|
19
|
-
"@nosana/ssh": "^2.
|
|
20
|
-
"@nosana/types": "^2.
|
|
16
|
+
"@nosana/kit": "^2.24.3",
|
|
17
|
+
"@nosana/pools-program": "^2.24.3",
|
|
18
|
+
"@nosana/rewards-program": "^2.24.3",
|
|
19
|
+
"@nosana/ssh": "^2.24.3",
|
|
20
|
+
"@nosana/types": "^2.24.3",
|
|
21
21
|
"@solana/kit": "^8.3.0",
|
|
22
22
|
"chalk": "^5.3.0",
|
|
23
23
|
"cli-progress": "^3.12.0",
|
|
@@ -1281,14 +1281,14 @@
|
|
|
1281
1281
|
}
|
|
1282
1282
|
},
|
|
1283
1283
|
"node_modules/@nosana/api": {
|
|
1284
|
-
"version": "2.
|
|
1285
|
-
"resolved": "https://registry.npmjs.org/@nosana/api/-/api-2.
|
|
1286
|
-
"integrity": "sha512-
|
|
1284
|
+
"version": "2.24.3",
|
|
1285
|
+
"resolved": "https://registry.npmjs.org/@nosana/api/-/api-2.24.3.tgz",
|
|
1286
|
+
"integrity": "sha512-lOV2bJX8iL3RsVy1LfG/ESsOEKlv0CPebTYX+SEm2PIccW2iNX6Fg7kh+5aU0HSBRHVn4NILhpX4Jjmh+JtS0A==",
|
|
1287
1287
|
"license": "MIT",
|
|
1288
1288
|
"dependencies": {
|
|
1289
|
-
"@nosana/authorization": "2.
|
|
1290
|
-
"@nosana/ssh": "2.
|
|
1291
|
-
"@nosana/types": "2.
|
|
1289
|
+
"@nosana/authorization": "2.24.3",
|
|
1290
|
+
"@nosana/ssh": "2.24.3",
|
|
1291
|
+
"@nosana/types": "2.24.3",
|
|
1292
1292
|
"eventsource": "^4.1.0",
|
|
1293
1293
|
"openapi-fetch": "^0.14.0"
|
|
1294
1294
|
},
|
|
@@ -1324,9 +1324,9 @@
|
|
|
1324
1324
|
"license": "MIT"
|
|
1325
1325
|
},
|
|
1326
1326
|
"node_modules/@nosana/authorization": {
|
|
1327
|
-
"version": "2.
|
|
1328
|
-
"resolved": "https://registry.npmjs.org/@nosana/authorization/-/authorization-2.
|
|
1329
|
-
"integrity": "sha512-
|
|
1327
|
+
"version": "2.24.3",
|
|
1328
|
+
"resolved": "https://registry.npmjs.org/@nosana/authorization/-/authorization-2.24.3.tgz",
|
|
1329
|
+
"integrity": "sha512-SOReiktcyaa3QD83LXknecvcON3Evx6GbahqqA1yO22WP2C+0ei4q04u/ez2MsVFvV/6tcwNqjjhxdztmD29Ug==",
|
|
1330
1330
|
"license": "MIT",
|
|
1331
1331
|
"dependencies": {
|
|
1332
1332
|
"bs58": "^6.0.0",
|
|
@@ -1343,9 +1343,9 @@
|
|
|
1343
1343
|
"link": true
|
|
1344
1344
|
},
|
|
1345
1345
|
"node_modules/@nosana/connect": {
|
|
1346
|
-
"version": "2.
|
|
1347
|
-
"resolved": "https://registry.npmjs.org/@nosana/connect/-/connect-2.
|
|
1348
|
-
"integrity": "sha512-
|
|
1346
|
+
"version": "2.24.3",
|
|
1347
|
+
"resolved": "https://registry.npmjs.org/@nosana/connect/-/connect-2.24.3.tgz",
|
|
1348
|
+
"integrity": "sha512-254RZf7vpFRKoU5Y5yG0nNfphXolMKFpk5Lzyv97h0i/yOq6HX6IXxOA5Cu4LQGdlImcpJHgmrUxtkh/tREluw==",
|
|
1349
1349
|
"license": "MIT",
|
|
1350
1350
|
"engines": {
|
|
1351
1351
|
"node": ">=20.18.0"
|
|
@@ -1356,12 +1356,12 @@
|
|
|
1356
1356
|
"link": true
|
|
1357
1357
|
},
|
|
1358
1358
|
"node_modules/@nosana/endpoints": {
|
|
1359
|
-
"version": "2.
|
|
1360
|
-
"resolved": "https://registry.npmjs.org/@nosana/endpoints/-/endpoints-2.
|
|
1361
|
-
"integrity": "sha512-
|
|
1359
|
+
"version": "2.24.3",
|
|
1360
|
+
"resolved": "https://registry.npmjs.org/@nosana/endpoints/-/endpoints-2.24.3.tgz",
|
|
1361
|
+
"integrity": "sha512-UXC0veLwUbOsJqPQsMJRjhnAHj4nGrxRQtbF8H4XsMM7H4b4AhZQKS35TnOP5HYwZH2yyCSWQxnn7ytW3KokPQ==",
|
|
1362
1362
|
"license": "MIT",
|
|
1363
1363
|
"dependencies": {
|
|
1364
|
-
"@nosana/types": "2.
|
|
1364
|
+
"@nosana/types": "2.24.3",
|
|
1365
1365
|
"bs58": "^6.0.0",
|
|
1366
1366
|
"tweetnacl": "^1.0.3"
|
|
1367
1367
|
},
|
|
@@ -1370,9 +1370,9 @@
|
|
|
1370
1370
|
}
|
|
1371
1371
|
},
|
|
1372
1372
|
"node_modules/@nosana/ipfs": {
|
|
1373
|
-
"version": "2.
|
|
1374
|
-
"resolved": "https://registry.npmjs.org/@nosana/ipfs/-/ipfs-2.
|
|
1375
|
-
"integrity": "sha512-
|
|
1373
|
+
"version": "2.24.3",
|
|
1374
|
+
"resolved": "https://registry.npmjs.org/@nosana/ipfs/-/ipfs-2.24.3.tgz",
|
|
1375
|
+
"integrity": "sha512-WolCmwquyWw0/CYMOP/yzjCwyUPou1wG8T0nFWTyPnVw002uaQoOD6UgbhSDzeXcSuWrecEKMBuESkBULK7W9w==",
|
|
1376
1376
|
"license": "MIT",
|
|
1377
1377
|
"dependencies": {
|
|
1378
1378
|
"bs58": "^6.0.0"
|
|
@@ -1386,9 +1386,9 @@
|
|
|
1386
1386
|
"link": true
|
|
1387
1387
|
},
|
|
1388
1388
|
"node_modules/@nosana/jobs-program": {
|
|
1389
|
-
"version": "2.
|
|
1390
|
-
"resolved": "https://registry.npmjs.org/@nosana/jobs-program/-/jobs-program-2.
|
|
1391
|
-
"integrity": "sha512-
|
|
1389
|
+
"version": "2.24.3",
|
|
1390
|
+
"resolved": "https://registry.npmjs.org/@nosana/jobs-program/-/jobs-program-2.24.3.tgz",
|
|
1391
|
+
"integrity": "sha512-nxV+z3qjobq0joqDbVLy3Uq2dNnsBinsU76LhhpNckXNa8mzaM1Een/57IWFJt9taIzzMWT6fyhnTOilDGsjZQ==",
|
|
1392
1392
|
"license": "MIT",
|
|
1393
1393
|
"dependencies": {
|
|
1394
1394
|
"@solana/kit": "8.3.0"
|
|
@@ -1398,27 +1398,28 @@
|
|
|
1398
1398
|
}
|
|
1399
1399
|
},
|
|
1400
1400
|
"node_modules/@nosana/kit": {
|
|
1401
|
-
"version": "2.
|
|
1402
|
-
"resolved": "https://registry.npmjs.org/@nosana/kit/-/kit-2.
|
|
1403
|
-
"integrity": "sha512-
|
|
1404
|
-
"license": "MIT",
|
|
1405
|
-
"dependencies": {
|
|
1406
|
-
"@nosana/api": "2.
|
|
1407
|
-
"@nosana/authorization": "2.
|
|
1408
|
-
"@nosana/connect": "2.
|
|
1409
|
-
"@nosana/endpoints": "2.
|
|
1410
|
-
"@nosana/ipfs": "2.
|
|
1411
|
-
"@nosana/jobs-program": "2.
|
|
1412
|
-
"@nosana/merkle-distributor-program": "2.
|
|
1413
|
-
"@nosana/pools-program": "2.
|
|
1414
|
-
"@nosana/rewards-program": "2.
|
|
1415
|
-
"@nosana/ssh": "2.
|
|
1416
|
-
"@nosana/stake-program": "2.
|
|
1417
|
-
"@nosana/types": "2.
|
|
1401
|
+
"version": "2.24.3",
|
|
1402
|
+
"resolved": "https://registry.npmjs.org/@nosana/kit/-/kit-2.24.3.tgz",
|
|
1403
|
+
"integrity": "sha512-bB3p7VawNKt0rh8JPWQtLUdoPutTUzwgGQptgV4cYQVsixRVmgPk8jDsZd97piSUYN/JqBYEDI70bIJTayjcFg==",
|
|
1404
|
+
"license": "MIT",
|
|
1405
|
+
"dependencies": {
|
|
1406
|
+
"@nosana/api": "2.24.3",
|
|
1407
|
+
"@nosana/authorization": "2.24.3",
|
|
1408
|
+
"@nosana/connect": "2.24.3",
|
|
1409
|
+
"@nosana/endpoints": "2.24.3",
|
|
1410
|
+
"@nosana/ipfs": "2.24.3",
|
|
1411
|
+
"@nosana/jobs-program": "2.24.3",
|
|
1412
|
+
"@nosana/merkle-distributor-program": "2.24.3",
|
|
1413
|
+
"@nosana/pools-program": "2.24.3",
|
|
1414
|
+
"@nosana/rewards-program": "2.24.3",
|
|
1415
|
+
"@nosana/ssh": "2.24.3",
|
|
1416
|
+
"@nosana/stake-program": "2.24.3",
|
|
1417
|
+
"@nosana/types": "2.24.3",
|
|
1418
1418
|
"@solana-program/compute-budget": "0.18.1",
|
|
1419
1419
|
"@solana-program/system": "0.14.1",
|
|
1420
1420
|
"@solana-program/token": "0.16.1",
|
|
1421
1421
|
"@solana/kit": "8.3.0",
|
|
1422
|
+
"@solana/rpc-subscriptions-channel-websocket": "8.3.0",
|
|
1422
1423
|
"bs58": "^6.0.0"
|
|
1423
1424
|
},
|
|
1424
1425
|
"engines": {
|
|
@@ -1456,9 +1457,9 @@
|
|
|
1456
1457
|
}
|
|
1457
1458
|
},
|
|
1458
1459
|
"node_modules/@nosana/merkle-distributor-program": {
|
|
1459
|
-
"version": "2.
|
|
1460
|
-
"resolved": "https://registry.npmjs.org/@nosana/merkle-distributor-program/-/merkle-distributor-program-2.
|
|
1461
|
-
"integrity": "sha512-
|
|
1460
|
+
"version": "2.24.3",
|
|
1461
|
+
"resolved": "https://registry.npmjs.org/@nosana/merkle-distributor-program/-/merkle-distributor-program-2.24.3.tgz",
|
|
1462
|
+
"integrity": "sha512-rF1MUIqmIwm0DowAP+WlrSFQojDRRNQydVmEajihaXNWSsVwH4wMhjdhvE2gCwP5dBraXgxiU6FzhEEvGOLY1Q==",
|
|
1462
1463
|
"license": "MIT",
|
|
1463
1464
|
"dependencies": {
|
|
1464
1465
|
"@solana/kit": "8.3.0"
|
|
@@ -1468,9 +1469,9 @@
|
|
|
1468
1469
|
}
|
|
1469
1470
|
},
|
|
1470
1471
|
"node_modules/@nosana/pools-program": {
|
|
1471
|
-
"version": "2.
|
|
1472
|
-
"resolved": "https://registry.npmjs.org/@nosana/pools-program/-/pools-program-2.
|
|
1473
|
-
"integrity": "sha512-
|
|
1472
|
+
"version": "2.24.3",
|
|
1473
|
+
"resolved": "https://registry.npmjs.org/@nosana/pools-program/-/pools-program-2.24.3.tgz",
|
|
1474
|
+
"integrity": "sha512-BCyIvFNukTxoZU28Wiq8UGKYspWy224rc5c3/KNVY94xq5rCZD5rEUZQh3oiGIncNeLnCHe17a2VdotE+MOPyg==",
|
|
1474
1475
|
"license": "MIT",
|
|
1475
1476
|
"dependencies": {
|
|
1476
1477
|
"@solana/kit": "8.3.0"
|
|
@@ -1480,9 +1481,9 @@
|
|
|
1480
1481
|
}
|
|
1481
1482
|
},
|
|
1482
1483
|
"node_modules/@nosana/rewards-program": {
|
|
1483
|
-
"version": "2.
|
|
1484
|
-
"resolved": "https://registry.npmjs.org/@nosana/rewards-program/-/rewards-program-2.
|
|
1485
|
-
"integrity": "sha512-
|
|
1484
|
+
"version": "2.24.3",
|
|
1485
|
+
"resolved": "https://registry.npmjs.org/@nosana/rewards-program/-/rewards-program-2.24.3.tgz",
|
|
1486
|
+
"integrity": "sha512-4WREdw4pQ1v0IfEqOnIfeYfIuldVfUobub+b7pM8zXMAeJsbfCyKrFo9EHY+FnojsyBk8c07iZLZiZuSGsYA1A==",
|
|
1486
1487
|
"license": "MIT",
|
|
1487
1488
|
"dependencies": {
|
|
1488
1489
|
"@solana/kit": "8.3.0"
|
|
@@ -1492,12 +1493,12 @@
|
|
|
1492
1493
|
}
|
|
1493
1494
|
},
|
|
1494
1495
|
"node_modules/@nosana/ssh": {
|
|
1495
|
-
"version": "2.
|
|
1496
|
-
"resolved": "https://registry.npmjs.org/@nosana/ssh/-/ssh-2.
|
|
1497
|
-
"integrity": "sha512-
|
|
1496
|
+
"version": "2.24.3",
|
|
1497
|
+
"resolved": "https://registry.npmjs.org/@nosana/ssh/-/ssh-2.24.3.tgz",
|
|
1498
|
+
"integrity": "sha512-yCNHjTtEgAJtd4ULphdKJtCf9fqTqsCOkQOZ0/SI5Ikqoe3gWtaaQKLfaEBRIZTfmWAGwk16/zZxvQ6Cby+S/w==",
|
|
1498
1499
|
"license": "MIT",
|
|
1499
1500
|
"dependencies": {
|
|
1500
|
-
"@nosana/types": "2.
|
|
1501
|
+
"@nosana/types": "2.24.3",
|
|
1501
1502
|
"tweetnacl": "^1.0.3"
|
|
1502
1503
|
},
|
|
1503
1504
|
"engines": {
|
|
@@ -1505,9 +1506,9 @@
|
|
|
1505
1506
|
}
|
|
1506
1507
|
},
|
|
1507
1508
|
"node_modules/@nosana/stake-program": {
|
|
1508
|
-
"version": "2.
|
|
1509
|
-
"resolved": "https://registry.npmjs.org/@nosana/stake-program/-/stake-program-2.
|
|
1510
|
-
"integrity": "sha512-
|
|
1509
|
+
"version": "2.24.3",
|
|
1510
|
+
"resolved": "https://registry.npmjs.org/@nosana/stake-program/-/stake-program-2.24.3.tgz",
|
|
1511
|
+
"integrity": "sha512-MyFzx9319RvLfJhTpJO8DK8OjR+szw/FFihVLme+DRDjFxnI717A8Y7X+I12t3EAPds0C3T1TxMG/jd6YPriIw==",
|
|
1511
1512
|
"license": "MIT",
|
|
1512
1513
|
"dependencies": {
|
|
1513
1514
|
"@solana/kit": "8.3.0"
|
|
@@ -1517,9 +1518,9 @@
|
|
|
1517
1518
|
}
|
|
1518
1519
|
},
|
|
1519
1520
|
"node_modules/@nosana/types": {
|
|
1520
|
-
"version": "2.
|
|
1521
|
-
"resolved": "https://registry.npmjs.org/@nosana/types/-/types-2.
|
|
1522
|
-
"integrity": "sha512-
|
|
1521
|
+
"version": "2.24.3",
|
|
1522
|
+
"resolved": "https://registry.npmjs.org/@nosana/types/-/types-2.24.3.tgz",
|
|
1523
|
+
"integrity": "sha512-EatDfDIcJjMJEQ1KTNVV4u60kmxmuFH8s8QxPwYGbC9jOkmHwBYhOF6H4ycPE3HL7uS37p6NofzMGTkN3Kp+/w==",
|
|
1523
1524
|
"license": "MIT",
|
|
1524
1525
|
"dependencies": {
|
|
1525
1526
|
"typia": "^10.0.2"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosana/node",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.82",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nosana-node": "./dist/src/index.js"
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@inquirer/prompts": "^4.3.0",
|
|
78
|
-
"@nosana/kit": "^2.
|
|
79
|
-
"@nosana/pools-program": "^2.
|
|
80
|
-
"@nosana/rewards-program": "^2.
|
|
81
|
-
"@nosana/ssh": "^2.
|
|
82
|
-
"@nosana/types": "^2.
|
|
78
|
+
"@nosana/kit": "^2.24.3",
|
|
79
|
+
"@nosana/pools-program": "^2.24.3",
|
|
80
|
+
"@nosana/rewards-program": "^2.24.3",
|
|
81
|
+
"@nosana/ssh": "^2.24.3",
|
|
82
|
+
"@nosana/types": "^2.24.3",
|
|
83
83
|
"@solana/kit": "^8.3.0",
|
|
84
84
|
"chalk": "^5.3.0",
|
|
85
85
|
"cli-progress": "^3.12.0",
|