-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
examples: add basic pubsub-with-rendezvous example #1738
Conversation
Does it make sense to exhaust the combinatory space here, and have a pubsub with mdns, a pubsub with rendezvouz, and a chat with rendezvouz example? Every example creates maintenance burden for years to come, and we should only add it if it actually adds value over what we currently have. |
That's fair - you're welcome to reject this PR, or suggest something else. I just wanted to share the product of a couple hours of trying to work out pubsub with rendezvous in case it was useful to anyone else. |
@vyzo, what do you think? You're more familiar with our pubsub code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All that looks fine to me.
@smartin015 : CI is failing. Can you please investigate to try and get CI to pass? |
Can do - looks like some deprecation notices are the issue. I'll try to have a fix in by the next couple of days. |
Okay @BigLep - pushed changes and ran |
And yet... apparently I needed to |
Thanks @smartin015 :) |
I'm evaluating libp2p's pubsub implementation for coordinating a dynamic number of distributed nodes. I noticed there was a neat (but IMO rather complex and hard to quickly grok) example for pubsub using mdns, but as my nodes could span multiple networks I needed to use rendezvous instead.
This PR is a pared-down example that mashes together
pubsub/chat
andchat-with-rendezvous
, stripping away all of the UI prettiness in order to more clearly show the most basic setup needed to get a shared pubsub topic sent to 2+ nodes.I haven't yet tested this on multiple PCs / across NAT barriers, but it does work with multiple processes running locally.