libp2p / go-libp2p-examples

Example libp2p applications
MIT License
338 stars 145 forks source link

chat-with-rendezvous: The provided host does loose addresses #23

Open stefanhans opened 5 years ago

stefanhans commented 5 years ago

After the host with its []ma.Multiaddr addresses were kadDht.Provide provided and kadDht.FindProviders found again by the same host the addresses were lost

upperwal commented 5 years ago

Can you elaborate?

Do you mean the same host calling Provide followed by FindProviders can't see it's own addresses in the list?

stefanhans commented 5 years ago

Hi @upperwal,

I have elaborated it. Here is what I found:

host.Peerstore().SetAddrs(host.ID(), host.Addrs(), peerstore.ConnectedAddrTTL) is needed to set the addresses in the peerstore.

Cheers, Stefan