-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Only log addresses that are actually being listened on #213
Comments
👍 , note however, that adding websockets, tcp or any multiaddrs to the browser PeerInfo is not recommended (at all), because those multiaddrs will be propagate and no other peer will be able to dial to the browser on those multiaddrs. |
@dignifiedquire wanna handle this one? |
@diasdavid sure |
So this is more tricky than I thought, I would suggest changing libp2p-swarm in a way that it drops all multiaddrs in |
We can't drop the multiaddrs that we weren't able to listen into, since these multiaddrs might be valid only under certain networks, so the fact that I'm not listening in an addr now, might just mean that on the wifi network that I'm right now, that multiaddr doesn't work, but I might change networks (without closing my daemon) and then I want to listen on that multiaddr. We need to upgrade peer-info to enumerate the active addresses. This will also be useful for knowing which multiaddr we used to connect to a certain peer. |
would it make sense for the daemon to listen for network changes and try to On Mon, Sep 26, 2016 at 12:33 PM, David Dias notifications@github.com
|
Hey @dignifiedquire mind adding a test case for this showing the failure? |
@diasdavid not sure how to exactly, and I don't think that I will have time for this soon. |
@dryajov does this sound like something you could handle? |
@diasdavid sure thing, I'll take a look! |
I did some initial digging and this is what I've found. There is currently no way of telling if an address succeed listening or not outside of swarm. Tho addresses do get updated if listening succeed with whatever the To @victorbjelkholm point, do we perform any sort of active reconnect on network changes? @diasdavid One more thing I found is that If there are no objections, I'll start making the changes to PeerInfo. I'll create issues for the other two things I identified. |
The correct statement is that 0.0.0.0 should be also supported by Websockets transport. Here is an issue to track that: libp2p/js-libp2p-websockets#12 webrtc-star and websocket-star won't use 0.0.0.0 at all. 0.0.0.0 means listen in all interfaces
The current "activeMultiaddrs" is, in reality, the "peer.multiaddrs" as these get updated when on every listener that is created (i.e 0.0.0.0 gets expanded to the interfaces). They just do not get removed when a listen call fails and I believe that is where the bug needs to be fixed. |
The reason I suggested having a separate field for active connections, is because of this statement:
Would this still be an issue if we remove addresses from How about the point on reconnecting on network changes, what do you think about that - is it something we already do? If not, do you see any value on handling those cases? |
In https://github.com/ipfs/js-ipfs/blob/master/src/core/ipfs/libp2p.js#L16-L18 it prints all addresses that are passed in but sometimes those listens fail or do not happen at all (e.g. in the browser).
The text was updated successfully, but these errors were encountered: