trac-msb 0.0.49 → 0.0.51

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.
Files changed (2) hide show
  1. package/package.json +21 -20
  2. package/src/index.js +6 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-msb",
3
3
  "main": "msb.mjs",
4
- "version": "0.0.49",
4
+ "version": "0.0.51",
5
5
  "pear": {
6
6
  "name": "trac-msb",
7
7
  "type": "terminal"
@@ -12,24 +12,10 @@
12
12
  "test": "brittle test/*.test.js"
13
13
  },
14
14
  "dependencies": {
15
- "trac-wallet": "^0.0.34",
15
+ "assert": "npm:bare-node-assert",
16
16
  "autobase": "7.0.45",
17
17
  "b4a": "1.6.7",
18
18
  "bare": "^1.17.1",
19
- "brittle": "3.0.0",
20
- "corestore": "7.0.22",
21
- "debounceify": "1.1.0",
22
- "hyperbee": "2.23.0",
23
- "hypercore": "11.0.48",
24
- "hypercore-crypto": "3.4.0",
25
- "hyperdht": "6.19.0",
26
- "hyperswarm": "4.8.4",
27
- "is-options": "1.0.2",
28
- "pear-interface": "1.0.0",
29
- "protomux-wakeup": "^2.2.1",
30
- "ready-resource": "^1.0.0",
31
- "safety-catch": "1.0.2",
32
- "xache": "1.2.0",
33
19
  "bare-assert": "^1.0.2",
34
20
  "bare-buffer": "^3.1.2",
35
21
  "bare-console": "^6.0.1",
@@ -54,29 +40,44 @@
54
40
  "bare-utils": "^1.2.0",
55
41
  "bare-worker": "^3.0.0",
56
42
  "bare-zlib": "^1.2.5",
57
- "worker_threads": "npm:bare-node-worker-threads",
58
- "crypto": "npm:bare-node-crypto",
59
- "assert": "npm:bare-node-assert",
43
+ "brittle": "3.0.0",
60
44
  "buffer": "npm:bare-node-buffer",
61
45
  "child_process": "npm:bare-node-child-process",
62
46
  "console": "npm:bare-node-console",
47
+ "corestore": "7.0.22",
48
+ "crypto": "npm:bare-node-crypto",
49
+ "debounceify": "1.1.0",
63
50
  "events": "npm:bare-node-events",
64
51
  "fs": "npm:bare-node-fs",
65
52
  "http": "npm:bare-node-http",
66
53
  "https": "npm:bare-node-https",
67
- "module": "npm:bare-node-module",
54
+ "hyperbee": "2.23.0",
55
+ "hypercore": "11.0.48",
56
+ "hypercore-crypto": "3.4.0",
57
+ "hyperdht": "6.19.0",
58
+ "hyperswarm": "4.8.4",
68
59
  "inspector": "npm:bare-node-inspector",
60
+ "is-options": "1.0.2",
61
+ "module": "npm:bare-node-module",
69
62
  "os": "npm:bare-node-os",
70
63
  "path": "npm:bare-node-path",
64
+ "pear-interface": "1.0.0",
71
65
  "process": "npm:bare-node-process",
66
+ "protomux-wakeup": "^2.2.1",
72
67
  "readline": "npm:bare-node-readline",
68
+ "ready-resource": "^1.0.0",
73
69
  "repl": "npm:bare-node-repl",
70
+ "safety-catch": "1.0.2",
71
+ "sodium-native": "^5.0.1",
74
72
  "stream": "npm:bare-node-stream",
75
73
  "timers": "npm:bare-node-timers",
76
74
  "tls": "npm:bare-node-tls",
75
+ "trac-wallet": "^0.0.34",
77
76
  "tty": "npm:bare-node-tty",
78
77
  "url": "npm:bare-node-url",
79
78
  "util": "npm:bare-node-util",
79
+ "worker_threads": "npm:bare-node-worker-threads",
80
+ "xache": "1.2.0",
80
81
  "zlib": "npm:bare-node-zlib"
81
82
  },
82
83
  "publishConfig": {
package/src/index.js CHANGED
@@ -10,7 +10,8 @@ import { sanitizeTransaction, addWriter } from './functions.js';
10
10
  import w from 'protomux-wakeup';
11
11
  import PeerWallet from "trac-wallet"
12
12
  import Corestore from 'corestore';
13
- import tty from 'tty'
13
+ import tty from 'tty';
14
+ import sodium from 'sodium-native';
14
15
 
15
16
  const wakeup = new w();
16
17
 
@@ -69,7 +70,7 @@ export class MainSettlementBus extends ReadyResource {
69
70
  sanitizeTransaction(postTx) &&
70
71
  hccrypto.verify(b4a.from(postTx.tx + postTx.in, 'utf-8'), b4a.from(postTx.is, 'hex'), b4a.from(postTx.ipk, 'hex')) &&
71
72
  hccrypto.verify(b4a.from(postTx.tx + postTx.wn, 'utf-8'), b4a.from(postTx.ws, 'hex'), b4a.from(postTx.wp, 'hex')) &&
72
- postTx.tx === await _this.generateTx(postTx.bs, postTx.w, postTx.i, postTx.ipk, postTx.ch, postTx.in) &&
73
+ postTx.tx === await _this.generateTx(postTx.bs, this.bootstrap, postTx.w, postTx.i, postTx.ipk, postTx.ch, postTx.in) &&
73
74
  b4a.byteLength(JSON.stringify(postTx)) <= 4096
74
75
  ) {
75
76
  await view.put(op.key, op.value);
@@ -173,6 +174,7 @@ export class MainSettlementBus extends ReadyResource {
173
174
  ch: parsedPreTx.ch,
174
175
  in: parsedPreTx.in,
175
176
  bs: parsedPreTx.bs,
177
+ mbs: parsedPreTx.mbs,
176
178
  ws: signature.toString('hex'),
177
179
  wp: this.wallet.publicKey,
178
180
  wn : nonce
@@ -278,8 +280,9 @@ export class MainSettlementBus extends ReadyResource {
278
280
  }
279
281
  }
280
282
 
281
- async generateTx(bootstrap, validator_writer_key, local_writer_key, local_public_key, content_hash, nonce){
283
+ async generateTx(bootstrap, msb_bootstrap, validator_writer_key, local_writer_key, local_public_key, content_hash, nonce){
282
284
  let tx = bootstrap + '-' +
285
+ msb_bootstrap + '-' +
283
286
  validator_writer_key + '-' +
284
287
  local_writer_key + '-' +
285
288
  local_public_key + '-' +