Minting an NFT on Solana can be quite a tedious task, even with the ease of use provided by Candy Machine. However, since the Solana blockchain is singular, its main goal is to scale the blockchain for global adoption.
Today, we will be taking you on a step-by-step guide towards everything you need to know about minting an NFT on Solana through the utilization of Candy Machine.
Key Points:
- You will be required to install a lot of prerequisites prior to beginning this process and familiarity with CLI tools is required.
- You will be utilizing Candy Machine, where you will essentially fork the repository.
- By the end of this, you will be fully able to set up a project and mint your own Solana NFT.
- Make sure to re-read this guide over again once more if you feel like you need additional information, as there will be a lot of coding involved.
Install the following Programs to create your NFTs
Prior to using the Candy Machine and prior to minting any NFTs on your machine, you will be required to download some software first.
This includes the following programs:
- Nodejs (version 14.17.6)
NodeJs is essentially developed as a means of building scalable network applications. It is primarily used for non-blocking, event-driven servers, and is primarily used for traditional websites and back-end API services due to the fact that it is single-threaded. It was designed with real-time, push-based architecture.
Docker is essentially a software network specifically designed for building, running, and managing containers within servers and the cloud. It is fully open-source, and enables developers to package applications within containers, which standardizes executable components that combine application source-code with the operating system libraries and dependencies that are required to run code within any environment.
Yarn caches every package that it downloads so that it never needs to download it again in the future and even parallelizes operations as a means of maximizing resource utilization, which in turn leads to faster install times. It is the standard for fast, reliable, and secure dependency management.
The Solana CLI is essentially this collection of different commands for every single action that a user might want to take within the Solana Tool Suite. It enables users to view a list of all of the possible commands through running Solana — help, and they can even zoom in within a particular command with ease.
Metaplex CLI is a command-line interface for the creation and management of non-fungible tokens on the Solana blockchain through the utilization of Metaplex programs. Candy Machine is essentially this tool that utilizes the Metaplex CLI as a means of generating an NFT, linking a picture and relevant metadata to the NFT token, and even setting up a fair auction.
Phantom Wallet is a digital wallet specifically developed for Decentralized Finance (DeFI) which aims to make it easy as well as secure to store, send, receive, collect and swap tokens within the Solana blockchain network. Its main function is to allow users to instantly swap Solana-based tokens directly from within their wallets.
Remember to save the public key and the seed in your important documents after creating the wallet, and remember that you should never share your 12-word seed.
Note that once you are in the wallet, you have to change Solana’s mannet to Devnet. This is due to the fact that if you want to operate within the Mainnet, you will need to spend real SOL tokens. However, you can also fund your wallet with fictional SOL, which has no value, so using it would have no effect, as a means of testing out this procedure for free prior to fully utilizing it within the mainnet.
In order for you to be able to do this, you will need to scroll down until you come across this menu:
Here, you can select the Devnet option. Note that you will need to send some SOL tokens within your phantom wallet initially as a means of avoiding any issues when you are finally ready to mint on the mainnet. After you have completed this, you can begin your coding journey.
- Deep familiarity with CLI tools
CLI is short for command-line interface and is a text-based user interface (UI) used as a means of running programs, managing computer files, and even interacting with a computer. These command-line interfaces are also called console user interfaces or even character user interfaces. They can be utilized to use command-line tools, such as scripts, programs, and libraries created with a unique purpose.
Please ensure that you complete all of these software requirements prior to engaging with the process of minting an NFT on Solana through the utilization of Candy Machine.
What is Candy Machine?
To truly understand how you can complete this process fully, you will first need to be aware of what exactly Candy Machine is. This is essentially software built to utilize the Metaplex CLI, through which it generates an NFT.
Through utilizing it, you can essentially link a picture and relevant metadata to the NFT token, after which you can set a fair auction.
Forking the Repository
Within this next category, you will essentially be given a choice of utilizing two different types of repositories. One of them is built by the candy-machine mainneters, and the other one is developed by a community member and provides specific benefits. However, to keep things as simple as possible, for the time being, we will be using the second repository. If you feel confident in your Metaplex knowledge, then you can deviate from this path as well.
In order for you to be able to fork this repository, you will need to go to the community member’s repo and fork it by clicking the fork button at the top of the page.
After you have it forked, you will need to clone it.
To do this, enter the following code:
Once this project has been successfully forked from your end, you will be able to begin the setup of the overall project.
How to setup project: Step-by-Step Guide
Once you have successfully gotten a hold of all of the required code within the previous step, you will now be able to open a folder known as the “solana-candy-factory” folder in the code editor you feel comfortable with using.
The next step will involve installing the dependencies. Start by running the following command
After installing the dependencies, you will want to start the Postgres database in Docker, which will essentially hold the NFTs prior to them being deployed within the network.
How to run the Candy Machine: Step-by-Step Guide
This will essentially enable your database to allow Strapi, a headless CMS which can hold all of the NFT information you throw its way, through which you can connect to the docker container.
Then we need to move on to the NFT manager. Here, you are able to use a headless CMS as a means of uploading and managing all of your NFTs before they get minted.
Here, you will need to run the following command.
Here, first, create a free Strapi account and log in, after which you can quickly navigate to:
Ensure that you create a user by clicking on the tab:
With all of that done, you will need to fill the following fields:
- Username: User1
- Password: User1234
- Email: [email protected]
- Confirmed: Ensure that this is set to ON
- Role: Authenticated
Once all of this has been completed from your end, you will now be able to save your newly created user.
We can now move on towards the NFT collection creation process.
Go to the “Collections” tab and create a new collection. Here, you will find two fields, Name and Family.
Here, make sure that your name is “Collection_Selected_Name”, and the Family will be “The_Collection_Family_Name”, You can save the collection and move to the “NFTs” tab to create individual NFTs.
Here, you will need to format specific information, such as the Name, Symbol, Description, Seller fee basis points, image, Animation URL, External URL, Traits, Properties, and Content. It is within the Content tab that you upload your image, however, ensure that the image is in .png format. After you fill out all of this information, you will finally be able to mint your NFT.
Once all of this has been successfully completed, you will now be able to deploy the Candy Machine.
Now, due to the specific setup of the framework, this will only take a few moments and a few commands to truly finalize.
First, ensure that all of the funds within the NFTs generated are going to you through the utilization of this command:
Here, you will be asked to paste in your correct address, and all you have to do is paste your Solana address here. Furthermore, you can put the % of royalties you will make off of future sales of the artwork, which is a reference to the Seller_fee_basis_poinsts field.
You can move on towards generating the NFT data through the following command:
Here, you will be asked if you want to shuffle which will randomize the order in which the NFTs will be minted. If you’re doing a 10K NFT set, this might be a solid option for you.
Once the previous command has been compiled, you will see two files within the nft-manager/nfts-sources folder, 0.json, and 0.png.
You can run this command, and accept all of the default values by pressing on the “Enter” key:
Once the program is up, all you have to do now is simply interact with it. To set up the website, you will need to run this command:
After this, you will see a website at:
You can connect your wallet, and click on the “Mint” button.
If things went according to plan, the NFT should appear within your Phantom Wallet.
How to run a Solana Node?
You can run a Solana node with any node connection on the Solana Network. Through the utilization of NOWNodes, you can easily create your account and get any API for instant access to many blockchain networks, which do include Solana.
How to use Solana block explorer
NOWNodes allows you to access the SOL explorer for free. To begin, you will need to create a free account, after which you will be able to get a free blockchain API key. You will then need to click on the corresponding “GET FREE API-KEY” button located on the main page in order to get started.
Once you enter your email and submit, you will receive the key in a few seconds. WIth the API key, you can start using the SOL block explorer right away.
Conclusion
Hopefully, now you have a heightened level of understanding as to how minting an NFT on Solana actually works, and how you can utilize Candy Machine as a means of doing so.
If you have completed all of the aforementioned steps successfully in the Devnet, then you can switch back to the mainnet, after which you will be able to see all of your NFTs in your collectibles tab on your wallet.
The main reason as to why you might want to use NOWNodes as a means of connecting to the Solana block explorer is due to the fact that we offer a fast and reliable collection, over 40 block explorers within a single location and have gained a high level of trust within the industry.