Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Add the list of supported libp2p protocols to /id#381

Draft
ljedrz wants to merge 1 commit into
rs-ipfs:masterfrom
ljedrz:future_conformance_compat
Draft

Add the list of supported libp2p protocols to /id#381
ljedrz wants to merge 1 commit into
rs-ipfs:masterfrom
ljedrz:future_conformance_compat

Conversation

@ljedrz
Copy link
Copy Markdown
Member

@ljedrz ljedrz commented Sep 18, 2020

Following the changes in go-ipfs and js-ipfs (and already required in the upstream conformance tests), this PR adds the quite useful list of supported libp2p protocols to the JSON returned by /id.

Since I'm not sure about the resulting small API changes and the way the protocols get populated (which was WAY harder than anticipated), I'm marking it as a draft.

Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz requested a review from koivunej September 18, 2020 13:04
Comment thread src/p2p/swarm.rs
_: &mut impl PollParameters,
params: &mut impl PollParameters,
) -> Poll<NetworkBehaviourAction> {
if params.supported_protocols().len() != self.protocols.len() {
Copy link
Copy Markdown
Member Author

@ljedrz ljedrz Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PollParameters::supported_protocols returns an ExactSizeIterator, so obtaining the len is cheap; this implementation assumes that the protocols could change during the node's lifetime

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant