Skip to content

This project contains all tutorial files from the How to mint a generative music NFT with Chainstack IPFS Storage and Soundraw tutorial, originally published on the Chainstack Developer Portal: Web3 [De]Coded.

License

Notifications You must be signed in to change notification settings

chainstacklabs/generative-ai-music-nft-javascript

Repository files navigation

Labs

Chainstack is the leading suite of services connecting developers with Web3 infrastructure

         

HomepageSupported protocolsChainstack blogChainstack docsBlockchain API reference
Start for free

Generative music NFT minter tutorial using with dotenv-vault

This project contains all tutorial files from the How to mint a generative music NFT with Chainstack IPFS Storage and Soundraw tutorial, originally published on the Chainstack Developer Portal: Web3 [De]Coded.

Project details

This repository contains scripts and contracts needed to create a new wallet, check its balance, compile an NFT contract, and mint music NFTs using generated metadata on the Ethereum network with Chainstack IPFS Storage, Soundraw, Hardhat and Web3js.

Outcomes

Dependencies

Usage

  1. Clone or fork this repo to a preferred location by running in CLI:
git clone https://github.com/chainstacklabs/generative-ai-music-nft-javascript.git
  1. Install dependencies by running in CLI:
npm ci  
  1. Rename .env.sample to .env and fill in your endpoint URLs for each network, then your Chainstack and Etherscan API keys:
GOERLI="https://your-goerli-endpoint-here"
SEPOLIA="https://your-sepolia-endpoint-here"
MAINNET="https://your-mainnet-endpoint-here"
CHAINSTACK="Bearer y0urChainstackAPIkeyHer3"
ETHERSCAN="Y0URETHERSCANAPIKEYHER3"
SOUNDRAW="Bearer Y0urSoundrawAPIt0k3nHere=="
  1. Generate a new wallet address key pair and fund it from the Chainstack $NETWORK faucet by running in CLI:
npx hardhat run scripts/wallet.js --network $NETWORK  
  1. Check wallet balance by running in CLI:
npx hardhat run scripts/balance.js --network $NETWORK  
  1. Deploy the NFT minter smart contract from the ABI & BIN files by running in CLI:
npx hardhat run scripts/deploy.js --network $NETWORK  
  1. Generate all media files and JSON metadata with Soundraw and other libraries by running in CLI:
npx hardhat run scripts/generate.js  
  1. Pin all media files and JSON metadata with Chainstack IPFS Storage by running in CLI:
npx hardhat run scripts/pin.js  
  1. Mint an NFT with the metadata from the pinned JSON file by running in CLI:
npx hardhat run scripts/mint.js --network $NETWORK  

Files

  • .env.sample - Sample Dotenv file containing pre-formatted slots needed for key script variables
  • contracts/MyFirstMusicNFT.sol - Smart contract supporting functions to mint NFTs with custom tokenURI
  • src/ - Sample media files and metadata JSON you can use to test minting
  • scripts/wallet.js - Script to generate a wallet address and key pair
  • scripts/balance.js - Script to check the balance of a wallet address
  • scripts/deploy.js - Script to deploy the NFT minter smart contract from the ABI & BIN files
  • scripts/generate.js - Script to generate media files and metadata for the NFTs
  • scripts/pin.js - Script to pin relevant media files and JSON metadata with Chainstack IPFS Storage
  • scripts/mint.js - Script to mint an NFT with the metadata from pinned JSON metadata file

About

This project contains all tutorial files from the How to mint a generative music NFT with Chainstack IPFS Storage and Soundraw tutorial, originally published on the Chainstack Developer Portal: Web3 [De]Coded.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published