@leofcoin/chain 1.4.20 → 1.4.22
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/CHANGELOG.md +14 -14
- package/LICENSE +88 -88
- package/README.md +4 -4
- package/demo/index.html +25 -25
- package/examples/contracts/token.js +7 -7
- package/package.json +71 -71
- package/plugins/bundle.js +18 -18
- package/src/chain.js +716 -716
- package/src/config/config.js +14 -14
- package/src/config/main.js +4 -4
- package/src/config/protocol.js +5 -5
- package/src/contract.js +51 -51
- package/src/fee/config.js +3 -3
- package/src/machine.js +215 -215
- package/src/node.js +24 -24
- package/src/protocol.js +3 -3
- package/src/state.js +31 -31
- package/src/transaction.js +233 -233
- package/src/type.index.d.ts +20 -20
- package/src/typer.js +19 -19
- package/test/chain.js +120 -109
- package/test/contracts/token.js +40 -40
- package/test/create-genesis.js +66 -66
- package/tsconfig.js +14 -14
- package/workers/block-worker.js +40 -40
- package/workers/machine-worker.js +218 -218
- package/workers/pool-worker.js +28 -28
- package/workers/transaction-worker.js +19 -19
- package/workers/workers.js +8 -8
- package/block-worker.js +0 -1
- package/demo/865.browser.js +0 -10
- package/demo/chain.browser.js +0 -66842
- package/demo/generate-account.browser.js +0 -50
- package/demo/messages.browser.js +0 -328
- package/demo/multi-wallet.browser.js +0 -15
- package/demo/node.browser.js +0 -9858
- package/demo/pako.browser.js +0 -6900
- package/demo/peernet-swarm.browser.js +0 -839
- package/demo/storage.browser.js +0 -3724
- package/demo/workers/865.js +0 -10
- package/demo/workers/block-worker.js +0 -13175
- package/demo/workers/machine-worker.js +0 -13385
- package/demo/workers/pool-worker.js +0 -8503
- package/demo/workers/transaction-worker.js +0 -8495
- package/demo/wrtc.browser.js +0 -28
- package/dist/browser/workers/865.js +0 -10
- package/dist/browser/workers/block-worker.js +0 -9460
- package/dist/browser/workers/machine-worker.js +0 -9670
- package/dist/browser/workers/pool-worker.js +0 -4608
- package/dist/browser/workers/transaction-worker.js +0 -4600
- package/dist/chain.js +0 -10128
- package/dist/client-80bc8156.js +0 -491
- package/dist/commonjs-7fe3c381.js +0 -270
- package/dist/contracts/factory.js +0 -1
- package/dist/contracts/name-service.js +0 -1
- package/dist/contracts/native-token.js +0 -1
- package/dist/contracts/validators.js +0 -1
- package/dist/generate-account-445db122.js +0 -46
- package/dist/index-57f93805.js +0 -718
- package/dist/messages-bce1b91d-81af3b00.js +0 -315
- package/dist/module/chain.js +0 -10091
- package/dist/module/client-8031ec88.js +0 -489
- package/dist/module/commonjs-9005d5c0.js +0 -268
- package/dist/module/generate-account-489552b6.js +0 -44
- package/dist/module/index-ac2285c4.js +0 -688
- package/dist/module/messages-bce1b91d-eaf75d83.js +0 -302
- package/dist/module/node.js +0 -7049
- package/dist/module/workers/block-worker.js +0 -94
- package/dist/module/workers/machine-worker.js +0 -304
- package/dist/module/workers/pool-worker.js +0 -55
- package/dist/module/workers/transaction-worker.js +0 -47
- package/dist/node.js +0 -7061
- package/dist/standards/token.js +0 -1
- package/dist/workers/machine-worker.js +0 -1
- package/dist/workers/pool-worker.js +0 -1
- package/dist/workers/transaction-worker.js +0 -1
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
2
|
-
import { BigNumber } from '@ethersproject/bignumber';
|
|
3
|
-
import '@ethersproject/units';
|
|
4
|
-
import 'randombytes';
|
|
5
|
-
import EasyWorker from '@vandeurenglenn/easy-worker';
|
|
6
|
-
|
|
7
|
-
var proto = `
|
|
8
|
-
message ValidatorMessage {
|
|
9
|
-
required string address = 1;
|
|
10
|
-
required string reward = 2;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
message Transaction {
|
|
14
|
-
required string hash = 1;
|
|
15
|
-
required uint64 timestamp = 2;
|
|
16
|
-
required string from = 3;
|
|
17
|
-
required string to = 4;
|
|
18
|
-
required uint64 nonce = 5;
|
|
19
|
-
required string method = 6;
|
|
20
|
-
repeated string params = 7;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
message BlockMessage {
|
|
24
|
-
required uint64 index = 1;
|
|
25
|
-
required string previousHash = 3;
|
|
26
|
-
required uint64 timestamp = 4;
|
|
27
|
-
required uint64 reward = 5;
|
|
28
|
-
required string fees = 6;
|
|
29
|
-
repeated Transaction transactions = 7;
|
|
30
|
-
repeated ValidatorMessage validators = 8;
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
class BlockMessage extends FormatInterface {
|
|
35
|
-
get keys() {
|
|
36
|
-
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
get messageName() {
|
|
40
|
-
return 'BlockMessage'
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
constructor(buffer) {
|
|
44
|
-
const name = 'block-message';
|
|
45
|
-
super(buffer, proto, {name});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const byteFormats = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
50
|
-
|
|
51
|
-
const formatBytes = (bytes, decimals = 2) => {
|
|
52
|
-
if (bytes === 0) return '0 Bytes';
|
|
53
|
-
if (decimals < 0) decimals = 0;
|
|
54
|
-
|
|
55
|
-
const k = 1024;
|
|
56
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
57
|
-
|
|
58
|
-
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(decimals))} ${byteFormats[i]}`
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const worker = new EasyWorker();
|
|
62
|
-
|
|
63
|
-
globalThis.BigNumber = BigNumber;
|
|
64
|
-
|
|
65
|
-
globalThis.peernet = globalThis.peernet || {};
|
|
66
|
-
globalThis.contracts = {};
|
|
67
|
-
|
|
68
|
-
const run = async (blocks) => {
|
|
69
|
-
blocks = await Promise.all(blocks.map(block => new BlockMessage(block)));
|
|
70
|
-
blocks = blocks.sort((a, b) => a.decoded.timestamp - b.decoded.timestamp);
|
|
71
|
-
|
|
72
|
-
blocks = await Promise.all(blocks.map(block => new Promise(async (resolve, reject) => {
|
|
73
|
-
// todo: tx worker or nah?
|
|
74
|
-
const size = block.encoded.length || block.encoded.byteLength;
|
|
75
|
-
console.log(`loaded block: ${await block.hash} @${block.decoded.index} ${formatBytes(size)}`);
|
|
76
|
-
resolve(block);
|
|
77
|
-
})));
|
|
78
|
-
return blocks
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const tasks = async blocks => {
|
|
82
|
-
globalThis.peernet.codecs = {
|
|
83
|
-
'block-message': {
|
|
84
|
-
codec: parseInt('626d', 16),
|
|
85
|
-
hashAlg: 'keccak-256'
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
blocks = await run(blocks);
|
|
90
|
-
worker.postMessage(blocks);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
worker.onmessage(data => tasks(data));
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
2
|
-
import { BigNumber } from '@ethersproject/bignumber';
|
|
3
|
-
import '@ethersproject/units';
|
|
4
|
-
import 'randombytes';
|
|
5
|
-
import EasyWorker from '@vandeurenglenn/easy-worker';
|
|
6
|
-
|
|
7
|
-
var proto$1 = `
|
|
8
|
-
message ContractMessage {
|
|
9
|
-
required string creator = 1;
|
|
10
|
-
required bytes contract = 2;
|
|
11
|
-
repeated string constructorParameters = 3;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
class ContractMessage extends FormatInterface {
|
|
16
|
-
get keys() {
|
|
17
|
-
return ['creator', 'contract', 'constructorParameters']
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get messageName() {
|
|
21
|
-
return 'ContractMessage'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
constructor(buffer) {
|
|
25
|
-
super(buffer, proto$1, {name: 'contract-message'});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var proto = `
|
|
30
|
-
message ValidatorMessage {
|
|
31
|
-
required string address = 1;
|
|
32
|
-
required string reward = 2;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
message Transaction {
|
|
36
|
-
required string hash = 1;
|
|
37
|
-
required uint64 timestamp = 2;
|
|
38
|
-
required string from = 3;
|
|
39
|
-
required string to = 4;
|
|
40
|
-
required uint64 nonce = 5;
|
|
41
|
-
required string method = 6;
|
|
42
|
-
repeated string params = 7;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
message BlockMessage {
|
|
46
|
-
required uint64 index = 1;
|
|
47
|
-
required string previousHash = 3;
|
|
48
|
-
required uint64 timestamp = 4;
|
|
49
|
-
required uint64 reward = 5;
|
|
50
|
-
required string fees = 6;
|
|
51
|
-
repeated Transaction transactions = 7;
|
|
52
|
-
repeated ValidatorMessage validators = 8;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
|
-
class BlockMessage extends FormatInterface {
|
|
57
|
-
get keys() {
|
|
58
|
-
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
get messageName() {
|
|
62
|
-
return 'BlockMessage'
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
constructor(buffer) {
|
|
66
|
-
const name = 'block-message';
|
|
67
|
-
super(buffer, proto, {name});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const byteFormats = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
72
|
-
|
|
73
|
-
const formatBytes = (bytes, decimals = 2) => {
|
|
74
|
-
if (bytes === 0) return '0 Bytes';
|
|
75
|
-
if (decimals < 0) decimals = 0;
|
|
76
|
-
|
|
77
|
-
const k = 1024;
|
|
78
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
79
|
-
|
|
80
|
-
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(decimals))} ${byteFormats[i]}`
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
var contractFactory = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,56,71,85,107,103,52,120,87,113,109,110,83,56,75,101,122,56,107,54,68,115,82,120,90,66,68,97,54,114,71,74,109,104,107,122,67,75,113,78,75,102,85,110,103,90,122,109,54,97,81,34,44,34,99,111,110,116,114,97,99,116,34,58,34,99,108,97,115,115,32,70,97,99,116,111,114,121,123,35,110,97,109,101,61,92,34,65,114,116,79,110,108,105,110,101,67,111,110,116,114,97,99,116,70,97,99,116,111,114,121,92,34,59,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,61,48,59,35,99,111,110,116,114,97,99,116,115,61,91,93,59,99,111,110,115,116,114,117,99,116,111,114,40,115,116,97,116,101,41,123,115,116,97,116,101,38,38,40,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,61,115,116,97,116,101,46,99,111,110,116,114,97,99,116,115,44,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,61,115,116,97,116,101,46,116,111,116,97,108,67,111,110,116,114,97,99,116,115,41,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,116,111,116,97,108,67,111,110,116,114,97,99,116,115,58,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,44,99,111,110,116,114,97,99,116,115,58,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,125,125,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,99,111,110,116,114,97,99,116,115,40,41,123,114,101,116,117,114,110,91,46,46,46,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,93,125,103,101,116,32,116,111,116,97,108,67,111,110,116,114,97,99,116,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,125,97,115,121,110,99,32,114,101,103,105,115,116,101,114,67,111,110,116,114,97,99,116,40,97,100,100,114,101,115,115,41,123,105,102,40,97,119,97,105,116,32,109,115,103,46,115,116,97,116,105,99,67,97,108,108,40,97,100,100,114,101,115,115,44,92,34,104,97,115,82,111,108,101,92,34,44,91,109,115,103,46,115,101,110,100,101,114,44,92,34,79,87,78,69,82,92,34,93,41,44,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,46,105,110,99,108,117,100,101,115,40,97,100,100,114,101,115,115,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,97,108,114,101,97,100,121,32,114,101,103,105,115,116,101,114,101,100,92,34,41,59,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,43,61,49,44,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,46,112,117,115,104,40,97,100,100,114,101,115,115,41,125,125,114,101,116,117,114,110,32,70,97,99,116,111,114,121,59,34,44,34,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,34,58,91,93,125";
|
|
84
|
-
var nativeToken = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,56,71,85,107,103,52,120,87,113,109,110,83,56,75,101,122,56,107,54,68,115,82,120,90,66,68,97,54,114,71,74,109,104,107,122,67,75,113,78,75,102,85,110,103,90,122,109,54,97,81,34,44,34,99,111,110,116,114,97,99,116,34,58,34,99,108,97,115,115,32,82,111,108,101,115,123,35,114,111,108,101,115,61,123,79,87,78,69,82,58,91,93,44,77,73,78,84,58,91,93,44,66,85,82,78,58,91,93,125,59,99,111,110,115,116,114,117,99,116,111,114,40,114,111,108,101,115,41,123,105,102,40,114,111,108,101,115,41,123,105,102,40,33,40,114,111,108,101,115,32,105,110,115,116,97,110,99,101,111,102,32,79,98,106,101,99,116,41,41,116,104,114,111,119,32,110,101,119,32,84,121,112,101,69,114,114,111,114,40,92,34,101,120,112,101,99,116,101,100,32,114,111,108,101,115,32,116,111,32,98,101,32,97,110,32,111,98,106,101,99,116,92,34,41,59,116,104,105,115,46,35,114,111,108,101,115,61,123,46,46,46,114,111,108,101,115,44,46,46,46,116,104,105,115,46,35,114,111,108,101,115,125,125,101,108,115,101,32,116,104,105,115,46,35,103,114,97,110,116,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,92,34,79,87,78,69,82,92,34,41,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,114,111,108,101,115,58,116,104,105,115,46,114,111,108,101,115,125,125,103,101,116,32,114,111,108,101,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,114,111,108,101,115,125,125,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,114,101,116,117,114,110,33,33,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,38,38,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,105,110,99,108,117,100,101,115,40,97,100,100,114,101,115,115,41,125,35,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,36,123,114,111,108,101,125,32,114,111,108,101,32,97,108,114,101,97,100,121,32,103,114,97,110,116,101,100,32,102,111,114,32,36,123,97,100,100,114,101,115,115,125,96,41,59,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,112,117,115,104,40,97,100,100,114,101,115,115,41,125,35,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,36,123,114,111,108,101,125,32,114,111,108,101,32,97,108,114,101,97,100,121,32,114,101,118,111,107,101,100,32,102,111,114,32,36,123,97,100,100,114,101,115,115,125,96,41,59,105,102,40,92,34,79,87,78,69,82,92,34,61,61,61,114,111,108,101,38,38,49,61,61,61,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,108,101,110,103,116,104,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,97,116,108,101,97,115,116,32,111,110,101,32,111,119,110,101,114,32,105,115,32,110,101,101,100,101,100,33,92,34,41,59,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,115,112,108,105,99,101,40,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,105,110,100,101,120,79,102,40,97,100,100,114,101,115,115,41,41,125,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,92,34,79,87,78,69,82,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,78,111,116,32,97,108,108,111,119,101,100,92,34,41,59,116,104,105,115,46,35,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,125,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,92,34,79,87,78,69,82,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,78,111,116,32,97,108,108,111,119,101,100,92,34,41,59,116,104,105,115,46,35,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,125,125,99,108,97,115,115,32,84,111,107,101,110,32,101,120,116,101,110,100,115,32,82,111,108,101,115,123,35,110,97,109,101,59,35,115,121,109,98,111,108,59,35,104,111,108,100,101,114,115,61,48,59,35,98,97,108,97,110,99,101,115,61,123,125,59,35,97,112,112,114,111,118,97,108,115,61,123,125,59,35,100,101,99,105,109,97,108,115,61,49,56,59,35,116,111,116,97,108,83,117,112,112,108,121,61,66,105,103,78,117,109,98,101,114,46,102,114,111,109,40,48,41,59,99,111,110,115,116,114,117,99,116,111,114,40,110,97,109,101,44,115,121,109,98,111,108,44,100,101,99,105,109,97,108,115,61,49,56,44,115,116,97,116,101,41,123,105,102,40,33,110,97,109,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,97,109,101,32,117,110,100,101,102,105,110,101,100,92,34,41,59,105,102,40,33,115,121,109,98,111,108,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,115,121,109,98,111,108,32,117,110,100,101,102,105,110,101,100,92,34,41,59,115,117,112,101,114,40,115,116,97,116,101,63,46,114,111,108,101,115,41,44,116,104,105,115,46,35,110,97,109,101,61,110,97,109,101,44,116,104,105,115,46,35,115,121,109,98,111,108,61,115,121,109,98,111,108,44,116,104,105,115,46,35,100,101,99,105,109,97,108,115,61,100,101,99,105,109,97,108,115,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,46,46,46,115,117,112,101,114,46,115,116,97,116,101,44,104,111,108,100,101,114,115,58,116,104,105,115,46,104,111,108,100,101,114,115,44,98,97,108,97,110,99,101,115,58,116,104,105,115,46,98,97,108,97,110,99,101,115,44,97,112,112,114,111,118,97,108,115,58,123,46,46,46,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,125,44,116,111,116,97,108,83,117,112,112,108,121,58,116,104,105,115,46,116,111,116,97,108,83,117,112,112,108,121,125,125,103,101,116,32,116,111,116,97,108,83,117,112,112,108,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,125,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,115,121,109,98,111,108,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,115,121,109,98,111,108,125,103,101,116,32,104,111,108,100,101,114,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,104,111,108,100,101,114,115,125,103,101,116,32,98,97,108,97,110,99,101,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,98,97,108,97,110,99,101,115,125,125,109,105,110,116,40,116,111,44,97,109,111,117,110,116,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,92,34,77,73,78,84,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,116,32,97,108,108,111,119,101,100,92,34,41,59,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,61,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,46,97,100,100,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,105,110,99,114,101,97,115,101,66,97,108,97,110,99,101,40,116,111,44,97,109,111,117,110,116,41,125,98,117,114,110,40,102,114,111,109,44,97,109,111,117,110,116,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,92,34,66,85,82,78,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,116,32,97,108,108,111,119,101,100,92,34,41,59,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,61,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,46,115,117,98,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,100,101,99,114,101,97,115,101,66,97,108,97,110,99,101,40,102,114,111,109,44,97,109,111,117,110,116,41,125,35,98,101,102,111,114,101,84,114,97,110,115,102,101,114,40,102,114,111,109,44,116,111,44,97,109,111,117,110,116,41,123,105,102,40,33,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,102,114,111,109,93,124,124,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,102,114,111,109,93,60,97,109,111,117,110,116,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,97,109,111,117,110,116,32,101,120,99,101,101,100,115,32,98,97,108,97,110,99,101,92,34,41,125,35,117,112,100,97,116,101,72,111,108,100,101,114,115,40,97,100,100,114,101,115,115,44,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,41,123,92,34,48,120,48,48,92,34,61,61,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,116,111,72,101,120,83,116,114,105,110,103,40,41,63,116,104,105,115,46,35,104,111,108,100,101,114,115,45,61,49,58,92,34,48,120,48,48,92,34,33,61,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,116,111,72,101,120,83,116,114,105,110,103,40,41,38,38,92,34,48,120,48,48,92,34,61,61,61,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,46,116,111,72,101,120,83,116,114,105,110,103,40,41,38,38,40,116,104,105,115,46,35,104,111,108,100,101,114,115,43,61,49,41,125,35,105,110,99,114,101,97,115,101,66,97,108,97,110,99,101,40,97,100,100,114,101,115,115,44,97,109,111,117,110,116,41,123,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,124,124,40,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,61,66,105,103,78,117,109,98,101,114,46,102,114,111,109,40,48,41,41,59,99,111,110,115,116,32,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,59,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,97,100,100,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,117,112,100,97,116,101,72,111,108,100,101,114,115,40,97,100,100,114,101,115,115,44,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,41,125,35,100,101,99,114,101,97,115,101,66,97,108,97,110,99,101,40,97,100,100,114,101,115,115,44,97,109,111,117,110,116,41,123,99,111,110,115,116,32,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,59,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,115,117,98,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,117,112,100,97,116,101,72,111,108,100,101,114,115,40,97,100,100,114,101,115,115,44,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,41,125,98,97,108,97,110,99,101,79,102,40,97,100,100,114,101,115,115,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,125,115,101,116,65,112,112,114,111,118,97,108,40,111,112,101,114,97,116,111,114,44,97,109,111,117,110,116,41,123,99,111,110,115,116,32,111,119,110,101,114,61,103,108,111,98,97,108,84,104,105,115,46,109,115,103,46,115,101,110,100,101,114,59,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,124,124,40,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,61,123,125,41,44,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,91,111,112,101,114,97,116,111,114,93,61,97,109,111,117,110,116,125,97,112,112,114,111,118,101,100,40,111,119,110,101,114,44,111,112,101,114,97,116,111,114,44,97,109,111,117,110,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,91,111,112,101,114,97,116,111,114,93,61,61,61,97,109,111,117,110,116,125,116,114,97,110,115,102,101,114,40,102,114,111,109,44,116,111,44,97,109,111,117,110,116,41,123,97,109,111,117,110,116,61,66,105,103,78,117,109,98,101,114,46,102,114,111,109,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,98,101,102,111,114,101,84,114,97,110,115,102,101,114,40,102,114,111,109,44,116,111,44,97,109,111,117,110,116,41,44,116,104,105,115,46,35,100,101,99,114,101,97,115,101,66,97,108,97,110,99,101,40,102,114,111,109,44,97,109,111,117,110,116,41,44,116,104,105,115,46,35,105,110,99,114,101,97,115,101,66,97,108,97,110,99,101,40,116,111,44,97,109,111,117,110,116,41,125,125,99,108,97,115,115,32,65,114,116,79,110,108,105,110,101,32,101,120,116,101,110,100,115,32,84,111,107,101,110,123,99,111,110,115,116,114,117,99,116,111,114,40,115,116,97,116,101,41,123,115,117,112,101,114,40,92,34,65,114,116,79,110,108,105,110,101,92,34,44,92,34,65,82,84,92,34,44,49,56,44,115,116,97,116,101,41,125,125,114,101,116,117,114,110,32,65,114,116,79,110,108,105,110,101,59,34,44,34,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,34,58,91,93,125";
|
|
85
|
-
var nameService = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,56,71,85,107,103,52,120,87,113,109,110,83,56,75,101,122,56,107,54,68,115,82,120,90,66,68,97,54,114,71,74,109,104,107,122,67,75,113,78,75,102,85,110,103,90,122,109,54,97,81,34,44,34,99,111,110,116,114,97,99,116,34,58,34,99,108,97,115,115,32,78,97,109,101,83,101,114,118,105,99,101,123,35,110,97,109,101,61,92,34,65,114,116,79,110,108,105,110,101,78,97,109,101,83,101,114,118,105,99,101,92,34,59,35,111,119,110,101,114,59,35,112,114,105,99,101,61,48,59,35,114,101,103,105,115,116,114,121,61,123,125,59,35,99,117,114,114,101,110,99,121,59,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,114,101,103,105,115,116,114,121,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,114,101,103,105,115,116,114,121,125,125,103,101,116,32,115,116,97,116,101,40,41,123,125,99,111,110,115,116,114,117,99,116,111,114,40,102,97,99,116,111,114,121,65,100,100,114,101,115,115,44,99,117,114,114,101,110,99,121,44,118,97,108,105,100,97,116,111,114,65,100,100,114,101,115,115,44,112,114,105,99,101,44,115,116,97,116,101,41,123,115,116,97,116,101,63,40,116,104,105,115,46,35,111,119,110,101,114,61,115,116,97,116,101,46,111,119,110,101,114,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,61,115,116,97,116,101,46,114,101,103,105,115,116,114,121,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,115,116,97,116,101,46,99,117,114,114,101,110,99,121,44,116,104,105,115,46,35,112,114,105,99,101,61,115,116,97,116,101,46,112,114,105,99,101,41,58,40,116,104,105,115,46,35,111,119,110,101,114,61,109,115,103,46,115,101,110,100,101,114,44,116,104,105,115,46,35,112,114,105,99,101,61,112,114,105,99,101,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,65,114,116,79,110,108,105,110,101,67,111,110,116,114,97,99,116,70,97,99,116,111,114,121,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,102,97,99,116,111,114,121,65,100,100,114,101,115,115,125,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,65,114,116,79,110,108,105,110,101,84,111,107,101,110,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,99,117,114,114,101,110,99,121,125,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,65,114,116,79,110,108,105,110,101,86,97,108,105,100,97,116,111,114,115,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,118,97,108,105,100,97,116,111,114,65,100,100,114,101,115,115,125,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,99,117,114,114,101,110,99,121,41,125,99,104,97,110,103,101,79,119,110,101,114,40,111,119,110,101,114,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,32,111,119,110,101,114,92,34,41,59,116,104,105,115,46,35,111,119,110,101,114,61,111,119,110,101,114,125,99,104,97,110,103,101,80,114,105,99,101,40,112,114,105,99,101,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,32,111,119,110,101,114,92,34,41,59,116,104,105,115,46,35,112,114,105,99,101,61,112,114,105,99,101,125,99,104,97,110,103,101,67,117,114,114,101,110,99,121,40,99,117,114,114,101,110,99,121,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,32,111,119,110,101,114,92,34,41,59,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,99,117,114,114,101,110,99,121,125,97,115,121,110,99,32,112,117,114,99,104,97,115,101,78,97,109,101,40,110,97,109,101,44,97,100,100,114,101,115,115,41,123,105,102,40,97,119,97,105,116,32,109,115,103,46,99,97,108,108,40,116,104,105,115,46,35,99,117,114,114,101,110,99,121,44,92,34,98,97,108,97,110,99,101,79,102,92,34,44,91,109,115,103,46,115,101,110,100,101,114,93,41,60,116,104,105,115,46,35,112,114,105,99,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,112,114,105,99,101,32,101,120,99,101,101,100,115,32,98,97,108,97,110,99,101,92,34,41,59,116,114,121,123,97,119,97,105,116,32,109,115,103,46,99,97,108,108,40,116,104,105,115,46,35,99,117,114,114,101,110,99,121,44,92,34,116,114,97,110,115,102,101,114,92,34,44,91,109,115,103,46,115,101,110,100,101,114,44,116,104,105,115,46,35,111,119,110,101,114,44,116,104,105,115,46,35,112,114,105,99,101,93,41,125,99,97,116,99,104,40,101,114,114,111,114,41,123,116,104,114,111,119,32,101,114,114,111,114,125,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,125,125,108,111,111,107,117,112,40,110,97,109,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,125,116,114,97,110,115,102,101,114,79,119,110,101,114,115,104,105,112,40,110,97,109,101,44,116,111,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,116,32,97,32,111,119,110,101,114,92,34,41,59,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,46,111,119,110,101,114,61,116,111,125,99,104,97,110,103,101,65,100,100,114,101,115,115,40,110,97,109,101,44,97,100,100,114,101,115,115,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,116,32,97,32,111,119,110,101,114,92,34,41,59,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,46,97,100,100,114,101,115,115,61,97,100,100,114,101,115,115,125,125,114,101,116,117,114,110,32,78,97,109,101,83,101,114,118,105,99,101,59,34,44,34,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,34,58,91,34,105,104,110,121,50,103,113,103,54,99,54,109,119,121,53,109,104,98,114,115,53,117,108,107,107,111,122,115,103,119,116,107,53,118,117,122,53,107,114,106,105,100,111,117,121,52,109,98,119,102,100,98,106,110,98,109,107,122,122,34,44,34,105,104,110,121,50,103,113,104,111,111,99,107,121,103,55,121,103,52,110,53,98,112,120,117,108,100,97,104,102,97,118,112,113,110,109,112,111,101,50,98,110,52,105,118,110,120,109,107,55,114,101,100,99,50,108,116,119,107,98,34,44,34,105,104,110,121,50,103,113,104,52,101,50,112,114,52,112,98,116,112,107,97,109,104,106,51,104,116,115,118,117,111,121,100,121,51,119,111,116,97,117,100,111,101,97,107,116,103,99,100,119,109,111,105,106,54,54,112,101,99,112,34,44,34,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,34,93,125";
|
|
86
|
-
var validators = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,56,71,85,107,103,52,120,87,113,109,110,83,56,75,101,122,56,107,54,68,115,82,120,90,66,68,97,54,114,71,74,109,104,107,122,67,75,113,78,75,102,85,110,103,90,122,109,54,97,81,34,44,34,99,111,110,116,114,97,99,116,34,58,34,99,108,97,115,115,32,82,111,108,101,115,123,35,114,111,108,101,115,61,123,79,87,78,69,82,58,91,93,44,77,73,78,84,58,91,93,44,66,85,82,78,58,91,93,125,59,99,111,110,115,116,114,117,99,116,111,114,40,114,111,108,101,115,41,123,105,102,40,114,111,108,101,115,41,123,105,102,40,33,40,114,111,108,101,115,32,105,110,115,116,97,110,99,101,111,102,32,79,98,106,101,99,116,41,41,116,104,114,111,119,32,110,101,119,32,84,121,112,101,69,114,114,111,114,40,92,34,101,120,112,101,99,116,101,100,32,114,111,108,101,115,32,116,111,32,98,101,32,97,110,32,111,98,106,101,99,116,92,34,41,59,116,104,105,115,46,35,114,111,108,101,115,61,123,46,46,46,114,111,108,101,115,44,46,46,46,116,104,105,115,46,35,114,111,108,101,115,125,125,101,108,115,101,32,116,104,105,115,46,35,103,114,97,110,116,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,92,34,79,87,78,69,82,92,34,41,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,114,111,108,101,115,58,116,104,105,115,46,114,111,108,101,115,125,125,103,101,116,32,114,111,108,101,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,114,111,108,101,115,125,125,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,114,101,116,117,114,110,33,33,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,38,38,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,105,110,99,108,117,100,101,115,40,97,100,100,114,101,115,115,41,125,35,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,36,123,114,111,108,101,125,32,114,111,108,101,32,97,108,114,101,97,100,121,32,103,114,97,110,116,101,100,32,102,111,114,32,36,123,97,100,100,114,101,115,115,125,96,41,59,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,112,117,115,104,40,97,100,100,114,101,115,115,41,125,35,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,36,123,114,111,108,101,125,32,114,111,108,101,32,97,108,114,101,97,100,121,32,114,101,118,111,107,101,100,32,102,111,114,32,36,123,97,100,100,114,101,115,115,125,96,41,59,105,102,40,92,34,79,87,78,69,82,92,34,61,61,61,114,111,108,101,38,38,49,61,61,61,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,108,101,110,103,116,104,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,97,116,108,101,97,115,116,32,111,110,101,32,111,119,110,101,114,32,105,115,32,110,101,101,100,101,100,33,92,34,41,59,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,115,112,108,105,99,101,40,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,105,110,100,101,120,79,102,40,97,100,100,114,101,115,115,41,41,125,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,92,34,79,87,78,69,82,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,78,111,116,32,97,108,108,111,119,101,100,92,34,41,59,116,104,105,115,46,35,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,125,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,92,34,79,87,78,69,82,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,78,111,116,32,97,108,108,111,119,101,100,92,34,41,59,116,104,105,115,46,35,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,125,125,99,108,97,115,115,32,86,97,108,105,100,97,116,111,114,115,32,101,120,116,101,110,100,115,32,82,111,108,101,115,123,35,110,97,109,101,61,92,34,65,114,116,79,110,108,105,110,101,86,97,108,105,100,97,116,111,114,115,92,34,59,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,61,48,59,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,61,48,59,35,118,97,108,105,100,97,116,111,114,115,61,123,125,59,35,99,117,114,114,101,110,99,121,59,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,59,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,46,46,46,115,117,112,101,114,46,115,116,97,116,101,44,109,105,110,105,109,117,109,66,97,108,97,110,99,101,58,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,44,99,117,114,114,101,110,99,121,58,116,104,105,115,46,35,99,117,114,114,101,110,99,121,44,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,58,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,44,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,58,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,44,118,97,108,105,100,97,116,111,114,115,58,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,125,125,99,111,110,115,116,114,117,99,116,111,114,40,116,111,107,101,110,65,100,100,114,101,115,115,44,115,116,97,116,101,41,123,115,117,112,101,114,40,115,116,97,116,101,63,46,114,111,108,101,115,41,44,115,116,97,116,101,63,40,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,61,115,116,97,116,101,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,115,116,97,116,101,46,99,117,114,114,101,110,99,121,44,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,61,115,116,97,116,101,46,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,44,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,61,115,116,97,116,101,46,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,61,115,116,97,116,101,46,118,97,108,105,100,97,116,111,114,115,41,58,40,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,61,53,101,52,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,116,111,107,101,110,65,100,100,114,101,115,115,44,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,43,61,49,44,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,43,61,49,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,109,115,103,46,115,101,110,100,101,114,93,61,123,102,105,114,115,116,83,101,101,110,58,68,97,116,101,46,110,111,119,40,41,44,108,97,115,116,83,101,101,110,58,68,97,116,101,46,110,111,119,40,41,44,97,99,116,105,118,101,58,33,48,125,41,125,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,99,117,114,114,101,110,99,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,99,117,114,114,101,110,99,121,125,103,101,116,32,118,97,108,105,100,97,116,111,114,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,125,125,103,101,116,32,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,125,103,101,116,32,109,105,110,105,109,117,109,66,97,108,97,110,99,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,125,99,104,97,110,103,101,67,117,114,114,101,110,99,121,40,99,117,114,114,101,110,99,121,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,92,34,79,87,78,69,82,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,110,111,116,32,97,110,32,111,119,110,101,114,92,34,41,59,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,99,117,114,114,101,110,99,121,125,104,97,115,40,118,97,108,105,100,97,116,111,114,41,123,114,101,116,117,114,110,32,66,111,111,108,101,97,110,40,118,111,105,100,32,48,33,61,61,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,41,125,35,105,115,65,108,108,111,119,101,100,40,97,100,100,114,101,115,115,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,97,100,100,114,101,115,115,38,38,33,116,104,105,115,46,104,97,115,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,92,34,79,87,78,69,82,92,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,115,101,110,100,101,114,32,105,115,32,110,111,116,32,116,104,101,32,118,97,108,105,100,97,116,111,114,32,111,114,32,111,119,110,101,114,92,34,41,59,114,101,116,117,114,110,33,48,125,97,115,121,110,99,32,97,100,100,86,97,108,105,100,97,116,111,114,40,118,97,108,105,100,97,116,111,114,41,123,105,102,40,116,104,105,115,46,35,105,115,65,108,108,111,119,101,100,40,118,97,108,105,100,97,116,111,114,41,44,116,104,105,115,46,104,97,115,40,118,97,108,105,100,97,116,111,114,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,97,108,114,101,97,100,121,32,97,32,118,97,108,105,100,97,116,111,114,92,34,41,59,99,111,110,115,116,32,98,97,108,97,110,99,101,61,97,119,97,105,116,32,109,115,103,46,115,116,97,116,105,99,67,97,108,108,40,116,104,105,115,46,99,117,114,114,101,110,99,121,44,92,34,98,97,108,97,110,99,101,79,102,92,34,44,91,118,97,108,105,100,97,116,111,114,93,41,59,105,102,40,98,97,108,97,110,99,101,60,116,104,105,115,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,98,97,108,97,110,99,101,32,116,111,32,108,111,119,33,32,103,111,116,58,32,36,123,98,97,108,97,110,99,101,125,32,110,101,101,100,58,32,36,123,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,125,96,41,59,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,43,61,49,44,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,43,61,49,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,61,123,102,105,114,115,116,83,101,101,110,58,68,97,116,101,46,110,111,119,40,41,44,108,97,115,116,83,101,101,110,58,68,97,116,101,46,110,111,119,40,41,44,97,99,116,105,118,101,58,33,48,125,125,114,101,109,111,118,101,86,97,108,105,100,97,116,111,114,40,118,97,108,105,100,97,116,111,114,41,123,105,102,40,116,104,105,115,46,35,105,115,65,108,108,111,119,101,100,40,118,97,108,105,100,97,116,111,114,41,44,33,116,104,105,115,46,104,97,115,40,118,97,108,105,100,97,116,111,114,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,118,97,108,105,100,97,116,111,114,32,110,111,116,32,102,111,117,110,100,92,34,41,59,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,45,61,49,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,46,97,99,116,105,118,101,38,38,40,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,45,61,49,41,44,100,101,108,101,116,101,32,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,125,97,115,121,110,99,32,117,112,100,97,116,101,86,97,108,105,100,97,116,111,114,40,118,97,108,105,100,97,116,111,114,44,97,99,116,105,118,101,41,123,105,102,40,116,104,105,115,46,35,105,115,65,108,108,111,119,101,100,40,118,97,108,105,100,97,116,111,114,41,44,33,116,104,105,115,46,104,97,115,40,118,97,108,105,100,97,116,111,114,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,118,97,108,105,100,97,116,111,114,32,110,111,116,32,102,111,117,110,100,92,34,41,59,99,111,110,115,116,32,98,97,108,97,110,99,101,61,97,119,97,105,116,32,109,115,103,46,115,116,97,116,105,99,67,97,108,108,40,116,104,105,115,46,99,117,114,114,101,110,99,121,44,92,34,98,97,108,97,110,99,101,79,102,92,34,44,91,118,97,108,105,100,97,116,111,114,93,41,59,105,102,40,98,97,108,97,110,99,101,60,116,104,105,115,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,38,38,97,99,116,105,118,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,98,97,108,97,110,99,101,32,116,111,32,108,111,119,33,32,103,111,116,58,32,36,123,98,97,108,97,110,99,101,125,32,110,101,101,100,58,32,36,123,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,125,96,41,59,105,102,40,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,46,97,99,116,105,118,101,61,61,61,97,99,116,105,118,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,97,108,114,101,97,100,121,32,92,34,43,40,97,99,116,105,118,101,63,92,34,97,99,116,105,118,97,116,101,100,92,34,58,92,34,100,101,97,99,116,105,118,97,116,101,100,92,34,41,41,59,97,99,116,105,118,101,63,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,43,61,49,58,116,104,105,115,46,35,97,99,116,105,118,101,86,97,108,105,100,97,116,111,114,115,45,61,49,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,46,97,99,116,105,118,101,61,97,99,116,105,118,101,125,125,114,101,116,117,114,110,32,86,97,108,105,100,97,116,111,114,115,59,34,44,34,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,34,58,91,34,105,104,110,121,50,103,113,104,111,111,99,107,121,103,55,121,103,52,110,53,98,112,120,117,108,100,97,104,102,97,118,112,113,110,109,112,111,101,50,98,110,52,105,118,110,120,109,107,55,114,101,100,99,50,108,116,119,107,98,34,93,125";
|
|
87
|
-
var bytecodes = {
|
|
88
|
-
contractFactory: contractFactory,
|
|
89
|
-
nativeToken: nativeToken,
|
|
90
|
-
nameService: nameService,
|
|
91
|
-
validators: validators
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const worker = new EasyWorker();
|
|
95
|
-
|
|
96
|
-
const contractFactoryMessage = bytecodes.contractFactory;
|
|
97
|
-
const nativeTokenMessage = bytecodes.nativeToken;
|
|
98
|
-
const nameServiceMessage = bytecodes.nameService;
|
|
99
|
-
const validatorsMessage = bytecodes.validators;
|
|
100
|
-
|
|
101
|
-
globalThis.BigNumber = BigNumber;
|
|
102
|
-
|
|
103
|
-
globalThis.peernet = globalThis.peernet || {};
|
|
104
|
-
globalThis.contracts = {};
|
|
105
|
-
|
|
106
|
-
const get = (contract, method, params) => {
|
|
107
|
-
let result;
|
|
108
|
-
if (params?.length > 0) {
|
|
109
|
-
result = contracts[contract][method](...params);
|
|
110
|
-
} else {
|
|
111
|
-
result = contracts[contract][method];
|
|
112
|
-
}
|
|
113
|
-
return result
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const runContract = async ({decoded, hash, encoded}) => {
|
|
117
|
-
const params = decoded.constructorParameters;
|
|
118
|
-
try {
|
|
119
|
-
|
|
120
|
-
const func = new Function(decoded.contract);
|
|
121
|
-
const Contract = func();
|
|
122
|
-
|
|
123
|
-
globalThis.msg = createMessage(decoded.creator);
|
|
124
|
-
contracts[hash] = await new Contract(...params);
|
|
125
|
-
worker.postMessage({
|
|
126
|
-
type: 'debug',
|
|
127
|
-
messages: [
|
|
128
|
-
`loaded contract: ${hash}`,
|
|
129
|
-
`size: ${formatBytes(encoded.length)}`
|
|
130
|
-
]
|
|
131
|
-
});
|
|
132
|
-
} catch (e) {
|
|
133
|
-
console.log(e);
|
|
134
|
-
worker.postMessage({
|
|
135
|
-
type: 'contractError',
|
|
136
|
-
hash: await contractMessage.hash
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const execute = async (contract, method, params) => {
|
|
142
|
-
try {
|
|
143
|
-
let result;
|
|
144
|
-
// don't execute the method on a proxy
|
|
145
|
-
if (contracts[contract].fallback) {
|
|
146
|
-
result = await contracts[contract].fallback(method, params);
|
|
147
|
-
} else {
|
|
148
|
-
result = await contracts[contract][method](...params);
|
|
149
|
-
}
|
|
150
|
-
// state.put(result)
|
|
151
|
-
return result
|
|
152
|
-
} catch (e) {
|
|
153
|
-
throw e
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const createMessage = (sender = globalThis.peerid) => {
|
|
159
|
-
return {
|
|
160
|
-
sender,
|
|
161
|
-
call: execute,
|
|
162
|
-
staticCall: get
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const _init = async ({ contracts, blocks, peerid })=> {
|
|
167
|
-
|
|
168
|
-
globalThis.peernet.codecs = {
|
|
169
|
-
'contract-message': {
|
|
170
|
-
codec: parseInt('63636d', 16),
|
|
171
|
-
hashAlg: 'keccak-256'
|
|
172
|
-
},
|
|
173
|
-
'transaction-message': {
|
|
174
|
-
codec: parseInt('746d', 16),
|
|
175
|
-
hashAlg: 'keccak-256'
|
|
176
|
-
},
|
|
177
|
-
'block-message': {
|
|
178
|
-
codec: parseInt('626d', 16),
|
|
179
|
-
hashAlg: 'keccak-256'
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
globalThis.peerid = peerid;
|
|
184
|
-
contracts = [
|
|
185
|
-
contractFactoryMessage,
|
|
186
|
-
nativeTokenMessage,
|
|
187
|
-
nameServiceMessage,
|
|
188
|
-
validatorsMessage
|
|
189
|
-
];
|
|
190
|
-
|
|
191
|
-
contracts = await Promise.all(contracts.map(async contract => {
|
|
192
|
-
contract = await new ContractMessage(new Uint8Array(contract.split(',')));
|
|
193
|
-
await runContract({decoded: contract.decoded, encoded: contract.encoded, hash: await contract.hash});
|
|
194
|
-
return contract
|
|
195
|
-
}));
|
|
196
|
-
|
|
197
|
-
let lastBlock = {hash: '0x0'};
|
|
198
|
-
|
|
199
|
-
if (blocks?.length > 0) {
|
|
200
|
-
const _worker = await new EasyWorker('./block-worker.js', {serialization: 'advanced', type: 'module' });
|
|
201
|
-
blocks = await _worker.once([blocks[blocks.length - 1]]);
|
|
202
|
-
|
|
203
|
-
// blocks = unique(globalThis.blocks ? globalThis : [], blocks)
|
|
204
|
-
// for (let i = 0; i < blocks.length; i++) {
|
|
205
|
-
|
|
206
|
-
// }
|
|
207
|
-
// for (const block of blocks) {
|
|
208
|
-
// await Promise.all(block.decoded.transactions.map(async message => {
|
|
209
|
-
// if (!block.loaded) {
|
|
210
|
-
// const {from, to, method, params} = message;
|
|
211
|
-
// globalThis.msg = createMessage(from);
|
|
212
|
-
|
|
213
|
-
// await execute(to, method, params);
|
|
214
|
-
// block.loaded = true
|
|
215
|
-
// }
|
|
216
|
-
// }));
|
|
217
|
-
// }
|
|
218
|
-
|
|
219
|
-
if (blocks.length > 0) {
|
|
220
|
-
lastBlock = blocks[blocks.length - 1].decoded;
|
|
221
|
-
lastBlock = await new BlockMessage(lastBlock);
|
|
222
|
-
|
|
223
|
-
lastBlock = {
|
|
224
|
-
...lastBlock.decoded,
|
|
225
|
-
hash: await lastBlock.hash
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
globalThis.blocks = blocks;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
worker.postMessage({type: 'machine-ready', lastBlock});
|
|
235
|
-
|
|
236
|
-
// worker.postMessage({blocks});
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
const tasks = async (e) => {
|
|
240
|
-
const id = e.id;
|
|
241
|
-
if (e.type === 'init') {
|
|
242
|
-
try {
|
|
243
|
-
await _init(e.input);
|
|
244
|
-
} catch (e) {
|
|
245
|
-
worker.postMessage({
|
|
246
|
-
type: 'initError',
|
|
247
|
-
message: e.message,
|
|
248
|
-
id
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
if (e.type === 'run') {
|
|
253
|
-
try {
|
|
254
|
-
const value = await runContract(e.input);
|
|
255
|
-
worker.postMessage({
|
|
256
|
-
type: 'response',
|
|
257
|
-
id,
|
|
258
|
-
value
|
|
259
|
-
});
|
|
260
|
-
} catch (e) {
|
|
261
|
-
worker.postMessage({
|
|
262
|
-
type: 'runError',
|
|
263
|
-
message: e.message,
|
|
264
|
-
id
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
if (e.type === 'get') {
|
|
269
|
-
try {
|
|
270
|
-
const value = await get(e.input.contract, e.input.method, e.input.params);
|
|
271
|
-
worker.postMessage({
|
|
272
|
-
type: 'response',
|
|
273
|
-
id,
|
|
274
|
-
value
|
|
275
|
-
});
|
|
276
|
-
} catch (e) {
|
|
277
|
-
worker.postMessage({
|
|
278
|
-
type: 'fetchError',
|
|
279
|
-
message: e.message,
|
|
280
|
-
id
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
if (e.type === 'execute') {
|
|
286
|
-
try {
|
|
287
|
-
const value = await execute(e.input.contract, e.input.method, e.input.params);
|
|
288
|
-
worker.postMessage({
|
|
289
|
-
type: 'response',
|
|
290
|
-
id,
|
|
291
|
-
value
|
|
292
|
-
});
|
|
293
|
-
} catch(e) {
|
|
294
|
-
worker.postMessage({
|
|
295
|
-
type: 'executionError',
|
|
296
|
-
message: e.message,
|
|
297
|
-
id
|
|
298
|
-
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
worker.onmessage(data => tasks(data));
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
2
|
-
import EasyWorker from '@vandeurenglenn/easy-worker';
|
|
3
|
-
|
|
4
|
-
var proto = `
|
|
5
|
-
|
|
6
|
-
message TransactionMessage {
|
|
7
|
-
required uint64 timestamp = 1;
|
|
8
|
-
required string from = 2;
|
|
9
|
-
required string to = 3;
|
|
10
|
-
required uint64 nonce = 4;
|
|
11
|
-
required string method = 5;
|
|
12
|
-
repeated string params = 6;
|
|
13
|
-
required string signature = 7;
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
class TransactionMessage extends FormatInterface {
|
|
18
|
-
get keys() {
|
|
19
|
-
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
get messageName() {
|
|
23
|
-
return 'TransactionMessage'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
constructor(buffer) {
|
|
27
|
-
const name = 'transaction-message';
|
|
28
|
-
super(buffer, proto, {name});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
globalThis.peernet = globalThis.peernet || {};
|
|
33
|
-
globalThis.contracts = {};
|
|
34
|
-
|
|
35
|
-
const worker = new EasyWorker();
|
|
36
|
-
|
|
37
|
-
const tasks = async transactions => {
|
|
38
|
-
|
|
39
|
-
globalThis.peernet.codecs = {
|
|
40
|
-
'transaction-message': {
|
|
41
|
-
codec: parseInt('746d', 16),
|
|
42
|
-
hashAlg: 'keccak-256'
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
transactions = await Promise.all(transactions.map(async message => {
|
|
47
|
-
message = await new TransactionMessage(message);
|
|
48
|
-
|
|
49
|
-
return {...message.decoded, hash: await message.hash, size: message.encoded.length}
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
worker.postMessage(transactions);
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
worker.onmessage(data => tasks(data));
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
2
|
-
import EasyWorker from '@vandeurenglenn/easy-worker';
|
|
3
|
-
|
|
4
|
-
var proto = `
|
|
5
|
-
|
|
6
|
-
message TransactionMessage {
|
|
7
|
-
required uint64 timestamp = 1;
|
|
8
|
-
required string from = 2;
|
|
9
|
-
required string to = 3;
|
|
10
|
-
required uint64 nonce = 4;
|
|
11
|
-
required string method = 5;
|
|
12
|
-
repeated string params = 6;
|
|
13
|
-
required string signature = 7;
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
class TransactionMessage extends FormatInterface {
|
|
18
|
-
get keys() {
|
|
19
|
-
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
get messageName() {
|
|
23
|
-
return 'TransactionMessage'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
constructor(buffer) {
|
|
27
|
-
const name = 'transaction-message';
|
|
28
|
-
super(buffer, proto, {name});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
globalThis.peernet = globalThis.peernet || {};
|
|
33
|
-
globalThis.contracts = {};
|
|
34
|
-
|
|
35
|
-
const worker = new EasyWorker();
|
|
36
|
-
|
|
37
|
-
worker.onmessage(async (transactions) => {
|
|
38
|
-
globalThis.peernet.codecs = {
|
|
39
|
-
'transaction-message': {
|
|
40
|
-
codec: parseInt('746d', 16),
|
|
41
|
-
hashAlg: 'keccak-256'
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
transactions = await Promise.all(transactions.map(async message => new TransactionMessage(message)));
|
|
45
|
-
|
|
46
|
-
worker.postMessage(transactions);
|
|
47
|
-
});
|