# Guide to Airdrop Using Metaplex *Intermediate Tutorial - 30 min* ## The Setup Before anything you need to make sure you have the Solana tool suite, npm, and ts-node installed or you won't be able to run the commands. Installing these is slightly different for Mac, Windows, and Linux so you'll need to look up the specific ones for you. Once that's done we can get started! as a side note, I'll also be using vscode to run and view all my files but you don't need to (I'll be doing my commands from wsl (Linux on Windows) but the next commands should be the same for everyone in terminal, shell, or powershell) **This setup process can be found in my beginner guide with more detail:** https://hackmd.io/@8LSEewFFQ2OwXMjUKZP-pA/BJYh8FU7F ### 1. Make a new project folder. ``` mkdir czers_gen cd czers_gen ``` **Note: You can call this folder whatever you want.** The two things we need to start with are the Metaplex code for Candy Machine and your project's assets. ### 2. Clone Metaplex You can get Metaplex into your project folder with: ``` git clone https://github.com/metaplex-foundation/metaplex ``` ### 3. Install dependencies You'll need to run a yarn install of the clients' dependencies ``` cd metaplex/js npm install -g yarn yarn install cd ../.. ``` ### 4. Create and store assets ``` mkdir assets ``` Inside you'll need to put your asset pairs. 0.png 0.json, 1.png 1.json, etc... Here's an example of the ones we'll be using for this tutorial. ![](https://i.imgur.com/5OSCYEB.png) ### 5. Verify the .json is correct Make sure to REALLY pay attention to this .json schema. This is where most people mess up. You can get the full markup for the schema at: https://docs.metaplex.com/nft-standard If your candy machine isn't working then there is MOST likely an issue with your schema ### 6. Make sure the wallet is set up and funded If you haven't hooked up a wallet to your terminals Solana tool suite and filled it with some sol you'll need to do that now. The command is: ``` solana-keygen new solana-keygen pubkey ``` For this tutorial I'm using the devnet so I can easily fund the wallet with some sol using the command: ``` solana airdrop 1 ``` But for mainnet-beta, you'll need to buy and send real sol to that pubkey. ## Create Candy Machine and Mint Okay, so there are only five commands left. In order they are: Upload, Verify, Create, Update, and Mint You SHOULD NOT MOVE ON to the next command if the previous command fails. CandyMachine is set up to be able to run commands over again if they fail. Due to the nature of distributed systems, they often do. (especially on collections over 1000) It is perfectly fine to run the upload and verify commands over and over until they both check out. With that disclaimer out of the way here's the full process from creation to mint ### 1. Upload ``` ts-node ./metaplex/js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/.config/solana/id.js ``` ![](https://i.imgur.com/NSCoIWB.png) ### 2. Verify ``` ts-node ./metaplex/js/packages/cli/src/candy-machine-cli.ts verify --env devnet --keypair ~/.config/solana/id.json ``` ![](https://i.imgur.com/OFUAvlM.png) ### 3. Create ``` ts-node ./metaplex/js/packages/cli/src/candy-machine-cli.ts create_candy_machine --env devnet --keypair ~/.config/solana/id.json ``` ![](https://i.imgur.com/dGqt0aL.png) ### 4. Update ``` ts-node ./metaplex/js/packages/cli/src/candy-machine-cli.ts update_candy_machine --env devnet --keypair ~/.config/solana/id.json "31 Oct 2021 04:20:00 GMT" -p 0.69 ``` ![](https://i.imgur.com/6ag7OzO.png) ### 5. Mint ``` ts-node ./metaplex/js/packages/cli/src/candy-machine-cli.ts mint_one_token --env devnet --keypair ~/.config/solana/id.json ``` ![](https://i.imgur.com/qN2Tnte.png) Altogether the entire process looks like this: ![](https://i.imgur.com/Tz4MvfU.png) ### DONE! You can view your NFTs in the wallet that was set up and airdrop them to your most loyal community members. Please note that only the wallet that made the candy machine can get early access to mints for airdrops. ![](https://i.imgur.com/rbN8oI9.png) The main writer for this guide can be found on Twitter: [@GageBachik](https://twitter.com/GageBachik) The secondary writer and owner of the assets can be found on Twitter [@Baby_Doodles_](https://twitter.com/Baby_Doodles_)