Solana Fair Launch Guide (1 of 2)

NftDownUnder
5 min readNov 10, 2021

This article provides a short yet sweet summary of the fair launch protocol. In the first part of this article, we will cover:

  1. What the fair launch protocol is
  2. What you need to set up the fair launch protocol
  3. Launching your own fair launch candy machine

This guide was written by the team at NftDownUnder, show us some love and join our awesome community where we travel around Australia, make AI-generated art, and sink beers.

What Is Fair Launch

The fair launch protocol provides the community behind any NFT project to dictate a fair median price for the assets in a collection. It provides people with a fair opportunity to get their hands on an NFT by creating a lottery-style raffle.

The videos below summarise the process better than we can:

This video was kindly provided by the team over at Rogue sharks! Go show them some love!
This video was also provided by the lovely folk at the Flux Art Project! Go check em out ❤

Fair Launch Prerequisites

  1. Have GIT installed on your computer: https://git-scm.com/downloads
  2. Have the Solana CLI installed on your computer: https://docs.solana.com/cli/install-solana-cli-tools

Creating A Wallet For Minting

This wallet will be used to upload the assets to Arweave as well as collect the funds after the fair launch. We recommend making a new wallet for every launch.

  1. Create your wallet
solana-keygen new --outfile ~/.config/solana/wallet.json

2. Set this as your default wallet

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

3. Connect to the Solana cluster of your choice ( mainnet for real deploy, devnet for test deploy)

solana config set — url https://api.devnet.solana.com
OR
solana config set — url https://api.mainnet-beta.solana.co

4. Airdrop yourself some money ( if doing a test deploy on devnet ). Note: if you're using mainnet you must send funds to this account as it will be required to upload the assets.

solana airdrop 3

IMPORTANT: save your key path and solana network. This will be needed for future steps

Key Path:

export KEY=~/.config/solana/wallet.json

Solana Network:

export SOLANA_NETWORK=devnet
OR
export SOLANA_NETWORK=mainnet-beta

Initialising The Metaplex Repo

  1. Create a folder and cd into that directory.
  2. Download the Metaplex repo using the following command
git clone https://github.com/metaplex-foundation/metaplex.git ./

3. Install the repo’s dependencies in the js directory

cd js 
yarn install

If you run into issues, please make sure you have an updated version of node.

Preparing Your Assets

  1. Create a folder in the js directory called assets ( you may want to overwrite the existing one )
  2. In this folder, you want to create an image + JSON file for each one of your NFT’s
- 0.png
- 0.json
- 1.png
- 1.json
… ( order is used for mint order )

3. An example JSON looks like the following:

The standard is defined here: https://docs.metaplex.com/nft-standard

Making a fair launch

We need to actually make the fair launch first

  1. Create the fair launch by running this command. NOTE: You will want to customize the parameters in this command:
  • The fee is the price it costs to bid in the fair launch
  • The price ranges are the min and max allowable bid prices
  • The number of tokens should correspond to the number of NFT’s you’re releasing
  • The tick size is the increment of bids that are allowed
  • The lottery duration is measured in seconds
  • The UUID is a unique identifier for this fair launch
  • The dates must be set for each stage
ts-node ./packages/cli/src/fair-launch-cli.ts  \new_fair_launch \--env $SOLANA_NETWORK \--keypair $KEY \--fee 0.01 \--price-range-start 0.5 \--price-range-end 2.5 \--phase-one-start-date "Thu Nov 04 2021 03:50:00 GMT" \--phase-one-end-date "Thu Nov 04 2021 04:00:00 GMT" \--phase-two-end-date "Thu Nov 04 2021 04:20:00 GMT" \--number-of-tokens 5 \--tick-size 0.1 \--lottery-duration 86400 \--uuid "my-creative-name"

IMPORTANT: save the fair launch id for use in future steps

export FAIRLAUNCH_ID=YOUR_FAIR_LAUNCH_ID

Check the fair launch was successful

ts-node ./packages/cli/src/fair-launch-cli.ts  \show \--env $SOLANA_NETWORK \--keypair $KEY \-f $FAIRLAUNCH_ID

IMPORTANT: save the token mint for use in future steps

export TOKEN_MINT=YOUR_TOKEN_MINT

Create an SPL account for the token

This is the token that will be redeemed for an NFT during the fair launch.

spl-token create-account $TOKEN_MINT

IMPORTANT: save the token account for use in future steps

export TOKEN_ACCOUNT=YOUR_TOKEN_ACCOUNT

Upload Your Assets To Arweave

Upload the assets like we normally would. Your assets should be in a folder called assets in the js directory. NOTE: Ensure your cache file is deleted in the js directory.

ts-node ./packages/cli/src/candy-machine-cli.ts  \upload \./assets/ \--env $SOLANA_NETWORK \--keypair $KEY

Create Your Candy Machine

Create the candy machine. Note that the price is 1 fair launch token NOT 1 sol.

ts-node ./packages/cli/src/candy-machine-cli.ts  \create_candy_machine \--env $SOLANA_NETWORK \--keypair $KEY \--price 1 \--spl-token $TOKEN_MINT \--spl-token-account $TOKEN_ACCOUNT

IMPORTANT: save the candy machine address for use in future steps

export CANDY_MACHINE_ADDRESS=YOUR_CANDY_ADDRESS

Update The Candy Machine

Update the candy machine so that people can mint right after phase 2 ends (use the same phase 2 date from the fair launch step above )

ts-node ./packages/cli/src/candy-machine-cli.ts  \update_candy_machine \./assets/ \--env $SOLANA_NETWORK \--keypair $KEY \--date "Thu Nov 04 2021 04:20:00 GMT"

Front End Guide

The frontend side of things is in the second article which can be found here.

--

--

NftDownUnder

“Roadtrip, drink beers and make NFT’s … Down Under!”