We will create directories to hold our images and metadata, and then compile them into a single IPFS CAR (Content Addressable aRchive) file that can be uploaded.
Copy all your images into the
/imagesfolder. Two sample images have been provided in this repo, but obviously you should replace these with the images for your collection.
Pack them into an IPFS .car file:
The command will output the root CID (Content IDentifer) for your image folder.
root CID: bafybeih3ykpa42eipgtzcrfkeo5nvazcdqhj3oh3ztju44tcoipzsdaauy
Create an account with NFT.storage if you don't have one already, and navigate to your Files directory. Click on "Upload" and select
After uploading you should be able to see the CID and click through to see your images.
Now let's do the same thing for metadata.
A few sample metadata files are available in
/metadata. Let's take a look at one of them.
"description": "Just some guy that likes to code.",
"name": "Shane Stargaze"
Using a similar command to the images, let's pack the metadata into another .car file.
It should generate another CID, this time for the metadata. This root CID is the base URL for your collection.
root CID: bafybeigemuqa4ddnexclmc633qghcrbd34ne2jq6aym6udubldxzmss6ma
Follow the same steps as you did for images to upload the
metadata.carfile to NFT.storage.
After getting the CID for metadata, you set it as the base URL in your contract. This way, the contract knows how to associate each token ID with an individual token URI without having to send the contract a list of URIs. All token URIs can be determined by appending the token ID to the base URL.
For this example, the