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

Expose muxer ids #2012

Merged
merged 4 commits into from
Jan 25, 2023
Merged

Expose muxer ids #2012

merged 4 commits into from
Jan 25, 2023

Conversation

aschmahmann
Copy link
Collaborator

@aschmahmann aschmahmann commented Jan 24, 2023

The protocol IDs of the stream multiplexers are not exposed as constants, which makes using them a pretty miserable experience since you have to hunt through the code to find them. This is particularly true for mplex which, while still being the only multiplexer used in parts of the libp2p ecosystem, does not have its protocol ID referenced in go-libp2p outside of tests anymore (also the constructor documentation said mplux instead of mplex).

This exposes the protocol IDs with an exported constant ID as is done for Noise and TLS.

Also, fixes a documentation bug indicating that mplex was used by default.

Note: the various ipfs-camp-2019 examples can be updated as well post-release so that the constants are only defined once within go-libp2p.

libp2p.go Outdated Show resolved Hide resolved
libp2p.go Outdated Show resolved Hide resolved
@MarcoPolo MarcoPolo merged commit d5a280e into master Jan 25, 2023
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