metaplex-foundation / sugar

Candy Machine Rust CLI.
Apache License 2.0
206 stars 117 forks source link

[Bug]: Reveal issues #328

Closed blizzyenterprises closed 2 years ago

blizzyenterprises commented 2 years ago

Issue description

  1. sugar reveal (on devnet)
  2. return error "main" panicked
  3. note that this is mid-mint, attempting to reveal partially minted collection on devnet

Relevant log output

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src\reveal\process.rs:323:25

Priority this issue should have

Medium (should be fixed soon)

samuelvanderwaal commented 2 years ago

@blizzyenterprises do you have a collection item in your cache file? (Will be a key of "-1".)

blizzyenterprises commented 2 years ago

I see the fix, thank you @samuelvanderwaal @stegaBOB

stegaBOB commented 2 years ago

All the credit for the fix goes to @samuelvanderwaal. I just click buttons 😆

blizzyenterprises commented 2 years ago

Now it's throwing a new error,

thread 'main' panicked at 'called Option::unwrap() on a None value', \sugar\src\reveal\process.rs:203:43

samuelvanderwaal commented 2 years ago

Now it's throwing a new error,

thread 'main' panicked at 'called Option::unwrap() on a None value', \sugar\src\reveal\process.rs:203:43

Can you post your cache file here or send it to me on Discord or email it to me at sam@metaplex.com?

blizzyenterprises commented 2 years ago

testing this on devnet cache.txt

i can get them to reveal using metaboss method, but "sugar reveal" is causing that "unwrap" issue above

Once i get more experience i might be able to offer solutions instead of issues ;)

samuelvanderwaal commented 2 years ago

testing this on devnet cache.txt

i can get them to reveal using metaboss method, but "sugar reveal" is causing that "unwrap" issue above

Once i get more experience i might be able to offer solutions instead of issues ;)

There's only the collections item in your cache file, no other ones. Did you run sugar upload?

blizzyenterprises commented 2 years ago

As it is a hidden collection the only upload was the hidden.png and hidden.json

blizzyenterprises commented 2 years ago

i have the collection minting on mainnet now, and using metaboss to reveal, but i feel like the reveal functionality of sugar should be working correctly, is it an issue because i have a "hidden" collection and they weren't loaded to CMID from the beginning?

samuelvanderwaal commented 2 years ago

This is just a misunderstanding of how Sugar handles reveal. If you want to use sugar reveal you still need to use upload to create all the external links for the assets. This does not upload the assets on-chain to Solana, it just uses the third-party storage method you choose (aws, bundlr, nft.storage, shdw) to upload and store the external metadata and images. Otherwise, Sugar doesn't know how to update your NFTs as it uses the values in the cache file for the reveal step.

blizzyenterprises commented 2 years ago

Interesting.

While this is minting can i upload the images/jsons through the sugar commands, and then use reveal?

blizzyenterprises commented 2 years ago

FYI guys, the main issue was this....the only NFTs I had uploaded to the CM were the hidden.png/hidden.json, the CM didn't know what to attempt to even reveal. you were right @samuelvanderwaal, even though i followed someone that seemed to know what they were doing, it didn't work as they described. I apologize for wasting the time, but I'm glad it failed so I could learn exactly how to fix it. 💯

samuelvanderwaal commented 2 years ago

Interesting.

While this is minting can i upload the images/jsons through the sugar commands, and then use reveal?

For hidden settings you should follow the same steps as a normal candy machine: create-config, upload, deploy. The difference will be when Sugar detects it is a Hidden Settings candy machine it won't actually put all the asset data on chain during the deploy step. You still want to run upload though so your cache file is populated and the reveal command works.

FYI guys, the main issue was this....the only NFTs I had uploaded to the CM were the hidden.png/hidden.json, the CM didn't know what to attempt to even reveal. you were right @samuelvanderwaal, even though i followed someone that seemed to know what they were doing, it didn't work as they described. I apologize for wasting the time, but I'm glad it failed so I could learn exactly how to fix it. 💯

Thanks for opening the issue; it highlighted that some of the error messages in reveal are not very good so I updated them to give a bit better information. It shouldn't panic in those cases anymore, but will provide a more helpful error message.