Setup Candy Machine
Last updated
Last updated
Solana Godot SDK features implementation of Metaplex Candymachine V3, which allows minting generated NFTs from a premade collection
Supported featues:
pNFTs (Programmable NFTs)
Candy Guards
Candy Guard Groups
This is one of the most powerful features in the SDK, allowing developers to setup a much more interactive and interesting NFT minting experience using Godot game engine.
Before implementing your NFT collection's minting inside Godot, you need to set it up using Metaplex Sugar. Once you have created a new candymachine and the necessary candy guards, you can bring it to Godot for minting.
We have prepared a very convenient class for setting candy guards in Godot, which you can create by right-clicking in the project's FileSystem, and choosing Create New -> Resource. Then, search for CandyGuardAccessList.
If you have set your Candy Guards when initializing the collection, this class will be very familiar: you have all the different guards on a Default guard group, and for any additional groups, you can just create new CandyGuardAccessList in the Groups section!
What you need to do is copy the guards here exactly how you did when creating the candy machine and save this file. You will need it to pass in later.
This is a basic example of minting an NFT from a desired Guard group depending on which button was used. Note that mint_groups array should be filled with String texts of the group names, and the mint_buttons will be mapped to them.
For a full example with fetching the candy machine data, getting the callback of whether mint was success or fail and more, check SolanaSDK -> Demos -> CandyMachineDemo in the imported SolanaSDK addon!