Searching the error didn’t seem to give me anything relevant. Any pointers would be appreciated! Not sure if I’m just missing something obvious. If it makes a difference, the node I’m trying to connect to is using rust-libp2p.
Hey @noot! Thanks for using the libp2p discussion forums.
I’m having the same issue when connecting to that node. It looks like it’s running in Azure. Are you sure you’ve opened up that port for inbound traffic? You should also disable the firewall on that machine, or add an exception to whitelist that port.
What’s the full multiaddr you’re using to connect to that peer? I don’t see it in your test code. It may contain the wrong peer ID – as the error message indicates.
Also @raul, how do I access the protocols/stream protocols that are supported by peers? I tried using host.Peerstore().ProtoBook but that doesn’t seem to be accessible.
By enabling the DEBUG level (env variable IPFS_LOGGING=DEBUG // TODO: need to change var name), you should see this log statement from the secio logger:
Both peers need to support the Identify protocol. You need to wait a little until that completes (once merge the stabilize branch which emits the EvtPeerIdentificationCompleted event on the eventbus once identify completes, you will be able to subscribe to that). Then you can query the Peerstore via host.Peerstore().GetProtocols(id).
Great, thank you! The debug logs are really helpful. I’m also using the DHT to discover peers, any idea what this means? 16:27:06.566 DEBUG dht: discarding dialled peer because of error: context canceled dial_queue.go:328
Seeing it a lot, wondering if it’s an issue.
When do you expect the stabilize branch to be merged?
I’m using context.Background which shouldn’t have a deadline. It looks like it’s finding peers okay though, so I don’t think it’s a huge issue.
Is there a function for the DHT that triggers upon discovering a new peer? I’d like to do something like dht.OnPeerFound( // do something). Would it be best to use dht.GetClosestPeers()?