Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡️ 0.26 RELEASE 🚀 #387

Closed
19 tasks done
jacobheun opened this issue Jul 29, 2019 · 3 comments
Closed
19 tasks done

⚡️ 0.26 RELEASE 🚀 #387

jacobheun opened this issue Jul 29, 2019 · 3 comments
Assignees

Comments

@jacobheun
Copy link
Contributor

jacobheun commented Jul 29, 2019

Gossipsub support and Promisify API

🗺 What's left for release

🔦 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.

✅ Release Checklist

  • Robustness and quality
    • Ensure that all tests are passing, this includes:
      • unit
    • Publish a release candidate to npm
      # Minor prerelease (e.g. 0.24.1 -> 0.25.0-rc.0)
      $ npx aegir release --type preminor -t node -t browser --preid rc --dist-tag next
      
      # Increment prerelease (e.g. 0.25.0-rc.0 -> 0.25.0-rc.1)
      $ npx aegir release --type prerelease -t node -t browser --preid rc --dist-tag next
    • Run tests of the following projects with the new release:
  • Documentation
    • Ensure that README.md is up to date
    • Ensure that all the examples run
  • Communication

❤️ Huge thank you to everyone that made this release possible

In alphabetical order, here are the 38 humans that made 429 contributions to this release:

🙌🏽 Want to contribute?

Would you like to contribute to the libp2p project and don't know how? Well, there are a few places you can get started:

⁉️ Do you have questions?

The best place to ask your questions about libp2p, how it works and what you can do with it is at discuss.libp2p.io. We are also available at the #libp2p channel on Freenode.

@jacobheun jacobheun self-assigned this Jul 29, 2019
@jacobheun jacobheun pinned this issue Jul 29, 2019
@didlie
Copy link

didlie commented Aug 1, 2019

...So, without studying the code (too many repos to study), please give a step by-step nodeJS install process and client setup process for an entirely new unique network using this js-libp2p... thanks. From: Project Organizer at NoClouds @github/orgs/noclouds --- just enough to send some text messages back and forth, maybe select specific peers to private message, maybe give a comprehensive list of objects and methods and examples of how to use them. maybe just do a simple run through of the install process so I can open a command console and test it for our network needs prior to spending days disecting this code... If you want to know whats in it for you, you can become a developer in the NoClouds project and get real assets when the network is deployed. Please read the NoClouds description.

@jacobheun
Copy link
Contributor Author

@didlie I'd recommend checking out the more in depth chat example tutorial at https://github.com/libp2p/js-libp2p-examples/tree/master/chat, that includes a bootstrap server, nodejs and browser client, to get started. If you have more questions about getting started I'd recommend also checking out the discuss forums https://discuss.libp2p.io.

Unless you have an issue with the pending 0.26 release, please use the forums or create another issue to avoid spamming folks who are subscribed to this issue for release updates. Thank you!

@jacobheun
Copy link
Contributor Author

0.26 is out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants