Candy Machine Commands
Upload Assets
The mplx cm upload command uploads assets to a decentralized storage and generates an asset-cache.json file containing upload URIs and metadata. This command provides intelligent caching, progress tracking, and comprehensive validation.
Usage
# Upload assets from current candy machine directory
mplx cm upload
# Upload assets from specific candy machine directory
mplx cm upload <directory>
Directory Structure
my-candy-machine/
├── assets/
│ ├── 0.png # Image files (PNG, JPG)
│ ├── 0.json # Metadata files
│ ├── 1.png
│ ├── 1.json
│ ├── ...
│ ├── collection.png # Collection image
│ └── collection.json # Collection metadata
└── asset-cache.json # Generated after upload
Upload Process
- Asset Discovery: The command automatically scans the
assets/directory and identifies image, metadata and collection files. - Validation Phase: Verifies the integrity of your files, for example if all image files have matching metadata files and that the metadata is valid json.
- Cache Check: To identify which files were already uploaded the
asset-cache.jsonfile is validated. - Upload: The actual upload is done.
- Cache Generation: The
asset-cache.jsonfile is generated
Generated Asset Cache
The asset-cache.json file contains detailed information about uploaded assets. Manually inspecting and using it is only recommended for advanced users.
Example:
{
"candyMachineId": null,
"collection": null,
"assetItems": {
"0": {
"name": "Asset #0",
"image": "0.png",
"imageUri": "https://gateway.irys.xyz/ABC123...",
"imageType": "image/png",
"json": "0.json",
"jsonUri": "https://gateway.irys.xyz/DEF456...",
"loaded": false
},
"1": {
"name": "Asset #1",
"image": "1.png",
"imageUri": "https://gateway.irys.xyz/GHI789...",
"imageType": "image/png",
"json": "1.json",
"jsonUri": "https://gateway.irys.xyz/JKL012...",
"loaded": false
}
}
}
Related Commands
mplx cm create- Create candy machine (can upload automatically)mplx cm validate- Validate uploaded assetsmplx cm insert- Insert uploaded assets into candy machinemplx cm fetch- View candy machine and asset information
Next Steps
- Validate your uploads to ensure everything uploaded correctly
- Create your candy machine using the uploaded assets
- Insert items to load assets into the candy machine
- Monitor your setup to verify everything is working