Upload files under same CID to IPFS

Viewed 2156

I'm looking to create an NFT project with 10k pieces, each piece should be made available as soon as the token was minted, therefore I want to call upload the JSON object to IPFS under the same hash as I've seen in other projects.

This means that when the item was minted a new file will be uploaded to:

ipfs://<CID>/1

the seconds minting will create token 2 and then a new file will be uploaded to

ipfs://<CID>/2

How is it possible to be done with ipfs or pinata api?

2 Answers

Update: I just reread the last part of the question.

I found this here (https://docs.pinata.cloud/api-pinning/pin-file) :

wrapWithDirectory - Wrap your content inside of a directory when adding to IPFS. This allows users to retrieve content via a filename instead of just a hash. For a more detailed explanation, see this informative blogpost. Valid options are: true or false

I'm pretty sure that you can do this with ipfs add /PATH/TO/CONTENT/* -w

I'm still exploring with IPFS, but this sounds like what you are looking for.

Related