-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Making your own ipfs service' example does not work #2401
Comments
We've added another step in getting go-ipfs set up from source -- please see https://github.com/ipfs/go-ipfs/#build-from-source Sorry about the hassle and thanks for commenting! We're working on making |
Compiled from source, but upon launching
|
@Zogg that ones normal, and will be downgraded to a warning in the next update of our libp2p dependency. The program shouldnt exit after printing that, it should continue functioning just fine |
I have host/client running in docker containers, on the same machine, yet client is unable to reach the host. Host container:
Client container:
|
I'm not sure about how that example works on containers. the docker networking setup does really weird things to NAT traversal, and might screw things up a bit. Could you confirm whether or not it works when run on two separate machines on the same LAN? I havent looked at that code pretty much since writing it a year ago. |
I'm having a similar issue. (same error messages, just trying to get or pin files, though)
Saw this issue, so moved node1 to run with Switched my Rancher stack to use host networking as well (avoiding docker NAT and the IPsec network) and this completed a transfer. Looks like it should be easily reproduced if needed. |
OK - so to add some help to the above node2 & node3 are on the same subnet - node3 failed to transfer the data, while node2 succeeded. I changed node3 to have a config that uses only the explicitly desired interface, I used the PrivateIPv4, restarted the daemon. This ALSO was not successful, so I explicitly added node2 via No matter what I do ipfs puts errors like so: in which 172.18.42.1 is the local docker0 address (RancherOS user-docker) - 127.0.0.1 127.0.0.2, system-docker address, and IPsec address as mentioned above all are seen in this error importantly I've also noted that on my AWS instances go-ipfs sets the swarm address to the private ipv4 ONLY, if ONLY the swarm address is set in the config - if the Gateway address is ALSO set to the private ipv4 then the SWARM address is set to BOTH the private and public ipv4 addresses. I've spun up a fresh node (node4) and cannot get this data transferred (ipfs get) to it. It appears that all but the one successful node fail on the same blocks. I am unable to reproduce the successful transfer. :( This is prep for automated release of data files - it would be so much preferable to release via ipfs than torrents. If I can provide any additional debug info - please let me know. This is the wrap hash of the data I'm trying to make available via ipfs (and verify that it is truly available to downloaders) QmZz9yywiWN2C4SzGd3tQYLQkUGsyJctn7dGoQ9TTzKMDi |
@guruvan we've had a couple issues with docker NAT stuff. I will have more time to help you debug this weekend, but for now heres some tips and things i would try, some of this you might already know (and should serve as help for others with similar issues) first, note down the peer IDs of all your involved nodes (run To check what peers a given node is connected to, run To check connectivity to a given node, i normally start at an ipfs node that i know has good connectivity (my vps normally) and run If you can successfully connect a node to the node with the data, you should be able to run an If you connect and arent able to get the data, i would check If you cant make a connection from an outside node to your node with the data, the next thing I would try is making a connection from the data node out to other peers, then try fetching the data on those other peers. If that works, then the issue lies entirely with NAT traversal not working. Ipfs does require some amount of port forwarding to work on NAT'ed networks (whether manual forwarding, NAT PMP or upnp). |
thank you - definitely helps in debugging this -
The docker addresses are surprising given the Hopefully by removing Docker networking, I should have the sufficient port forwarding in place, one host only is behind the NAT gw. I seem to have made a bit of a mess by starting up with swarm/API/Gateway addresses all set to bind-all interfaces. There does seem some inconsistency in how go-ipfs is picking up the public ipv4 address on AWS (note this isn't a separate interface as it is at rackspace or DO), it runs off the eth0 interface.
I have successfully run I'll run some more tests tomorrow/weekend. |
I was doing
Not sure if helpful. (I do not have IPv6 connectivity.) |
@whyrusleeping - Thanks - I think I have it sorta working, but it's not clear what's going on. I will put more notes in 2509 |
I will test the solution in there later tonight :)) |
can someone verify if the example in question still works? |
I'm trying the example right now (link for reference) but having troubles with compilation as it seems two of the dependencies have changed. Changing and "github.com/ipfs/go-ipfs/p2p/peer" to "gx/ipfs/QmWUswjn261LSyVxWAEpMVtPdy8zmKBJJfBpG3Qdpa8ZsE/go-libp2p-peer" Seem to have fixed the compilation problem. I have not yet tried to run host and client on two different machines but running them on the same machine with each using different ipfs repo doesn't seem to work out of the box.
UPDATE: The same failure happens when two different PCs in different parts of the world try it. |
For reference, the source for that example seems to be https://github.com/ipfs/examples/tree/master/examples/api/service. I'll give it a quick try too. |
@inetic after getting it to build, the example works for me among two computers on the local network (taking the code from the repo above). |
@inetic when running locally, are you using different configurations for ipfs so listening ports don't conflict? when running on two different PCs, it may be the case that the two peers don't manage to discover each other but I'm not sure. Discovery on local networks takes advantange of mDNS so should be faster. |
Good point, I wasn't. Once I changed the ports in We also managed to connect two distant PCs, in my latest comment we failed at this because one PC was behind a proxy and was running Tor. |
@hsanjuan |
@mib-kd743naq this API has been replaced with |
@magik6k this is my first mention of this thread... perhaps you highlighted the wrong person? |
Oh, sorry about that. |
When I run
go get
to download all the libraries of the example application, error is thrown:The text was updated successfully, but these errors were encountered: