@leofcoin/chain 1.1.9 → 1.1.10
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/demo/865.browser.js +10 -0
- package/demo/865.machine-worker.js +10 -0
- package/demo/chain.browser.js +50189 -10308
- package/demo/chain.js +1209 -0
- package/demo/machine-worker.js +17623 -0
- package/demo/node.browser.js +29343 -9241
- package/demo/node.js +1 -0
- package/demo/workers/machine-worker.js +6611 -1538
- package/dist/865.browser.js +10 -0
- package/dist/865.machine-worker.js +10 -0
- package/dist/chain.browser.js +54473 -0
- package/dist/chain.js +162 -169
- package/dist/machine-worker.js +17617 -0
- package/dist/module/chain.js +161 -169
- package/dist/module/node.js +203 -1
- package/dist/module/workers/machine-worker.js +34 -324
- package/{demo/peernet-worker.browser.js → dist/node.browser.js} +29462 -9355
- package/dist/node.js +209 -1
- package/dist/workers/block-worker.js +1 -1
- package/dist/workers/machine-worker.js +1 -1
- package/dist/workers/pool-worker.js +1 -1
- package/dist/workers/transaction-worker.js +1 -1
- package/package.json +8 -3
- package/rollup.config.js +11 -11
- package/src/machine.js +24 -27
- package/webpack.config.js +9 -1
- package/demo/151.browser.js +0 -271
- package/demo/205.browser.js +0 -215
- package/demo/427.browser.js +0 -8092
- package/demo/560.browser.js +0 -3
- package/demo/911.browser.js +0 -11024
- package/demo/main.browser.js +0 -8163
- package/src/workers/block-worker.js +0 -70
- package/src/workers/machine-worker.js +0 -174
- package/src/workers/pool-worker.js +0 -37
- package/src/workers/transaction-worker.js +0 -26
- package/workers/block-worker.js +0 -1
- package/workers/machine-worker.js +0 -1
- package/workers/pool-worker.js +0 -1
- package/workers/transaction-worker.js +0 -1
package/dist/module/chain.js
CHANGED
|
@@ -1,152 +1,16 @@
|
|
|
1
1
|
import { BigNumber, formatUnits, parseUnits } from '@leofcoin/utils';
|
|
2
|
-
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
2
|
import _BN from 'bn.js';
|
|
4
3
|
import '@ethersproject/bytes';
|
|
5
4
|
import { Logger } from '@ethersproject/logger';
|
|
6
5
|
import '@ethersproject/bignumber';
|
|
7
6
|
import { randomBytes } from 'crypto';
|
|
8
|
-
import { fork } from 'child_process';
|
|
9
7
|
import { join } from 'path';
|
|
8
|
+
import EasyWorker from '@vandeurenglenn/easy-worker';
|
|
9
|
+
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
10
10
|
import MultiWallet from '@leofcoin/multi-wallet';
|
|
11
11
|
import { CodecHash } from '@leofcoin/codec-format-interface/dist/index';
|
|
12
12
|
import bs32 from '@vandeurenglenn/base32';
|
|
13
13
|
|
|
14
|
-
var proto$4 = `
|
|
15
|
-
message ContractMessage {
|
|
16
|
-
required string creator = 1;
|
|
17
|
-
required bytes contract = 2;
|
|
18
|
-
repeated string constructorParameters = 3;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
class ContractMessage extends FormatInterface {
|
|
23
|
-
get keys() {
|
|
24
|
-
return ['creator', 'contract', 'constructorParameters']
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get messageName() {
|
|
28
|
-
return 'ContractMessage'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
constructor(buffer) {
|
|
32
|
-
super(buffer, proto$4, {name: 'contract-message'});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var proto$3 = `
|
|
37
|
-
|
|
38
|
-
message TransactionMessage {
|
|
39
|
-
required uint64 timestamp = 1;
|
|
40
|
-
required string from = 2;
|
|
41
|
-
required string to = 3;
|
|
42
|
-
required uint64 nonce = 4;
|
|
43
|
-
required string method = 5;
|
|
44
|
-
repeated string params = 6;
|
|
45
|
-
required string signature = 7;
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
class TransactionMessage extends FormatInterface {
|
|
50
|
-
get keys() {
|
|
51
|
-
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
get messageName() {
|
|
55
|
-
return 'TransactionMessage'
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
constructor(buffer) {
|
|
59
|
-
const name = 'transaction-message';
|
|
60
|
-
super(buffer, proto$3, {name});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var proto$2 = `
|
|
65
|
-
message ValidatorMessage {
|
|
66
|
-
required string address = 1;
|
|
67
|
-
required string reward = 2;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
message Transaction {
|
|
71
|
-
required string hash = 1;
|
|
72
|
-
required uint64 timestamp = 2;
|
|
73
|
-
required string from = 3;
|
|
74
|
-
required string to = 4;
|
|
75
|
-
required uint64 nonce = 5;
|
|
76
|
-
required string method = 6;
|
|
77
|
-
repeated string params = 7;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
message BlockMessage {
|
|
81
|
-
required uint64 index = 1;
|
|
82
|
-
required string previousHash = 3;
|
|
83
|
-
required uint64 timestamp = 4;
|
|
84
|
-
required uint64 reward = 5;
|
|
85
|
-
required string fees = 6;
|
|
86
|
-
repeated Transaction transactions = 7;
|
|
87
|
-
repeated ValidatorMessage validators = 8;
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
class BlockMessage extends FormatInterface {
|
|
92
|
-
get keys() {
|
|
93
|
-
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
get messageName() {
|
|
97
|
-
return 'BlockMessage'
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
constructor(buffer) {
|
|
101
|
-
const name = 'block-message';
|
|
102
|
-
super(buffer, proto$2, {name});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
var proto$1 = `
|
|
107
|
-
|
|
108
|
-
message BWMessage {
|
|
109
|
-
required uint64 up = 1;
|
|
110
|
-
required uint64 down = 2;
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
113
|
-
|
|
114
|
-
class BWMessage extends FormatInterface {
|
|
115
|
-
get keys() {
|
|
116
|
-
return ['up', 'down']
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
get messageName() {
|
|
120
|
-
return 'BWMessage'
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
constructor(buffer) {
|
|
124
|
-
const name = 'bw-message';
|
|
125
|
-
super(buffer, proto$1, {name});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
var proto = `
|
|
130
|
-
|
|
131
|
-
message BWRequestMessage {
|
|
132
|
-
}
|
|
133
|
-
`;
|
|
134
|
-
|
|
135
|
-
class BWRequestMessage extends FormatInterface {
|
|
136
|
-
get keys() {
|
|
137
|
-
return []
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
get messageName() {
|
|
141
|
-
return 'BWRequestMessage'
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
constructor(buffer) {
|
|
145
|
-
const name = 'bw-request-message';
|
|
146
|
-
super(buffer, proto, {name});
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
14
|
var contractFactory$2 = "ihny2gqgorwofhvfgtr5dm2targnxrul5rr4wnyk4vl7akbmwox43nlvpim";
|
|
151
15
|
var nativeToken$2 = "ihny2gqhe7gazkieey4o3rztfy757ia3as6snrmov4e3vkfdvt2olvx3ste";
|
|
152
16
|
var nameService$2 = "ihny2gqgztuego4qkbcaqp5ttunly3j3f5vehe65txord7r7osv7xrqxbl6";
|
|
@@ -231,34 +95,31 @@ class Machine {
|
|
|
231
95
|
|
|
232
96
|
async #init() {
|
|
233
97
|
return new Promise(async (resolve) => {
|
|
234
|
-
// this.worker = new Worker('./workers/machine-worker.js')
|
|
235
|
-
// this.worker.onmessage = this.#onmessage.bind(this)
|
|
236
|
-
|
|
237
98
|
pubsub.subscribe('machine.ready', () => {
|
|
238
99
|
resolve(this);
|
|
239
100
|
});
|
|
240
|
-
|
|
241
|
-
this.worker
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
101
|
+
|
|
102
|
+
this.worker = await new EasyWorker(join(__dirname, './workers/machine-worker.js'), {serialization: 'advanced', type:'module'});
|
|
103
|
+
this.worker.onmessage(this.#onmessage.bind(this));
|
|
104
|
+
|
|
105
|
+
const blocks = await blockStore.values();
|
|
106
|
+
const contracts = await Promise.all([
|
|
107
|
+
contractStore.get(contractFactory$1),
|
|
108
|
+
contractStore.get(nativeToken$1),
|
|
109
|
+
contractStore.get(validators$1),
|
|
110
|
+
contractStore.get(nameService$1)
|
|
111
|
+
]);
|
|
112
|
+
|
|
113
|
+
const message = {
|
|
114
|
+
type: 'init',
|
|
115
|
+
input: {
|
|
116
|
+
contracts,
|
|
117
|
+
blocks,
|
|
118
|
+
peerid: peernet.peerId
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
this.worker.postMessage(message);
|
|
260
122
|
})
|
|
261
|
-
// return
|
|
262
123
|
|
|
263
124
|
}
|
|
264
125
|
|
|
@@ -300,7 +161,7 @@ this.worker.on('message', this.#onmessage.bind(this));
|
|
|
300
161
|
else resolve(message);
|
|
301
162
|
};
|
|
302
163
|
pubsub.subscribe(id, message);
|
|
303
|
-
this.worker.
|
|
164
|
+
this.worker.postMessage({
|
|
304
165
|
type: 'execute',
|
|
305
166
|
id,
|
|
306
167
|
input: {
|
|
@@ -328,7 +189,7 @@ this.worker.on('message', this.#onmessage.bind(this));
|
|
|
328
189
|
resolve(message);
|
|
329
190
|
};
|
|
330
191
|
pubsub.subscribe(id, message);
|
|
331
|
-
this.worker.
|
|
192
|
+
this.worker.postMessage({
|
|
332
193
|
type: 'get',
|
|
333
194
|
id,
|
|
334
195
|
input: {
|
|
@@ -351,6 +212,142 @@ this.worker.on('message', this.#onmessage.bind(this));
|
|
|
351
212
|
}
|
|
352
213
|
}
|
|
353
214
|
|
|
215
|
+
var proto$4 = `
|
|
216
|
+
message ContractMessage {
|
|
217
|
+
required string creator = 1;
|
|
218
|
+
required bytes contract = 2;
|
|
219
|
+
repeated string constructorParameters = 3;
|
|
220
|
+
}
|
|
221
|
+
`;
|
|
222
|
+
|
|
223
|
+
class ContractMessage extends FormatInterface {
|
|
224
|
+
get keys() {
|
|
225
|
+
return ['creator', 'contract', 'constructorParameters']
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
get messageName() {
|
|
229
|
+
return 'ContractMessage'
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
constructor(buffer) {
|
|
233
|
+
super(buffer, proto$4, {name: 'contract-message'});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
var proto$3 = `
|
|
238
|
+
|
|
239
|
+
message TransactionMessage {
|
|
240
|
+
required uint64 timestamp = 1;
|
|
241
|
+
required string from = 2;
|
|
242
|
+
required string to = 3;
|
|
243
|
+
required uint64 nonce = 4;
|
|
244
|
+
required string method = 5;
|
|
245
|
+
repeated string params = 6;
|
|
246
|
+
required string signature = 7;
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
|
|
250
|
+
class TransactionMessage extends FormatInterface {
|
|
251
|
+
get keys() {
|
|
252
|
+
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
get messageName() {
|
|
256
|
+
return 'TransactionMessage'
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
constructor(buffer) {
|
|
260
|
+
const name = 'transaction-message';
|
|
261
|
+
super(buffer, proto$3, {name});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
var proto$2 = `
|
|
266
|
+
message ValidatorMessage {
|
|
267
|
+
required string address = 1;
|
|
268
|
+
required string reward = 2;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
message Transaction {
|
|
272
|
+
required string hash = 1;
|
|
273
|
+
required uint64 timestamp = 2;
|
|
274
|
+
required string from = 3;
|
|
275
|
+
required string to = 4;
|
|
276
|
+
required uint64 nonce = 5;
|
|
277
|
+
required string method = 6;
|
|
278
|
+
repeated string params = 7;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
message BlockMessage {
|
|
282
|
+
required uint64 index = 1;
|
|
283
|
+
required string previousHash = 3;
|
|
284
|
+
required uint64 timestamp = 4;
|
|
285
|
+
required uint64 reward = 5;
|
|
286
|
+
required string fees = 6;
|
|
287
|
+
repeated Transaction transactions = 7;
|
|
288
|
+
repeated ValidatorMessage validators = 8;
|
|
289
|
+
}
|
|
290
|
+
`;
|
|
291
|
+
|
|
292
|
+
class BlockMessage extends FormatInterface {
|
|
293
|
+
get keys() {
|
|
294
|
+
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
get messageName() {
|
|
298
|
+
return 'BlockMessage'
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
constructor(buffer) {
|
|
302
|
+
const name = 'block-message';
|
|
303
|
+
super(buffer, proto$2, {name});
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
var proto$1 = `
|
|
308
|
+
|
|
309
|
+
message BWMessage {
|
|
310
|
+
required uint64 up = 1;
|
|
311
|
+
required uint64 down = 2;
|
|
312
|
+
}
|
|
313
|
+
`;
|
|
314
|
+
|
|
315
|
+
class BWMessage extends FormatInterface {
|
|
316
|
+
get keys() {
|
|
317
|
+
return ['up', 'down']
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
get messageName() {
|
|
321
|
+
return 'BWMessage'
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
constructor(buffer) {
|
|
325
|
+
const name = 'bw-message';
|
|
326
|
+
super(buffer, proto$1, {name});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
var proto = `
|
|
331
|
+
|
|
332
|
+
message BWRequestMessage {
|
|
333
|
+
}
|
|
334
|
+
`;
|
|
335
|
+
|
|
336
|
+
class BWRequestMessage extends FormatInterface {
|
|
337
|
+
get keys() {
|
|
338
|
+
return []
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
get messageName() {
|
|
342
|
+
return 'BWRequestMessage'
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
constructor(buffer) {
|
|
346
|
+
const name = 'bw-request-message';
|
|
347
|
+
super(buffer, proto, {name});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
354
351
|
var contractFactory = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,51,67,122,86,51,66,98,76,103,117,57,105,55,119,70,115,83,101,82,101,90,113,110,80,111,53,82,114,121,49,118,81,98,82,115,89,114,116,67,67,97,81,103,98,113,80,72,112,116,117,85,111,72,52,34,44,34,99,111,110,116,114,97,99,116,34,58,34,114,101,116,117,114,110,32,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,105,115,118,97,108,105,100,40,104,97,115,104,44,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,61,91,93,41,123,99,111,110,115,116,32,109,101,115,115,97,103,101,61,110,101,119,32,67,111,110,116,114,97,99,116,77,101,115,115,97,103,101,40,123,99,114,101,97,116,111,114,58,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,58,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,58,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,125,41,59,114,101,116,117,114,110,32,66,111,111,108,101,97,110,40,109,101,115,115,97,103,101,46,104,97,115,104,61,61,61,104,97,115,104,41,125,97,115,121,110,99,32,100,101,112,108,111,121,67,111,110,116,114,97,99,116,40,99,111,110,116,114,97,99,116,72,97,115,104,44,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,61,91,93,41,123,105,102,40,99,111,110,116,114,97,99,116,46,99,114,101,97,116,111,114,33,61,61,109,115,103,46,115,101,110,100,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,111,110,108,121,32,97,32,99,111,110,116,114,97,99,116,32,99,114,101,97,116,111,114,32,99,97,110,32,100,101,112,108,111,121,32,97,32,99,111,110,116,114,97,99,116,92,34,41,59,105,102,40,97,119,97,105,116,32,99,111,110,116,114,97,99,116,83,116,111,114,101,46,104,97,115,40,104,97,115,104,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,100,117,112,108,105,99,97,116,101,32,99,111,110,116,114,97,99,116,92,34,41,59,105,102,40,33,116,104,105,115,46,105,115,86,97,108,105,100,40,99,111,110,116,114,97,99,116,72,97,115,104,44,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,92,34,105,110,118,97,108,105,100,32,99,111,110,116,114,97,99,116,92,34,41,59,97,119,97,105,116,32,99,111,110,116,114,97,99,116,83,116,111,114,101,46,112,117,116,40,104,97,115,104,44,101,110,99,111,100,101,100,41,44,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,104,97,115,104,41,125,125,59,92,110,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";
|
|
355
352
|
var nativeToken = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,51,67,122,86,51,66,98,76,103,117,57,105,55,119,70,115,83,101,82,101,90,113,110,80,111,53,82,114,121,49,118,81,98,82,115,89,114,116,67,67,97,81,103,98,113,80,72,112,116,117,85,111,72,52,34,44,34,99,111,110,116,114,97,99,116,34,58,34,114,101,116,117,114,110,32,99,108,97,115,115,32,65,114,116,79,110,108,105,110,101,32,101,120,116,101,110,100,115,32,99,108,97,115,115,32,84,111,107,101,110,32,101,120,116,101,110,100,115,32,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,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,45,49,33,61,61,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,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,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,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,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,116,111,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,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,59,92,110,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";
|
|
356
353
|
var nameService = "237,198,141,3,123,34,99,114,101,97,116,111,114,34,58,34,51,67,122,86,51,66,98,76,103,117,57,105,55,119,70,115,83,101,82,101,90,113,110,80,111,53,82,114,121,49,118,81,98,82,115,89,114,116,67,67,97,81,103,98,113,80,72,112,116,117,85,111,72,52,34,44,34,99,111,110,116,114,97,99,116,34,58,34,114,101,116,117,114,110,32,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,41,123,116,104,114,111,119,32,101,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,58,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,59,92,110,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,111,114,119,111,102,104,118,102,103,116,114,53,100,109,50,116,97,114,103,110,120,114,117,108,53,114,114,52,119,110,121,107,52,118,108,55,97,107,98,109,119,111,120,52,51,110,108,118,112,105,109,34,44,34,105,104,110,121,50,103,113,104,101,55,103,97,122,107,105,101,101,121,52,111,51,114,122,116,102,121,55,53,55,105,97,51,97,115,54,115,110,114,109,111,118,52,101,51,118,107,102,100,118,116,50,111,108,118,120,51,115,116,101,34,44,34,105,104,110,121,50,103,113,104,108,109,117,98,114,118,107,108,51,105,120,121,102,97,100,111,109,112,118,102,105,105,110,118,119,116,104,105,52,51,119,112,116,52,113,100,102,106,55,54,55,110,104,112,121,106,108,110,119,105,110,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";
|
|
@@ -506,9 +503,7 @@ class Chain {
|
|
|
506
503
|
return set
|
|
507
504
|
}, {index: 0, hash: '0x0'});
|
|
508
505
|
// get lastblock
|
|
509
|
-
console.log(promises.hash);
|
|
510
506
|
if (promises.hash && promises.hash !== '0x0') {
|
|
511
|
-
console.log('get');
|
|
512
507
|
let localBlock = await peernet.get(promises.hash);
|
|
513
508
|
console.log({localBlock});
|
|
514
509
|
}
|
|
@@ -540,9 +535,6 @@ class Chain {
|
|
|
540
535
|
peernet.subscribe('validator:timeout', this.#validatorTimeout.bind(this));
|
|
541
536
|
|
|
542
537
|
pubsub.subscribe('peer:connected', this.#peerConnected.bind(this));
|
|
543
|
-
// let a = await new BlockMessage(this.#machine.lastBlock)
|
|
544
|
-
// console.log(a.decoded);
|
|
545
|
-
// console.log(await a.hash);
|
|
546
538
|
|
|
547
539
|
try {
|
|
548
540
|
let localBlock;
|
package/dist/module/node.js
CHANGED
|
@@ -1 +1,203 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Peernet from '@leofcoin/peernet';
|
|
2
|
+
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
|
|
4
|
+
var proto$4 = `
|
|
5
|
+
message ContractMessage {
|
|
6
|
+
required string creator = 1;
|
|
7
|
+
required bytes contract = 2;
|
|
8
|
+
repeated string constructorParameters = 3;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
class ContractMessage extends FormatInterface {
|
|
13
|
+
get keys() {
|
|
14
|
+
return ['creator', 'contract', 'constructorParameters']
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get messageName() {
|
|
18
|
+
return 'ContractMessage'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
constructor(buffer) {
|
|
22
|
+
super(buffer, proto$4, {name: 'contract-message'});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var proto$3 = `
|
|
27
|
+
|
|
28
|
+
message TransactionMessage {
|
|
29
|
+
required uint64 timestamp = 1;
|
|
30
|
+
required string from = 2;
|
|
31
|
+
required string to = 3;
|
|
32
|
+
required uint64 nonce = 4;
|
|
33
|
+
required string method = 5;
|
|
34
|
+
repeated string params = 6;
|
|
35
|
+
required string signature = 7;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
class TransactionMessage extends FormatInterface {
|
|
40
|
+
get keys() {
|
|
41
|
+
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params', 'signature']
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get messageName() {
|
|
45
|
+
return 'TransactionMessage'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
constructor(buffer) {
|
|
49
|
+
const name = 'transaction-message';
|
|
50
|
+
super(buffer, proto$3, {name});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var proto$2 = `
|
|
55
|
+
message ValidatorMessage {
|
|
56
|
+
required string address = 1;
|
|
57
|
+
required string reward = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message Transaction {
|
|
61
|
+
required string hash = 1;
|
|
62
|
+
required uint64 timestamp = 2;
|
|
63
|
+
required string from = 3;
|
|
64
|
+
required string to = 4;
|
|
65
|
+
required uint64 nonce = 5;
|
|
66
|
+
required string method = 6;
|
|
67
|
+
repeated string params = 7;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message BlockMessage {
|
|
71
|
+
required uint64 index = 1;
|
|
72
|
+
required string previousHash = 3;
|
|
73
|
+
required uint64 timestamp = 4;
|
|
74
|
+
required uint64 reward = 5;
|
|
75
|
+
required string fees = 6;
|
|
76
|
+
repeated Transaction transactions = 7;
|
|
77
|
+
repeated ValidatorMessage validators = 8;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
class BlockMessage extends FormatInterface {
|
|
82
|
+
get keys() {
|
|
83
|
+
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
get messageName() {
|
|
87
|
+
return 'BlockMessage'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
constructor(buffer) {
|
|
91
|
+
const name = 'block-message';
|
|
92
|
+
super(buffer, proto$2, {name});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var proto$1 = `
|
|
97
|
+
|
|
98
|
+
message BWMessage {
|
|
99
|
+
required uint64 up = 1;
|
|
100
|
+
required uint64 down = 2;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
class BWMessage extends FormatInterface {
|
|
105
|
+
get keys() {
|
|
106
|
+
return ['up', 'down']
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get messageName() {
|
|
110
|
+
return 'BWMessage'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
constructor(buffer) {
|
|
114
|
+
const name = 'bw-message';
|
|
115
|
+
super(buffer, proto$1, {name});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var proto = `
|
|
120
|
+
|
|
121
|
+
message BWRequestMessage {
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
class BWRequestMessage extends FormatInterface {
|
|
126
|
+
get keys() {
|
|
127
|
+
return []
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
get messageName() {
|
|
131
|
+
return 'BWRequestMessage'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
constructor(buffer) {
|
|
135
|
+
const name = 'bw-request-message';
|
|
136
|
+
super(buffer, proto, {name});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
var nodeConfig = async (config = {
|
|
141
|
+
network: 'leofcoin:mandarine',
|
|
142
|
+
networkName: 'leofcoin:mandarine',
|
|
143
|
+
networkVersion: 'v0.1.0'
|
|
144
|
+
}) => {
|
|
145
|
+
await peernet.addProto('contract-message', ContractMessage);
|
|
146
|
+
await peernet.addProto('transaction-message', TransactionMessage);
|
|
147
|
+
await peernet.addProto('block-message', BlockMessage);
|
|
148
|
+
await peernet.addProto('bw-message', BWMessage);
|
|
149
|
+
await peernet.addProto('bw-request-message', BWRequestMessage);
|
|
150
|
+
|
|
151
|
+
await peernet.addCodec('contract-message', {
|
|
152
|
+
codec: parseInt('63636d', 16),
|
|
153
|
+
hashAlg: 'keccak-256'
|
|
154
|
+
});
|
|
155
|
+
await peernet.addCodec('transaction-message', {
|
|
156
|
+
codec: parseInt('746d', 16),
|
|
157
|
+
hashAlg: 'keccak-256'
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
await peernet.addCodec('block-message', {
|
|
161
|
+
codec: parseInt('626d', 16),
|
|
162
|
+
hashAlg: 'keccak-256'
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
await peernet.addCodec('bw-message', {
|
|
166
|
+
codec: parseInt('62776d', 16),
|
|
167
|
+
hashAlg: 'keccak-256'
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
await peernet.addCodec('bw-request-message', {
|
|
171
|
+
codec: parseInt('6277726d', 16),
|
|
172
|
+
hashAlg: 'keccak-256'
|
|
173
|
+
});
|
|
174
|
+
let name = `.${config.network}`;
|
|
175
|
+
const parts = config.network.split(':');
|
|
176
|
+
if (parts[1]) name = `.${parts[0]}/${parts[1]}`;
|
|
177
|
+
await peernet.addStore('contract', 'lfc', name, false);
|
|
178
|
+
await peernet.addStore('accounts', 'lfc', name, false);
|
|
179
|
+
await peernet.addStore('transactionPool', 'lfc', name, false);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// import config from './config/config'
|
|
183
|
+
|
|
184
|
+
class Node {
|
|
185
|
+
constructor() {
|
|
186
|
+
return this._init()
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async _init(config = {
|
|
190
|
+
network: 'leofcoin:mandarine',
|
|
191
|
+
networkName: 'leofcoin:mandarine',
|
|
192
|
+
networkVersion: 'v0.1.0'
|
|
193
|
+
}) {
|
|
194
|
+
globalThis.Peernet ? await new globalThis.Peernet(config) : await new Peernet(config);
|
|
195
|
+
await nodeConfig();
|
|
196
|
+
|
|
197
|
+
return this
|
|
198
|
+
// this.config = await config()
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export { Node as default };
|