I’m trying to upload a file on https://web3.storage/ and save the same one on my server.
However, the cid generated on the site is different from the one generate on my server.
Below are the two cids:
I checked them on https://cid.ipfs.io/. They have everything in common except sha256 hex.
These are the same files. After
ipfs get, they came with the same sha256sum.
So why they are different? And when user tries to get one cid, can they also connect to the server
the other cid?
I’m new to ipfs. This might be a silly question.
web3.storage uses different chunking settings than the defaults in
ipfs add (1MiB blocks, CIDv1, raw-leaves I think).
The CID identifies the Merkle-DAG that contains your file, and this Merkle-DAG is different so you have different CIDs.
By the way, can we get the chunk size directly from the cid and can users get the file from all the servers using one of the two different cids?
can we get the chunk size directly from the cid
can users get the file from all the servers using one of the two different cids
No, in general should use the web3.storage one.
Thanks a lot! I thought that others may get the same problem. And I successfully find the chunk size in the discord channel.
ipfs add --raw-leaves --chunker=size-1048576 --cid-version 1 example.file
By doing this can I generate the same cid with https://web3.storage/