Skip to content

v0.2.0

Compare
Choose a tag to compare
@aschmahmann aschmahmann released this 31 Oct 23:23
· 592 commits to master since this release
55f4ad6

This release has a number of large changes and bugfixes:

Functionality and Interfaces

Active Peer Discovery

PubSub can now actively discover peers for a given topic using libp2p Discovery libp2p/go-libp2p-pubsub-router#28 #184

  • Passing the WithDiscovery option into PubSub will cause active discovery of peers until they reach an appropriate threshold defined by each router (i.e. floodsub, gossipsub, etc.)
  • This includes both initial bootstrapping and continuous polling if the number of peers for a given topic drops too low

Topic Handles

Added Topic and TopicEventHandler objects to serve as the entry points to PubSub functionality #198 #184

  • Calling pubsub.Join(topic, topicOpts...) will return a Topic object that Publish and Subscribe can be called on.
    • The new topic.Publish function has an updated function signature
    • The old pubsub.Publish and pubsub.Subscribe methods are still usable, but have been deprecated
    • Option for publish to block until the router has enough peers. Fixes #211 and some testing race conditions
  • The events added in v0.1.0 have been moved from Subscription to a separate TopicEventHandler that can be created by the Topic.

Message contains reference to the message deliverer

Messages returned by Subscription now contain the peer ID of the peer that actually delivered the message

Bugfixes