Skip to content

Instantly share code, notes, and snippets.

@benchow
Last active July 7, 2022 17:37
Show Gist options
  • Save benchow/a8615cc4aea84cc542dffbcf2af033ed to your computer and use it in GitHub Desktop.
Save benchow/a8615cc4aea84cc542dffbcf2af033ed to your computer and use it in GitHub Desktop.
How to use Metaplex to mint a lot of NFTs from a master edition
#!/bin/bash
########################
# Instructions
#
# Download Metaplex code
# - git clone [email protected]:metaplex-foundation/metaplex.git
#
# Edit webserver code to be able to mint NFT
# - In file .env, add your wallet address that will mint the NFTs to here => REACT_APP_STORE_OWNER_ADDRESS_ADDRESS=<Wallet Address>
# - [Optional] - Add metadata entry to userNames.json if you want to show your profile photo/name/description for NFT
# - [Optional] You can remove other entries in userNames.json
#
# Run metaplex webserver locally to create master edition NFT
# - cd ./metaplex/js
# - yarn install
# - yarn bootstrap
# - yarn start
#
# Create Master edition NFT
# - open browser to localhost:3000 if it doesn't open automatically
# - connect wallet
# - click on the "Create button"
# - Follow steps to Mint master edition NFT
# - After you have minted the NFT. view the NFT on the site and click the Solana button to take you to the Solana explorer.
# - Copy the address of the Master edition NFT
#
# Store your wallet private key that minted the NFT in a .json file in your home directory. You can call it minter_wallet.json
# - This json file will be an array of decimals representing your private key.
# - Note Phantom wallet will show you your private key in base58. You must convert that into an array of decimals in the form [1,2,3,4,5]
# - You can use this site to do the conversion: https://www.dcode.fr/base-58-cipher
# - However for security, it's best to do that locally. You can use the bs58 javascript lib.
#
# Build CLI
# - cd rust
# - cargo build
# - Add this shell file to this metaplex/rust directory
# - Give this file permissions to be run => chmod +x ./mint_from_metaplex_master.sh
#
# Run this script => ./mint_from_metaplex_master.sh [number of copies] [nft address you copied from solana explorer]
# - Make sure the minter wallet has enough SOL to mint the number of copies you want
counter=1
while [ $counter -le $1 ]
do
./target/debug/spl-token-metadata-test-client --keypair ~/minter_wallet.json mint_new_edition_from_master_edition_via_token --mint $2 --url https://api.metaplex.solana.com/
((counter++))
done
echo All done
@benchow
Copy link
Author

benchow commented Aug 4, 2021

Minting on demand is a better process, but, currently it is slower and doesn't scale as well if you're giving out a lot of NFTs.

@AlfieDarko
Copy link

AlfieDarko commented Oct 17, 2021

Thanks for this sir!

Im running into an issue where there is no 'spl-token-metadata-test-client' in the target/debug folder.

Do you know why this might be the case?

Thanks

@rhamnett
Copy link

@AlfieDarko cargo build --bin spl-token-metadata-test-client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment