[solved ]Why some CID are working using the API port and some others not?

Hi.

I discovered that:

works.

But for some others CID (I tried the latest webui CID Release v2.12.4 · ipfs/ipfs-webui · GitHub) it doesn’t and I have a 404 error (but works using the gateway in port 8080)

What’s happening bethind the scene ?

If some content is available on a public gateway but not on your local node, that means your local node isn’t aware of the content yet. If your local node is in a private network, then you also have your own DHT, meaning you’ll only see content added by nodes in your private swarm.

Thanks, I guess I was not clear enough.
So, on this private node (so yes, no content available by default) I did:

curl https://ipfs.io/api/v0/get/QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub | tar -xf -
ipfs add -r QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub
...
added QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub


curl https://ipfs.io/api/v0/get/bafybeiflkjt66aetfgcrgvv75izymd5kc47g6luepqmfq6zsf5w6ueth6y| tar -xf -
ipfs add -r bafybeiflkjt66aetfgcrgvv75izymd5kc47g6luepqmfq6zsf5w6ueth6y
...
added QmcB9KLBaivEU1NLpXH2UswDWQT23E1CbAcTsZprZqcho6 bafybeiflkjt66aetfgcrgvv75izymd5kc47g6luepqmfq6zsf5w6ueth6y

Then

This is what I don’t understand, what is the difference?

Or maybe I did not understand what you meant… Both contents are available on my private node right (I thought it was the case as available thru the gateway and the CLI)

Ah… Looking in the go-ipfs code, I found why, I needed to pass “–unrestricted-api” to the daemon else only a whitelist of CID are allowed. Good to know!

Why are you using the API port instead of the gateway port for accessing files? It seems like just going to port 8080 (or using ipfs cat or ipfs ls on the API port) would resolve your issues here.

Hi Adin,

I don’t really understand what differs from the API server (5001) and the Gateway (8080) but definitively this is one :slight_smile: When the webui framework is “read” from the API server, the underlying calls to the API are working but when “read” from the Gateway, the HTML is displayed but the API calls are blocked by the browser.

Probably because the API server can manage CORS policies why the Gateway cannot?