waku-org / nwaku

Waku node and protocol.
Other
201 stars 52 forks source link

chore: improving get_peer_ids_by_protocol in libwaku #3109

Closed gabrielmer closed 1 month ago

gabrielmer commented 1 month ago

Description

Currently, libwaku's GET_PEER_IDS_BY_PROTOCOL returns the peer ids of peers that have an open libp2p stream associated with a given protocol.

However, what's most interesting for us is the capabilities of our connected peers and not which protocols are we actually using.

For example, for req-res protocols such as Store, most of the time we don't have an open stream associated with the Store protocol - which means that with the current approach GET_PEER_IDS_BY_PROTOCOL won't return anything.

Therefore, changing the approach so we return all our connected peers that support a given protocol, even if we don't have open streams for that protocol in specific.

Changes

Issue

3039

github-actions[bot] commented 1 month ago

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3109

Built from f793b40f3c988739b831aa68f6976b8d38b6a7f4