Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Core Candy Machine with hidden settings guide #306

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ASCorreia
Copy link

No description provided.

Copy link

vercel bot commented Jan 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
developer-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 2:12am

Copy link
Collaborator

@tonyboylehub tonyboylehub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this Andre. Great first guide here, reads nice.

Just some small nits and a couple of comments that will have to be dicussed in slack/a meeting as probably to large a scope for github comments.

import * as fs from 'fs';

// We will be using Solana Devnet as endpoint, and loading the mplCoreCandyMachine plugin
const umi = createUmi("https://api.devnet.solana.com")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put a warning here that they will most likely need to upgrade to endpoint from an RPC provider. They will most likely get limited trying to do some of these actions, especially if they are doing larger mints.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note about rate limit and added a reference to RPC provider resource

You can find more details about setting up UMI [here](https://developers.metaplex.com/core/guides/javascript/how-to-create-a-core-nft-asset-with-javascript#setting-up-umi)

### Prepare Reveal Data
Now, let’s prepare the reveal data, which will include the metadata for the final revealed NFTs. This data contains the name and URI for each NFT in the collection and will be used to update the placeholder metadata after minting.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would possibly move the topic of "you need to upload all the data yourself" to the top here and explain that the uri's you are using are from the metadata json uploads. This also possibly won't be detremistic by default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Fixed

import { createCollection, ruleSet } from '@metaplex-foundation/mpl-core';

const collectionMint = generateSigner(umi);
const collectionUpdateAuthority = generateSigner(umi);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collection Update Authority should most likely default to umi.identity just for safety purposes and for delegation purposes with Candy Machine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Fixed

let collectionDetails = await fetchCollection(umi, collectionMint.publicKey);
let collectionAssets = await fetchAssetsByCollection(umi,collectionMint.publicKey);

for(let i = 0; i < candyMachineDetails.itemsRedeemed; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While technically correct and would update the 5 assets most likely with no issues when you start getting into a greater number of assets things get a lot more complicated.

You need to deal with some form or cache file, errors, and retrys because inevitably revealing 10,000 nfts we are bound to get a failure and you have to keep 100% track of what assetId's have been revealed, what index has been revealed. Fetching all assets by collection I don't think will return the array in the same order each time.

It's something to discuss offline not here as it's a huge topic.

This would need some form of comment and warning that this is a super basic implementation of a reveal loop that wouldn't work at scale.

Co-authored-by: Tony Boyle <81017245+tonyboylehub@users.noreply.github.com>
Reworked according to review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants