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

Support multiple peers for the "chat-with-mdns" example #2993

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MqllR
Copy link

@MqllR MqllR commented Oct 2, 2024

The chat-with-mdns example is pretty limited and quite confusing regarding the streams management. As a libp2p beginner, it is not easy to really get the behavior of the StreamHandler and when another stream is opened.

In addition, the input read from Stdin cannot be consumed from the different goroutines which make the example incompatible with a multi peers setup.

In this PR, I propose to store the peers in a distinct struct to later be able to broadcast messages to all the peers part of the p2p network.

Execution example:

image

@sukunrt sukunrt self-assigned this Oct 7, 2024
@MarcoPolo
Copy link
Collaborator

Can you also update the example to use the latest version of go-libp2p? Update the examples/go.mod file to use go-libp2p v0.37.

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

Successfully merging this pull request may close these issues.

3 participants