Try   HackMD

Solana NFTs: 0 to Mint

I'm Hector and I have created this guide to help you launch your first NFT collection on Solana. If you're interested in working together, you can contact me on Twitter: @HectorNBardales.

At the end of the guide I have added resources and links to discord groups where you can ask questions. This guide doesn't replace the official documents of the programs that are used but instead compiles information so that it can hopefully be easier to understand and use.

If you have any questions, you can leave them as comments or join either the Metaplex or Hashlips Discord server and post them there.

Reasons for Update

The original guide Solana NFTs: Everything you need is still available, but all the necessary information for the new versions of the Metaplex software, Hashlips, and others will be documented here from now on.

Some of the changes are:

  • Sugar is now the standard for Metaplex (CM V1 was deprecated and V2 is now operated through Sugar)
  • Updates to Metadata structure
  • General Updates to all programs

Solana

The following content can be used to interact with the Solana Blockchain through the creation of non fungible tokens. Solana operates by using Proof of Hsitory which allows it to have a much higher speed than other blockchains.

Tools

Necessary Tools

These are the programs used in this guide. Start by downloading Visual Studio Code for your system. Follow with the rest until yarn. The following can be done later.

Art Generators

You only need one, but can always test others.

RPCs & Additional Tools

Some commands require the use of your own custom RPC to prevent any timeouts or errors. Here is a list of some providers you can choose from:

Quicknode: Free and recommended for Mainnet (Remember to choose Mainnet Beta)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

GenesysGo: Free, but due to this you might be rate limited on Mainnet.

RPC Info
What is it? Remote procedure call. It is used to interact with Solana.
Why use one? Speed and being able to mint without issues. You will be rate limited if you use the ones from Solana.
How to choose one? Consider the size of the project and number of users interacting with it.

Metadata Standard & Collections

Token Standard

Before proceeding to generate or create any metadata you must familiarize yourself with the correct metadata standard. The link show the standard for nonfungible tokens ie NFTs.

Collections

Collections are now defined onchain with an additional NFT called the Collection NFT.
A collection NFT is minted to the uploaders wallet as soon as a Candy Machine is created.

If you want a Collection NFT. Create an image and json file called collection.png and collection.json respectively. Here is more information about the Collection NFT.

Image & Metadata Generation

For large collections you'll most likely generate the images from layers. Always check that the generated metadata matches the [token metadata standar](dI have listed the following generators:

  1. Hashlips Art Generator
  • Uses Javascript
  • Can choose layers that cannot go together
  • Currently appends additional edition to metadata. To bulk delete this use my remove_json_item script
  1. Solseum NFT Generator(Metadata format should be checked)
  • Used Python and results in much faster generation
  • Generates rarity sheet and graphics
  1. NFT Chef
  • Allows for exclusions and forced combinations

I've added the main steps to follow. This sometimes includes some commands that you can copy/paste and hit enter to run.

Hashlips Generator

Once again, keep in mind that this generator appends edition which is not used in Solana but can be deleted after generation.

The Hashlips Art Generator is available for free on Github. Start by opening up Visual Studio Code.

  1. Clone the repo

  2. Open the Hashlips Generator folder in an IDE. Create a new terminal and run yarn:

yarn install

This should install yarn.

  1. To generate for Solana go to Src folder and go into the config.js file. Change the network to solana:
const network = NETWORK.sol
  1. Add you layers into the Layers folder. Be sure to name each folder correctly.

  2. Stay in the config.js file and change the namePrefix, description, and solanaMetadata. (baseUri doesn't need to be changed because your assets will be uploaded to Arweave by default when using the Candy Machine.)

  3. Select the number of NFts to be generated:

growEditionSizeTo: 1000, //this create 1000 NFTs.
  1. Choose the order of the layers in:
const layerConfigurations = []

Names must match the folder names.

  1. Generate them by running:
yarn generate
  1. Check the build folder. It has an image and json folder inside containing the generated images and json files.

Solseum Generator

This python based generator can generate image and metadata at very high speeds. It producdes graphs such as the one below to view trait rarity.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

(Image from Solseum Generator Github)

To operate:

  1. Install Python 3

  2. Clone the repo

git clone https://github.com/Solseum/solseum-nft-generator.git
  1. Locate the cloned folder. Your assets you go into the Input->Assets folder.

  2. Edit the template.json file to match the token metdata standard.(If users require it I, comment and I'll create a fork following the new standard.)

  3. Follow the instructions on how to generate based on your needs. The following command generates 100 NFTs for public minting.

python3 main.py -p 9500

NFT Chef

Operation is similar to the Hashlips Generator. Follow the instructions on Github to create exclusions ie layers that cannot go together and forced combinations ie force layers to appeat together.

Installing & Operating Solana Cli

Once your assets are ready, you can move on to using the Solana Cli.

1. Install Solana Tool Suite by following the steps on that website.

Always confirm the installation was successful with:

solana --version

Solana has Mainnet Beta, Devnet, and Testnet. For an official launch you must use Mainnet Beta. For testing purposes you should use Devnet.Your first project should begin on Devnet. Here you can use Solana that isn't real i.e. fake Sol.

2. Begin by changing cluster. Open your terminal and run:
Devnet:

solana config set --url https://api.devnet.solana.com

For mainnet it's suggested to use an rpc such as Quicknode.
Mainnet:

solana config set --url https://api.mainnet-beta.solana.com

3. Create a file system wallet:

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

The wallet, devnet.json, is stored on your device in the folder: ~/.config/solana. This is a hidden folder. To show a hidden folder on MacOS use cmd+shift+..

4. Set your keypair:

solana config set --keypair ~/.config/solana/devnet.json

5. Add Solana and check balance of your wallet

solana airdrop 1 solana balance

If solana airdrop fails, use a Sol Faucet.

For more info on steps 2-5 visit the Metaplex Docs: Solana Toolinh Required

Metaplex

Sugar is the new Candy Machine Cli. The Candy Machine is still the program in charge of interacting with Solana. Metaplex has simplified the process by creating Sugar to operate the program.

1. Install Sugar: Choose installation for your system.

// MacOs, Linux bash <(curl -sSf https://sugar.metaplex.com/install.sh)

2. Add a folder named assets into the metaplex folder. It should contain all your images and json files and your Collection NFT, if you want a new collection.

3. Create a config file: This file will contain the settings of the Candy Machine.
I've copied the sample from Metaplex below. You'll notice that creators are here. These creators are addresses that will receive the royalty fees.

{ "price": 1.0, "number": 10, "symbol": "SR", "sellerFeeBasisPoints": 500, "creators": [ { "address": "<CREATOR 1 WALLET ADDRESS>", "share": 50 }, { "address": "<CREATOR n WALLET ADDRESS>", "share": 50 } ], "gatekeeper": null, "solTreasuryAccount": "<TREASURY WALLET ADDRESS>", "splTokenAccount": null, "splToken": null, "goLiveDate": "2022-04-22T00:00:00Z", "endSettings": null, "whitelistMintSettings": null, "hiddenSettings": null, "uploadMethod": "bundlr", "awsS3Bucket": null, "nftStorageAuthToken": null, "shdwStorageAccount": null, "retainAuthority": true, "isMutable": true }

(This is the sample configuration file provided on the Metaplex Docs)

This is a basic config file. The Metaplex Docs have other settings that can be addded if needed.

4. Upload your assets

One of the most common storages is Arweave. You can change the upload method in your configuration file.

uploadMethod="bundlr"

Before uploading make sure all of the files in the assets folder are correct:

sugar validate <ASSETS DIRECTORY>

Before moving forward, if you are on mainnet it is highly recommended to use your own private RPC server. Quicknode is one of the providers.
Here is how you can use it:

solana config set --url <rpc url> --keypair <path to keypair file>

To upload:

sugar upload <ASSETS DIRECTORY> -c <CONFIG FILE>

This will create a cache file named cache.json

If you used bundlr you will have an account funded and can with with

sugar bundlr balance

5. Deploy Sugar

sugar deploy sugar deploy -c <CONFIG FILE> //if you need to specify the path to the config file

Setting a Collection

Skip this step if you are not adding NFTs to an existing collection. If you are use:

sugar collection set <COLLECTION NFT MINT ID

Collection NFT MINT ID on Solscian.io
Collection NFT MINT ID on Solscan.io example

Here I used the sample assets from Metaplex to and then set the collection to the address on the screen.

This is the result from setting a collection to an existing one:

NFT in verified collection on solscan.io

Minting

The first option is to use use Sugar to directly mint.

//mint one sugar mint //mint 5 sugar mint -5

Updating NFT

There are several tools you can using including:

Withdraw

CAUTION this commands closes youre Candy Machine. It will retrieve the remaining funds.

sugar withdraw

You can also check bundlr balance and withdraw from bundlr:

sugar bundlr balance sugar bundlr withdraw

Updating Colleciton Name

You can do it like this

And upload data using tools such as Arloader

Metaboss

The link for metaboss above has lots of instructions. Therefore, I'll only add anything that might clear things up.

Test on devnet. When you're ready remember to change to mainnet or it will not work.

solana config get //check if you're on devnet or mainnet-beta

For many actions in Metaboss you'll need a mint list. Here is how you can get one using snapshot mints:

//With Candy Machine ID metaboss snapshot mints --output <OUTPUT-PATH> --rpc <RPC-URL> --v2 <CANDY-MACHINE-ID> //With Update Authority metaboss snapshot mints --output <OUTPUT-PATH> --rpc <RPC-URL> --update-authority <UPDATE-AUTHORITY> //Example using solana RPC. For large projects use a private rpc metaboss snapshot mints --output ~/desktop --rpc https://api.metaplex.solana.com/ --update-authority xxxxxxxxxxxxx

Update Image / URI / png

  1. Upload new image to Arweave.
  2. Update the json file.
  3. Run
metaboss update data --keypair <PATH_TO_KEYPAIR> --acount <MINT_ACCOUNT> --new-data-file <PATH_TO_NEW_DATA_FILE>

Sol-Tools by Tony Boyle

Make sure to connect with the authority wallet.

Costs

  • Candy Machine Cost: ~1.67Sol/1000 NFTs
  • Storage costs: Arweave
    • Bundlr uploads to Arweave
  • Minting: ~0.012/NFT
    • These are transaction fees. Everytime you interact with the blockchain it will incur some fees

Resources

Automation Tools

  • To delete lines in a bulk of json files you can use the python script in my github account called: remove_json_item

Additional Resources

FAQ

Any questions that might help others will be added here.

Collection Q&A

  • How is a collection defined?
    A collection now defined onchain with the creation of an additional NFT that groups all of them together.
  • How can I update a collection name (not yet minted nfts)?
    Change the name in the json file of the collection NFT and rerun upload. The program checks for changes and should replace your old file with this new version.
  • Can I add NFTs to a deployed Candy Machine?
    No you can't. You must create a new candy machine. You can use the collection command from Sugar to set a new set of NFTs to a preexisting collection.
sugar collection set <COLLECTION NFT MINT ID>

Candy Machine / Sugar

  • What happened to Candy Machine V1 and V2?
    Sugar is now the standard tool that will is used to operate the candy machine.

Update NFT

  • How can I update an NFT?
    Depends on what you want to update. You can use: metaboss, the hiddensettings in the candy machine, or sol-tools.

Transfer Solana (Funds)

  • How can I recover funds / solana sent to a token address?
    You CANNOT recover funds sent to a token. NEVER send funds to a token.

Bundlr Balance

  • After sugar upload my sugar bundlr balance reuturns 0. Why?
    Sometimes Bundlr fails to fund the account. Tony Boyle has a page on how to fix this.