Skip to content

@jacobheun jacobheun released this Aug 21, 2019 · 2 commits to master since this release

Bug Fixes

Assets 2

@jacobheun jacobheun released this Aug 20, 2019 · 34 commits to master since this release

Bug Fixes

Assets 2

@jacobheun jacobheun released this Aug 7, 2019 · 13 commits to master since this release

Gossipsub support and Promisify API

🔦 Highlights

🗣 Gossipsub

Thanks to the awesome work of the ChainSafe team, Gossipsub is here! Gossipsub is a much more efficient pubsub router than Floodsub. Intead of broadcasting to all of its peers, it broadcasts to a controlled subset of peers. To learn more about how Gossipsub works and where it differs from Floodsub, check out the Spec.

If you are using Pubsub you can now switch to using Gossipsub instead of Floodsub. Have old peers you need to flood stuff to? Don't worry, Gossipsub will automatically fallback to Floodsub for peers that don't support it. See the API Changes section below for how to migrate your config over to using Gossipsub.

🚉 Promisify

As we migrate to async/await we are promisifying the Libp2p public methods. Several lower level libraries are currently leveraging libp2p for testing. Their transition to full async/await will be greatly helped by promisifying the libp2p API. Once the async/await changes are propagated up, we will remove Promisify in a future update, along with callback support, as libp2p will have full async/await support at that time. See the API Changes below to check out the Breaking Changes.

🏗 API Changes

BREAKING CHANGES

Configuration

Switch Options

Configuration for libp2p-switch has changed. blacklistTTL and blackListAttempts have been changed to denyTTL and denyAttempts respectively. You can set these as follows:

const libp2p = new Libp2p({
  switch: {
    denyTTL: 120e3,
    denyAttempts: 5,
  }
  ...
})

Pubsub

Subscribe: To comply with the pubsub interface, the order of params for libp2p.pubsub.subscribe have been reordered. They were previously topic, options, handler, callback, and are now topic, handler, options, callback. If your implementation does not use options you should be able to ignore this change.

Config: Pubsub was previously enabled via the EXPERIMENTAL config. You must now specify your pubsub implementation (Gossipsub or Floodsub), and enable/disable it via it's own configuration. Setting pubsub will automatically enable it. You can disable it by explicitly setting enabled to false in the configuration .

const libp2p = new Libp2p({
  modules: {
    pubsub: require('libp2p-gossipsub'),
    ...
  },
  config: {
    pubsub: {
      enabled: true
    },
    ...
  }
  ...
})

Promisify

All libp2p public methods have been promisified, so callbacks can be omitted in favor of promise based usage, including async/await. For example, start can be used as:

libp2p.start(onStart)
// or
await libp2p.start()

Gossipsub

Gossipsub is integrated into the existing libp2p.pubsub API. Once Gossipsub has been supplied as your pubsub implementation, you will be able to use it just as Floodsub was previously used. See the section above for pubsub configuration changes.

Assets 2
Pre-release
Pre-release

@jacobheun jacobheun released this Aug 6, 2019 · 15 commits to master since this release

Bug Fixes

Assets 2
Aug 1, 2019
chore: release version v0.43.0
Pre-release
Pre-release

@jacobheun jacobheun released this Aug 1, 2019 · 19 commits to master since this release

Bug Fixes

Chores

BREAKING CHANGES

  • switch configuration has changed.
    'blacklistTTL' is now 'denyTTL' and 'blackListAttempts' is now 'denyAttempts'
Assets 2
Pre-release
Pre-release

@jacobheun jacobheun released this Jul 31, 2019 · 24 commits to master since this release

chore: release version v0.26.0-rc.1
Assets 2
Pre-release
Pre-release

@jacobheun jacobheun released this Jul 31, 2019 · 27 commits to master since this release

Bug Fixes

  • make subscribe comply with ipfs interface (#389) (9554b05)

Features

  • integrate gossipsub by default (#365) (791f39a)
  • promisify all api methods that accept callbacks (#381) (df6ef45)

BREAKING CHANGES

This corrects the order of parameters. See the jsdocs examples
for subscribe to see how it should be used.

Assets 2

@jacobheun jacobheun released this Jul 12, 2019 · 34 commits to master since this release

Assets 2

@jacobheun jacobheun released this Jun 7, 2019 · 38 commits to master since this release

Features

  • add createLibp2p to generate a PeerInfo instance (#367) (04faf18)
  • pass libp2p as option to transport creation (#363) (b06ca1b)
Assets 2
You can’t perform that action at this time.