This Metaplex tutorial details how to build and deploy a Metaplex fork and then use it to create and sell a Solana NFT.
- What Is Metaplex
- Metaplex Demo Video
- Solana NFT’s & Solanart
- Metaplex Dev Environment
- Forking Metaplex And Settings
- Deploying Metaplex Market
- How To Mint A Solana NFT
- Auctioning A Solana NFT
- Conclusion
What Is Metaplex
The standard for building a NFT store and minting application on Solana is called Metaplex. It’s an open source framework which lets anyone mint and sell NFT artwork.
The Metaplex example site I setup in the video below can be found here:
https://jamesbachini.com/metaplex/
The source code can be found here:
https://github.com/metaplex-foundation/metaplex
The dev team have a Discord channel here:
https://discord.com/channels/848060988636921856/849845842784288798
There are multiple auction applications for both initial and secondary markets.
Metaplex Demo Video
Solana NFT’s & Solanart
The Solana NFT ecosystem has grown strongly over the summer of 2021. This growth has mainly been based on the Solanart launches such as Sol Punks and Aurory. A lot of these were originally minted using customized versions of Metaplex.
Solanart is a curated market place and requires terms to be agreed with the owners to list a project. A lot of the projects also have striking similarities. For most artists this wont be possible unfortunately.
There are other alternatives such as solsea which recently launched and has a more decentralized business model.
The rest of this tutorial will be dedicated to setting up Metaverse to mint and sell NFT’s.
Metaplex Dev Environment
If you use Windows like I do you’ll need to setup a Linux virtual machine to build Metaplex. There’s documentation here on setting up Windows Subsystem For Linux: https://docs.microsoft.com/en-us/windows/wsl/install-win10
You’ll also need a digital wallet for Solana called Phantom: https://phantom.app/
A text editor, I’d recommend VScode: https://code.visualstudio.com/
Then you’ll need to install https://nodejs.org/en/ install latest “Current” version above v15.0.0
You’ll need a version of git which will be installed already on Linux but may need to be downloaded for mac.
You can install NodeJS on linux using the following commands:
sudo apt update
sudo apt upgrade
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
node -v
The last line will output the version number of NodeJS that you have running which should be 16.x.x
Forking Metaplex And Settings
We can access the local filesystem on WSL (windows subsystem for linux) at /mnt/c/
So let’s move into a local directory and fork the project using git.
cd /mnt/c/
git clone https://github.com/metaplex-foundation/metaplex.git
cd metaplex
We now need to edit the file metaplex/js/packages/web/.env and add credentials. Open it up in VScode and copy your address from Phantom App to the top line after the equals sign.
REACT_APP_STORE_OWNER_ADDRESS_ADDRESS=5nqu5mW61ecgiLtCz43M4Xf3JEmdPo9mjLFAgyg6FECC
The deployment scripts are setup to deploy to Github pages and I found that I had to change the Github URL in metaplex/js/packages/web/package.json to avoid an error, even when deploying to a standard web host.
Line 50: "deploy:gh": "yarn export && gh-pages -d ../../build/web --repo https://github.com/jamesbachini/metaplex -t true",
Now we have our own version of the Metaplex software ready to deploy.
Deploying Metaplex Market
Now let’s install and build the project. Some of these commands will take 5 mins to execute as they are downloading large packages.
cd js
npm install
yarn
yarn bootstrap
yarn build
yarn deploy
Now let’s upload the files we just built in metaplex/js/build/web/ across to a website.
If you don’t have a website then you could potentially use Github Pages free hosting. There’s some more details about how to set that up with Metaplex here: https://www.youtube.com/watch?v=CWqW1Akcnqo
How To Mint A Solana NFT
So let’s now visit our deployed metaplex fork using a webbrowser, connect the phantom app and click create.
We can mint images, videos, music and VR/3D content. The following file types are supported: JPG, PNG, GIF, MP4, MOV, MP3, WAV, FLAC, GLB
We can then upload the file which will be “uploaded to the decentralized web via Arweave” and give it some metadata such as title, description and attributes.
In the next section we can add royalties which is how much of each secondary sale will be paid out to the creators. We also have the option to distribute funds from the sale to multiple accounts.
Finally we mint the NFT which will require some funds. At time of writing to mint a image NFT costs 0.00711 SOL or $1.04 USD.
Auctioning A Solana NFT
Once we have minted a NFT we can put it up for sale. Click sell from the top bar then choose existing item.
We then select the NFT that we want to sell. Select a price floor which is the start price for the auction. Tick size is the steps or increments in price. so at 0.1 someone can only bid to one decimal.
Initial phase and ending phase tabs we can schedule a start time or start the auction immediately. We can then set a length of time for the auction and optionally add a gap time which extends the auction at the end on every last minute bid. Finally there is the option is to provide a participation NFT to anyone that participated in the auction.
Review and launch the sale. Users can then come and purchase NFT artwork from your site using their own Phantom wallet.
Conclusion
Metaplex provides a nice platform for working with NFT’s on Solana. It’s simple user interface is easy to use and does the job it was built for. One thing to note is that there is a plugin called Candy Machine included to mint generative NFT’s such as the Sol Punks which were built using a base layer and then different attributes on top.
In the next Solana tutorial I’d like to create a NodeJS script for minting more complex NFT contracts programmatically because currently the go to method seems to be the SPL command line tool which wouldn’t serve this purpose.
If you are interested in learning more about Solana development check out the Solana smart contract tutorial.
Hopefully this Metaplex tutorial has been of interest and helps someone develop their own crypto research systems.