godprotocol 1.0.839 → 1.0.840
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/Loader_sequence/main.js +6 -1
- package/Loader_sequence/repository.js +3 -2
- package/Objects/Account.js +1 -1
- package/Objects/Block.js +1 -0
- package/Objects/Chain.js +2 -0
- package/Objects/Manager.js +4 -1
- package/Objects/Oracle.js +3 -1
- package/package.json +1 -1
package/Loader_sequence/main.js
CHANGED
|
@@ -473,13 +473,16 @@ class Loader {
|
|
|
473
473
|
obj[index] = line.slice(1).join(":").trim();
|
|
474
474
|
};
|
|
475
475
|
|
|
476
|
+
spawn = () => {
|
|
477
|
+
return new Loader(this.account);
|
|
478
|
+
};
|
|
479
|
+
|
|
476
480
|
compile = (codes) => {
|
|
477
481
|
let code_array = codes.split("\n");
|
|
478
482
|
|
|
479
483
|
for (let c = 0; c < code_array.length; c++) {
|
|
480
484
|
let line = code_array[c].trim();
|
|
481
485
|
|
|
482
|
-
console.log(line);
|
|
483
486
|
let curr_program = this.current_program();
|
|
484
487
|
this.is_routine = line.startsWith(".") || line.startsWith("@");
|
|
485
488
|
|
|
@@ -539,6 +542,8 @@ class Loader {
|
|
|
539
542
|
callback: cb,
|
|
540
543
|
});
|
|
541
544
|
|
|
545
|
+
this.program_configs[0].main = this.repository.oracle.hash(codes);
|
|
546
|
+
console.log(this.program_configs);
|
|
542
547
|
this.program_configs.map((config) => this.repository.add_program(config));
|
|
543
548
|
|
|
544
549
|
this.program_configs = [];
|
|
@@ -8,11 +8,12 @@ class Repository {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
add_program = (config) => {
|
|
11
|
-
let
|
|
11
|
+
let codes = config.codes.filter((line) => !!line.trim());
|
|
12
|
+
let code_hash = this.oracle.hash(codes);
|
|
12
13
|
let code_exist = this.codes.readone({ hash: code_hash });
|
|
13
14
|
|
|
14
15
|
let code = this.codes.write({
|
|
15
|
-
body:
|
|
16
|
+
body: codes,
|
|
16
17
|
hash: code_hash,
|
|
17
18
|
_id: code_exist && code_exist._id,
|
|
18
19
|
});
|
package/Objects/Account.js
CHANGED
|
@@ -131,7 +131,7 @@ class Account extends Filesystem {
|
|
|
131
131
|
this.propagate(payload, "load");
|
|
132
132
|
|
|
133
133
|
if (assemble) {
|
|
134
|
-
this.assembler.run(instructions, { cb: callback });
|
|
134
|
+
this.assembler.spawn().run(instructions, { cb: callback });
|
|
135
135
|
} else {
|
|
136
136
|
let pid = this.manage_buffer(callback);
|
|
137
137
|
|
package/Objects/Block.js
CHANGED
package/Objects/Chain.js
CHANGED
package/Objects/Manager.js
CHANGED
|
@@ -15,7 +15,10 @@ class Manager {
|
|
|
15
15
|
this.running = 0;
|
|
16
16
|
this.tracks = new Object();
|
|
17
17
|
this.web = new Blockweb(this);
|
|
18
|
-
this.oracle = new Oracle(this, {
|
|
18
|
+
this.oracle = new Oracle(this, {
|
|
19
|
+
compression: this.compression,
|
|
20
|
+
datastore: meta.datastore,
|
|
21
|
+
});
|
|
19
22
|
this.servers = new Array();
|
|
20
23
|
}
|
|
21
24
|
|
package/Objects/Oracle.js
CHANGED
|
@@ -10,7 +10,9 @@ class Oracle {
|
|
|
10
10
|
this.fs = fs;
|
|
11
11
|
this.mgr = mgr;
|
|
12
12
|
this.datapaths = new Object();
|
|
13
|
-
this.gds = new GDS(
|
|
13
|
+
this.gds = new GDS(
|
|
14
|
+
meta.datastore || process.env.DATASTORE || "godprotocol"
|
|
15
|
+
).sync({
|
|
14
16
|
manager: this.mgr,
|
|
15
17
|
});
|
|
16
18
|
}
|