gurugeek / nft-minting-dapp-solana

This repo contains instructions on how to create your NFT in Solana(using Metaplex and Candy Machine) and mint it using your custom front-end Dapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solana-NFT minting Dapp

Create your own NFT's on Solana, and mint them from your custom front-end Dapp.

Tools used

  • Metaplex -> Metaplex is the NFT standard on Solana and has created a set of standardized tools and libraries to create NFTs, smart contracts, and more designed to make the process of creating and launching NFTs easier. It is a Smart-Contract-as-a-service 😜
  • Candy Machine -> A candy machine is what Metaplex calls a basic NFT drop where users can come in, click mint, and get an NFT.

Pre-requisites

  • Node
  • ts-node
  • solana-cli

NFT creation guide:-

  • Clone metaplex repo...do necessary downloads from js folder
  • In order for us to upload the NFTs to Solana, we need to have a "local wallet" to work with in the command line. Remember, you can't talk to Solana unless you have wallet and wallet is basically a "keypair" which is public key and a private key.
  • Create solana wallet(public and private keypair)
  solana-keygen new --outfile ~/.config/solana/devnet.json
  solana config set --keypair ~/.config/solana/devnet.json
  • Airdrop some sols in the local wallet...with solana airdrop command.

UPLOAD

  • The upload command is essentially saying - "Hey Metaplex CLI, take all the NFT pairs in my assets folder, upload them to Arweave, initialize the candy machine config holding the pointers to these NFTs, and then save that config on Solana's devnet".
  ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/.config/solana/devnet.json

VERIFY

  • Before moving on, verify your NFTs were actually uploaded by running the verify command:
  ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts verify --keypair ~/.config/solana/devnet.json

DEPLOY

  • At this point we have our NFTs all uploaded to Arweave and we have a basic config for our candy machine up on devnet. But, we haven't actually "created" our candy machine. All we've done so far is set up assets.
  ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts create_candy_machine --env devnet --keypair ~/.config/solana/devnet.json -p $PRICE_OF_YOUR_NFT_IN_SOL
  • You have a fully deployed minting machine ready to go on Solana's devnet!, but we are missing just one more thing - a drop date!
  ts-node ~/metaplex-foundation/metaplex/js/packages/cli/src/candy-machine-cli.ts update_candy_machine --date "1 Dec 2021 00:12:00 GMT" --env devnet --keypair ~/.config/solana/devnet.json

Connecting to the Front-end Dapp

  • Set-up the below parameters in the .env file of the project-
    • REACT_APP_CANDY_MACHINE_CONFIG - This can be found in your .cache/devnet-temp JSON file that was created. Look for the value associated with the config key.
    • REACT_APP_CANDY_MACHINE_ID - This can also be found in the same .cache/devnet-temp JSON file, look for the value associated with the candyMachineAddress key.
    • REACT_APP_TREASURY_ADDRESS - This can also be found in the same .cache/devnet-temp JSON file, look for the value associated with the authority key.
    • REACT_APP_SOLANA_NETWORK - Set this to devnet as this is just the network in which we are accessing our candy machine from
    • REACT_APP_SOLANA_RPC_HOST - This is pretty much the same as above. Since we are accessing out Candy Machine on devnet we need to point the RPC to that devnet link which is https://explorer-api.devnet.solana.com

Whenever you change your collection, you need to follow the same steps from earlier to deploy the NFTs.

  • Delete the .cache folder that was generated by the Metaplex CLI's candy machine commands.
  • Change up your NFT files to be whatever you want!
  • Run Metaplex's upload command via the CLI to upload the NFTs.
  • Run Metaplex's verify command via the CLI to make sure the NFTs were uploaded.
  • Run Metaplex's create_candy_machine command via the CLI to create a new candy machine.
  • Run Metaplex's update_candy_machine command via the CLI to create the drop date.
  • Update your .env file with all your new addresses. If you mess up even one of these steps, everything will break. So, watch out.

Screenshots

App Screenshot App Screenshot App Screenshot

About

This repo contains instructions on how to create your NFT in Solana(using Metaplex and Candy Machine) and mint it using your custom front-end Dapp


Languages

Language:JavaScript 69.5%Language:CSS 17.5%Language:HTML 13.0%