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

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ljedrz
Copy link
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.

@ljedrz ljedrz requested a review from koivunej September 18, 2020 13:04
) -> Poll<NetworkBehaviourAction> {
if params.supported_protocols().len() != self.protocols.len() {
Copy link
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