Dag put http api: cid link not working


I have been studying IPFS for a bit and I tried to follow some tutorials about the IPLD data model and programming in IPFS on proto school.

However, I can’t say it’s everything clear to me. In particular, during my journey of exploring IPLD, unfortunately, I got stuck very quickly. The problem is that the DAG objects I create do not work as expected for cid links are not recognized as such.

I am running an ipfs node with the following docker-compose file

version: “3”
image: ipfs/go-ipfs:latest
command: [“daemon”, “–enable-pubsub-experiment”]
container_name: ipfs-daemon
- /home/$USER/ipfs-docker:/data/ipfs
- 8080:8080
- 5001:5001
- 4001:4001

Then I tried to create a DAG object with the dag/put API, both from CLI and HTTP API. To do that I passed to the DAG API a JSON object and the execution of the command returned me the CID of the DAG object I created:

docker-compose exec ipfs-daemon ipfs dag put my_file.json 

docker-compose exec ipfs-daemon ipfs dag get 
[returns my JSON object]

Finally, I tried to create a new dag object which points to the previously created one.
The CID of this object is

and the object is something like this:

Unfortunately, the IPDL explorer does not recognize the keyword author to contain a CID, it’s just a string. Why is that? I think I am doing something wrong though I do not understand how to fix thix.

To me, it seems that the only difference between my code and the examples I am following (see https://proto.school/blog) is that I am NOT using the JS implementation of IPFS. Is that just it?

Do I have to use the JS implementation?

Thank you in advance for your time and patience, I will appreciate any comment and I wish you all a good day

1 Like

I’ve just got it.


A Link is an object that has the key / whose value is a CID.
It took me a while to figure it out, is there a place where I can find a kind of list of those specs? I tried from the IPDL website though I was not able to find what I was looking for

1 Like