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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +8 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-peer",
3
3
  "main": "src/index.js",
4
- "version": "0.0.26",
4
+ "version": "0.0.27",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "autobase": "7.0.45",
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);