js-libp2p 0.25.0 released

js-libp2p 0.25.0 released

Save the routers, save the world.

# 🔦 Highlights

Libp2p 0.25 is already in the new js-ipfs 0.35 release (opens new window). If you're using js-ipfs, you'll get these changes immediately if you upgrade there!

# ☎️ Auto Dial

Libp2p will now auto dial to discovered peers by default. This can be disabled in configuration if you need to do any specialized dialing. Discovered peers will only be dialed if we are under our min peers threshold, which is configured for the Connection Manager. You can read more about Peer Discovery and Auto Dial here (opens new window).

# ✂️ Better Connection Management

We fixed an issue with Libp2p Switch that resulted in the Connection Manager thinking there were far fewer connections than there actually were. The Connection Manager is back to keeping your router safe and your connection count within its configured range (opens new window).

# 📔 Blacklisting Undialable Nodes

Libp2p will now blacklist nodes that aren't dialable. The blacklisting includes an exponential backoff with a random jitter. This along with auto dial, helps to ensure libp2p is spending its connection resources wisely. You can read more about the configuration options in the libp2p-switch readme (opens new window).

# 🔢 Dial Queues

Libp2p Switch now has better queuing for dials! Previously, the only limiting of dials was done per peer. Now, all dials will enter a global queue so that we can better manage connection attempts. The current default limit is 100 parallel dials, but you can configure this to your needs. If a peer is already connected, any calls to .dial() or .dialProtocol() skip the line and will be executed immediately. Any dials done as a result of Auto Dial will take a back seat.

# ⚖️ Smaller than ever

Since the 0.24 release, libp2p has dropped some weight. The bundle size is now ~42% smaller!

# 🏗 API Changes

  • Auto Dial is enabled by default. Applications that previously dialed on peer discovery should either stop doing so, or turn off Auto Dial. We recommend using Auto Dial if you're not customizing your dialing logic when peers are discovered.
  • The DHT no longer lives under EXPERIMENTAL in the config. It is enabled directly in it's own config options. Check out the Peer and Content Routing example (opens new window) to see how to configure a basic Libp2p node with the DHT on.
  • Pubsub now supports unsubscribe all. Check out interface-js-ipfs-core docs (opens new window) if you want to be able to unsubscribe all listeners for a topic.

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

In alphabetical order, here are all the humans that contributed to the 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:

  • Check the issues with the help wanted label in the libp2p repo (opens new window)
  • Join an IPFS All Hands, introduce yourself and let us know where you would like to contribute - https://github.com/ipfs/team-mgmt#all-hands-call
  • Hack with IPFS and show us what you made! The All Hands call is also the perfect venue for demos, join in and show us what you built
  • Join the discussion at http://discuss.ipfs.tech/ and help users finding their answers.
  • Join the ⚡️ⒿⓈ Core Dev Team Weekly Sync 🙌🏽 (opens new window) and be part of the Sprint action!

# ⁉️ 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 (opens new window). We are also available at the #libp2p channel on Freenode.