Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ChainSafe/js-libp2p-gossipsub
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1852ec82f1316fecba40cd96410d4bda9ff23192
Choose a base ref
...
head repository: ChainSafe/js-libp2p-gossipsub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aafe59aa84cb78b367bcfaf26c8df94fe80c4a30
Choose a head ref

Commits on Oct 8, 2019

  1. chore: update deps

    vasco-santos committed Oct 8, 2019
    Copy the full SHA
    660b054 View commit details

Commits on Oct 21, 2019

  1. refactor: switch to async iterators

    BREAKING CHANGE: Switch to using async/await and async iterators for all the API. Moreover, gossipsub does not need the libp2p instance anymore, receiving a registerar that enables it to receive the necessary events from libp2p
    vasco-santos committed Oct 21, 2019
    Copy the full SHA
    3027835 View commit details

Commits on Nov 6, 2019

  1. Copy the full SHA
    5e45409 View commit details

Commits on Nov 14, 2019

  1. Copy the full SHA
    5b7e14a View commit details
  2. chore: address review

    vasco-santos committed Nov 14, 2019
    Copy the full SHA
    bfa4378 View commit details

Commits on Nov 15, 2019

  1. chore: update pubsub

    vasco-santos committed Nov 15, 2019
    Copy the full SHA
    3de6f46 View commit details

Commits on Nov 19, 2019

  1. Merge pull request #49 from ChainSafe/refactor/async

    refactor: async migration
    wemeetagain authored Nov 19, 2019
    Copy the full SHA
    ec8db51 View commit details
  2. Copy the full SHA
    ccb49bf View commit details
  3. Merge pull request #51 from ChainSafe/chore/release-version-v0.1.0

    chore: release version v0.1.0
    wemeetagain authored Nov 19, 2019
    Copy the full SHA
    79934a8 View commit details

Commits on Dec 1, 2019

  1. chore: update dependencies

    BREAKING CHANGE: getPeersSubscribed from parent class renamed to getSubscribers to remove redundant wording
    vasco-santos committed Dec 1, 2019
    Copy the full SHA
    7a44b66 View commit details

Commits on Dec 2, 2019

  1. Merge pull request #52 from ChainSafe/chore/update-dependencies

    chore: update dependencies
    wemeetagain authored Dec 2, 2019
    Copy the full SHA
    4618790 View commit details
  2. Copy the full SHA
    8e15324 View commit details
  3. Merge pull request #53 from ChainSafe/chore/release-version-v0.2.0

    chore: release version v0.2.0
    wemeetagain authored Dec 2, 2019
    Copy the full SHA
    d54e655 View commit details

Commits on Dec 12, 2019

  1. Copy the full SHA
    d48dfbc View commit details

Commits on Dec 13, 2019

  1. Merge pull request #55 from ChainSafe/chore/add-lead-maintainer-property

    chore: add lead maintainer property
    wemeetagain authored Dec 13, 2019
    Copy the full SHA
    47a6429 View commit details

Commits on Jan 13, 2020

  1. fix: bind is not needed

    vasco-santos committed Jan 13, 2020
    Copy the full SHA
    7faae98 View commit details

Commits on Jan 14, 2020

  1. Merge pull request #56 from ChainSafe/fix/bind-is-not-needed

    fix: bind is not needed for log
    wemeetagain authored Jan 14, 2020
    Copy the full SHA
    a9a72bf View commit details
  2. Copy the full SHA
    ae9dde2 View commit details
  3. Merge pull request #57 from ChainSafe/chore/release-version-0.2.1

    chore: release version v0.2.1
    wemeetagain authored Jan 14, 2020
    Copy the full SHA
    8cc71a2 View commit details

Commits on Jan 16, 2020

  1. fix: parameter to _onPeerDisconnected

    `_onPeerDisconnected` is expecting a `PeerInfo` but it was being passed a pubsub `Peer`.
    
    I'm not sure if this is the correct fix but it resolves this error for me:
    
    ```
    (node:77189) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toB58String' of undefined
        at GossipSub._onPeerDisconnected (/Users/alan/Code/pl/ipfs/js-ipfs/node_modules/libp2p-pubsub/src/index.js:190:34)
        at GossipSub._processMessages (/Users/alan/Code/pl/ipfs/js-ipfs/node_modules/libp2p-gossipsub/src/pubsub.js:120:12)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:94:5)
    ```
    Alan Shaw authored Jan 16, 2020
    Copy the full SHA
    d43ceb5 View commit details

Commits on Jan 22, 2020

  1. test: add test for disconnect on stream error

    Alan Shaw committed Jan 22, 2020
    Copy the full SHA
    9bb25ba View commit details
  2. chore: appease linter

    Alan Shaw committed Jan 22, 2020
    Copy the full SHA
    2754dcf View commit details
  3. Merge pull request #58 from alanshaw/patch-1

    fix: parameter to _onPeerDisconnected
    wemeetagain authored Jan 22, 2020
    Copy the full SHA
    71cb905 View commit details

Commits on Jan 23, 2020

  1. fix: fix heartbeat startup/shutdown timing bug

    The heartbeat code sets a timeout to start the heartbeat then sets
    an interval to perform the heartbeat.
    
    If the node is shut down after the timeout is set but before it
    fires, the interval is set and the process never ends.
    
    This PR refactors the heatbeat shutdown to clear the timeout as well
    as the interval.
    achingbrain committed Jan 23, 2020
    Copy the full SHA
    a8302f9 View commit details
  2. docs: fix travis link

    This project is not Aegir, this updates the travis link in the
    README to point to the right build
    achingbrain committed Jan 23, 2020
    Copy the full SHA
    4858c51 View commit details

Commits on Jan 24, 2020

  1. fix: fix double publish bug

    The tests of this module are currently failing but they don't fail
    the build because the error that should fail it is thrown [out of
    the flow control](https://github.com/ChainSafe/gossipsub-js/blob/master/test/floodsub.spec.js#L21)
     of the tests.  An [UnhandledPromiseRejectionWarning](https://travis-ci.com/ChainSafe/gossipsub-js/jobs/278427804#L270)
    is thrown.
    
    This PR:
    
    1. Passes an `error` object to `done` if the error condition is hit
    2. Fixes a bug where a message was being sent back to the sender
        and then emitted by the sender even though `emitSelf` was false
    achingbrain committed Jan 24, 2020
    Copy the full SHA
    519f868 View commit details
  2. Merge pull request #59 from achingbrain/fix-timing-bug

    fix: fix heartbeat startup/shutdown timing bug
    wemeetagain authored Jan 24, 2020
    Copy the full SHA
    6114d4d View commit details
  3. Merge pull request #60 from achingbrain/update-travis-link

    docs: fix travis link
    wemeetagain authored Jan 24, 2020
    Copy the full SHA
    62e509d View commit details
  4. Merge pull request #61 from achingbrain/fix-double-publish-bug

    fix: fix double publish bug
    wemeetagain authored Jan 24, 2020
    Copy the full SHA
    2de2f3b View commit details
  5. Copy the full SHA
    9e50a35 View commit details
  6. Copy the full SHA
    67e35c2 View commit details

Commits on Jan 31, 2020

  1. chore: update it-length-prefixed dep

    Alan Shaw committed Jan 31, 2020
    Copy the full SHA
    eaab883 View commit details

Commits on Feb 3, 2020

  1. Merge pull request #64 from alanshaw/chore/update-deps-20200131

    chore: update it-length-prefixed dep
    wemeetagain authored Feb 3, 2020
    Copy the full SHA
    2ecbcb0 View commit details
  2. perf: do not depend on floodsub (#63)

    We only use the multicodec from floodsub, so just copy it here instead of bundling the whole of floodsub and it's dependencies.
    Alan Shaw authored Feb 3, 2020
    Copy the full SHA
    f825e07 View commit details
  3. Copy the full SHA
    63049d8 View commit details
  4. Copy the full SHA
    978444d View commit details

Commits on Feb 14, 2020

  1. fix: remove use of assert module (#65)

    The polyfill is big, we can simulate it by throwing an Error and it doesn't work under React Native.
    achingbrain authored Feb 14, 2020
    Copy the full SHA
    e0a37cc View commit details
  2. Copy the full SHA
    d18692b View commit details
  3. Copy the full SHA
    97515f7 View commit details

Commits on Mar 15, 2020

  1. add typescript definitions

    mpetrunic committed Mar 15, 2020
    Copy the full SHA
    7e17f12 View commit details

Commits on Mar 16, 2020

  1. Provide a way to override message id function

    Tuyen committed Mar 16, 2020
    Copy the full SHA
    d20b42f View commit details
  2. Add method comment

    Tuyen committed Mar 16, 2020
    Copy the full SHA
    c7459e7 View commit details
  3. Update README.md

    Tuyen committed Mar 16, 2020
    Copy the full SHA
    f174b5a View commit details

Commits on Mar 18, 2020

  1. Address comments

    Tuyen committed Mar 18, 2020
    Copy the full SHA
    4033b8b View commit details

Commits on Mar 19, 2020

  1. Document 'messageCache' option

    Tuyen committed Mar 19, 2020
    Copy the full SHA
    d8fa6aa View commit details

Commits on Mar 21, 2020

  1. Merge pull request #67 from ChainSafe/tuyen/message-id-function

    Provide a way to override message id function
    wemeetagain authored Mar 21, 2020
    Copy the full SHA
    9b7af11 View commit details
  2. Copy the full SHA
    9102b0d View commit details
  3. Copy the full SHA
    7c6f65b View commit details

Commits on Mar 27, 2020

  1. Copy the full SHA
    beb3c90 View commit details

Commits on Apr 4, 2020

  1. Merge pull request #66 from ChainSafe/mpetrunic/type-definitions

    add typescript definitions
    mpetrunic authored Apr 4, 2020
    Copy the full SHA
    4b133b1 View commit details
142 changes: 142 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,145 @@
<a name="0.4.0"></a>
# [0.4.0](https://github.com/ChainSafe/gossipsub-js/compare/v0.3.0...v0.4.0) (2020-04-23)


### Chores

* remove peer-info usage ([602ccaa](https://github.com/ChainSafe/gossipsub-js/commit/602ccaa))


### BREAKING CHANGES

* using new topology api with peer-id instead of peer-info and new pubsub internal peer data structure



<a name="0.3.0"></a>
# [0.3.0](https://github.com/ChainSafe/gossipsub-js/compare/v0.2.6...v0.3.0) (2020-04-23)


### Bug Fixes

* add buffer and update deps ([d8e9d1b](https://github.com/ChainSafe/gossipsub-js/commit/d8e9d1b))



<a name="0.2.6"></a>
## [0.2.6](https://github.com/ChainSafe/gossipsub-js/compare/v0.2.5...v0.2.6) (2020-04-04)



<a name="0.2.5"></a>
## [0.2.5](https://github.com/ChainSafe/gossipsub-js/compare/v0.2.4...v0.2.5) (2020-03-21)



<a name="0.2.4"></a>
## [0.2.4](https://github.com/ChainSafe/gossipsub-js/compare/v0.2.3...v0.2.4) (2020-02-14)


### Bug Fixes

* remove use of assert module ([#65](https://github.com/ChainSafe/gossipsub-js/issues/65)) ([e0a37cc](https://github.com/ChainSafe/gossipsub-js/commit/e0a37cc))



<a name="0.2.3"></a>
## [0.2.3](https://github.com/ChainSafe/gossipsub-js/compare/v0.0.5...v0.2.3) (2020-02-03)


### Bug Fixes

* bind is not needed ([7faae98](https://github.com/ChainSafe/gossipsub-js/commit/7faae98))
* fix double publish bug ([519f868](https://github.com/ChainSafe/gossipsub-js/commit/519f868)), closes [/github.com/ChainSafe/gossipsub-js/blob/master/test/floodsub.spec.js#L21](https://github.com//github.com/ChainSafe/gossipsub-js/blob/master/test/floodsub.spec.js/issues/L21) [/travis-ci.com/ChainSafe/gossipsub-js/jobs/278427804#L270](https://github.com//travis-ci.com/ChainSafe/gossipsub-js/jobs/278427804/issues/L270)
* fix heartbeat startup/shutdown timing bug ([a8302f9](https://github.com/ChainSafe/gossipsub-js/commit/a8302f9))
* parameter to _onPeerDisconnected ([d43ceb5](https://github.com/ChainSafe/gossipsub-js/commit/d43ceb5))


### Chores

* update dependencies ([7a44b66](https://github.com/ChainSafe/gossipsub-js/commit/7a44b66))


### Code Refactoring

* switch to async iterators ([3027835](https://github.com/ChainSafe/gossipsub-js/commit/3027835))


### Performance Improvements

* do not depend on floodsub ([#63](https://github.com/ChainSafe/gossipsub-js/issues/63)) ([f825e07](https://github.com/ChainSafe/gossipsub-js/commit/f825e07))


### BREAKING CHANGES

* getPeersSubscribed from parent class renamed to getSubscribers to remove redundant wording
* Switch to using async/await and async iterators for all the API. Moreover, gossipsub does not need the libp2p instance anymore, receiving a registerar that enables it to receive the necessary events from libp2p



<a name="0.2.2"></a>
## [0.2.2](https://github.com/ChainSafe/gossipsub-js/compare/v0.0.5...v0.2.2) (2020-01-24)


### Bug Fixes

* bind is not needed ([7faae98](https://github.com/ChainSafe/gossipsub-js/commit/7faae98))
* fix double publish bug ([519f868](https://github.com/ChainSafe/gossipsub-js/commit/519f868)), closes [/github.com/ChainSafe/gossipsub-js/blob/master/test/floodsub.spec.js#L21](https://github.com//github.com/ChainSafe/gossipsub-js/blob/master/test/floodsub.spec.js/issues/L21) [/travis-ci.com/ChainSafe/gossipsub-js/jobs/278427804#L270](https://github.com//travis-ci.com/ChainSafe/gossipsub-js/jobs/278427804/issues/L270)
* fix heartbeat startup/shutdown timing bug ([a8302f9](https://github.com/ChainSafe/gossipsub-js/commit/a8302f9))
* parameter to _onPeerDisconnected ([d43ceb5](https://github.com/ChainSafe/gossipsub-js/commit/d43ceb5))


### Chores

* update dependencies ([7a44b66](https://github.com/ChainSafe/gossipsub-js/commit/7a44b66))


### Code Refactoring

* switch to async iterators ([3027835](https://github.com/ChainSafe/gossipsub-js/commit/3027835))


### BREAKING CHANGES

* getPeersSubscribed from parent class renamed to getSubscribers to remove redundant wording
* Switch to using async/await and async iterators for all the API. Moreover, gossipsub does not need the libp2p instance anymore, receiving a registerar that enables it to receive the necessary events from libp2p



<a name="0.2.1"></a>
## 0.2.1 (2019-01-14)


### Bug Fixes

* bind is not needed ([7faae98](https://github.com/ChainSafe/gossipsub-js/commit/7faae98))



<a name="0.2.0"></a>
## [0.2.0](https://github.com/ChainSafe/gossipsub-js/compare/v0.0.5...v0.1.0) (2019-12-02)

### Chores

* update dependencies ([7a44b66](https://github.com/ChainSafe/gossipsub-js/commit/7a44b66))

### BREAKING CHANGES

* getPeersSubscribed from parent class renamed to getSubscribers to remove redundant wording.



<a name="0.1.0"></a>
## [0.1.0](https://github.com/ChainSafe/gossipsub-js/compare/v0.0.5...v0.1.0) (2019-19-14)

### Code Refactoring

* switch to async iterators ([ec8db51](https://github.com/ChainSafe/gossipsub-js/commit/2c32d25))

### BREAKING CHANGES

* Switch to using async/await and async iterators.

<a name="0.0.2"></a>
## [0.0.2](https://github.com/ChainSafe/gossipsub-js/compare/v0.0.1...v0.0.2) (2019-06-04)

37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ js-libp2p-gossipsub
==================

[![](https://img.shields.io/badge/made%20by-ChainSafe-blue.svg?style=flat-square)](https://chainsafe.io/)
[![Travis CI](https://flat.badgen.net/travis/ipfs/aegir)](https://travis-ci.com/ipfs/aegir)
[![Travis CI](https://flat.badgen.net/travis/ChainSafe/gossipsub-js)](https://travis-ci.com/ChainSafe/gossipsub-js)

## Lead Maintainer

@@ -20,6 +20,8 @@ js-libp2p-gossipsub
## Specs
Gossipsub is an implementation of pubsub based on meshsub and floodsub. You can read the specification [here](https://github.com/libp2p/specs/tree/master/pubsub/gossipsub).

`libp2p-gossipsub` currently implements the `v1.0` of the spec.

## Install

`npm install libp2p-gossipsub`
@@ -29,20 +31,29 @@ Gossipsub is an implementation of pubsub based on meshsub and floodsub. You can
```javascript
const Gossipsub = require('libp2p-gossipsub')

const gsub = new Gossipsub(node)
const registrar = {
handle: (multicodecs, handle) => {
// register multicodec to libp2p
// handle function is called everytime a remote peer opens a stream to the peer.
},
register: (multicodecs, handlers) => {
// handlers will be used to notify pubsub of peer connection establishment or closing
},
unregister: (id) => {

gsub.start((err) => {
if (err) {
console.log('Upsy', err)
}
gsub.on('fruit', (data) => {
console.log(data)
})
gsub.subscribe('fruit')
}

const gsub = new Gossipsub(peerId, registrar, options)

gsub.publish('fruit', new Buffer('banana'))
await gsub.start()

gsub.on('fruit', (data) => {
console.log(data)
})
gsub.subscribe('fruit')

gsub.publish('fruit', new Buffer('banana'))
```

## API
@@ -51,13 +62,17 @@ gsub.start((err) => {

```js
const options = {…}
const gossipsub = new Gossipsub(libp2pNode, options)
const gossipsub = new Gossipsub(peerId, registrar, options)
```

Options is an optional object with the following key-value pairs:

* **`fallbackToFloodsub`**: boolean identifying whether the node should fallback to the floodsub protocol, if another connecting peer does not support gossipsub (defaults to **true**).
* **`emitSelf`**: boolean identifying whether the node should emit to self on publish, in the event of the topic being subscribed (defaults to **false**).
* **`msgIdFn`**: a function with signature `(message) => string` defining the message id given a message, used internally to deduplicate gossip (defaults to `(message) => message.from + message.seqno.toString('hex')`)
* **`messageCache`**: optional, a customized `MessageCache` instance, see the implementation for the interface.

For the remaining API, see https://github.com/libp2p/js-libp2p-pubsub

## Contribute

52 changes: 28 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "libp2p-gossipsub",
"version": "0.0.5",
"version": "0.4.0",
"description": "A javascript implementation of gossipsub",
"leadMaintainer": "Cayman Nava <caymannava@gmail.com>",
"main": "src/index.js",
"files": [
"src",
"dist"
],
"types": "src/index.d.ts",
"scripts": {
"lint": "aegir lint",
"release": "aegir release",
@@ -32,43 +34,45 @@
"lint"
],
"dependencies": {
"async": "^2.6.2",
"err-code": "^1.1.2",
"libp2p-floodsub": "~0.17.1",
"libp2p-pubsub": "~0.2.0",
"multistream-select": "~0.14.6",
"peer-id": "~0.12.2",
"peer-info": "~0.15.1",
"buffer": "^5.6.0",
"debug": "^4.1.1",
"err-code": "^2.0.0",
"it-length-prefixed": "^3.0.0",
"it-pipe": "^1.0.1",
"libp2p-pubsub": "^0.5.0",
"p-map": "^4.0.0",
"peer-id": "~0.13.3",
"protons": "^1.0.1",
"pull-length-prefixed": "^1.3.3",
"pull-stream": "^3.6.13"
"time-cache": "^0.3.0"
},
"devDependencies": {
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.7",
"aegir": "^20.0.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^7.0.2",
"aegir": "^21.9.0",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"chai-spies": "^1.0.0",
"detect-node": "^2.0.4",
"dirty-chai": "^2.0.1",
"libp2p": "~0.25.5",
"libp2p-secio": "~0.11.1",
"libp2p-spdy": "~0.13.3",
"libp2p-tcp": "~0.13.0",
"libp2p-websockets": "~0.12.2",
"it-pair": "^1.0.0",
"libp2p-floodsub": "^0.21.0",
"lodash": "^4.17.15",
"mocha": "^5.2.0",
"mocha": "^7.1.1",
"p-times": "^2.1.0",
"p-wait-for": "^3.1.0",
"promisify-es6": "^1.0.3",
"sinon": "^7.3.2"
"sinon": "^9.0.2"
},
"contributors": [
"Cayman <caymannava@gmail.com>",
"ChainSafe <aidan@chainsafe.io>",
"ChainSafe <superadmin@chainsafe.io>",
"Mikerah <mikerahqc@protonmail.com>",
"Mikerah <mikerah14@gmail.com>",
"Vasco Santos <vasco.santos@moxy.studio>",
"Vasco Santos <vasco.santos@ua.pt>"
"Alan Shaw <alan.shaw@protocol.ai>",
"Tuyen <tuyen@wetrust.io>",
"achingbrain <alex@achingbrain.net>",
"Jacob Heun <jacobheun@gmail.com>",
"ChainSafe <aidan@chainsafe.io>",
"Marin Petrunić <marin.petrunic@gmail.com>",
"Hugo Dias <hugomrdias@gmail.com>"
]
}
49 changes: 22 additions & 27 deletions src/heartbeat.js
Original file line number Diff line number Diff line change
@@ -12,52 +12,47 @@ class Heartbeat {
this.gossipsub = gossipsub
}

start (callback) {
start () {
if (this._heartbeatTimer) {
const errMsg = 'Heartbeat timer is already running'
this.gossipsub.log(errMsg)
return callback(errcode(new Error(errMsg), 'ERR_HEARTBEAT_ALREADY_RUNNING'))
throw errcode(new Error(errMsg), 'ERR_HEARTBEAT_ALREADY_RUNNING')
}

const heartbeatTimer = {
const heartbeat = this._heartbeat.bind(this)

const timeout = setTimeout(() => {
heartbeat()
this._heartbeatTimer.runPeriodically(heartbeat, constants.GossipSubHeartbeatInterval)
}, constants.GossipSubHeartbeatInitialDelay)

this._heartbeatTimer = {
_onCancel: null,
_timeoutId: null,
_intervalId: null,
runPeriodically: (fn, period) => {
heartbeatTimer._timeoutId = setInterval(fn, period)
this._heartbeatTimer._intervalId = setInterval(fn, period)
},
cancel: (cb) => {
clearTimeout(heartbeatTimer._timeoutId)
cb()
cancel: () => {
clearTimeout(timeout)
clearInterval(this._heartbeatTimer._intervalId)
}
}

const heartbeat = this._heartbeat.bind(this)
setTimeout(() => {
heartbeat()
heartbeatTimer.runPeriodically(heartbeat, constants.GossipSubHeartbeatInterval)
}, constants.GossipSubHeartbeatInitialDelay)

this._heartbeatTimer = heartbeatTimer
callback()
}

/**
* Unmounts the gossipsub protocol and shuts down every connection
*
* @override
* @param {Function} callback
* @returns {void}
*/
stop (callback) {
stop () {
if (!this._heartbeatTimer) {
const errMsg = 'Heartbeat timer is not running'
this.gossipsub.log(errMsg)
return callback(errcode(new Error(errMsg), 'ERR_HEARTBEAT_NO_RUNNING'))
throw errcode(new Error(errMsg), 'ERR_HEARTBEAT_NO_RUNNING')
}
this._heartbeatTimer.cancel(() => {
this._heartbeatTimer = null
callback()
})

this._heartbeatTimer.cancel()
this._heartbeatTimer = null
}

/**
@@ -88,7 +83,7 @@ class Heartbeat {
return
}

this.gossipsub.log('HEARTBEAT: Add mesh link to %s in %s', peer.info.id.toB58String(), topic)
this.gossipsub.log('HEARTBEAT: Add mesh link to %s in %s', peer.id.toB58String(), topic)
peers.add(peer)
const peerGrafts = tograft.get(peer)
if (!peerGrafts) {
@@ -107,7 +102,7 @@ class Heartbeat {
peersArray = peersArray.slice(0, idontneed)

peersArray.forEach((peer) => {
this.gossipsub.log('HEARTBEAT: Remove mesh link to %s in %s', peer.info.id.toB58String(), topic)
this.gossipsub.log('HEARTBEAT: Remove mesh link to %s in %s', peer.id.toB58String(), topic)
peers.delete(peer)
const peerPrunes = toprune.get(peer)
if (!peerPrunes) {
Loading