zkcloudworker 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -237,92 +237,24 @@ export class zkCloudWorkerClient {
237
237
  throw new Error("localWorker is undefined");
238
238
  switch (command) {
239
239
  case "recursiveProof": {
240
- console.log("calculating recursive proof locally...");
241
- const timeCreated = Date.now();
242
- const jobId = this.generateJobId();
243
- const job = {
244
- id: "local",
245
- jobId: jobId,
246
- developer: data.developer,
247
- repo: data.repo,
248
- task: data.task,
249
- userId: data.userId,
250
- args: data.args,
251
- metadata: data.metadata,
252
- filename: "recursiveProof.json",
253
- txNumber: data.transactions.length,
254
- timeCreated,
255
- timeCreatedString: new Date(timeCreated).toISOString(),
256
- timeStarted: timeCreated,
257
- jobStatus: "started",
258
- maxAttempts: 0,
259
- };
260
- const cloud = new LocalCloud({
261
- job,
240
+ const jobId = yield LocalCloud.run({
241
+ command: "recursiveProof",
242
+ data,
262
243
  chain: this.chain,
263
244
  localWorker: this.localWorker,
264
245
  });
265
- const worker = yield this.localWorker(cloud);
266
- if (worker === undefined)
267
- throw new Error("worker is undefined");
268
- const proof = yield LocalCloud.sequencer({
269
- worker,
270
- data,
271
- });
272
- job.timeFinished = Date.now();
273
- job.maxAttempts = 1;
274
- if (proof !== undefined) {
275
- job.jobStatus = "finished";
276
- job.result = proof;
277
- }
278
- else {
279
- job.jobStatus = "failed";
280
- }
281
- LocalStorage.jobs[jobId] = job;
282
246
  return {
283
247
  success: true,
284
248
  data: jobId,
285
249
  };
286
250
  }
287
251
  case "execute": {
288
- console.log("executing locally...");
289
- const timeCreated = Date.now();
290
- const jobId = this.generateJobId();
291
- const job = {
292
- id: "local",
293
- jobId: jobId,
294
- developer: data.developer,
295
- repo: data.repo,
296
- task: data.task,
297
- userId: data.userId,
298
- args: data.args,
299
- metadata: data.metadata,
300
- txNumber: 1,
301
- timeCreated,
302
- timeCreatedString: new Date(timeCreated).toISOString(),
303
- timeStarted: timeCreated,
304
- jobStatus: "started",
305
- maxAttempts: 0,
306
- };
307
- const cloud = new LocalCloud({
308
- job,
252
+ const jobId = yield LocalCloud.run({
253
+ command: "execute",
254
+ data,
309
255
  chain: this.chain,
310
256
  localWorker: this.localWorker,
311
257
  });
312
- const worker = yield this.localWorker(cloud);
313
- if (worker === undefined)
314
- throw new Error("worker is undefined");
315
- const result = yield worker.execute();
316
- job.timeFinished = Date.now();
317
- job.maxAttempts = 1;
318
- if (result !== undefined) {
319
- job.jobStatus = "finished";
320
- job.result = result;
321
- }
322
- else {
323
- job.jobStatus = "failed";
324
- }
325
- LocalStorage.jobs[jobId] = job;
326
258
  return {
327
259
  success: true,
328
260
  data: jobId,
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/api/api.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,MAAM,MAAM,WAAW,CAAC;AAI/B,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;AAEzD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAM9B;;;OAGG;IACH,YAAY,MAIX;QACC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QAC7C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,UAAU,CAAC;QACjC,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;YACpB,IAAI,aAAa,KAAK,SAAS;gBAC7B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;QACnC,CAAC;IACH,CA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WAAW,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;YACpE,OAAO,IAAI,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,aAAa;QACnB,OAAO,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;CACF"}
@@ -46,6 +46,7 @@ export declare abstract class Cloud {
46
46
  metadata?: string;
47
47
  }): Promise<string>;
48
48
  abstract execute(data: {
49
+ transactions: string[];
49
50
  task: string;
50
51
  userId?: string;
51
52
  args?: string;
@@ -71,7 +72,7 @@ export declare abstract class zkCloudWorker {
71
72
  deployedContracts(): Promise<DeployedSmartContract[]>;
72
73
  create(transaction: string): Promise<string | undefined>;
73
74
  merge(proof1: string, proof2: string): Promise<string | undefined>;
74
- execute(): Promise<string | undefined>;
75
+ execute(transactions: string[]): Promise<string | undefined>;
75
76
  processTransactions(transactions: CloudTransaction[]): Promise<void>;
76
77
  task(): Promise<string | undefined>;
77
78
  }
@@ -37,7 +37,7 @@ export class zkCloudWorker {
37
37
  });
38
38
  }
39
39
  // Those methods should be implemented for anything except for recursive proofs
40
- execute() {
40
+ execute(transactions) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
42
  return undefined;
43
43
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../src/cloud/cloud.ts"],"names":[],"mappings":";AAQA,MAAM,OAAgB,KAAK;IAazB,YAAY,MAYX;QACC,MAAM,EACJ,KAAK,EACL,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,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KA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,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,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,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAK,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CAgCF;AAQD,MAAM,OAAgB,aAAa;IAGjC,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,mCAAmC;IAC7B,iBAAiB;;YACrB,OAAO,EAAE,CAAC;QACZ,CAAC;KAAA;IAED,wEAAwE;IAClE,MAAM,CAAC,WAAmB;;YAC9B,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;IAEK,KAAK,CAAC,MAAc,EAAE,MAAc;;YACxC,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;IAED,+EAA+E;IACzE,OAAO,CAAC,YAAsB;;YAClC,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;IAED,iDAAiD;IAC3C,mBAAmB,CAAC,YAAgC;8DAAkB,CAAC;KAAA;IAE7E,4CAA4C;IACtC,IAAI;;YACR,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;CACF"}
@@ -4,6 +4,7 @@ import { Cloud, zkCloudWorker } from "./cloud";
4
4
  import { JobData } from "./job";
5
5
  import { TaskData } from "./task";
6
6
  import { blockchain } from "../networks";
7
+ import { ApiCommand } from "../api/api";
7
8
  export declare class LocalCloud extends Cloud {
8
9
  readonly localWorker: (cloud: Cloud) => Promise<zkCloudWorker>;
9
10
  constructor(params: {
@@ -20,7 +21,21 @@ export declare class LocalCloud extends Cloud {
20
21
  saveFile(filename: string, value: Buffer): Promise<void>;
21
22
  loadFile(filename: string): Promise<Buffer | undefined>;
22
23
  loadEnvironment(password: string): Promise<void>;
23
- private generateId;
24
+ private static generateId;
25
+ static run(params: {
26
+ command: ApiCommand;
27
+ data: {
28
+ developer: string;
29
+ repo: string;
30
+ transactions: string[];
31
+ task: string;
32
+ userId?: string;
33
+ args?: string;
34
+ metadata?: string;
35
+ };
36
+ chain: blockchain;
37
+ localWorker: (cloud: Cloud) => Promise<zkCloudWorker>;
38
+ }): Promise<string>;
24
39
  recursiveProof(data: {
25
40
  transactions: string[];
26
41
  task?: string;
@@ -29,6 +44,7 @@ export declare class LocalCloud extends Cloud {
29
44
  metadata?: string;
30
45
  }): Promise<string>;
31
46
  execute(data: {
47
+ transactions: string[];
32
48
  task: string;
33
49
  userId?: string;
34
50
  args?: string;
@@ -59,25 +59,26 @@ export class LocalCloud extends Cloud {
59
59
  throw new Error("Method not implemented.");
60
60
  });
61
61
  }
62
- generateId() {
62
+ static generateId() {
63
63
  return "local." + Date.now().toString() + "." + makeString(32);
64
64
  }
65
- recursiveProof(data) {
65
+ static run(params) {
66
66
  return __awaiter(this, void 0, void 0, function* () {
67
- console.log("calculating recursive proof locally...");
67
+ const { command, data, chain, localWorker } = params;
68
+ console.log("executing locally command", command);
69
+ const { developer, repo, transactions, task, userId, args, metadata } = data;
68
70
  const timeCreated = Date.now();
69
- const jobId = this.generateId();
71
+ const jobId = LocalCloud.generateId();
70
72
  const job = {
71
73
  id: "local",
72
- jobId: jobId,
73
- developer: this.developer,
74
- repo: this.repo,
75
- task: data.task,
76
- userId: data.userId,
77
- args: data.args,
78
- metadata: data.metadata,
79
- filename: "recursiveProof.json",
80
- txNumber: data.transactions.length,
74
+ jobId,
75
+ developer,
76
+ repo,
77
+ task,
78
+ userId,
79
+ args,
80
+ metadata,
81
+ txNumber: command === "recursiveProof" ? transactions.length : 1,
81
82
  timeCreated,
82
83
  timeCreatedString: new Date(timeCreated).toISOString(),
83
84
  timeStarted: timeCreated,
@@ -86,65 +87,76 @@ export class LocalCloud extends Cloud {
86
87
  };
87
88
  const cloud = new LocalCloud({
88
89
  job,
89
- chain: this.chain,
90
- localWorker: this.localWorker,
90
+ chain,
91
+ localWorker,
91
92
  });
92
- const worker = yield this.localWorker(cloud);
93
+ const worker = yield localWorker(cloud);
93
94
  if (worker === undefined)
94
95
  throw new Error("worker is undefined");
95
- const proof = yield LocalCloud.sequencer({
96
- worker,
97
- data: Object.assign(Object.assign({}, data), { developer: this.developer, repo: this.repo }),
98
- });
99
- job.timeFinished = Date.now();
100
- job.jobStatus = "finished";
101
- job.result = proof;
96
+ const result = command === "recursiveProof"
97
+ ? yield LocalCloud.sequencer({
98
+ worker,
99
+ data,
100
+ })
101
+ : command === "execute"
102
+ ? yield worker.execute(transactions)
103
+ : undefined;
104
+ const timeFinished = Date.now();
105
+ if (result !== undefined) {
106
+ job.jobStatus = "finished";
107
+ job.timeFinished = timeFinished;
108
+ job.result = result;
109
+ }
110
+ else {
111
+ job.jobStatus = "failed";
112
+ job.timeFailed = timeFinished;
113
+ }
102
114
  job.maxAttempts = 1;
115
+ job.billedDuration = timeFinished - timeCreated;
103
116
  LocalStorage.jobs[jobId] = job;
104
117
  return jobId;
105
118
  });
106
119
  }
120
+ recursiveProof(data) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ var _a;
123
+ return yield LocalCloud.run({
124
+ command: "recursiveProof",
125
+ data: {
126
+ developer: this.developer,
127
+ repo: this.repo,
128
+ transactions: data.transactions,
129
+ task: (_a = data.task) !== null && _a !== void 0 ? _a : "recursiveProof",
130
+ userId: data.userId,
131
+ args: data.args,
132
+ metadata: data.metadata,
133
+ },
134
+ chain: this.chain,
135
+ localWorker: this.localWorker,
136
+ });
137
+ });
138
+ }
107
139
  execute(data) {
108
140
  return __awaiter(this, void 0, void 0, function* () {
109
- console.log("executing locally...");
110
- const timeCreated = Date.now();
111
- const jobId = this.generateId();
112
- const job = {
113
- id: "local",
114
- jobId: jobId,
115
- developer: this.developer,
116
- repo: this.repo,
117
- task: data.task,
118
- userId: data.userId,
119
- args: data.args,
120
- metadata: data.metadata,
121
- txNumber: 1,
122
- timeCreated,
123
- timeCreatedString: new Date(timeCreated).toISOString(),
124
- timeStarted: timeCreated,
125
- jobStatus: "started",
126
- maxAttempts: 0,
127
- };
128
- const cloud = new LocalCloud({
129
- job,
141
+ return yield LocalCloud.run({
142
+ command: "execute",
143
+ data: {
144
+ developer: this.developer,
145
+ repo: this.repo,
146
+ transactions: data.transactions,
147
+ task: data.task,
148
+ userId: data.userId,
149
+ args: data.args,
150
+ metadata: data.metadata,
151
+ },
130
152
  chain: this.chain,
131
153
  localWorker: this.localWorker,
132
154
  });
133
- const worker = yield this.localWorker(cloud);
134
- if (worker === undefined)
135
- throw new Error("worker is undefined");
136
- const result = yield worker.execute();
137
- job.timeFinished = Date.now();
138
- job.jobStatus = "finished";
139
- job.result = result;
140
- job.maxAttempts = 1;
141
- LocalStorage.jobs[jobId] = job;
142
- return jobId;
143
155
  });
144
156
  }
145
157
  addTask(data) {
146
158
  return __awaiter(this, void 0, void 0, function* () {
147
- const taskId = this.generateId();
159
+ const taskId = LocalCloud.generateId();
148
160
  LocalStorage.tasks[taskId] = Object.assign(Object.assign({}, data), { id: "local", taskId, developer: this.developer, repo: this.repo });
149
161
  return taskId;
150
162
  });
@@ -158,7 +170,7 @@ export class LocalCloud extends Cloud {
158
170
  return __awaiter(this, void 0, void 0, function* () {
159
171
  for (const taskId in LocalStorage.tasks) {
160
172
  const data = LocalStorage.tasks[taskId];
161
- const jobId = this.generateId();
173
+ const jobId = LocalCloud.generateId();
162
174
  const timeCreated = Date.now();
163
175
  const job = {
164
176
  id: "local",
@@ -1 +1 @@
1
- {"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../../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