trac-msb 0.1.40 → 0.1.43

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.
@@ -1 +1 @@
1
- 320fef56d8fa3e2a226aacc2acdb397d63abfb96b60b8ea3b0624045fc6b3eae
1
+ 2eee6ef1862918445159c06a4dbff6dc3ebfebd53a0cc63964c9aead6bc8576e
package/msb.mjs CHANGED
@@ -3,10 +3,8 @@ import {MainSettlementBus} from './src/index.js';
3
3
  const opts = {
4
4
  stores_directory : 'stores/',
5
5
  store_name : typeof process !== "undefined" ? process.argv[2] : Pear.config.args[0],
6
- bootstrap: 'd7cce91547144be2e234992501b556dcd1591ab44313cf3036ddd3137afbc347',
7
- channel: '00axtracnetworkmainsettlementbus',
8
- enable_txlogs : true,
9
- disable_rate_limit : false
6
+ bootstrap: '19a12e9bdaf1cd9ae8169fd87f3d6d63d441c046e37e2ac6c3c36bcb87c59019',
7
+ channel: '0000tracnetworkmainsettlementbus',
10
8
  };
11
9
 
12
10
  const msb = new MainSettlementBus(opts);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-msb",
3
3
  "main": "msb.mjs",
4
- "version": "0.1.40",
4
+ "version": "0.1.43",
5
5
  "pear": {
6
6
  "name": "trac-msb",
7
7
  "type": "terminal"
package/src/index.js CHANGED
@@ -766,8 +766,8 @@ export class MainSettlementBus extends ReadyResource {
766
766
  this.#swarm.joinPeer(b4a.from(address, 'hex'));
767
767
  let cnt = 0;
768
768
  while(false === this.#swarm.peers.has(address)){
769
- if(cnt >= 15) break;
770
- await sleep(1_000);
769
+ if(cnt >= 1500) break;
770
+ await sleep(10);
771
771
  cnt += 1;
772
772
  }
773
773
  }
package/src/network.js CHANGED
@@ -76,6 +76,7 @@ class Network {
76
76
  };
77
77
  const sig = wallet.sign(JSON.stringify(_msg) + nonce);
78
78
  message.send({response: _msg, sig, nonce})
79
+ swarm.leavePeer(connection.remotePublicKey)
79
80
  } else if (msg === 'get_admin') {
80
81
  const res = await msb.get(EntryType.ADMIN);
81
82
  if (wallet.publicKey !== res.tracPublicKey) return;
@@ -98,6 +99,7 @@ class Network {
98
99
  network.validator_stream = connection;
99
100
  network.validator = msg.response.address;
100
101
  }
102
+ swarm.leavePeer(connection.remotePublicKey)
101
103
  } else if (msg.response !== undefined && msg.response.op !== undefined && msg.response.op === 'admin') {
102
104
  const res = await msb.get(EntryType.ADMIN);
103
105
  if (res === null || res.tracPublicKey !== msg.response.address) return;
@@ -193,6 +195,8 @@ class Network {
193
195
  };
194
196
  network.tx_pool.push({tx: parsedPreTx.tx, append_tx: append_tx});
195
197
  }
198
+
199
+ swarm.leavePeer(connection.remotePublicKey)
196
200
  }
197
201
  } catch (e) {
198
202
  console.log(e);