trac-msb 0.1.22 → 0.1.23
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/msb.mjs +2 -2
- package/package.json +1 -1
- package/src/index.js +12 -18
package/msb.mjs
CHANGED
|
@@ -3,8 +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: '
|
|
7
|
-
channel: '
|
|
6
|
+
bootstrap: '1e8bf2005085e3730c4869ebc1c0564aad34fb16e98dd2242921cb6a02a2d845',
|
|
7
|
+
channel: '00axtracnetworkmainsettlementbut'
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const msb = new MainSettlementBus(opts);
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -856,6 +856,8 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
856
856
|
const lengthEntry = await this.#base.view.get('wrl');
|
|
857
857
|
const length = lengthEntry?.value ?? 0;
|
|
858
858
|
|
|
859
|
+
console.log('Looking for available writers, please wait...');
|
|
860
|
+
|
|
859
861
|
async function findValidator(_this) {
|
|
860
862
|
if (_this.#validator_stream !== null) return;
|
|
861
863
|
|
|
@@ -891,36 +893,28 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
891
893
|
_this.#validator_stream = existing_stream;
|
|
892
894
|
_this.#validator = pubKey;
|
|
893
895
|
_this.#validator_stream.on('close', () => {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
console.log('Exissting Stream closed', pubKey);
|
|
898
|
-
}
|
|
896
|
+
_this.#validator_stream = null;
|
|
897
|
+
_this.#validator = null;
|
|
898
|
+
console.log('Existing Stream closed', pubKey);
|
|
899
899
|
});
|
|
900
900
|
console.log('Existing Stream established', pubKey);
|
|
901
901
|
} else {
|
|
902
902
|
_this.#validator_stream = _this.#dht_node.connect(b4a.from(pubKey, 'hex'));
|
|
903
903
|
|
|
904
904
|
_this.#validator_stream.on('open', () => {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
console.log('Stream established', pubKey);
|
|
908
|
-
}
|
|
905
|
+
_this.#validator = pubKey;
|
|
906
|
+
console.log('Stream established', pubKey);
|
|
909
907
|
});
|
|
910
908
|
|
|
911
909
|
_this.#validator_stream.on('close', () => {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
console.log('Stream closed', pubKey);
|
|
916
|
-
}
|
|
910
|
+
_this.#validator_stream = null;
|
|
911
|
+
_this.#validator = null;
|
|
912
|
+
console.log('Stream closed', pubKey);
|
|
917
913
|
});
|
|
918
914
|
|
|
919
915
|
_this.#validator_stream.on('error', (err) => {
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
_this.#validator = null;
|
|
923
|
-
}
|
|
916
|
+
_this.#validator_stream = null;
|
|
917
|
+
_this.#validator = null;
|
|
924
918
|
});
|
|
925
919
|
}
|
|
926
920
|
}
|