DEV Community

Giovanni Fu Lin
Giovanni Fu Lin

Posted on

How to launch a NFT collection on Solana

Requirements

Before everything you should have the Solana CLI installed as it is requisite later. You can follow the official instruction to install the Solana Tool Suite. https://docs.solana.com/cli/install-solana-cli-tools

Generate the PNGs

We generate the collection of PNGs and metadata with Hashlips art engine. Clone the repository https://github.com/HashLips/hashlips_art_engine and install the dependencies.

yarn install
Enter fullscreen mode Exit fullscreen mode

Now let's configure it. In the config.js file we change eth to sol.

const network = NETWORK.sol;
Enter fullscreen mode Exit fullscreen mode

Always in the same file, we change the collection's general information (name, symbol, description, external link, wallet address...)

Once it is configured we go to the layers folder. The parts are defined as folders where we put all the variants. For example, the part Eyeball contains 2 PNGs. Red and White. We can observe in the png file name a hashtag followed by a number. The number after the hashtag sign defines the rarity. Run yarn generate to create the images and JSON files under folder build.

Upload to the Solana network

To upload the PNGs to Solana we are going to use Metaplex, the protocol that is defining the NFT standard for the network.
Go to Github and clone https://github.com/metaplex-foundation/metaplex

We create a new folder and name it assets. Put it in the Metaplex repository and move the images and JSON files to the folder

We can customize such as the quantity, price, and launch date between others. Go and edit example-candy-machine-upload-config.json, you can change it to the minimal configuration that you can get from https://docs.metaplex.com/candy-machine-v2/configuration

Setup the upload code

Go to the js folder and install the dependencies cd js && yarn
Execute the upload code that you can copy from https://docs.metaplex.com/candy-machine-v2/creating-candy-machine. Then change the codes from the example to the following:

For the CLI file to execute copy the path to candy-machine-v2-cli.ts. Right-click on it and then click on copy path.

For the -k Run to solana-keygen new and use solana config get to know the Keypair Path

For the -cp Copy the path from example-candy-machine-upload-config.json

And last copy the Path to the assets folder where we have the PNGs and JSON metadata.

Run can always use the help flat to know what it does ... upload --help.

When you are running the command it may fail, you just have to try again or change the RPC URL https://docs.metaplex.com/community#rpc
When it is uploaded Copy and save the output of the collection addresses and candy machine address from the terminal to a new text file.

Mint the NFT

Go to candy-machine-ui folder and install the dependencies cd path-to/candy-machine-ui && yarn
Start the UI in local with yarn start and you can try to mint the first NFT of the collection.

Congrats you have created, deployed, and minted your own NFT collection on Solana.

Top comments (0)