In this text we’ll give you a short overview of how you can create a Solana NFT collection from scratch.
This is a short guide outlining necessary steps. If you want a more involved one, with all the detailed code, have a look here. This tutorial comes also with access to a private Discord channel for Solana Devs.
The end result of the full tutorial above is the NFT minting website on Solana that you can deploy on Vercel. All the steps are described for beginners:
Create a Solana NFT collection
Generally speaking in order to have a collection you need to:
- create a Solana wallet and interact with Solana blockchain
- create NFTs with metadata
- deploy an NFT collection on Solana
- create a simple website where people can buy your NFT
The first point is pretty straightforward. It’s all about installing Solana CLI (command line interface).
For 2-4 we will need to install Sugar (Candy Machine interface) that will allow uploading of NFTs and then download also a sample Candy Machine UI which will be our website.
The full code for creating a collection is:
### Install Sugar
bash <(curl -sSf https://sugar.metaplex.com/install.sh)
sugar --version
### Setup Solana Wallets
# Setup Solana Tool Suite
sh -c "$(curl -sSfL https://release.solana.com/v1.17.13/install)"
solana --version
# owner
solana-keygen new --outfile ./wallets/Owner.json
# treasury
solana-keygen new --outfile ./wallets/Treasury.json
# creator
solana-keygen new --outfile ./wallets/Creator.json
solana config set --keypair ./wallets/owner.json
solana config set --url https://metaplex.devnet.rpcpool.com/
### Prepare Assets - sample collection of NFTs with metadata
curl https://docs.metaplex.com/assets/files/assets-ff6bd873ecd07b49c86faf3c7aab82d2.zip --output ./assets.zip
unzip assets.zip
### Launch Interactive Setup with Sugar
# Gets you Candy Machine ID
sugar launch
### Setup Candy Machine UI - the NFT minting website
git clone https://github.com/metaplex-foundation/candy-machine-ui
cd candy-machine-ui
yarn install
cp .env.example .env
## modify this .env to add your details
yarn start
This is it!
Following these steps will create a simple NFT collection on Solana, using the exemplary metadata and images.
Create an NFT pfp collection
Another issue to solve when creating a large collection is how to create actual images when you want to have say 5000 elements.
The answer is you have to create them generatively using layers. You will have layers for bodies, eyes, hats, hands, etc. and you each NFT will be a randomly picked selection. This way you can create a pfp – a profil picture NFT depicting a person or an animal.
In the tutorial 3 ways are presented:
- manual modifications; you just do everything manually. This is doable if your collection has less than 100 NFTs.
- custom Python code: you can use simple Python code to generate all the NFTs from layers
- Hashlips Art Engine
HashLips Art Engine is a tool used to create multiple different instances of artworks based on provided layers. It’s available for free on Github and you can configure it following the official guide to output NFTs with Solana-adjusted metadata.
Deploying website and NFTs
There are two awesome tools you can use in your NFT journey.
First of all Vercel is a free tool that will allow you to deploy your website – especially the one above candy-machine-ui. You simply need to connect it to your Github account.
The second tool is Pinata that gives you free storage and is compatible with Sugar. You can register for free on Pinata. Go to API keys and generate one to get a JWT token that you can use for ‘sugar launch’ configuration.
That’s it!
Creating a Solana NFT collection is a great programming exercise that can be done by beginners too.
Leave a Reply