Cannot find an object after adding it from a different machine


I just started to play around with IPFS. I’ve added a file from my Macbook like this:

ipfs add <file1>

It was successful and I got CID.

Then I tried to list it from a different Linux machine in the same local network:

ipfs ls <CID>

but it gave me an error:

Error: merkledag: not found

My question is: what else do I need to do to be able to see a file ipfs added from a different machine?


Make sure you have the daemon running on both nodes.

I started the daemon in the 2nd machine (Linux). Now the error message is gone, but ipfs ls <CID> is stuck with no response.

If I run the same command on the 1st machine, it works. What is the recommended way to debug ipfs daemon?

Another question I have is: does the 1st machine have to appear in the output of ipfs swarm peers ?

Yes. You need a connection to a hosting peer to download the data. However you should not have to worry about that as IPFS should find and connect to the right peer automatically.

go-ipfs uses mDNS for autodiscovery in local networks. But your ports need to be open and the protocol not filtered.