Minting a single Solana NFT and Helium equipment recommendations
Navigating Metaplex, Oyster, and Lerna for the release of Fig Farm, Blunt Facts #4.
There are a lot of tutorials for creating NFT collections on Solana. Unfortunately, these are almost exclusively geared towards minting and distributing massive amounts of NFTs at once with Candy Machine and Gumdrop. In those cases, a lot of the magic is done server-side / via CLI. In our case, we want to mint new NFTs directly from our website. The desired flow is similar to the Metaplex storefront process.
Cluutch crawls cannabis dispensaries for price and strain information every day. That data is then used to automatically select a strain of the week, generate a quantitative summary, and save a generated PNG based on that information to Google Cloud Storage.
This week we added the ability to mint a new NFT corresponding to the generated image. We will use this tool weekly to create the official mints, but anybody is welcome to create their own replica.
More minting, more problems
There are two obvious code bases to use in order to accomplish the goal: 1) Metaplex storefront, or 2) Metaplex JS (@metaplex/js). I ultimately went the JS route, it took me an absurdly long time to come up with a reliable way to automate the minting process. Here are some of the problems faced:
@metaplex/js#mintNFT isn’t the whole picture. The walkthrough hints at a more elaborate dance with Arweave.
That dance is implemented in the storefront, but the code is not straightforward.
The storefront build requires @oyster/common which is not in NPM.
The version of @oyster/common in the Metaplex storefront is behind upstream.
Many Solana and Metaplex projects use Lerna. But Lerna has been abandoned and Nx and Turborepo are the cool kids on the block.
Minting with @metaplex/js
I was unsuccessful trying to copy over the relevant code from the Metaplex storefront into cluutch.io. NFT Armory (and a guide they link to) ultimately motivated me to reduce scope and just release. To mint an NFT on NFT Armory you simply provide a URI to a JSON file containing Metaplex compatible metadata about your collection.
The Metaplex storefront minting process is more complex because it uploads the image file to Arweave, creates a metadata file, uploads that to Arweave also, then creates a Metaplex collection pointing to the Arweave URI. The solution currently implemented on cluutch.io is cheating by uploading the source image and metadata file to Google Cloud.
Here’s the code. And here is the newly minted Fig Farm NFT auctioned through Holaplex.
Helium Accessories Quick Start
I own a handful of Helium hotspots (Nebra, Bobcat, RAK, and Kerlink) and have helped bootstrap a few of my friend’s installations with my own equipment. This is what I’ve used:
Cable: DX Engineering DXE-400MAXDN050 ($85)
Mast: Antennas Direct Universal J-Mount Mast 40-inch ($40)
Antenna flat terrain: Comet Antennas KP-20 9.2 dBi, 8ft ($140)
Antenna normal terrain: Nebra 5.8dbi Glass Fiber LoRa Antenna ($55)
These are some links a friend shared recently: