metaplex-foundation / sugar

Candy Machine Rust CLI.
Apache License 2.0
203 stars 116 forks source link

[Feature]: sugar-cli 2.1.1 it does not perform the step sugar deploy #442

Closed luisrovirac closed 1 year ago

luisrovirac commented 1 year ago

Issue description

When creating a Candy Machine with sugar-cli 2.1.1 it does not perform the step sugar deploy, Error running command (re-run needed): Missing collection item in cache

Relevant log output

Error running command (re-run needed): Missing collection item in cache

Priority this issue should have

High (immediate attention needed)

samuelvanderwaal commented 1 year ago

Do you have the collection.json and collection.png files in your assets folder?

luisrovirac commented 1 year ago

Yes, I have the collection.json and collection.png files in assets folder

luisrovirac commented 1 year ago

Detail01

luisrovirac commented 1 year ago

This is not an bug!. Solution: I added in my assets directory 2 files: collection.json and collection.png and ready! Content example of collection.json based on https://docs.metaplex.com/developer-tools/sugar/guides/preparing-assets:
{ "name": "Faces Collection", "symbol": "SAX", "description": "Collection of 3 faces on the blockchain.", "image": "collection.png", "attributes": [], "properties": { "files": [ { "uri": "collection.png", "type": "image/png" } ] } } While collection.png must be an image alluding to the collection (for test it can be anything called collection.png)

I'm not sure, but it seems that for this version it is mandatory to add collection in the assets directory, it was optional before. In sugar-2.1.1/src/deploy/process.rs there is this condition: // collection_item could be missing when args.collection_mint is provided let collection_item = if let Some(collection_item) = cache.items.get_mut("-1") { Some(collection_item) } else { match args.collectionmint { Some() => None, // existing collection provided None => return Err(anyhow!("Missing collection item in cache")), } };

luisrovirac commented 1 year ago

solution01

luisrovirac commented 1 year ago

Thanks for the excellent product.

samuelvanderwaal commented 1 year ago

@luisrovirac having a collection was optional on Candy Machine V2 (Sugar <= 1.2) but is mandatory on Candy Machine V3 (Sugar 2.0+).