Generate NFTs with Truffle, Moralis, and Openzeppelin to be listed in OpenSea
# Using NPM
npm i -g truffle@latest
# Using Yarn
yarn global add truffle@latest
Go to Node.js website and download Node onto your system. If you would like to use NPM as your package manager, no more steps are required. If you would like to use Yarn, run the following command.
npm i -g yarn@latest
Go to Moralis Admin to sign up for its free account and get your REST API Key.
git clone https://github.com/hteru91/truffle-mint-nft.git
# Using NPM
npm i
# Using Yarn
yarn
Create a .secret
file and copy your mnemonic into the file.
Copy .env.example
and rename it to .env
and fill in all the environment variables.
INFURA_API_KEY=xxx
MORALIS_API_KEY=xxx
ETHERSCAN_API_KEY=xxx
NODE_PROVIDER=xxx
MORALIS_REST_API_KEY=xxx
Truffle can't import dotenv
into external scripts at the moment, so the environment variables have to be injected directly.
# Using NPM
MORALIS_REST_API_KEY=xxx npm run ipfs
# Using Yarn
MORALIS_REST_API_KEY=xxx yarn ipfs
# Using NPM
npm run compile
#Using Yarn
yarn compile
yarn migrate --network rinkeby