trac-peer 0.0.26 → 0.0.27
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 +8 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -57,7 +57,6 @@ export class Peer extends ReadyResource {
|
|
|
57
57
|
const _this = this;
|
|
58
58
|
this.base = new Autobase(this.store, this.bootstrap, {
|
|
59
59
|
valueEncoding: 'json',
|
|
60
|
-
|
|
61
60
|
open(store) {
|
|
62
61
|
_this.bee = new Hyperbee(store.get('view'), {
|
|
63
62
|
extension: false,
|
|
@@ -168,6 +167,7 @@ export class Peer extends ReadyResource {
|
|
|
168
167
|
}
|
|
169
168
|
if (this.replicate) await this._replicate();
|
|
170
169
|
await this.txChannel();
|
|
170
|
+
this.updater();
|
|
171
171
|
const auto_add_writers = await this.base.view.get('auto_add_writers');
|
|
172
172
|
if(!this.base.writable && null !== auto_add_writers && auto_add_writers.value === 'on'){
|
|
173
173
|
this.emit('announce', {
|
|
@@ -225,6 +225,13 @@ export class Peer extends ReadyResource {
|
|
|
225
225
|
console.log('Joined MSB TX channel');
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
async updater(){
|
|
229
|
+
while(true){
|
|
230
|
+
await this.base.append(null);
|
|
231
|
+
await this.sleep(10_000);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
228
235
|
async tx_observer(){
|
|
229
236
|
while(true){
|
|
230
237
|
const ts = Math.floor(Date.now() / 1000);
|