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
[x] improving GET_PEER_IDS_BY_PROTOCOL so it returns our connected peers with a given capability
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
GET_PEER_IDS_BY_PROTOCOL
so it returns our connected peers with a given capabilityIssue
3039