Part 3) Deploying to Mainnet-Beta

Is it time to deploy to production? Congratulations! Here are some notes I took when it was time to go live with Porcupine Playground Pals.

Solana Config

If you have run through all the sugar commands on devnet (of course you have!), all your solana configurations are pointing to devnet, so now you can change them over to mainnet-beta. The main thing you need is an RPC URL. I created accounts with a couple providers from the Metaplex list of RPCs availableQuickNode and Alchemy — and used the RPC URL assigned to me by QuickNode for my solana config url setting.

solana config set --url https://{XXXXXXX}{XXXXXXX}/

I am also using a different wallet for our mainnet-beta creator wallet, so I generated a new keypair and set that into my solana config as well.

solana-keygen new --outfile {path to keypair}/keypair.json
solana config set --keypair {path to keypair}/keypair.json

Funding Creator Wallet

We decided on arweave for storing our NFT images and metadata from Metaplex’s list of storage providers and used their fee calculator to estimate how much SOL to put into the creator wallet before running the sugar commands. After transferring SOL into the creator wallet, and with my solana config set to this creator wallet and the mainnet-beta RPC, I then ran through the sugar steps.

Deploying Mint UI to Vercel vs. Netlify

The Mint UI was created as a Next JS project (see Part 2) and stored on Github and for deployment, the decision came down to Vercel vs Netlify. Both allow sign-up/sign-in with a Github account, and both allow for custom domains or subdomains. Both allow for environment variables based on scope or context, and Vercel’s project environment variables are easier to set up initially and modify later. The initial deployment was overall slightly easier using Vercel but we ultimately switched to Netlify because of some handy features I appreciate.

Skip a deployment

There are times when I want to commit code to Github, but do not want to automatically trigger a new deployment. Whether it is a simple README update or a change that I don’t want deployed just yet, Netlify’s skip a deployment upon git commit feature using [skip ci] or [skip netlify] comes in really handy.

Using a branch for deployment

Both Vercel and Netlify allow you to easily import projects from Github, but with Netlify, you can also specify a branch for a project. That means you can have 2 different sites that share the same main code but one can be a branch of the other. Both Vercel and Netlify allow for preview deployments of branches within a project, and separate environment variables for branches, so this can be achieved with previews, but I prefer having a separate site entirely. I find this particularly useful when utilizing multiple guard groups.

Commercial Projects

Lastly, Vercel’s Hobby plan is for non-commercial projects. You have to create a team, even if your team has only 1 member, and upgrade to at least the Pro plan for a commercial project; whereas the Netlify Starter plan is a single-member plan that can be used to for commercial projects. For this “mom-and-dop” shop, that made the most compelling reason for me to switch.