# How to Use IPFS

OmniHub makes it easy to use IPFS-hosted metadata for your NFTs. Follow this step-by-step guide to ensure your metadata is correctly formatted, uploaded, and integrated for seamless deployment.

### **1. Prepare Your Metadata**

Before uploading, ensure your metadata follows the correct JSON format. Each NFT should have a separate metadata file containing essential attributes such as:

```
{
  "name": "Your NFT Name",
  "description": "Your NFT description",
  "image": "ipfs://your_image_cid",
  "attributes": [
    {
      "trait_type": "Background",
      "value": "Blue"
    },
    {
      "trait_type": "Rarity",
      "value": "Legendary"
    }
  ]
}
```

#### **Metadata Preparation**

* **Use consistent naming** – Each metadata file should match the corresponding image file (e.g. `/1.png`).
* **Optimize images** – Ensure they are compressed and in the correct format (PNG, JPEG, or GIF).
* **Check JSON validity** – Use tools like [JSONLint](https://jsonlint.com/) to validate your metadata files.
* **Store metadata on IPFS** – Use decentralized storage solutions to keep your metadata available long-term.

***

### 2. Upload Files to IPFS

To store images and metadata on IPFS, you can use one of the following services:

* [**Pinata**](https://www.pinata.cloud/)
* [**NFT.Storage**](https://nft.storage/)
* [**Web3.Storage**](https://web3.storage/)

#### **How to Upload**

1. **Upload all image files first** – This will generate a **CID (Content Identifier)** for the folder.
2. **Update the `image` field in your metadata** – Replace the placeholder with the actual CID, e.g.:

```
"image": "ipfs://bafybeibn.../1.png"
```

3. **Upload the metadata folder** – Once updated, upload the metadata files to IPFS to receive a new CID.

***

### 3. Generate Your IPFS Link

After uploading your metadata folder, reference it using the correct IPFS format:

#### **For IPFS Uploads:**

```
https://ipfs.io/ipfs/{CID}
```

#### **For External Storage:**

If you are using custom storage, make sure your metadata URLs are structured properly. Example:

```
https://your-storage.com/path/
```

***

### 4. Integrate Metadata in OmniHub

When setting up your NFT collection on OmniHub, input the **IPFS link** in the "**Metadata URL**" field. The platform will automatically recognize and apply your metadata.

#### Final Steps

* **Test your links** – Use an IPFS gateway like <https://ipfs.io/ipfs/{CID}> to verify accessibility.
* **Ensure correct formatting** – Invalid JSON or broken links may prevent NFTs from displaying correctly.
* **Ensure supply matches metadata** – If your collection has 100 NFTs, make sure there are `{CID}/1.png`→ `{CID}/100.png`files in the folder.
* **Proceed with minting** – Once everything is verified, continue with the minting process.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://omnihub-launchpad.gitbook.io/omnihub/create-and-deploy-nft/how-to-use-ipfs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
