This guide outlines the steps required to upload and synchronize data in the IPFS cache, ensuring compatibility with the frontend.
Uploading Files to IPFS
You can use any uploader or service to upload files and JSON metadata to IPFS.
Supported File Formats
Currently, the frontend supports the following avatar file formats:
.gif
.jpg
Ensure the uploaded file meets these format requirements.
CID Format
After uploading a file, the service will return a CID (Content Identifier). IPFS supports multiple CID formats. Our frontend supports CID v1 (base32), which looks like this:
bafybeigxhwjaljyquoltsz7o6qq24npbk2diz2s43wsxl6dqagne3qvnsq
Avoid using the older CID v0 format, which appears as:
QmcprpP6Sc3LY4x4BDbGNo1k5e3CwcDRCNmaZ9kX6GLnAo
For more details on CIDs, refer to:
Creating Metadata JSON
Once the CID is obtained and formatted to CID v1 (base32), you need to create a JSON structure to store the metadata required by the frontend.
The metadata format is similar to OpenSea standards:
Example JSON (refer to this sample when creating own json):
Differences from OpenSea Format:
image
: The CID of the uploaded image in CID v1 (base32) format + the file extension (e.g., .jpg
or .gif
).description
: Should not contain special characters and must be limited to 256 characters.Synchronizing Files with IPFS Cache
After adding the image CID to the JSON and uploading the JSON to IPFS, synchronize both files (image + JSON) with the IPFS cache.
API Request for Synchronization
URL: https://api.dexe.io/integrations/ipfs-cache-svc/public/pool-info
Method: POST
Headers:
{
"Content-Type": "application/json"
}
Body:
{
"data": {
"attributes": {
"link": "your_cid_here"
}
}
}
Accessing Content
Once synchronized, the content will be accessible and viewable on the frontend. You can verify it using the following GET requests:
JSON Metadata:
https://ipfs-cache.dexe.io/<json_cid>.json
Example:
https://ipfs-cache.dexe.io/bafybeiapxtj7d65qwu6byb3twjt4fpdqmkw4ilagsqc3zdgpzplxzbtunu.json
Image File:
https://ipfs-cache.dexe.io/<image_cid>.<extension>
Example:
https://ipfs-cache.dexe.io/bafybeidfdzuvo7ostazu3sw65mmmf46vo6h3fa5qxeqmo56gwqsndvduo4.jpg
By following this guide, your data will be correctly uploaded, synchronized, and ready for frontend integration.