Missing protocols in peer data

Hi all,

I’m running js-libp2p in browser and using the WebRTC transport with the test WebRTC servers @ wrtc-star1.par.dwebops.pub.
I’ve implemented a test protocol based on the chat example, but I keep coming up against a strange problem, where peer data is returning an empty list of protocols, so my message sending is aborted.

Here is how I get the peer data:

  • I have a bootstrap server that I’m using to return the peerId b58 string and listen addresses (currently the WebRTC servers) for the peer.

  • I combine these into a multiaddr and dial the peer, which (I believe) adds the peer to my addressbook/peerstore.

  • Now I want to start communicating using my custom chat protocol. So I get the peer data like this:
    let peerData = await node.peerStore.get(peerId);

But I regularly retrieve peer data that contains the addresses and id object of the peer but an empty list of protocols.
image

Has anyone got any insight into this?

Thanks in advance!
Dan