zkcloudworker 0.7.2 → 0.7.4

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.
Files changed (45) hide show
  1. package/lib/ts/src/api/api.d.ts +39 -27
  2. package/lib/ts/src/api/api.js +28 -27
  3. package/lib/ts/src/cloud/cloud.d.ts +176 -0
  4. package/lib/ts/src/cloud/cloud.js +72 -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 +39 -27
  20. package/lib/web/src/api/api.js +28 -27
  21. package/lib/web/src/api/api.js.map +1 -1
  22. package/lib/web/src/cloud/cloud.d.ts +176 -0
  23. package/lib/web/src/cloud/cloud.js +72 -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,18 @@ 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
- * @param jwt The jwt token for authentication, get it at https://t.me/minanft_bot?start=auth
18
+ * @param params the parameters for the API class
19
+ * @param params.jwt The jwt token for authentication, get it at https://t.me/minanft_bot?start=auth
20
+ * @param params.zkcloudworker The local worker for the serverless api to test the code locally
21
+ * @param params.chain The blockchain network to use
22
+ * @param params.webhook The webhook for the serverless api to get the results
16
23
  */
17
24
  constructor(params) {
18
25
  const { jwt, zkcloudworker, chain, webhook } = params;
@@ -28,19 +35,20 @@ export class zkCloudWorkerClient {
28
35
  }
29
36
  /**
30
37
  * 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
38
  * @param data the data for the proof call
34
- * @param data.transactions the transactions
35
39
  * @param data.developer the developer
36
40
  * @param data.repo the repo to use
41
+ * @param data.transactions the transactions
37
42
  * @param data.task the task of the job
38
- * @param data.args the arguments of the job
43
+ * @param data.userId the userId of the job
44
+ * @param data.args the arguments of the job, should be serialized JSON or string
45
+ * @param data.metadata the metadata of the job, should be serialized JSON or string
46
+ * @param data.webhook the webhook for the job
39
47
  * @returns { success: boolean, error?: string, jobId?: string }
40
48
  * where jonId is the jobId of the job
41
49
  *
42
- * The developers repo should provide a BackupPlugin with the name task
43
- * that can be called with the given parameters
50
+ * The developers repo should provide a zkcloudworker function
51
+ * that can be called with the given parameters, see the examples
44
52
  */
45
53
  async recursiveProof(data) {
46
54
  const result = await this.apiHub("recursiveProof", data);
@@ -71,8 +79,6 @@ export class zkCloudWorkerClient {
71
79
  }
72
80
  /**
73
81
  * 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
82
  * @param data the data for the proof call
77
83
  * @param data.developer the developer
78
84
  * @param data.repo the repo to use
@@ -82,8 +88,8 @@ export class zkCloudWorkerClient {
82
88
  * @param data.args the arguments of the job
83
89
  * @param data.metadata the metadata of the job
84
90
  * @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
91
+ * @returns { success: boolean, error?: string, jobId?: string, result?: any }
92
+ * where jonId is the jobId of the job (for async calls), result is the result of the job (for sync calls)
87
93
  */
88
94
  async execute(data) {
89
95
  const result = await this.apiHub("execute", data);
@@ -124,16 +130,13 @@ export class zkCloudWorkerClient {
124
130
  };
125
131
  }
126
132
  /**
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
133
+ * Sends transactions to the blockchain using serverless api call
130
134
  * @param data the data for the proof call
131
135
  * @param data.developer the developer
132
136
  * @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
137
+ * @param data.transactions the transactions
138
+ * @returns { success: boolean, error?: string, txId?: string[] }
139
+ * where txId is the transaction id of the transaction, in the sequence of the input transactions
137
140
  */
138
141
  async sendTransactions(data) {
139
142
  const result = await this.apiHub("sendTransactions", data);
@@ -178,15 +181,13 @@ export class zkCloudWorkerClient {
178
181
  };
179
182
  }
180
183
  /**
181
- * Gets the result of the job using serverless api call
184
+ * Deploys the code to the cloud using serverless api call
182
185
  * @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
186
+ * @param data.repo the repo to use
187
+ * @param data.developer the developer
188
+ * @param data.packageManager the package manager to use
189
+ * @returns { success: boolean, error?: string, jobId?: string}
190
+ * where jobId is the jobId of the job
190
191
  */
191
192
  async deploy(data) {
192
193
  // TODO: encrypt env.json
@@ -232,7 +233,7 @@ export class zkCloudWorkerClient {
232
233
  /**
233
234
  * Gets the remaining balance
234
235
  * @returns { success: boolean, error?: string, result?: any }
235
- * where result is the billing report
236
+ * where result is the balance
236
237
  */
237
238
  async getBalance() {
238
239
  const result = await this.apiHub("getBalance", {});
@@ -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;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,EAAE,sCAAsC;aAC9D,CAAC;YAEF,IAAI,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,23 @@ 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 params the parameters for the Cloud class
64
+ * @param params.id the id of the user
65
+ * @param params.jobId the job id
66
+ * @param params.stepId the step id
67
+ * @param params.taskId the task id
68
+ * @param params.cache the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
69
+ * @param params.developer the developer id
70
+ * @param params.repo the repo id
71
+ * @param params.task the task id
72
+ * @param params.userId the user id
73
+ * @param params.args the arguments, should be a string or serialized JSON
74
+ * @param params.metadata the metadata, should be a string or serialized JSON
75
+ * @param params.chain the blockchain network
76
+ * @param params.isLocalCloud a boolean to check if the cloud is local or not
77
+ */
36
78
  constructor(params: {
37
79
  id: string;
38
80
  jobId: string;
@@ -48,16 +90,69 @@ export declare abstract class Cloud {
48
90
  isLocalCloud?: boolean;
49
91
  chain: blockchain;
50
92
  });
93
+ /**
94
+ * Abstract method to get the deployer key pair
95
+ * Used to get the public and private keys of the deployer for test networks only
96
+ * Devnet and Zeko are supported
97
+ * @returns the deployer key pair
98
+ */
51
99
  abstract getDeployer(): Promise<DeployerKeyPair | undefined>;
100
+ /**
101
+ * Abstract method to release the deployer
102
+ * @param params the public key of the deployer and the transactions hashes
103
+ * Used to release the deployer after the transactions are sent to the blockchain
104
+ * @param params.publicKey the public key of the deployer
105
+ * @param params.txsHashes the transactions hashes
106
+ */
52
107
  abstract releaseDeployer(params: {
53
108
  publicKey: string;
54
109
  txsHashes: string[];
55
110
  }): Promise<void>;
111
+ /**
112
+ * Abstract method to get the data by key
113
+ * Used to get the data by key from the cloud storage
114
+ * @param key the key
115
+ * @returns the value of the key
116
+ */
56
117
  abstract getDataByKey(key: string): Promise<string | undefined>;
118
+ /**
119
+ * Abstract method to save the data by key
120
+ * Used to save the data by key to the cloud storage
121
+ * @param key the key
122
+ * @param value the value
123
+ */
57
124
  abstract saveDataByKey(key: string, value: string | undefined): Promise<void>;
125
+ /**
126
+ * Abstract method to save the file
127
+ * Used to save the file to the cloud storage
128
+ * @param filename the filename
129
+ * @param value the value
130
+ */
58
131
  abstract saveFile(filename: string, value: Buffer): Promise<void>;
132
+ /**
133
+ * Abstract method to load the file
134
+ * Used to load the file from the cloud storage
135
+ * @param filename the filename
136
+ * @returns the value of the file
137
+ */
59
138
  abstract loadFile(filename: string): Promise<Buffer | undefined>;
139
+ /**
140
+ * Abstract method to load the environment
141
+ * Used to load the environment from the cloud storage
142
+ * @param password the password
143
+ */
60
144
  abstract loadEnvironment(password: string): Promise<void>;
145
+ /**
146
+ * Abstract method to calculate the recursive proof
147
+ * Used to calculate the recursive proof
148
+ * @param data the data
149
+ * @param data.transactions the transactions
150
+ * @param data.task the task
151
+ * @param data.userId the user id
152
+ * @param data.args the arguments
153
+ * @param data.metadata the metadata
154
+ * @returns the proof
155
+ */
61
156
  abstract recursiveProof(data: {
62
157
  transactions: string[];
63
158
  task?: string;
@@ -65,6 +160,17 @@ export declare abstract class Cloud {
65
160
  args?: string;
66
161
  metadata?: string;
67
162
  }): Promise<string>;
163
+ /**
164
+ * Abstract method to execute the transactions
165
+ * Used to execute the transactions
166
+ * @param data the data
167
+ * @param data.transactions the transactions
168
+ * @param data.task the task
169
+ * @param data.userId the user id
170
+ * @param data.args the arguments
171
+ * @param data.metadata the metadata
172
+ * @returns the result
173
+ */
68
174
  abstract execute(data: {
69
175
  transactions: string[];
70
176
  task: string;
@@ -72,6 +178,18 @@ export declare abstract class Cloud {
72
178
  args?: string;
73
179
  metadata?: string;
74
180
  }): Promise<string>;
181
+ /**
182
+ * Abstract method to add the task
183
+ * Used to add the task
184
+ * @param data the data
185
+ * @param data.task the task
186
+ * @param data.startTime the start time
187
+ * @param data.userId the user id
188
+ * @param data.args the arguments
189
+ * @param data.metadata the metadata
190
+ * @param data.maxAttempts the maximum attempts
191
+ * @returns the task id
192
+ */
75
193
  abstract addTask(data: {
76
194
  task: string;
77
195
  startTime?: number;
@@ -80,19 +198,77 @@ export declare abstract class Cloud {
80
198
  metadata?: string;
81
199
  maxAttempts?: number;
82
200
  }): Promise<string>;
201
+ /**
202
+ * Abstract method to delete the transaction
203
+ * Used to delete the transaction
204
+ * @param txId the transaction id
205
+ */
83
206
  abstract deleteTransaction(txId: string): Promise<void>;
207
+ /**
208
+ * Abstract method to get the transactions
209
+ * Used to get the transactions
210
+ * @returns the transactions
211
+ */
84
212
  abstract getTransactions(): Promise<CloudTransaction[]>;
213
+ /**
214
+ * Abstract method to delete the task
215
+ * Used to delete the task
216
+ * @param taskId the task id
217
+ */
85
218
  abstract deleteTask(taskId: string): Promise<void>;
219
+ /**
220
+ * Abstract method to process the tasks
221
+ */
86
222
  abstract processTasks(): Promise<void>;
223
+ /**
224
+ * Abstract method to get the job result
225
+ * Used to get the job result
226
+ * @param jobId the job id
227
+ * @returns the job result
228
+ */
87
229
  abstract jobResult(jobId: string): Promise<JobData | undefined>;
88
230
  }
231
+ /**
232
+ * Abstract class for the zkCloudWorker
233
+ * Used to define the zkCloudWorker methods and properties
234
+ * Should be implemented for by the developer for the zkCloudWorker in the cloud
235
+ * @param cloud: the cloud
236
+ */
89
237
  export declare abstract class zkCloudWorker {
90
238
  readonly cloud: Cloud;
239
+ /**
240
+ * Constructor for the zkCloudWorker class
241
+ * @param cloud the cloud instance provided by the zkCloudWorker in the local environment or in the cloud
242
+ */
91
243
  constructor(cloud: Cloud);
244
+ /**
245
+ * Returns the deployed smart contracts for verification in the blockchain explorer
246
+ * @returns the deployed smart contracts
247
+ */
92
248
  deployedContracts(): Promise<DeployedSmartContract[]>;
249
+ /**
250
+ * Creates a new proof from a transaction
251
+ * @param transaction the transaction
252
+ * @returns the serialized proof
253
+ */
93
254
  create(transaction: string): Promise<string | undefined>;
255
+ /**
256
+ * Merges two proofs
257
+ * @param proof1 the first proof
258
+ * @param proof2 the second proof
259
+ * @returns the merged proof
260
+ */
94
261
  merge(proof1: string, proof2: string): Promise<string | undefined>;
262
+ /**
263
+ * Executes the transactions
264
+ * @param transactions the transactions, can be empty list
265
+ * @returns the result
266
+ */
95
267
  execute(transactions: string[]): Promise<string | undefined>;
96
268
  processTransactions(transactions: CloudTransaction[]): Promise<void>;
269
+ /**
270
+ * process the task defined by the developer
271
+ * @returns the result
272
+ */
97
273
  task(): Promise<string | undefined>;
98
274
  }
@@ -1,4 +1,39 @@
1
+ /*
2
+ * Abstract class for the cloud service
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 params the parameters for the Cloud class
23
+ * @param params.id the id of the user
24
+ * @param params.jobId the job id
25
+ * @param params.stepId the step id
26
+ * @param params.taskId the task id
27
+ * @param params.cache the cache folder. Use it to get the Cache object: cache = Cache.FileSystem(this.cloud.cache);
28
+ * @param params.developer the developer id
29
+ * @param params.repo the repo id
30
+ * @param params.task the task id
31
+ * @param params.userId the user id
32
+ * @param params.args the arguments, should be a string or serialized JSON
33
+ * @param params.metadata the metadata, should be a string or serialized JSON
34
+ * @param params.chain the blockchain network
35
+ * @param params.isLocalCloud a boolean to check if the cloud is local or not
36
+ */
2
37
  constructor(params) {
3
38
  const { id, jobId, stepId, taskId, cache, developer, repo, task, userId, args, metadata, isLocalCloud, chain, } = params;
4
39
  this.id = id;
@@ -16,28 +51,62 @@ export class Cloud {
16
51
  this.chain = chain;
17
52
  }
18
53
  }
54
+ /**
55
+ * Abstract class for the zkCloudWorker
56
+ * Used to define the zkCloudWorker methods and properties
57
+ * Should be implemented for by the developer for the zkCloudWorker in the cloud
58
+ * @param cloud: the cloud
59
+ */
19
60
  export class zkCloudWorker {
61
+ /**
62
+ * Constructor for the zkCloudWorker class
63
+ * @param cloud the cloud instance provided by the zkCloudWorker in the local environment or in the cloud
64
+ */
20
65
  constructor(cloud) {
21
66
  this.cloud = cloud;
22
67
  }
23
- // To verify the SmartContract code
68
+ /**
69
+ * Returns the deployed smart contracts for verification in the blockchain explorer
70
+ * @returns the deployed smart contracts
71
+ */
24
72
  async deployedContracts() {
25
73
  return [];
26
74
  }
27
75
  // Those methods should be implemented for recursive proofs calculations
76
+ /**
77
+ * Creates a new proof from a transaction
78
+ * @param transaction the transaction
79
+ * @returns the serialized proof
80
+ */
28
81
  async create(transaction) {
29
82
  return undefined;
30
83
  }
84
+ /**
85
+ * Merges two proofs
86
+ * @param proof1 the first proof
87
+ * @param proof2 the second proof
88
+ * @returns the merged proof
89
+ */
31
90
  async merge(proof1, proof2) {
32
91
  return undefined;
33
92
  }
34
93
  // Those methods should be implemented for anything except for recursive proofs
94
+ /**
95
+ * Executes the transactions
96
+ * @param transactions the transactions, can be empty list
97
+ * @returns the result
98
+ */
35
99
  async execute(transactions) {
36
100
  return undefined;
37
101
  }
38
- // process the transactions received by the cloud
102
+ /* Process the transactions received by the cloud
103
+ * @param transactions: the transactions
104
+ */
39
105
  async processTransactions(transactions) { }
40
- // process the task defined by the developer
106
+ /**
107
+ * process the task defined by the developer
108
+ * @returns the result
109
+ */
41
110
  async task() {
42
111
  return undefined;
43
112
  }
@@ -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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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;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;