solana candy machine docs


The newly-created Solana NFT shows all of the information from the metadata json file. Then, add funds. Here's how you should organize the files you want to upload. We will use the folder "cm-project" mkdir ~/cm-project and then change directory to the project folder root cd ~/cm-project. If the NFT was supposedly generated on Candy Machine but lacks a Candy Machine ID (CMID), users should be cautious of minting, buying, or trading for the NFT. For the most convenient setup, creators are encouraged to use the frontend UI provided by Metaplex. are sure that your local environment is configured properly. If the command fails, you can run it again. You can change the metadata for each NFT so it is unique to that NFT. For example, you could use a Solana-based NFT analytics tool that relies on data being parsed through by a Solana API. Name {redacted-name} 2 with https://arweave.net/{redacted-tx-id} checked out First, go read the fine manuals ## confirm those numbers are all what you would expect. NOTE: If you are not able to upload at all, you can try to clear the cache and try again. Users can either rely upon an existing keypair with funds or create a new keypair specifically for this project. Update Authority: Solana address that is able to update the NFT metadata. In addition, any configuration value can be updated. 100 Processing file: 1 Uses a simulation of the Ethereum Virtual Machine (EVM), which allows it to run arbitrary logic and support smart contracts. Don't speed run this section. Since we have five assets, we need five configuration files. :::info 0.json This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. $ ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/.config/solana/devnet.json Save this seed phrase and your BIP39 passphrase to recover your new keypair: Being verified means that the creator with that wallet address has signed the NFT, proving that they are the actual creator. Our images will be similar to this image: Our NFT metadata will look similar to this JSON file (download JSON file example metadata.json): When you set seller_fee_basis_points, be aware that the number should be an integer and it represents basis points (1/100 of a percent), not a full percent. Technically, the candy-machine is an on chain Solana program (smart contract) that governs fair mints. $ ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts help - initialize your projects candy-machine noRetainAuthority: False means you keep the role as update authority. Explore the top 10 Solana RPC node providers enabling web3 developers to deploy smart contracts to Solana's Devnet, testnet, and mainnet. The Candy Machine metadata requires all metadata JSON files to follow the Solana Token Metadata Standard. This guide and the accompanying candy-machine-mint web starter kit enable you to launch NFTs on Solana with zero knowledge of Rust. - ensure you have a recent version `jq` installed ```bash Moreover, Candy Machines name has been derived from a real-world mechanical candy machine. Congratulations! ``` We can then view the Solana NFT mint transaction on Solana Explorer. There are a few important steps to follow to ensure Candy Machine v2 is up-and-running. noMutable: False means you can update the on-chain metadata. -l, --log-level log level Some important problems that have been addressed in the latest update include the following: In general, there was a clear need to create an easier way to solve the most fundamental problems that buyers, sellers, and marketplaces experienced in the NFT landscape. This config is built to comply with Metaplex's Token Metadata Standard. These folder names can be anything. --- Once you are ready run: npx ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts upload -e devnet -k ~/.config/solana/keypair.json -cp config.json -c example ./assets. Metaplex has created a sample collection that you can download for testing purposes. ```bash You can sell them, build a community around them, or keep them in your wallet forever. ::: -c, --cache-name Cache file name (default: "temp") The Candy Machine CLI will check the images and metadata json files. Even though globally recognized NFT creators use automated minting tools similar to Candy Machine, the Metaplex-developed tool is highly recommended because it is now a fully on-chain distribution program for NFTs. - fork it Set a start date and or price using: The studio and its community have been moving fast to support several thousand NFT developers and the most popular Solana NFT collections and creators who are interested in launching their very own NFT projects on the Solana blockchain network. Once you have completed the initial preparation, it is critical that you verify that the files are ready to be uploaded. [] | [.address,.share]' | sort | uniq | jq '. You need to connect your Solana wallet and add funds to create and deploy a Candy Machine. ``` This is just our personal preference. Devnet serves as a playground for anyone who wants to take Solana for a test drive, as a user, token holder, app developer, or NFT publisher. 5.json - install `ts-node` -- if you're me: 7.png 2 SOL, node ../build/candy-machine-v2-cli.js upload \, Beginning the upload for 5 (img+json) pairs ```bash The Metaplex package comes with multiple packages, but we only care about cli. -k, --keypair Solana wallet location (default: "--keypair not provided") Commands: --date "26 Sep 2021 00:12:00 GMT" ~/metaplex-foundation/metaplex You can read more about creating metadata files in Avana Wallet NFT documentation. ### Prerequisites -e, --env Solana cluster env name (default: "devnet") Make sure that you name then 0.png, 1.png and so on. $ solana airdrop 10 # request funds Processing file: 3 ## this command flattens, then counts the unique properties.creators values in your metadata. Each file should be a number, starting at 0. In fact, the Candy Machine CLI provides the verify_assets command to check that uploaded assets are in the correct format. Users don't need someone to watch the L2 chain to detect fraud. Youre all set and ready to mint your very first NFT using Candy Machine v2. This functionality ensures that theres a level playing field when it comes to minting NFTs using Candy Machine v2. In the js/packages/cli/tara directory, run the following command to upload the assets to Arweave: On successful completion, you will get an output that looks like this: Take a not of the candy machine public key. Prepare your files in the folder ~/cm-project/assets/. We can verify the upload using the Metaplex Candy Machine CLI as well: npx ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts verify_upload -e devnet -k ~/.config/solana/keypair.json -c example. We can add SOL by running solana airdrop 1. update_candy_machine \ This non-randomized order created the opportunity to be able to choose which NFT to mint, given that all of the information about the items was available on-chain. In conjunction with Strata's Dynamic NFT Pricing Mint tool, creators can reliably launch NFT campaigns on Solana with a simple toolkit. 3.png Minting NFT collections correctly requires technical know-how, and the Candy Machine helps streamline the process. Config File: /Users/levi/.config/solana/cli/config.yml ::: #### Uploading your project assets ``` This is because there is a general expectation that once an individual puts a token into the machine, they will only receive one item. You can add this keypair to Phantom to check the NFTs. Acceptance of buyer funds even when the underlying project was out of NFTs to sell, Not having a precise and global start time, Projects were not producing consistent, valid NFTs, Protection from persistent NFT bot attacks, Creating an on-chain collection of NFTs for authentication purposes. $ find assets -type f -name '*.json' | xargs jq '.properties.creators' | jq -c '. The second version of Candy Machine provides many functionality improvements over its predecessor. RPC URL: https://api.devnet.solana.com Once you have downloaded the prerequisite Solana developer tools and configured your machine, you should be able to create a new Candy Machine that is ready to mint tokens after initial deployment. #### Updating your candy-machine In my case this will be ~/Desktop. `solana config set --url https://api.devnet.solana.com` Fair mints: If running the program on Mac OS with the Apple M1 chip, additional dependencies will be required. - mint individual tokens with _mint_one_token_ - configure it upload [options] 0 SOL ::: The Solana airdrop command is sometimes unreliable. 4.json -h, --help display help for command We will use solana config set --url https://api.devnet.solana.com/ to connect to Solana devnet. The Metaplex Candy Machine operates on the Solana blockchain. Then set the Solana RPC connection. On-chain NFT collections help validate accuracy and authenticity. Metaplexs Candy Machine addresses these shortcomings in a dynamic way. ## make sure your json and file name agree There is a single account on-chain that holds all the configuration of a Candy Machine and you can make changes to your configuration in the future. Make sure you switch the network to devnet: Now you have minted your awesome NFT collection. 3.json We are almost ready to create your Candy Machine. mint_multiple_tokens finished, https://docs.metaplex.com/candy-machine-v2/configuration, https://docs.metaplex.com/candy-machine-v2/mint-frontend, some understanding of bash scripts, and a terminal, You can add as many attributes as you want in, For additional files, make sure you use the correct, If there are multiple creators, you can specify the share split of royalties, Share = 100 signifies that 100% of the royalties for goto this creator, Mint them to your wallet via the command line or, Generate a candy machine website where users can mint their own. Nevertheless, the owner of the Candy Machine should be ready to mint tokens. - clone the project -- if you're me: Generative NFTs take multiple design assets to automatically create a large number of uniquely designed NFTs compared to 1-of-1 NFTs and AI-generated NFTs. - _upload_ your images and metadata to arweave, then register them on the solana block-chain Depending on configurations, it is either restricted to whitelist users or the goLiveDate has not been reached yet. Clone the latest Metaplex Candy Machine V2 from the master branch on Github. ```bash `solana config set --keypair ~/.config/solana/devnet.json` True means you do not keep the role. By incorporating Captchas, mints have now been limited to humans which means far fewer bots. Relies on cryptographic guarantees for security. You can confirm the health of your on-chain assets using `ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts verify`: Candy Machine helps solve common issues related to minting Solana NFTs including: Most large-scale NFT creators use automated minting tools similar to Candy Machine. Read more about NFTs in Avana Wallet Docs. - swap SOL for AR and send files to arweave Finally, you need some SOL to pay gas. The goal of this project is to let you: ::: Processing asset: 1 :::info Note that if you enabled captcha bot protection, then you will not be able to mint tokens from the command line. You can use an existing wallet by creating a json file with your private key bytes on your computer. Notice that another address was added to the creators - that's normal. transaction 1 complete 61H3Ai5UPqDzLQ8fobZbN3zAnXycSKgt5vyqMB9eXuVWotH6hodwyCj1HnKNe3ynRybxdUiLZeCuwYs98V15WRV3 Because any SPL token can be used to create whitelists, it is up to the project creator's discretion how they are distributed. $ git clone git@github.com:metaplex-foundation/metaplex.git \ $ find assets -type f | wc -l # count the total number of asset files #### check `image` and `properties.files` values The Candy Machine can only mint NFTs to users after your goLiveDate setting in config.json. `ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts upload` sends files to arweave __and also__ registers those files with your candy-machine. To do this, goto the js/packages/cli folder inside metaplex, and execute the following commands: This will create a folder named build in the cli folder. Read the fine manual minted 5 tokens If you're me, you're confirming your config right now to ensure you're on devnet, because we're going to rely on this to make subsequent command line invocations simpler from here forward. ```bash Processing asset: 4 deploying your NFT collection using storage provider arweave-sol, you can try using arweave. #### Fund devnet wallet We will use the official CLI to mint our collection. ```bash No instructions provided 2.png ::: The valid number for this field is between 0 (0%) and 10000 (100%). Let's create one in js/packages/cli/tara: We are working on the devnet at the moment, so make sure that your network is set to devnet. `solana help airdrop` #### devnet for the win We have the code but it's not usable yet. ``` In less technical terms, Metaplex designed a standard that to store NFTs on Solana, an everyone in the ecosystem adopted the standard. # REDACTED ## etc -n, --number Number of images to upload Keypair Path: /Users/levi/.config/solana/devnet.json So for our 5 NFTs in the "Tara" collection, we will have the following files (total 10): We will create two folders called tara and tara/assets in metaplex/js/packages/cli: assets folder stores on-chain assets and the tara folder will be used to store keys and config. Be espescially careful with checking `seller_fee_basis_points` and `properties.creators` -- details below: ```bash - start and finish at the same time for everyone ## this command extends the prior command by extracting the shares & summing them up. The program uses the Metaplex command line interface (CLI) to generate an NFT, connect relevant metadata and an image to the NFT token, and ultimately set-up a fair auction. Looking at key 1 BIP39 Passphrase (empty for none): Installing and using Solana Candy Machine V2 requires ## for most projects, you should see a consistent count across all parties (address-[1..3]) Successful = true. verify_price [options] :::info Typically, the verified creator will be the Candy Machine by default. This process requires you to have: By the end of this tutorial, you will have 5 NFTs on the Solana devnet and a website to run a sale. Of course, there are some exceptions such as when the Candy Machine will return your token if there are no more NFTs left to mint. Mint Authority: Solana address that is able to mint the NFTs. eg: 4.png and 4.json are two halves of the NFT -- one is the art, the other is the metadata. ::: keypair file itself, which is stored as insecure plain text For example, the current version as of May 2022 is 0.0.2. Install the Solana Command-line Tools Candy Machine V2 is the second iteration, and it is now a fully on-chain generative NFT distribution program. ## the pattern looks like you'd expect it to. When done, you can change the network to Mainnet-Beta. - after the code is finished downloading, run --cwd ./js/ in the project root folder (do not change folders). Metaplex is a collection of tools, smart contracts, and other technologies that have been designed to make the process of minting and releasing NFTs simpler. 10 ["",30] ```bash The process for minting a Meta Blocks compatible collection is the same as minting a normal NFT collection. :::info create new distribution scenarios and offers protection from bot attacks. ``` ```bash The cache folder is hidden and called .cache. It will: Alchemy Supernode finally makes it possible to scale blockchain applications without all the headaches. Developers can clone the Metaplex repository by pulling the CLI from GitHub. Usage: candy-machine-cli upload [options] ``` The cover image of this article was created using graphics from Candy Machine Vectors by Vecteezy and Monkeys Vector by Brgfx on Freepik. -V, --version output the version number arweave is rarely able to show your your assets right away. Also, notice that Candy Machine automatically created a Collection NFT. The Candy Machine makes it very easy to upload a collection of images and their metadata from your computer to the Solana blockchain and file storage provider. Each png and json file are combined to represent a single Solana NFT. Run npx ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts verify_assets ./assets. directory Directory containing images named from 0-n ## this command lists then sorts all of your name values. Each NFT project using Candy Machine to mint NFTs, is always designated with a unique identifier (ID), which developers can use to verify the authenticity of the underlying asset on the Solana blockchain. Explore and interact with Solana NFTs created by Metaplex's Candy Machine v2. To configure this, create a file called config.json in js/packages/tara: To get more info about each key value pair, refer to the official Metaplex documen at https://docs.metaplex.com/candy-machine-v2/configuration. :::info Now you can decide to: The advantage of the latter approach is that the gas fee of the mint is paid by the user. The next step is to prepare the candy machine. We need to fetch its dependancies and compile it. WebSocket URL: wss://api.devnet.solana.com/ (computed) The Candy Machine reads a JSON file that can be adjusted to your preferences. We are not going to add a BIP39 passphrase to simplify the tutorial. Using version 2 of Candy Machine it is now possible to create large collections and hide-and-reveal drops by specifying a single hash. 10 SOL Keypair Path: /Users/levi/.config/solana/devnet.json Processing asset: 3 If you have a 10k collection, then there should be 20k files in this directory. You use this guide, even if don't plan to be upgradable via Meta Blocks protocol. You can check to make sure that everything installed properly by running npx ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts --version. ## for most projects you should see a consistent count across all metadata. From the point of view of the creator, you can think of this config as a way to specify the attributes, commissions and aspects of your NFT. Avana Wallet displays your NFTs in the app. Configuring Candy Machine is very important, so double and triple check your settings. initializing candy machine Processing file: 0 ::: And finally, the directory name `assets` doesn't really matter. ``` This implies that end-users are unable to purchase NFTs ahead of the mint time and once the limit of NFT mints has been reached, no more are generated. It's a system for managing fair mint. The command is smart enough to resume uploads. If you found this helpful, consider sending a tip to the author. ## 2.json should refer to 2.png in the .image and .files props 8.json Solana is here. Requires waiting through a 1-week delay (dispute period) before withdrawing funds. ``` If you decide to create a website, you can follow the steps outlined here: https://docs.metaplex.com/candy-machine-v2/mint-frontend. For added security, enter a BIP39 passphrase When we click on the newly-minted Solana NFT, we can see the details (if you look at link later the image may no longer exist because the file storage is temporary). Name {redacted-name} 3 with https://arweave.net/{redacted-tx-id} checked out 0.png The version should print in your command line. Here's how you check it: For us, it is AuuLoYV9kx8HKWrpnJCT5whgURqd5MwxckWesL5arqh. ## you should expect this to output 100. While there are Solana NFT communities that give access to NFT minting bots through their own NFT collection and token-gated Discord, Candy Machine's Captcha settings make it more difficult to auto-mint NFTs using bots. Here's what mine looks like: ## Preamble ===================================================================== Generating a new keypair -h, --help display help for command We highly recommend using Solana devnet to practice deploying Candy Machine and minting NFTs. You can find all configuration options at Metaplex Docs. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Usage: candy-machine-cli [options] [command] The Solana NFT Candy Machine, or CM for short, is a Solana Program designed to help NFT creators sell their NFTs. Drop your details to get notified when we launch , NFTs are rigid because there is no standard for upgrading them, How to build a Metaverse? Run solana-keygen new --outfile ~/.config/solana/keypair.json to create a new keypair. ``` We need to verify our assets before creating our Candy machine. If you're running into issues Nevertheless, here are a few features that developers and creators can be excited about: In the previous version of Candy Machine, it was feasible to estimate the specific NFT that would be minted during a generative NFT launch because the mint would happen in a sequential order.