zkcloudworker 0.7.1 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/lib/ts/src/api/api.d.ts +37 -26
  2. package/lib/ts/src/api/api.js +27 -27
  3. package/lib/ts/src/cloud/cloud.d.ts +175 -0
  4. package/lib/ts/src/cloud/cloud.js +71 -3
  5. package/lib/ts/src/cloud/job.d.ts +47 -0
  6. package/lib/ts/src/cloud/local.d.ts +157 -1
  7. package/lib/ts/src/cloud/local.js +157 -3
  8. package/lib/ts/src/cloud/task.d.ts +18 -0
  9. package/lib/ts/src/networks.d.ts +20 -0
  10. package/lib/ts/src/utils/fee.d.ts +4 -0
  11. package/lib/ts/src/utils/fee.js +5 -1
  12. package/lib/ts/src/utils/fetch.d.ts +20 -0
  13. package/lib/ts/src/utils/fetch.js +20 -0
  14. package/lib/ts/src/utils/fields.d.ts +10 -0
  15. package/lib/ts/src/utils/fields.js +10 -0
  16. package/lib/ts/src/utils/mina.d.ts +24 -0
  17. package/lib/ts/src/utils/mina.js +18 -0
  18. package/lib/ts/tsconfig.tsbuildinfo +1 -1
  19. package/lib/web/src/api/api.d.ts +37 -26
  20. package/lib/web/src/api/api.js +27 -27
  21. package/lib/web/src/api/api.js.map +1 -1
  22. package/lib/web/src/cloud/cloud.d.ts +175 -0
  23. package/lib/web/src/cloud/cloud.js +71 -3
  24. package/lib/web/src/cloud/cloud.js.map +1 -1
  25. package/lib/web/src/cloud/job.d.ts +47 -0
  26. package/lib/web/src/cloud/local.d.ts +157 -1
  27. package/lib/web/src/cloud/local.js +157 -3
  28. package/lib/web/src/cloud/local.js.map +1 -1
  29. package/lib/web/src/cloud/task.d.ts +18 -0
  30. package/lib/web/src/networks.d.ts +20 -0
  31. package/lib/web/src/networks.js.map +1 -1
  32. package/lib/web/src/utils/fee.d.ts +4 -0
  33. package/lib/web/src/utils/fee.js +5 -1
  34. package/lib/web/src/utils/fee.js.map +1 -1
  35. package/lib/web/src/utils/fetch.d.ts +20 -0
  36. package/lib/web/src/utils/fetch.js +20 -0
  37. package/lib/web/src/utils/fetch.js.map +1 -1
  38. package/lib/web/src/utils/fields.d.ts +10 -0
  39. package/lib/web/src/utils/fields.js +10 -0
  40. package/lib/web/src/utils/fields.js.map +1 -1
  41. package/lib/web/src/utils/mina.d.ts +24 -0
  42. package/lib/web/src/utils/mina.js +18 -0
  43. package/lib/web/src/utils/mina.js.map +1 -1
  44. package/lib/web/tsconfig.web.tsbuildinfo +1 -1
  45. package/package.json +1 -1
@@ -8,11 +8,17 @@ const { ZKCLOUDWORKER_AUTH, ZKCLOUDWORKER_API } = config;
8
8
  * API class for interacting with the zkCloudWorker
9
9
  * @property jwt The jwt token for authentication, get it at https://t.me/minanft_bot?start=auth
10
10
  * @property endpoint The endpoint of the serverless api
11
+ * @property chain The blockchain network to use
12
+ * @property webhook The webhook for the serverless api to get the results
13
+ * @property localWorker The local worker for the serverless api to test the code locally
11
14
  */
12
15
  export class zkCloudWorkerClient {
13
16
  /**
14
17
  * Constructor for the API class
15
18
  * @param jwt The jwt token for authentication, get it at https://t.me/minanft_bot?start=auth
19
+ * @param zkcloudworker The local worker for the serverless api to test the code locally
20
+ * @param chain The blockchain network to use
21
+ * @param webhook The webhook for the serverless api to get the results
16
22
  */
17
23
  constructor(params) {
18
24
  const { jwt, zkcloudworker, chain, webhook } = params;
@@ -28,19 +34,20 @@ export class zkCloudWorkerClient {
28
34
  }
29
35
  /**
30
36
  * Starts a new job for the proof calculation using serverless api call
31
- * The developer and name should correspond to the BackupPlugin of the API
32
- * All other parameters should correspond to the parameters of the BackupPlugin
33
37
  * @param data the data for the proof call
34
- * @param data.transactions the transactions
35
38
  * @param data.developer the developer
36
39
  * @param data.repo the repo to use
40
+ * @param data.transactions the transactions
37
41
  * @param data.task the task of the job
38
- * @param data.args the arguments of the job
42
+ * @param data.userId the userId of the job
43
+ * @param data.args the arguments of the job, should be serialized JSON or string
44
+ * @param data.metadata the metadata of the job, should be serialized JSON or string
45
+ * @param data.webhook the webhook for the job
39
46
  * @returns { success: boolean, error?: string, jobId?: string }
40
47
  * where jonId is the jobId of the job
41
48
  *
42
- * The developers repo should provide a BackupPlugin with the name task
43
- * that can be called with the given parameters
49
+ * The developers repo should provide a zkcloudworker function
50
+ * that can be called with the given parameters, see the examples
44
51
  */
45
52
  async recursiveProof(data) {
46
53
  const result = await this.apiHub("recursiveProof", data);
@@ -71,8 +78,6 @@ export class zkCloudWorkerClient {
71
78
  }
72
79
  /**
73
80
  * Starts a new job for the function call using serverless api call
74
- * The developer and name should correspond to the BackupPlugin of the API
75
- * All other parameters should correspond to the parameters of the BackupPlugin
76
81
  * @param data the data for the proof call
77
82
  * @param data.developer the developer
78
83
  * @param data.repo the repo to use
@@ -82,8 +87,8 @@ export class zkCloudWorkerClient {
82
87
  * @param data.args the arguments of the job
83
88
  * @param data.metadata the metadata of the job
84
89
  * @param data.mode the mode of the job execution: "sync" will not create a job, it will execute the function synchronously within 30 seconds and with the memory limit of 256 MB
85
- * @returns { success: boolean, error?: string, jobId?: string }
86
- * where jonId is the jobId of the job
90
+ * @returns { success: boolean, error?: string, jobId?: string, result?: any }
91
+ * where jonId is the jobId of the job (for async calls), result is the result of the job (for sync calls)
87
92
  */
88
93
  async execute(data) {
89
94
  const result = await this.apiHub("execute", data);
@@ -124,16 +129,13 @@ export class zkCloudWorkerClient {
124
129
  };
125
130
  }
126
131
  /**
127
- * Starts a new job for the function call using serverless api call
128
- * The developer and name should correspond to the BackupPlugin of the API
129
- * All other parameters should correspond to the parameters of the BackupPlugin
132
+ * Sends transactions to the blockchain using serverless api call
130
133
  * @param data the data for the proof call
131
134
  * @param data.developer the developer
132
135
  * @param data.repo the repo to use
133
- * @param data.task the task of the job
134
- * @param data.args the arguments of the job
135
- * @returns { success: boolean, error?: string, jobId?: string }
136
- * where jonId is the jobId of the job
136
+ * @param data.transactions the transactions
137
+ * @returns { success: boolean, error?: string, txId?: string[] }
138
+ * where txId is the transaction id of the transaction, in the sequence of the input transactions
137
139
  */
138
140
  async sendTransactions(data) {
139
141
  const result = await this.apiHub("sendTransactions", data);
@@ -178,15 +180,13 @@ export class zkCloudWorkerClient {
178
180
  };
179
181
  }
180
182
  /**
181
- * Gets the result of the job using serverless api call
183
+ * Deploys the code to the cloud using serverless api call
182
184
  * @param data the data for the deploy call
183
- * @param data.packageName the name of the zip file with the code to be deployed
184
- * @returns { success: boolean, error?: string, result?: any }
185
- * where result is the result of the job
186
- * if the job is not finished yet, the result will be undefined
187
- * if the job failed, the result will be undefined and error will be set
188
- * if the job is finished, the result will be set and error will be undefined
189
- * if the job is not found, the result will be undefined and error will be set
185
+ * @param data.repo the repo to use
186
+ * @param data.developer the developer
187
+ * @param data.packageManager the package manager to use
188
+ * @returns { success: boolean, error?: string, jobId?: string}
189
+ * where jobId is the jobId of the job
190
190
  */
191
191
  async deploy(data) {
192
192
  // TODO: encrypt env.json
@@ -232,7 +232,7 @@ export class zkCloudWorkerClient {
232
232
  /**
233
233
  * Gets the remaining balance
234
234
  * @returns { success: boolean, error?: string, result?: any }
235
- * where result is the billing report
235
+ * where result is the balance
236
236
  */
237
237
  async getBalance() {
238
238
  const result = await this.apiHub("getBalance", {});
@@ -364,7 +364,7 @@ export class zkCloudWorkerClient {
364
364
  });
365
365
  return {
366
366
  success: true,
367
- data: jobId,
367
+ data: { success: true, jobId },
368
368
  };
369
369
  }
370
370
  case "execute": {
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/api/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAc,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;AAUzD;;;;GAIG;AAC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CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChD,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC;gBACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;IAED,8DAA8D;IACtD,OAAO,CAAC,IAAS;QACvB,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;QAClC,IAAI,IAAI,EAAE,SAAS,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC9C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;YACpE,OAAO,IAAI,CAAC;QACd,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QAChE,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -1,6 +1,17 @@
1
1
  /// <reference types="node" />
2
2
  import { blockchain } from "../networks";
3
3
  import { JobData } from "./job";
4
+ /**
5
+ * Interface for the deployed smart contract
6
+ * Used to get verification keys and addresses of the deployed smart contracts
7
+ * to be published in the blockchain explorer
8
+ * @param address: the address of the deployed smart contract
9
+ * @param name: the name of the deployed smart contract
10
+ * @param chain: the blockchain network where the smart contract is deployed
11
+ * @param verificationKey: the verification key of the deployed smart contract
12
+ * @param verificationKey.hash: the hash of the verification key
13
+ * @param verificationKey.data: the data of the verification key
14
+ */
4
15
  export interface DeployedSmartContract {
5
16
  address: string;
6
17
  name: string;
@@ -10,10 +21,24 @@ export interface DeployedSmartContract {
10
21
  data: string;
11
22
  };
12
23
  }
24
+ /**
25
+ * Interface for the deployer key pair
26
+ * Used to get the public and private keys of the deployer for test networks only
27
+ * Devnet and Zeko are supported
28
+ * @param publicKey: the public key of the deployer
29
+ * @param privateKey: the private key of the deployer
30
+ */
13
31
  export interface DeployerKeyPair {
14
32
  publicKey: string;
15
33
  privateKey: string;
16
34
  }
35
+ /**
36
+ * Interface for the cloud transaction
37
+ * Used to get the transaction id, the transaction, and the time received
38
+ * @param txId: the transaction id
39
+ * @param transaction: the transaction
40
+ * @param timeReceived: the time received
41
+ */
17
42
  export interface CloudTransaction {
18
43
  txId: string;
19
44
  transaction: string;
@@ -33,6 +58,22 @@ export declare abstract class Cloud {
33
58
  readonly metadata?: string;
34
59
  readonly chain: blockchain;
35
60
  readonly isLocalCloud: boolean;
61
+ /**
62
+ * Constructor for the Cloud class
63
+ * @param id: the id of the user
64
+ * @param jobId: the job id
65
+ * @param stepId: the step id
66
+ * @param taskId: the task id
67
+ * @param cache: the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
68
+ * @param developer: the developer id
69
+ * @param repo: the repo id
70
+ * @param task: the task id
71
+ * @param userId: the user id
72
+ * @param args: the arguments, should be a string or serialized JSON
73
+ * @param metadata: the metadata, should be a string or serialized JSON
74
+ * @param chain: the blockchain network
75
+ * @param isLocalCloud: a boolean to check if the cloud is local or not
76
+ */
36
77
  constructor(params: {
37
78
  id: string;
38
79
  jobId: string;
@@ -48,16 +89,69 @@ export declare abstract class Cloud {
48
89
  isLocalCloud?: boolean;
49
90
  chain: blockchain;
50
91
  });
92
+ /**
93
+ * Abstract method to get the deployer key pair
94
+ * Used to get the public and private keys of the deployer for test networks only
95
+ * Devnet and Zeko are supported
96
+ * @returns the deployer key pair
97
+ */
51
98
  abstract getDeployer(): Promise<DeployerKeyPair | undefined>;
99
+ /**
100
+ * Abstract method to release the deployer
101
+ * @param params: the public key of the deployer and the transactions hashes
102
+ * Used to release the deployer after the transactions are sent to the blockchain
103
+ * @param publicKey: the public key of the deployer
104
+ * @param txsHashes: the transactions hashes
105
+ */
52
106
  abstract releaseDeployer(params: {
53
107
  publicKey: string;
54
108
  txsHashes: string[];
55
109
  }): Promise<void>;
110
+ /**
111
+ * Abstract method to get the data by key
112
+ * Used to get the data by key from the cloud storage
113
+ * @param key: the key
114
+ * @returns the value of the key
115
+ */
56
116
  abstract getDataByKey(key: string): Promise<string | undefined>;
117
+ /**
118
+ * Abstract method to save the data by key
119
+ * Used to save the data by key to the cloud storage
120
+ * @param key: the key
121
+ * @param value: the value
122
+ */
57
123
  abstract saveDataByKey(key: string, value: string | undefined): Promise<void>;
124
+ /**
125
+ * Abstract method to save the file
126
+ * Used to save the file to the cloud storage
127
+ * @param filename: the filename
128
+ * @param value: the value
129
+ */
58
130
  abstract saveFile(filename: string, value: Buffer): Promise<void>;
131
+ /**
132
+ * Abstract method to load the file
133
+ * Used to load the file from the cloud storage
134
+ * @param filename: the filename
135
+ * @returns the value of the file
136
+ */
59
137
  abstract loadFile(filename: string): Promise<Buffer | undefined>;
138
+ /**
139
+ * Abstract method to load the environment
140
+ * Used to load the environment from the cloud storage
141
+ * @param password: the password
142
+ */
60
143
  abstract loadEnvironment(password: string): Promise<void>;
144
+ /**
145
+ * Abstract method to calculate the recursive proof
146
+ * Used to calculate the recursive proof
147
+ * @param data: the data
148
+ * @param data.transactions: the transactions
149
+ * @param data.task: the task
150
+ * @param data.userId: the user id
151
+ * @param data.args: the arguments
152
+ * @param data.metadata: the metadata
153
+ * @returns the proof
154
+ */
61
155
  abstract recursiveProof(data: {
62
156
  transactions: string[];
63
157
  task?: string;
@@ -65,6 +159,17 @@ export declare abstract class Cloud {
65
159
  args?: string;
66
160
  metadata?: string;
67
161
  }): Promise<string>;
162
+ /**
163
+ * Abstract method to execute the transactions
164
+ * Used to execute the transactions
165
+ * @param data: the data
166
+ * @param data.transactions: the transactions
167
+ * @param data.task: the task
168
+ * @param data.userId: the user id
169
+ * @param data.args: the arguments
170
+ * @param data.metadata: the metadata
171
+ * @returns the result
172
+ */
68
173
  abstract execute(data: {
69
174
  transactions: string[];
70
175
  task: string;
@@ -72,6 +177,18 @@ export declare abstract class Cloud {
72
177
  args?: string;
73
178
  metadata?: string;
74
179
  }): Promise<string>;
180
+ /**
181
+ * Abstract method to add the task
182
+ * Used to add the task
183
+ * @param data: the data
184
+ * @param data.task: the task
185
+ * @param data.startTime: the start time
186
+ * @param data.userId: the user id
187
+ * @param data.args: the arguments
188
+ * @param data.metadata: the metadata
189
+ * @param data.maxAttempts: the maximum attempts
190
+ * @returns the task id
191
+ */
75
192
  abstract addTask(data: {
76
193
  task: string;
77
194
  startTime?: number;
@@ -80,19 +197,77 @@ export declare abstract class Cloud {
80
197
  metadata?: string;
81
198
  maxAttempts?: number;
82
199
  }): Promise<string>;
200
+ /**
201
+ * Abstract method to delete the transaction
202
+ * Used to delete the transaction
203
+ * @param txId: the transaction id
204
+ */
83
205
  abstract deleteTransaction(txId: string): Promise<void>;
206
+ /**
207
+ * Abstract method to get the transactions
208
+ * Used to get the transactions
209
+ * @returns the transactions
210
+ */
84
211
  abstract getTransactions(): Promise<CloudTransaction[]>;
212
+ /**
213
+ * Abstract method to delete the task
214
+ * Used to delete the task
215
+ * @param taskId: the task id
216
+ */
85
217
  abstract deleteTask(taskId: string): Promise<void>;
218
+ /**
219
+ * Abstract method to process the tasks
220
+ */
86
221
  abstract processTasks(): Promise<void>;
222
+ /**
223
+ * Abstract method to get the job result
224
+ * Used to get the job result
225
+ * @param jobId: the job id
226
+ * @returns the job result
227
+ */
87
228
  abstract jobResult(jobId: string): Promise<JobData | undefined>;
88
229
  }
230
+ /**
231
+ * Abstract class for the zkCloudWorker
232
+ * Used to define the zkCloudWorker methods and properties
233
+ * Should be implemented for by the developer for the zkCloudWorker in the cloud
234
+ * @param cloud: the cloud
235
+ */
89
236
  export declare abstract class zkCloudWorker {
90
237
  readonly cloud: Cloud;
238
+ /**
239
+ * Constructor for the zkCloudWorker class
240
+ * @param cloud: the cloud instance provided by the zkCloudWorker in the local environment or in the cloud
241
+ */
91
242
  constructor(cloud: Cloud);
243
+ /**
244
+ * Returns the deployed smart contracts for verification in the blockchain explorer
245
+ * @returns the deployed smart contracts
246
+ */
92
247
  deployedContracts(): Promise<DeployedSmartContract[]>;
248
+ /**
249
+ * Creates a new proof from a transaction
250
+ * @param transaction: the transaction
251
+ * @returns the serialized proof
252
+ */
93
253
  create(transaction: string): Promise<string | undefined>;
254
+ /**
255
+ * Merges two proofs
256
+ * @param proof1: the first proof
257
+ * @param proof2: the second proof
258
+ * @returns the merged proof
259
+ */
94
260
  merge(proof1: string, proof2: string): Promise<string | undefined>;
261
+ /**
262
+ * Executes the transactions
263
+ * @param transactions: the transactions, can be empty list
264
+ * @returns the result
265
+ */
95
266
  execute(transactions: string[]): Promise<string | undefined>;
96
267
  processTransactions(transactions: CloudTransaction[]): Promise<void>;
268
+ /**
269
+ * process the task defined by the developer
270
+ * @returns the result
271
+ */
97
272
  task(): Promise<string | undefined>;
98
273
  }
@@ -1,4 +1,38 @@
1
+ /*
2
+ * Abstract class for the cloud
3
+ * Used to define the cloud methods and properties
4
+ * Should be implemented by for local testing and for the zkCloudWorker in the cloud
5
+ * @param id: the id of the user
6
+ * @param jobId: the job id
7
+ * @param stepId: the step id
8
+ * @param taskId: the task id
9
+ * @param cache: the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
10
+ * @param developer: the developer id
11
+ * @param repo: the repo id
12
+ * @param task: the task id
13
+ * @param userId: the user id
14
+ * @param args: the arguments, should be a string or serialized JSON
15
+ * @param metadata: the metadata, should be a string or serialized JSON
16
+ * @param chain: the blockchain network
17
+ * @param isLocalCloud: a boolean to check if the cloud is local or not
18
+ */
1
19
  export class Cloud {
20
+ /**
21
+ * Constructor for the Cloud class
22
+ * @param id: the id of the user
23
+ * @param jobId: the job id
24
+ * @param stepId: the step id
25
+ * @param taskId: the task id
26
+ * @param cache: the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
27
+ * @param developer: the developer id
28
+ * @param repo: the repo id
29
+ * @param task: the task id
30
+ * @param userId: the user id
31
+ * @param args: the arguments, should be a string or serialized JSON
32
+ * @param metadata: the metadata, should be a string or serialized JSON
33
+ * @param chain: the blockchain network
34
+ * @param isLocalCloud: a boolean to check if the cloud is local or not
35
+ */
2
36
  constructor(params) {
3
37
  const { id, jobId, stepId, taskId, cache, developer, repo, task, userId, args, metadata, isLocalCloud, chain, } = params;
4
38
  this.id = id;
@@ -16,28 +50,62 @@ export class Cloud {
16
50
  this.chain = chain;
17
51
  }
18
52
  }
53
+ /**
54
+ * Abstract class for the zkCloudWorker
55
+ * Used to define the zkCloudWorker methods and properties
56
+ * Should be implemented for by the developer for the zkCloudWorker in the cloud
57
+ * @param cloud: the cloud
58
+ */
19
59
  export class zkCloudWorker {
60
+ /**
61
+ * Constructor for the zkCloudWorker class
62
+ * @param cloud: the cloud instance provided by the zkCloudWorker in the local environment or in the cloud
63
+ */
20
64
  constructor(cloud) {
21
65
  this.cloud = cloud;
22
66
  }
23
- // To verify the SmartContract code
67
+ /**
68
+ * Returns the deployed smart contracts for verification in the blockchain explorer
69
+ * @returns the deployed smart contracts
70
+ */
24
71
  async deployedContracts() {
25
72
  return [];
26
73
  }
27
74
  // Those methods should be implemented for recursive proofs calculations
75
+ /**
76
+ * Creates a new proof from a transaction
77
+ * @param transaction: the transaction
78
+ * @returns the serialized proof
79
+ */
28
80
  async create(transaction) {
29
81
  return undefined;
30
82
  }
83
+ /**
84
+ * Merges two proofs
85
+ * @param proof1: the first proof
86
+ * @param proof2: the second proof
87
+ * @returns the merged proof
88
+ */
31
89
  async merge(proof1, proof2) {
32
90
  return undefined;
33
91
  }
34
92
  // Those methods should be implemented for anything except for recursive proofs
93
+ /**
94
+ * Executes the transactions
95
+ * @param transactions: the transactions, can be empty list
96
+ * @returns the result
97
+ */
35
98
  async execute(transactions) {
36
99
  return undefined;
37
100
  }
38
- // process the transactions received by the cloud
101
+ /* Process the transactions received by the cloud
102
+ * @param transactions: the transactions
103
+ */
39
104
  async processTransactions(transactions) { }
40
- // process the task defined by the developer
105
+ /**
106
+ * process the task defined by the developer
107
+ * @returns the result
108
+ */
41
109
  async task() {
42
110
  return undefined;
43
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../src/cloud/cloud.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAgB,KAAK;IAezB,YAAY,MAcX;QACC,MAAM,EACJ,EAAE,EACF,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,GACN,GAAG,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,KAAK,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CAwCF;AACD,MAAM,OAAgB,aAAa;IAGjC,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,mCAAmC;IACnC,KAAK,CA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AAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,KAAK,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CA2JF;AAED;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IAGjC;;;OAGG;IACH,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,iBAAiB;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,wEAAwE;IACxE;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,WAAmB;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,KAAK,CAAC,MAAc,EAAE,MAAc;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,+EAA+E;IAC/E;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,YAAsB;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,YAAgC,IAAkB,CAAC;IAE7E;;;OAGG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -1,10 +1,57 @@
1
1
  import { blockchain } from "../networks";
2
2
  export type JobStatus = "created" | "started" | "finished" | "failed" | "used";
3
+ /**
4
+ * LogStream is a subset of the log stream data returned by AWS CloudWatch Logs when running the worker
5
+ * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/GetLogEventsCommand/
6
+ * example:
7
+ * {
8
+ * logGroupName: '/aws/lambda/zkcloudworker-dev-test',
9
+ * logStreamName: '2024/05/09/[$LATEST]52d048f64e894d2e8ba2800df93629c5'
10
+ * awsRequestId: '581d0d45-9165-47e8-84d9-678599938811',
11
+ * }
12
+ * @param logGroupName the log group name
13
+ * @param logStreamName the log stream name
14
+ * @param awsRequestId the AWS request ID
15
+ */
3
16
  export interface LogStream {
4
17
  logGroupName: string;
5
18
  logStreamName: string;
6
19
  awsRequestId: string;
7
20
  }
21
+ /**
22
+ * JobData is the data structure for a job, keeping track of the job status, result, logs, and metadata
23
+ * @param id the id of the user
24
+ * @param jobId the id of the job
25
+ * @param taskId the id of the task
26
+ * @param developer the developer of the repo executing the job
27
+ * @param repo the repo executing the job
28
+ * @param task the task to execute
29
+ * @param userId the id of the user
30
+ * @param args the arguments for the job
31
+ * @param metadata the metadata for the job
32
+ * @param chain the blockchain to execute the job on
33
+ * @param webhook the webhook to call after the job finishes
34
+ * @param cloudhook the cloudhook to call after the job finishes
35
+ * @param cloudIteration the recursive call number, must be less than 5
36
+ * @param previousJob the previous job data, provided in case of the cloudhook
37
+ *
38
+ * @param filename the filename where transactions data is stored
39
+ * @param txNumber the number of transactions
40
+ * @param timeCreated the time the job was created
41
+ * @param timeCreatedString the time the job was created as a string
42
+ * @param timeStarted the time the job was started
43
+ * @param timeFinished the time the job was finished
44
+ * @param timeFailed the time the job failed
45
+ * @param timeUsed the time the job result was used
46
+ * @param billedDuration the duration the job was billed for
47
+ * @param feeMINA the fee in MINA
48
+ * @param feeUSD the fee in USD
49
+ * @param jobStatus the status of the job
50
+ * @param maxAttempts the maximum number of attempts
51
+ * @param result the result of the job
52
+ * @param logStreams the log streams of the job
53
+ * @param logs the logs of the job
54
+ */
8
55
  export interface JobData {
9
56
  id: string;
10
57
  jobId: string;