Closed gitGksgk closed 4 years ago
Thanks for reporting this @gitGksgk
We are deprecating this module per libp2p/js-peer-info#85. This should not be a problem anymore with js-libp2p
new connection manager.
I am closing this. Let me know if this is still a problem in the new codebase.
this is pretty hard to reproduce, some behavior is still not comprehended .I'll try to make myself understood anyway... set up several nodes ( go node, js node, virtual node, nodes in different computers), don't bootstrap to outside network (so as to get a clear experiment environment). enable dht and circuits in js-ipfs. then nodes will discover and connect to each other. now set up a browser node with dht and circuits enabled. The node will discover others too once connected to a go node in the same computer. Now, the issue comes here: while it returns correct CIDs, the multiaddrs are very arbitrary. sometimes it considers another computer's connected multiaddr as 127.0.0.1. sometimes it returns address like 169.254.65.29, an unknown unreachable address.. sometimes it will get a correct multiaddr of another computer though. I've looked into the code:
it shows that the browser node has discovered 8 multiaddrs. the peerId is perfectly correct. addr is perfectly messy. When digging deeper into
swarm.js
I found that in _peerInfoBook, it hasit shows that in a certain discovered node we have found 7 multiaddrs and have got 1 connectedMultiaddr. in 7 multiaddrs there's often a correct ip address of that discovered not, though not always becoming the connectedMultiaddr, which eventually become messy addrs as mentioned above. In this example I got an addr of 192, 168, 197, 1 which is my vmware's ip, but the CID shows that the node is on another computer and has no chance to shake hands with my vmware. I'm not sure if this issue should be posted here or somewhere related to dht.. using peer-info@0.14.1
it seems that in
peer-info\src\index.js
there'sconnect(ma){...}
function which adds the first (or random) address in each discovered node's multiaddr list, no matter it's actually connected or not.