trac-msb 0.0.16 → 0.0.17
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/package.json +1 -1
- package/src/index.js +9 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -49,7 +49,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
49
49
|
const _this = this;
|
|
50
50
|
this.base = new Autobase(this.store, this.bootstrap, {
|
|
51
51
|
valueEncoding: 'json',
|
|
52
|
-
|
|
52
|
+
ackInterval: 1000,
|
|
53
53
|
open(store) {
|
|
54
54
|
_this.bee = new Hyperbee(store.get('view'), {
|
|
55
55
|
extension: false,
|
|
@@ -58,9 +58,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
58
58
|
})
|
|
59
59
|
return _this.bee;
|
|
60
60
|
},
|
|
61
|
-
|
|
62
61
|
apply: async (nodes, view, base) => {
|
|
63
|
-
|
|
64
62
|
for (const node of nodes) {
|
|
65
63
|
const op = node.value;
|
|
66
64
|
const postTx = op.value;
|
|
@@ -103,6 +101,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
103
101
|
if (this.enable_txchannel) {
|
|
104
102
|
await this.txChannel();
|
|
105
103
|
}
|
|
104
|
+
this.updater();
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
async close() {
|
|
@@ -112,6 +111,13 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
112
111
|
await this.base.close();
|
|
113
112
|
}
|
|
114
113
|
|
|
114
|
+
async updater(){
|
|
115
|
+
while(true){
|
|
116
|
+
await this.base.append(null);
|
|
117
|
+
await this.sleep(10_000);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
115
121
|
async txChannel() {
|
|
116
122
|
this.tx_swarm = new Hyperswarm({ maxPeers: 1024, maxParallel: 512, maxServerConnections: 256 });
|
|
117
123
|
this.tx_swarm.on('connection', async (connection, peerInfo) => {
|