This is an experimental tool to interact with Core Candy Machine program, and works in combination with sugar so you'll need that tool installed on your system as well.
As this hasn't yet been ported as a bin to be installed with npm publicly, you'll need to clone the repo, build it and link it to your copy.
- Install dependencies:
pnpm i - Build it:
pnpm build - Link the built folder:
npm link
Check it's working by running ts-sugar.
Be sure to set the solana cli to point to an RPC of yours (either devnet or mainnet) and the keypair that will be the authority of your Candy Machine and assets minted
This tool works in combination with sugar that supports Candy Machine for Token Metadata.
Place the assets for your CM in a folder (assets is the default to be picked up), enumerated from 0 to N - 1 (being N the size of the collection). Remember to also add the collection.json and its corresponding media file to the folder.
Follow the steps from sugar to create the config file and follow the steps as usual.
Again, use sugar upload to upload the assets to the storage selected, and await for all the assets to been pushed.
Here you'll start using ts-sugar, to first create the collection asset, and then the Core Candy Machine account with the lines to be minted later.
IMPORTANT: If you use
sugarinstead ofts-sugarfor this step, your CM will be created for Token Metadata instead of Core, and you'll need to witdraw the CM usingsugar withdrawand start over
To deploy the Candy Machine, just run:
ts-sugar deploy
This process might throw some errors, if so, check the cache file to see if the
candyMachineaddress was indeed created on the cluster you're using. If not, clear that field and run again.
Run ts-sugar verify to check that all the lines were written to the Candy Machine. If it gives an error, run the deploy command again
To allow others to mint from your Candy Machine and, for example, charge a payment for it you should add guards. Make sure the config.json file you created contains them similar as shown as in the Sugar documentation and the corresponding guard pages.
Run ts-sugar guard add to attach those guards to your candy machine.
Then you may proceed to directly mint assets from the CM or add the guard for making the CM publicly minted using the rules you set for each group.
Check the ts-sugar -h for getting the list of available commands, there's still missing functionality to cover all cases (and new guards).
Once the mint has ended, you may withdraw the Candy Machine, recovering the rent from it.
REMEMBER that this action is irreversible and all unminted assets are not gonna be able to be minted using this same CM