Solana Fair Launch Guide (2 of 2)

NftDownUnder
3 min readNov 10, 2021

This article is a continuation of the Solana fair launch guide which can be found here. In this part of the guide we will cover:

  1. How to create the frontend for your fair launch
  2. How to build and host your frontend
  3. How to end your fair launch and collect your SOL

Launching The Fairlaunch Frontend

The front end of the fair launch can be created by compiling the prebuilt fair launch frontend made by Metaplex.

  1. Enter the fair launch directory and install any dependencies
cd packages/fair-launch
yarn install

2. Open the .env file in the fair launch directory and change the following things.

REACT_APP_CANDY_MACHINE_ID=$CANDY_MACHINE_ADDRESSREACT_APP_FAIR_LAUNCH_ID=$FAIRLAUNCH_ID# IF USING DEVNET DO THE BELOWREACT_APP_SOLANA_NETWORK=devnetREACT_APP_SOLANA_RPC_HOST=https://explorer-api.devnet.solana.com# IF USING MAINNET DO THE BELOWREACT_APP_SOLANA_NETWORK=mainnet-betaREACT_APP_SOLANA_RPC_HOST=https://api.metaplex.solana.com/

NOTE: The $CANDY_MACHINE_ADDRESS and $FAIRLAUNCH_ID can be copied from your terminal by logging them out using “echo $….”

3. Start the frontend and check it works. This can be done by running the following command

yarn start
Snippet of the frontend

Building And Launching The Site

  1. Build the code to prepare it for production.
yarn build

2. Upload the build directory to a web hosting service. There are many different web hosting services available, but for simplicity, we will use Netlify. Here's a simple guide to help: https://app.netlify.com/drop. NOTE: You can use any web hosting platform, consult with your devs to see what's best for you.

Ending The Fair Launch

When we have completed phase 2, we need to manually run some commands to start the lottery and enter phase 3.

1. Once the bidding ( stage 2 ) ends, `create_missing_sequences` should be run.

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

2. Run the lottery to actually figure out who will win the tokens

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

3. Start phase 3, so people can mint their coins

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

4. Once everyone has finished minting, you can withdraw the money into the wallet specified at the start of this guide by running the following command:

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

Final Remarks

This guide was written to help the overall SOL community. It would mean the world to us to get some love back by supporting our project NFTDownUnder.

--

--

NftDownUnder

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