We have frequent troubles resolving IPFS links. Most people of our engineering team are behind NATs, sometimes even double NATs. Currently we “solve” this by creating SSH tunnels to a server outside the NAT running ipfs. This works, but is not really decentralised.
[User 1] <-- NAT–> [Node] <-- NAT --> [User 2]
So User 1 adds something, and User 2 is unable to resolve it. Once it is pinned on the central node, resolution works.
So how would I use it? From the description above I have to enable it using Swarm.DisableRelay = true. But then what? Are there some instructions on how to use this feature? I am sure we could figure it out given the info above, but it would be nice to have step by step instructions.
Thanks a lot for the link. I somehow missed this when I first looked.
So now I followed the instructions from @leerspace and was able to use the circuit relay. Two nodes A and B that are connected to a common node C via a NAT and a double NAT can see each others objects.
I tested that by adding random stuff on one node and seeing if I can get it on another node. Basically on A head -c 10 /dev/urandom | ipfs add and on B see if you can resolve it. Works pretty well despite all the NATs.
Now, is it possible to configure a node so that it will always try the circuit relay whenever it tries to resolve something?
I might be misreading this, but I think that this might be a limitation of the current relay implementation. Based on the future work section of libp2p relay spec, it seems like automatic relay node discovery isn’t implemented yet.
The two users can connect, but if there is no any other nodes with static IP, the resolving is only done by relay node. And after the resolving, if the user want to get data from user, the data must tranlate via the relay node.
So NAT would be a tremendous problem of private network in Asia.
I am using ipfs swarm connect to connect two go ipfs nodes version 0.4.23 connected to different networks. The nodes are approximately 24 km apart. But when I type the command ipfs swarm connect /ip4/external_ip_of_the_node/tcp/4001/ipfs/peer_id_of_the_node
where the external ip of the node has been found from https://whatismyipaddress.com/ this error is displayed:
Thank you for the reply. I have changed my go ipfs configuration for the circuit relay feature. Then I found one relay peer address in ipfs swarm peers. So do we have to check if we can find a common relay peer address among ipfs swarm peers from both nodes or is there any other way of discovering relay peer addresses?
Thank you for the answer. The “EnableAutoRelay” feature in our ipfs configuration was disabled previouslu. So I will see if connection can be made using ipfs swarm connect /p2p-circuit/p2p/QmOtherPeerId from one of the nodes after setting the “EnableAutoRelay” feature to true.
I tried connecting to the other node after enabling the AutoRelay feature. But it didn’t work. After using ipfs swarm connect /p2p-circuit/p2p/QmOtherPeerId,this error was displayed:
Error: connect Qmpeer_id failure: failed to
** dial : all dials failed**
** * [/p2p-circuit] Failed to dial through 2 known relay hosts**
What does this mean?Connection could not be established between these two nodes with or without relay. Is this a common issue?
Hi,In addition to the two methods of relay and NAT, are there other ways to connect ipfs nodes between two different intranets? If you use a relay, the traffic will pass through the public network ipfs node, which will cause a lot of traffic. If you use NAT, many households in China do not have a public network address and need to use a public network server for mapping, but the traffic still needs to go to the public network machine . Is there any way to transfer traffic directly between two different intranet ipfs nodes?