Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Update libp2p to the latest version 🚀 #2342

Closed
wants to merge 1 commit into from

Conversation

greenkeeper[bot]
Copy link
Contributor

@greenkeeper greenkeeper bot commented Aug 8, 2019

The dependency libp2p was updated from 0.25.5 to 0.26.0.

This version is not covered by your current version range.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.


Publisher: jacobheun
License: MIT

Release Notes for v0.26.0

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.

Commits

The new version differs by 21 commits.

  • d788433 chore: release version v0.26.0
  • d5a977b chore: update contributors
  • 0489972 chore: release version v0.26.0-rc.3
  • 3f31b1f chore: update contributors
  • a2b3446 docs: async migration (#397)
  • ff7a6c8 fix: promisified methods (#398)
  • 9a8d609 chore: release version v0.26.0-rc.2
  • 9fef58c chore: update contributors
  • 684f283 chore: update switch (#395)
  • 3e95e6f fix: dont override methods of created instance (#394)
  • f4f3f0f fix: pubsub default config (#393)
  • 7c2c852 chore: release version v0.26.0-rc.1
  • e8d8aab chore: update contributors
  • dd48d26 chore: promisify pubsub start and stop (#392)
  • 99a5359 chore: release version v0.26.0-rc.0

There are 21 commits in total.

See the full diff


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper bot 🌴

greenkeeper bot added a commit that referenced this pull request Aug 21, 2019
@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Aug 21, 2019

  • The dependency libp2p was updated from 0.25.6 to 0.26.1.

Update to this version instead 🚀

Release Notes for v0.26.1

Bug Fixes

Commits

The new version differs by 11 commits.

  • 8079c20 chore: release version v0.26.1
  • 80cf077 chore: update contributors
  • 60b0cbc fix: reject rather than throw in get peer info (#410)
  • 3eef695 fix: improve config defaults (#409)
  • b3deb35 fix: reference files directly to avoid npm install failures (#408)
  • 299cfef chore: remove webrtcsupport
  • aa95ab9 fix: avoid using superstruct interface
  • b0f124b fix: pubsub configuration (#404)
  • b294301 refactor: add core modules to libp2p (#400)
  • d92306f docs: fix contributing readme (#403)
  • fd738f9 refactor: add js-libp2p-switch to the libp2p codebase (#388)

See the full diff

@alanshaw
Copy link
Member

Will be updated in #2298

@alanshaw alanshaw closed this Aug 28, 2019
@alanshaw alanshaw deleted the greenkeeper/libp2p-0.26.0 branch August 28, 2019 08:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant