0

I've read a bit about IPFS and even added a feature to my comic book reader [1], but I am having trouble getting the basic flow to work:

  • I created a VM running on Google Cloud that has go-ipfs installed
  • ipfs daemon is running
  • on the VM, I added a file (which I believe pins it): hash Qma8Ru1qrJjeVcw5NpY8nXrCWnRhwZpKx617vV3atTYA9t
  • I can see lots of peers connecting via "ipfs swarm peers"
  • on my local computer, I installed go-ipfs

When I try on my local computer:

  $ ipfs get Qma8Ru1qrJjeVcw5NpY8nXrCWnRhwZpKx617vV3atTYA9t

it just sits there...

Is there a good way to monitor what's going on here (like is the IPFS node in the VM set up correctly)? Am I doing something wrong?

[1] https://github.com/codedread/kthoom

codedread
  • 1,312
  • 11
  • 18
  • It might be the case where your node on Google Cloud is not being able to connect to your node running in your machine. Try: Loading the CID on the gateway by opening https://gateway.ipfs.io/ipfs/ and/or also try to connect your nodes together with `ipfs swarm connect` – David Dias Sep 20 '19 at 09:22
  • Hi David - explicitly connecting my Macbook to my VM peer worked! I have to issue a ipfs swarm connect command, then an ipfs get to grab a file. Any idea how to make this happen without having to explicitly connect to a peer? Seems counter-intuitive that a distributed file system requires me to be explicit about where to grab the file from... – codedread Sep 22 '19 at 02:09
  • Awesome! I understand how you feel. The main issue is that there are too many blind spots in the whole IP protocol (NAT, Firewalls, iptables, lack of enough public IPs, etc) that create this situations in which _you can dial outside, but folks can't dial to you_. We are working on solving this and we do have some solutions already. Namely a WebRTC transport and a Relay protocol that facilitates these connections. – David Dias Oct 09 '19 at 06:43

1 Answers1

2

For the readers, the answer was that it was needed for the peer behind the NAT to dial to the peer in the public IP.

For folks wanting to learn more about how to deal with this automatically, check our tutorials on:

David Dias
  • 1,792
  • 3
  • 16
  • 28