Please note that I am sorry if this question is based on ipfs, where I am using integrated to Ethereum but in a very basic manner.

In this following example: a client stores a ipfs hash value inside a contract at ethereum. Server would access to already stored ipfs hash value by using the same contract. When ipfs hash value is obtained at the server, server node could obtain the ipfs file by using ipfs {ls||cat||get} < hash_value >. But when I use ipfs {ls||cat||get} < hash_value > there may occur a halt. Since I am doing all this process inside a script halt problem locks my script.

On the contrary I could obtain the files from ipfs.gateway(which uses public gateways) using wget (this process force gateways to cache the content till its garbage collector clear up the disk space).

[Q] Should I try to retrieve files using wget -r "https://ipfs.io/ipfs/< some_hash >" since its connection seems more reliable than using ipfs {cat||ls||get} < my_hash >? I am not questioning ipfs, I just want to learn what my cause this problem or where I made a mistake and come up with a solution. So far using wget through ipfs.gateway solved the halt problem I am facing with.

Please note that my server runs behind a firewall (on a university domain, so there has to be a firewall). On my case if my client on the same LAN behind the same firewall, there is not halt issue between my client and server. But if the client is outside of the LAN, it halts as I explained. The problem may arise because of the firewall, but the public gateways still could retrieve the added data via ipfs, from my server?

Explanation of this question as follows:

I have a client and server node. On both machines, on the background I am running the following command as guided on the ipfs tutorials:

ipfs daemon &

On my client machine, I have add a file into ipfs:

[~]$ ipfs add hello.c
added < my_hash > hello.c

After that on my server, I do try to retrieve the file:

[~]$ ipfs {cat||ls||get} < my_hash >

Following error message showed up multiple times.

14:18:59.986 ERROR  dht: no addresses on peer being sent!
                    [local:<peer.ID UjQJqD>]
                    [sending:<peer.ID aYb9MJ>]
                    [remote:<peer.ID Z86ow1>] handlers.go:75

ipfs {cat||get||ls} < my_hash > halts and I do wait a long time but nothing happens, maybe after few hours it works (The system acting unreliably on my case). This situation is weird because same process was working before without any problem and suddenly it may stop working as it should be.

On the other hand, I can see the file right away at my browser after ipfs add is done: url:https://gateway.ipfs.io/ipfs/< some_hash > or could download the file using wget -r "https://ipfs.io/ipfs/< my_hash >"".

Please note that if a folder added into the ipfs add -r folder_name it could retrieved from folder's hash with the following command:

wget -nH --cut-dirs=2 --no-parent -r -l 0 -nc "https://ipfs.io/ipfs/< folders_hash >"

Thank you for your valuable time and help.

  • 1
    Just for your info, IPFS is not directly on-topic for this site, however, there is an ongoing discussion on meta which you might want to join.
    – Afr
    Dec 22 '16 at 11:29
  • I am sorry about that, I was not sure where I could ask the question. There is a Github issues section (github.com/ipfs/go-ipfs/issues) but I could not able to reach anyone over there. I am using IPFS integrated to Ethereum so maybe those arising problem may help indirectly to Ethereum.
    – alper
    Dec 22 '16 at 11:59
  • 1
    I'm in favor of allowing ipfs questions here. Meanwhile, you could embed your question in an Ethereum context, maybe?
    – Afr
    Dec 22 '16 at 12:20
  • Sure I will do my best.
    – alper
    Dec 22 '16 at 13:28
  • @5chdn This question does not appear to be about Ethereum, the decentralized application platform and smart contract enabled blockchain, within the scope defined in the help center.
    – niksmac
    Dec 22 '16 at 13:37

You can run ipfs diag net to see if there's peers connected. If it says there's peers connected but you still can't retrieve the data then it could be that the peer information is expired and the node has trouble connecting to other peers because of the firewall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.