zkcloudworker 0.2.7 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,74 @@
1
+ import { __awaiter } from "tslib";
2
+ import fs from "fs/promises";
3
+ export function saveFile(params) {
4
+ return __awaiter(this, void 0, void 0, function* () {
5
+ const { data, filename } = params;
6
+ const folder = "./data/";
7
+ const name = folder + filename + ".json";
8
+ try {
9
+ yield fs.access("./data");
10
+ }
11
+ catch (e) {
12
+ // if not, create it
13
+ yield fs.mkdir("./data");
14
+ }
15
+ try {
16
+ yield fs.writeFile(name, JSON.stringify(data, null, 2));
17
+ return name;
18
+ }
19
+ catch (e) {
20
+ console.error(`Error writing file ${name}`);
21
+ return undefined;
22
+ }
23
+ });
24
+ }
25
+ export function loadFile(filename) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const name = "./data/" + filename + ".json";
28
+ try {
29
+ const filedata = yield fs.readFile(name, "utf8");
30
+ const data = JSON.parse(filedata);
31
+ return data;
32
+ }
33
+ catch (e) {
34
+ console.error(`File ${name} does not exist or has wrong format`);
35
+ return undefined;
36
+ }
37
+ });
38
+ }
39
+ export function saveBinaryFile(params) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const { data, filename } = params;
42
+ const folder = "./data/";
43
+ const name = folder + filename + ".bin";
44
+ try {
45
+ yield fs.access("./data");
46
+ }
47
+ catch (e) {
48
+ // if not, create it
49
+ yield fs.mkdir("./data");
50
+ }
51
+ try {
52
+ yield fs.writeFile(name, data);
53
+ return name;
54
+ }
55
+ catch (e) {
56
+ console.error(`Error writing file ${name}`);
57
+ return undefined;
58
+ }
59
+ });
60
+ }
61
+ export function loadBinaryFile(filename) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const name = "./data/" + filename + ".bin";
64
+ try {
65
+ const data = yield fs.readFile(name);
66
+ return data;
67
+ }
68
+ catch (e) {
69
+ console.error(`File ${name} does not exist or has wrong format`);
70
+ return undefined;
71
+ }
72
+ });
73
+ }
74
+ //# sourceMappingURL=files.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CAAC,CAAC;YACjE,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CAAA;AAED,MAAM,UAAgB,cAAc,CAAC,MAIpC;;QACC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAClC,MAAM,MAAM,GAAG,SAAS,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;QACxC,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,oBAAoB;YACpB,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;YAC5C,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CAAA;AAED,MAAM,UAAgB,cAAc,CAAC,QAAgB;;QACnD,MAAM,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,qCAAqC,CAAC,CAAC;YACjE,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CAAA"}
@@ -2,12 +2,16 @@
2
2
  import { Cache, PrivateKey } from "o1js";
3
3
  import { Cloud, zkCloudWorker } from "./cloud";
4
4
  import { JobData } from "./job";
5
+ import { TaskData } from "./task";
6
+ import { blockchain } from "../networks";
5
7
  export declare class LocalCloud extends Cloud {
6
- data: Map<string, string>;
8
+ readonly localWorker: (cloud: Cloud) => Promise<zkCloudWorker>;
7
9
  constructor(params: {
8
10
  job: JobData;
11
+ chain: blockchain;
9
12
  cache?: Cache;
10
13
  stepId?: string;
14
+ localWorker: (cloud: Cloud) => Promise<zkCloudWorker>;
11
15
  });
12
16
  getDeployer(): Promise<PrivateKey>;
13
17
  log(msg: string): Promise<void>;
@@ -16,6 +20,28 @@ export declare class LocalCloud extends Cloud {
16
20
  saveFile(filename: string, value: Buffer): Promise<void>;
17
21
  loadFile(filename: string): Promise<Buffer | undefined>;
18
22
  loadEnvironment(password: string): Promise<void>;
23
+ private generateId;
24
+ recursiveProof(data: {
25
+ transactions: string[];
26
+ task?: string;
27
+ userId?: string;
28
+ args?: string;
29
+ metadata?: string;
30
+ }): Promise<string>;
31
+ execute(data: {
32
+ task: string;
33
+ userId?: string;
34
+ args?: string;
35
+ metadata?: string;
36
+ }): Promise<string>;
37
+ addTask(data: {
38
+ task: string;
39
+ userId?: string;
40
+ args?: string;
41
+ metadata?: string;
42
+ }): Promise<string>;
43
+ deleteTask(taskId: string): Promise<void>;
44
+ processTasks(): Promise<void>;
19
45
  static sequencer(params: {
20
46
  worker: zkCloudWorker;
21
47
  data: {
@@ -29,3 +55,22 @@ export declare class LocalCloud extends Cloud {
29
55
  };
30
56
  }): Promise<string>;
31
57
  }
58
+ export declare class LocalStorage {
59
+ static jobs: {
60
+ [key: string]: JobData;
61
+ };
62
+ static data: {
63
+ [key: string]: string;
64
+ };
65
+ static transactions: {
66
+ [key: string]: {
67
+ transaction: string;
68
+ timeReceived: number;
69
+ };
70
+ };
71
+ static tasks: {
72
+ [key: string]: TaskData;
73
+ };
74
+ static saveData(name: string): Promise<void>;
75
+ static loadData(name: string): Promise<void>;
76
+ }
@@ -1,9 +1,11 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { Cache } from "o1js";
3
3
  import { Cloud } from "./cloud";
4
+ import { makeString } from "../mina";
5
+ import { saveFile, loadFile, saveBinaryFile, loadBinaryFile } from "./files";
4
6
  export class LocalCloud extends Cloud {
5
7
  constructor(params) {
6
- const { job, cache, stepId } = params;
8
+ const { job, chain, cache, stepId, localWorker } = params;
7
9
  const { jobId, developer, repo, task, userId, args, metadata } = job;
8
10
  super({
9
11
  jobId: jobId,
@@ -16,8 +18,9 @@ export class LocalCloud extends Cloud {
16
18
  args: args,
17
19
  metadata: metadata,
18
20
  isLocalCloud: true,
21
+ chain,
19
22
  });
20
- this.data = new Map();
23
+ this.localWorker = localWorker;
21
24
  }
22
25
  getDeployer() {
23
26
  return __awaiter(this, void 0, void 0, function* () {
@@ -31,23 +34,24 @@ export class LocalCloud extends Cloud {
31
34
  }
32
35
  getDataByKey(key) {
33
36
  return __awaiter(this, void 0, void 0, function* () {
34
- const value = this.data.get(key);
37
+ const value = LocalStorage.data[key];
35
38
  return value;
36
39
  });
37
40
  }
38
41
  saveDataByKey(key, value) {
39
42
  return __awaiter(this, void 0, void 0, function* () {
40
- this.data.set(key, value);
43
+ LocalStorage.data[key] = value;
41
44
  });
42
45
  }
43
46
  saveFile(filename, value) {
44
47
  return __awaiter(this, void 0, void 0, function* () {
45
- throw new Error("Method not implemented.");
48
+ yield saveBinaryFile({ data: value, filename });
46
49
  });
47
50
  }
48
51
  loadFile(filename) {
49
52
  return __awaiter(this, void 0, void 0, function* () {
50
- throw new Error("Method not implemented.");
53
+ const data = yield loadBinaryFile(filename);
54
+ return data;
51
55
  });
52
56
  }
53
57
  loadEnvironment(password) {
@@ -55,6 +59,145 @@ export class LocalCloud extends Cloud {
55
59
  throw new Error("Method not implemented.");
56
60
  });
57
61
  }
62
+ generateId() {
63
+ return "local." + Date.now().toString() + "." + makeString(32);
64
+ }
65
+ recursiveProof(data) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ console.log("calculating recursive proof locally...");
68
+ const timeCreated = Date.now();
69
+ const jobId = this.generateId();
70
+ const job = {
71
+ 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,
81
+ timeCreated,
82
+ timeCreatedString: new Date(timeCreated).toISOString(),
83
+ timeStarted: timeCreated,
84
+ jobStatus: "started",
85
+ maxAttempts: 0,
86
+ };
87
+ const cloud = new LocalCloud({
88
+ job,
89
+ chain: this.chain,
90
+ localWorker: this.localWorker,
91
+ });
92
+ const worker = yield this.localWorker(cloud);
93
+ if (worker === undefined)
94
+ 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;
102
+ job.maxAttempts = 1;
103
+ LocalStorage.jobs[jobId] = job;
104
+ return jobId;
105
+ });
106
+ }
107
+ execute(data) {
108
+ 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,
130
+ chain: this.chain,
131
+ localWorker: this.localWorker,
132
+ });
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
+ });
144
+ }
145
+ addTask(data) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ const taskId = this.generateId();
148
+ LocalStorage.tasks[taskId] = Object.assign(Object.assign({}, data), { id: "local", taskId, developer: this.developer, repo: this.repo });
149
+ return taskId;
150
+ });
151
+ }
152
+ deleteTask(taskId) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ delete LocalStorage.tasks[taskId];
155
+ });
156
+ }
157
+ processTasks() {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ for (const taskId in LocalStorage.tasks) {
160
+ const data = LocalStorage.tasks[taskId];
161
+ const jobId = this.generateId();
162
+ const timeCreated = Date.now();
163
+ const job = {
164
+ id: "local",
165
+ jobId: jobId,
166
+ developer: this.developer,
167
+ repo: this.repo,
168
+ task: data.task,
169
+ userId: data.userId,
170
+ args: data.args,
171
+ metadata: data.metadata,
172
+ txNumber: 1,
173
+ timeCreated: timeCreated,
174
+ timeCreatedString: new Date(timeCreated).toISOString(),
175
+ timeStarted: Date.now(),
176
+ jobStatus: "started",
177
+ maxAttempts: 0,
178
+ };
179
+ const cloud = new LocalCloud({
180
+ job,
181
+ chain: this.chain,
182
+ localWorker: this.localWorker,
183
+ });
184
+ const worker = yield this.localWorker(cloud);
185
+ console.log("Executing task", { taskId, data });
186
+ const result = yield worker.task();
187
+ job.timeFinished = Date.now();
188
+ job.maxAttempts = 1;
189
+ job.billedDuration = job.timeFinished - timeCreated;
190
+ if (result !== undefined) {
191
+ job.jobStatus = "finished";
192
+ job.result = result;
193
+ }
194
+ else {
195
+ job.jobStatus = "failed";
196
+ }
197
+ LocalStorage.jobs[jobId] = job;
198
+ }
199
+ });
200
+ }
58
201
  static sequencer(params) {
59
202
  return __awaiter(this, void 0, void 0, function* () {
60
203
  const { worker, data } = params;
@@ -79,4 +222,34 @@ export class LocalCloud extends Cloud {
79
222
  });
80
223
  }
81
224
  }
225
+ export class LocalStorage {
226
+ static saveData(name) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const data = {
229
+ jobs: LocalStorage.jobs,
230
+ data: LocalStorage.data,
231
+ transactions: LocalStorage.transactions,
232
+ tasks: LocalStorage.tasks,
233
+ };
234
+ const filename = name + ".cloud";
235
+ yield saveFile({ data, filename });
236
+ });
237
+ }
238
+ static loadData(name) {
239
+ return __awaiter(this, void 0, void 0, function* () {
240
+ const filename = name + ".cloud";
241
+ const data = yield loadFile(filename);
242
+ if (data === undefined)
243
+ return;
244
+ LocalStorage.jobs = data.jobs;
245
+ LocalStorage.data = data.data;
246
+ LocalStorage.transactions = data.transactions;
247
+ LocalStorage.tasks = data.tasks;
248
+ });
249
+ }
250
+ }
251
+ LocalStorage.jobs = {};
252
+ LocalStorage.data = {};
253
+ LocalStorage.transactions = {};
254
+ LocalStorage.tasks = {};
82
255
  //# sourceMappingURL=local.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../../src/cloud/local.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAc,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAG/C,MAAM,OAAO,UAAW,SAAQ,KAAK;IAGnC,YAAY,MAAwD;QAClE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACtC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;QACrE,KAAK,CAAC;YACJ,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,QAAQ;YAC1B,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC;YAC3C,SAAS,EAAE,SAAS;YACpB,IAAI,EAAE,IAAI;YACV,IAA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,IAAI,EAAE,YAAY,CAAC,IAAI;gBACvB,YAAY,EAAE,YAAY,CAAC,YAAY;gBACvC,KAAK,EAAE,YAAY,CAAC,KAAK;aAC1B,CAAC;YACF,MAAM,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;YACjC,MAAM,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrC,CAAC;KAAA;IAED,MAAM,CAAO,QAAQ,CAAC,IAAY;;YAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;YACjC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO;YAC/B,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC9B,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC9B,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YAC9C,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAClC,CAAC;KAAA;;AA1BM,iBAAI,GAA+B,EAAE,CAAC;AACtC,iBAAI,GAA8B,EAAE,CAAC;AACrC,yBAAY,GAEf,EAAE,CAAC;AACA,kBAAK,GAAgC,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface TaskData {
2
+ id: string;
3
+ taskId: string;
4
+ developer: string;
5
+ repo: string;
6
+ task: string;
7
+ userId?: string;
8
+ args?: string;
9
+ metadata?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.js","sourceRoot":"","sources":["../../../../../src/cloud/task.ts"],"names":[],"mappings":""}