@oceanprotocol/lib 7.0.0-next.6 → 7.0.0-next.8
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/lib.cjs +2 -2
- package/dist/lib.module.mjs +3 -3
- package/dist/lib.umd.js +2 -2
- package/dist/types/@types/Compute.d.ts +21 -0
- package/dist/types/@types/Provider.d.ts +39 -0
- package/dist/types/services/providers/BaseProvider.d.ts +3 -1
- package/dist/types/services/providers/HttpProvider.d.ts +3 -1
- package/dist/types/services/providers/P2pProvider.d.ts +3 -1
- package/package.json +1 -1
|
@@ -95,6 +95,27 @@ export interface ComputeJob {
|
|
|
95
95
|
OOMKilled?: boolean;
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
+
export interface ComputeJobPayment {
|
|
99
|
+
chainId: number;
|
|
100
|
+
token: string;
|
|
101
|
+
lockTx: string | null;
|
|
102
|
+
claimTx: string | null;
|
|
103
|
+
cancelTx: string | null;
|
|
104
|
+
cost: number;
|
|
105
|
+
}
|
|
106
|
+
export interface NodeComputeJob extends ComputeJob {
|
|
107
|
+
environment?: string;
|
|
108
|
+
stopRequested?: boolean;
|
|
109
|
+
resources?: ComputeResourceRequest[];
|
|
110
|
+
isFree?: boolean;
|
|
111
|
+
algoStartTimestamp?: string;
|
|
112
|
+
algoStopTimestamp?: string;
|
|
113
|
+
payment?: ComputeJobPayment;
|
|
114
|
+
algoDuration?: number;
|
|
115
|
+
queueMaxWaitTime?: number;
|
|
116
|
+
jobIdHash?: string;
|
|
117
|
+
maxJobDuration?: number;
|
|
118
|
+
}
|
|
98
119
|
export interface ComputeOutputEncryption {
|
|
99
120
|
encryptMethod: EncryptMethod.AES;
|
|
100
121
|
key: string;
|
|
@@ -37,6 +37,45 @@ export interface ServiceEndpoint {
|
|
|
37
37
|
method: string;
|
|
38
38
|
urlPath: string;
|
|
39
39
|
}
|
|
40
|
+
export interface NodeStatusProvider {
|
|
41
|
+
chainId: string;
|
|
42
|
+
network: string;
|
|
43
|
+
}
|
|
44
|
+
export interface NodeStatusIndexer {
|
|
45
|
+
chainId: string;
|
|
46
|
+
network: string;
|
|
47
|
+
block: string;
|
|
48
|
+
}
|
|
49
|
+
export interface NodeStatus {
|
|
50
|
+
id: string;
|
|
51
|
+
publicKey: string;
|
|
52
|
+
friendlyName: string;
|
|
53
|
+
address: string;
|
|
54
|
+
version: string;
|
|
55
|
+
http: boolean;
|
|
56
|
+
p2p: boolean;
|
|
57
|
+
provider: NodeStatusProvider[];
|
|
58
|
+
indexer: NodeStatusIndexer[];
|
|
59
|
+
escrowAddress: Record<string, string>;
|
|
60
|
+
supportedStorage: Record<string, boolean>;
|
|
61
|
+
platform: {
|
|
62
|
+
cpus: number;
|
|
63
|
+
freemem: number;
|
|
64
|
+
totalmem: number;
|
|
65
|
+
loadavg: number[];
|
|
66
|
+
arch: string;
|
|
67
|
+
machine: string;
|
|
68
|
+
platform: string;
|
|
69
|
+
osType: string;
|
|
70
|
+
node: string;
|
|
71
|
+
};
|
|
72
|
+
codeHash: string;
|
|
73
|
+
allowedAdmins: {
|
|
74
|
+
addresses: string[];
|
|
75
|
+
accessLists: string[] | null;
|
|
76
|
+
};
|
|
77
|
+
uptime: number;
|
|
78
|
+
}
|
|
40
79
|
export interface UserCustomParameters {
|
|
41
80
|
[key: string]: any;
|
|
42
81
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Multiaddr } from '@multiformats/multiaddr';
|
|
2
2
|
import { Signer } from 'ethers';
|
|
3
|
-
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ComputeResultStream, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse } from '../../@types/index.js';
|
|
3
|
+
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ComputeResultStream, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, NodeStatus, NodeComputeJob } from '../../@types/index.js';
|
|
4
4
|
import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
|
|
5
5
|
import { type P2PConfig } from './P2pProvider.js';
|
|
6
6
|
export { OCEAN_P2P_PROTOCOL, type P2PConfig } from './P2pProvider.js';
|
|
@@ -37,6 +37,8 @@ export declare class BaseProvider {
|
|
|
37
37
|
PolicyServerPassthrough(nodeUri: string | Multiaddr[], request: PolicyServerPassthroughCommand, signal?: AbortSignal): Promise<any>;
|
|
38
38
|
initializePSVerification(nodeUri: string | Multiaddr[], request: PolicyServerInitializeCommand, signal?: AbortSignal): Promise<any>;
|
|
39
39
|
downloadNodeLogs(nodeUri: string | Multiaddr[], signer: Signer, startTime: string, endTime: string, maxLogs?: number, moduleName?: string, level?: string, page?: number, signal?: AbortSignal): Promise<any>;
|
|
40
|
+
getNodeStatus(nodeUri: string | Multiaddr[], signal?: AbortSignal): Promise<NodeStatus>;
|
|
41
|
+
getNodeJobs(nodeUri: string | Multiaddr[], jobId?: string, fromTimestamp?: number, signal?: AbortSignal): Promise<NodeComputeJob[]>;
|
|
40
42
|
setupP2P(config: P2PConfig): Promise<void>;
|
|
41
43
|
getDiscoveredNodes(): Array<{
|
|
42
44
|
peerId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, ComputeResultStream } from '../../@types/index.js';
|
|
2
|
+
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, ComputeResultStream, NodeStatus, NodeComputeJob } from '../../@types/index.js';
|
|
3
3
|
import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
|
|
4
4
|
export declare class HttpProvider {
|
|
5
5
|
protected getConsumerAddress(s: Signer | string): Promise<string>;
|
|
@@ -11,6 +11,8 @@ export declare class HttpProvider {
|
|
|
11
11
|
* @return {Promise<any>}
|
|
12
12
|
*/
|
|
13
13
|
getEndpoints(nodeUri: string, authorization?: string): Promise<any>;
|
|
14
|
+
getNodeStatus(nodeUri: string, signal?: AbortSignal): Promise<NodeStatus>;
|
|
15
|
+
getNodeJobs(nodeUri: string, jobId?: string, fromTimestamp?: number, signal?: AbortSignal): Promise<NodeComputeJob[]>;
|
|
14
16
|
/**
|
|
15
17
|
* Returns the node public key
|
|
16
18
|
* @return {string} The node public key
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Libp2pOptions } from 'libp2p';
|
|
2
2
|
import { type Multiaddr } from '@multiformats/multiaddr';
|
|
3
3
|
import { Signer } from 'ethers';
|
|
4
|
-
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, ComputeResultStream } from '../../@types/index.js';
|
|
4
|
+
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, ComputeResultStream, NodeStatus, NodeComputeJob } from '../../@types/index.js';
|
|
5
5
|
import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
|
|
6
6
|
export declare const OCEAN_P2P_PROTOCOL = "/ocean/nodes/1.0.0";
|
|
7
7
|
export interface P2PConfig {
|
|
@@ -73,6 +73,8 @@ export declare class P2pProvider {
|
|
|
73
73
|
* @param {string} nodeUri - multiaddr of the node
|
|
74
74
|
*/
|
|
75
75
|
getEndpoints(nodeUri: string | Multiaddr[]): Promise<any>;
|
|
76
|
+
getNodeStatus(nodeUri: string | Multiaddr[], signal?: AbortSignal): Promise<NodeStatus>;
|
|
77
|
+
getNodeJobs(nodeUri: string | Multiaddr[], jobId?: string, fromTimestamp?: number, signal?: AbortSignal): Promise<NodeComputeJob[]>;
|
|
76
78
|
/**
|
|
77
79
|
* Get current nonce from the node via P2P.
|
|
78
80
|
*/
|
package/package.json
CHANGED