# Tips ``` Larger collections and hide-and-reveal drops: accepting a buyers funds when the project was out of NFTs to sell, not having a precise and global start time, projects were not producing consistent, well formed valid NFTs, creating on-chain collection NFTs for authentication. :::info For the first 500 developers, all usage is free through 2022. - _upload_ your images and metadata to arweave, then register them on the solana block-chain If running the program on Mac OS with the Apple M1 chip, additional dependencies will be required. We will need this address later. Users can either rely upon an existing keypair with funds or create a new keypair specifically for this project. ``` ## for most projects, you should see a consistent count across all parties (address-[1..3])

Doesn't need to publish transaction data on Ethereum because ZK-SNARKs and ZK-STARKs already guarantee the accuracy of the rollup state. ```bash This permits the broader marketplace, storefronts, and CLIs to search for NFTs that were minted by a Candy Machine seamlessly and with trust. The process for minting a Meta Blocks compatible collection is the same as minting a normal NFT collection.

Here's how you check it: 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.

Verify that your keypair has funds and your NFT images and metadata are in the assets folder. Read more about NFTs in Avana Wallet Docs. ### Running candy machine command line utility We will use the folder "cm-project" mkdir ~/cm-project and then change directory to the project folder root cd ~/cm-project.

$ solana-keygen new --outfile ~/.config/solana/devnet.json

npx ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts mint_one_token -e devnet -k ~/.config/solana/keypair.json -c example, You can mint multiple tokens by using the command mint_multiple_tokens, npx ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts mint_multiple_tokens -e devnet -k ~/.config/solana/keypair.json -c example --number 2. ===================================================================== `solana help airdrop` If the command fails, you can run it again.

#### Validating your candy-machine RPC URL: https://api.devnet.solana.com ## this command extracts unique seller_fee_basis_points, then sorts and counts them. By incorporating Captchas, mints have now been limited to humans which means far fewer bots. We will use it to:

10 YANAPE

Run solana-keygen new --outfile ~/.config/solana/keypair.json to create a new keypair. 6.png In Candy Machine v2, Metaplex has introduced improvements associated with how end-users configure Candy Machine and new settings that enable mint pausing at a certain point. Though the hash is the same across all the mints, the name of each item is specified with a unique number, allowing an off-chain process to later update the metadata with the actual item. :::

- after the code is finished downloading, run --cwd ./js/ in the project root folder (do not change folders). ## 1.json should refer to 1.png in the .image and .files props `metaplex` is a command line tool for interacting with the candy-machine program. $ ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts help

NFTs welcomed :) If you are uploading a lot of images, you might need more than 2 SOL.

For example, you could use a Solana-based NFT analytics tool that relies on data being parsed through by a Solana API. At this point, you can check the .cache folder to see the urls of the NFTs on Arweave. The value of the variable REACT_APP_CANDY_MACHINE_PROGRAM_ID is the public key of the candy machine computed in Step 6 (AuuLoYV9kx8HKWrpnJCT5whgURqd5MwxckWesL5arqh).

For our assets we will have files 0.png, 0.json, 1.png, 1.json, 9.png, 9.json. Next, let's clone the Metaplex repository including Candy Machine into our project folder git clone https://github.com/metaplex-foundation/metaplex.git . True means you do not keep the role. - customize your own ui

You can find all configuration options at Metaplex Docs. ``` Reduces costs since it publishes minimal data on Ethereum and doesn't have to post proofs for transactions, except in special circumstances.

```

Creators who are interested in providing a convenient end-to-end consumer experience should consider providing a frontend minting experience to allow the community the chance to mint as well.

:::

In general, the latest version of the program enables new distribution possibilities and offers enhanced protection from bot attacks, all packaged in the same easy-to-use interface. -V, --version output the version number This will create a new keypair for you.

Faces higher overhead from costs involved in generating and verifying proofs for every transaction block. There's a boilerplate community project available here. Metaplexs native user interface supports a variety of configurations of Candy Machine v2 such as whitelisting (for both pre-sale and discounts) and end-settings (i.e., automatically adapting the UI components depending on whether the whitelist token is detected or not. Signature: 2s8FE29f2fAaAoWphbiyb5b4iSKYWznLG64w93Jzx8k2DAbFGsmbyXhe3Uix8f5X6m9HRL5c6WB58j2t2WrUh88d

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. To ensure that the upload process, you can run the verify command as follows: It's recommended to run the verify command, but it's possible that you like taking risks.

```

``` If your me, you'll redact your mnemonic, store it somewhere safe and take advantage of the `--outfile` flag. You use this guide, even if don't plan to be upgradable via Meta Blocks protocol.

``` 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. ```bash :::info We are almost ready to create your Candy Machine. 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.

``` Signature: Kme6a2HjbiWCi3hVcqa8qAPcZHmC6kCQhNSVHKT9NyNacpKZ12uxE3GjDVsDHj8TbXtAGdh4An2qSYa9uKe8Hzt 0 SOL NOTE! If you decide to create a website, you can follow the steps outlined here: https://docs.metaplex.com/candy-machine-v2/mint-frontend.

You can pass any number in place of 5. ```bash= Also notice that we're starting with 0.json + 0.png, because that's the default value for the `--start-with`. This base card is where the story begins. transaction 1 complete 61H3Ai5UPqDzLQ8fobZbN3zAnXycSKgt5vyqMB9eXuVWotH6hodwyCj1HnKNe3ynRybxdUiLZeCuwYs98V15WRV3 Read the fine manual send the NFT to others. 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`: [] | [.address,.share]' | sort | uniq -c

According to Metaplex, over 11.5 million NFTs have been minted using the organizations protocols which have provided standards & tools for more than 100,000 projects and online communities. No instructions provided ```bash #### check the total number of assets, json and image files confirm these add up. $ npm install -g ts-node

10 ```bash update_candy_machine [options] Since we have five assets, we need five configuration files. Once you have completed the initial preparation, it is critical that you verify that the files are ready to be uploaded. ## etc

Once you have finished minting, you may want to consider you will want to sign your NFTs to verify yourself as the creator. The valid number for this field is between 0 (0%) and 10000 (100%). Options:

No instructions provided Wrote new keypair to /Users/levi/.config/solana/devnet.json

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. goLiveDate: Add the date you want your mint to go live.

9.png

The goal of this project is to let you:

$ find assets -type f -name '*.json' | wc -l # count the metadata files First, go read the fine manual ```bash 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. [1]' | jq -s 'add' Publishes full transaction data as calldata to Ethereum Mainnet, which increases rollup costs. Processing file: 3

wallet public key: 9WS1ezpcxDVfA8cWGzDswCxfXWPtc6xcrkEk9gN6PWh8 Notice that these come in numerical pairs. We have created these 5 images that can be joined together.

Update Authority: Solana address that is able to update the NFT metadata. $ find assets -type f -name '*.json' | xargs jq -r '.symbol' | sort | uniq -c

Done

ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts \ For example, update the attributes to explain the NFT's unique properties in the description.

- _verify_ the state of your candy-machine is valid and complete started at: 1643379208383 ``` #### Uploading your project assets 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. We will walk you through step-by-step First, go read the fine manuals This is sort of the "missing guide" on how to use the metaplex candy machine (espescially the command-line or cli interface). ``` :::info If the command does not work, you can use the airdrop tool at https://solfaucet.com. We highly recommend using Solana devnet to practice deploying Candy Machine and minting NFTs. If you have a 10k collection, then there should be 20k files in this directory. noRetainAuthority: False means you keep the role as update authority. Minting an NFT is the process of creating a token, freezing its maximum supply to 1 and attaching Metaplex NFT standard JSON to it, so a wallet can render it. $ find assets -type f -name '*.json' | xargs jq '.seller_fee_basis_points' | sort | uniq -c

## for most projects, your just paging through and confirming Then, add funds. 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. - ensure you have recent versions of both `node` and `yarn` installed Here's what mine looks like: -n, --number Number of images to upload

Explore and interact with Solana NFTs created by Metaplex's Candy Machine v2. `solana-keygen help new` 2 SOL, node ../build/candy-machine-v2-cli.js upload \, Beginning the upload for 5 (img+json) pairs For example, you can create ~/.config/solana/keypair.json and enter your private key bytes: An example of private key bytes for public key 5WfBt2ziAxA4DWV3XBSmvczhjcp9Az9eCcdmgSNvZ2Ar: Candy Machine is a Solana-based program developed by Metaplex Studios, anNFT ecosystem for marketplaces, games, and arts & collectibles, to reliably sell non-fungible tokens (NFTs). If you found this helpful, consider sending a tip to the author. In less technical terms, Metaplex designed a standard that to store NFTs on Solana, an everyone in the ecosystem adopted the standard. 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. - install `ts-node` -- if you're me: This is just our personal preference. Looking at key 3 Requesting airdrop of 10 SOL ```bash `JUskoxS2PTiaBpxfGaAPgf3cUNhdeYFGMKdL6mZKKfR` Don't speed run this section. 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. We can mint Solana NFTs from the Candy Machine CLI easily. The guide uses basic configuration settings to keep it simple.

It's not uncommon for me to wait 10-15 minutes to see it serve images and metadata. $ find assets -type f | wc -l # count the total number of asset files #### check `name` values We have the code but it's not usable yet. 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. Commands: We are not going to add a BIP39 passphrase to simplify the tutorial. # License ```

Once you verify that your keypair has funds and your assets have been uploaded appropriately, you are ready to deploy the candy machine.

minted 5 tokens Clone the latest Metaplex Candy Machine V2 from the master branch on Github. Installing and using Solana Candy Machine V2 requires We can then view the Solana NFT mint transaction on Solana Explorer.

Name {redacted-name} 2 with https://arweave.net/{redacted-tx-id} checked out Prepare your files in the folder ~/cm-project/assets/. Verifiers are needed to keep tabs on the actual rollup state and the one referenced in the state root to detect fraud. - run the command line utility: - won't accept your funds if they are out of NFTs to sell

## confirm those numbers are all what you would expect. You can download a sample config file here: config.json. 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. For added security, enter a BIP39 passphrase 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. You can view all of your NFT metadata, #### Organizing your project assets Explore the top 10 Solana RPC node providers enabling web3 developers to deploy smart contracts to Solana's Devnet, testnet, and mainnet. For the most convenient setup, creators are encouraged to use the frontend UI provided by Metaplex. The program authors are aware of this and carefully designed the program so that it's safe to simply re-run the upload command until everything goes through completely and cleanly. set the NFT as your profile picture, and The Candy Machine can only mint NFTs to users after your goLiveDate setting in config.json. Writing indices 0-4 -c, --cache-name Cache file name (default: "temp") minting another token ``` Building up commands with lots of long arguments can be challenging and error prone. The Candy Machine CLI will check the images and metadata json files.

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. There are a few reasons why developers should consider using Candy Machine. Processing file: 0 According to Metaplex, the numbering of the files start at 0. verify [options]

The version should print in your command line.

Metaplex offers a suite of tools and smart contracts (programs) that will ease the process of creating NFTs.

## this command lists then sorts all of your name values.

It will: The Solana NFT Candy Machine, or CM for short, is a Solana Program designed to help NFT creators sell their NFTs. You can add this keypair to Phantom to check the NFTs. NFT publishers should target devnet before going for mainnet.

Commitment: confirmed

These folder names can be anything.

-h, --help display help for command This means that creating a new instance of Candy Machine v1 is no longer possible and end-users are encouraged to use Candy Machine v2 instead. We need to verify our assets before creating our Candy machine. 4.png

The Candy Machine program is similar to a real-world mechanical candy machine whereby a person deposits a coin into the candy machine and gets one piece of candy back. When done, you can change the network to Mainnet-Beta. We will also add a script to mint NFTs to your wallet via the CLI. No instructions provided 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.

Meta Blocks Avatars are now called 3moji. 10 Arguments:

Minting NFT collections correctly requires technical know-how, and the Candy Machine helps streamline the process. Usage: candy-machine-cli [options] [command] Open the terminal app on your computer. $ ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts help upload eg: 4.png and 4.json are two halves of the NFT -- one is the art, the other is the metadata. ## for most projects you should see a consistent count across all metadata. - fork it Processing asset: 0 The Solana airdrop command is sometimes unreliable.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. directory Directory containing images named from 0-n Save this seed phrase and your BIP39 passphrase to recover your new keypair: As the Candy Machine is a distribution program for NFTs, its important for it to be loaded with your projects artwork and metadata. ### Prerequisites On-chain NFT collections help validate accuracy and authenticity. Solana is here. 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. The Solana devnet RPC connection is not reliable. We will use solana config set --url https://api.devnet.solana.com/ to connect to Solana devnet. WebSocket URL: wss://api.devnet.solana.com/ (computed)

- configure it ``` Looking at key 1 This is where permanent mistakes are made.

Plus, our legendary support will guide you every step of the way. $ find assets -type f -name '*.json' | xargs jq -r '.name' | sort | less $ ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/.config/solana/devnet.json

update_candy_machine \ 8.png #### check `properties.creators`

A successful output will look something like: After running this command, you should see 5 NFTs in your wallet.

Avana Wallet displays your NFTs in the app. pubkey: 7zMqBkHowtpEC8iayNmCoT42T8dKjikzmTbZX5aNJbhJ

This is going to feel tedious, but remember that bugs in this data are forever.

verify_price [options] Youre all set and ready to mint your very first NFT using Candy Machine v2.

You can change the metadata for each NFT so it is unique to that NFT.

Make sure you save the output pubkey: 5B2r75JbpajeWcx4niKq7pck3ZLcHvChXATm46YdRLGp. ```bash

RPC URL: https://api.devnet.solana.com You can read more about creating metadata files in Avana Wallet NFT documentation. ## Getting Started Your submission has been received!

Processing asset: 0 In addition, any configuration value can be updated.

Metaplex has created a sample collection that you can download for testing purposes.

Each png and json file are combined to represent a single Solana NFT.

:::info Easy Guide To Mint Solana NFTs Using Candy Machine V2. ::: #### Create devnet wallet (for testing) `metaplex upload` handles more than just sending files to arweave.

It is currently very new, so please report issues on GitHub.

Users don't need someone to watch the L2 chain to detect fraud.

Maintain your choice of settings across areas such as whitelisting, Captcha protection, and gatekeeper settings. `solana config set --url https://api.devnet.solana.com` ```bash

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. -k, --keypair Solana wallet location (default: "--keypair not provided")

time taken: 00:00:58, node ../build/candy-machine-v2-cli.js verify_upload \, wallet public key: 9WS1ezpcxDVfA8cWGzDswCxfXWPtc6xcrkEk9gN6PWh8, node ../build/candy-machine-v2-cli.js mint_multiple_tokens\, Minting 5 tokens Copyright 2021 Levi Cook

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. initializing candy machine If you created a new wallet and you are using devnet, make sure you add Solana SOL to your wallet. $ solana airdrop 10 # request funds Name {redacted-name} 1 with https://arweave.net/{redacted-tx-id} checked out :::info True means the on-chain metadata is frozen.

cd into a directory where you want to store the Metaplex related code. ## you should expect this to output 100. $ solana config get ``` BIP39 Passphrase (empty for none):

You have two options: use an existing keypair with funds, or create a new keypair and add funds. :::

`solana help balance` and minting front-end application written in React, Retrieving NFTs minted from Candy Machine v2. $ find assets -type f -name '*.json' | xargs jq '.properties.creators' | jq -c '.

https://docs.metaplex.com/nft-standard Size 5 { mediaExt: '.png', index: '0' } The Metaplex package comes with multiple packages, but we only care about cli. This cache was created in the upload process.

WebSocket URL: wss://api.devnet.solana.com/ (computed) Now your Candy Machine is ready to mint Solana NFTs.

10 420

```bash $ find assets -type f -name '*.json' | xargs jq '.properties.creators' | jq -c '.

$ find assets -type f -name '*.png' | wc -l # count the images files Depending on configurations, it is either restricted to whitelist users or the goLiveDate has not been reached yet. Each asset (image/video etc) that you want to publish as an NFT needs an accompanying Metaplex config. help [command] display help for command ```bash You need to connect your Solana wallet and add funds to create and deploy a Candy Machine.

It's based on me just reading code and figuring out how it's meant to be used--so don't assume I'm right or completely correct about anything. The Candy Machine metadata requires all metadata JSON files to follow the Solana Token Metadata Standard.

Candy Machine V2 requires installation of several packages to work correctly. For example, we set the fee at 100 basis points which is equivalent to 1%.

Keypair Path: /Users/levi/.config/solana/devnet.json

Candy Machine V2 is now configured in a single JSON file - this is a change from Candy Machine V1. Now we need to set keypair.json file as the Solana CLI keypair. ## 0.json should refer to 0.png in the .image and .files props We can add SOL by running solana airdrop 1. Connect a relevant Solana wallet and add funds to create and deploy a Candy Machine.

Mutable: Means that the update authority can change the on-chain metadata. 10 SOL 8.json sign [options]

Processing asset: 1 Subsequently, by downloading the relevant dependences, end-users should be able to compile and run the software. noMutable: False means you can update the on-chain metadata. Each file should be a number, starting at 0. Typically, the verified creator will be the Candy Machine by default. $ ls assets | sort -n 2.png

- register those assets with your candy-machine's inventory ~/metaplex-foundation/metaplex Any other RPC provider works for this tutorial as well.

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?

```bash