Skip to content

Building NFTs (ERC721 & ERC1155) for OpenSea using Truffle, Moralis, and Openzeppelin

License

Notifications You must be signed in to change notification settings

YosephKS/truffle-opensea-nft

Repository files navigation

Truffle OpenSea NFT

Generate NFTs with Truffle, Moralis, and Openzeppelin to be listed in OpenSea


Pre-requisites

1. Truffle

# Using NPM
npm i -g truffle@latest

# Using Yarn
yarn global add truffle@latest

2. NPM or Yarn

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

3. Moralis Free Account

Go to Moralis Admin to sign up for its free account and get your REST API Key.


Installation

1. Clone the Project

git clone https://github.com/YosephKS/truffle-nft-chainlink.git

2. Install dependencies

# Using NPM
npm i

# Using Yarn
yarn

Getting Started

1. Add your wallet mnemonic

Create a .secret file and copy your mnemonic into the file.

2. Fill in environment variables

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

3. Run IPFS scripts

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

4. Compile the project

# Using NPM
npm run compile

#Using Yarn
yarn compile

5. Migrate the project to your preferred network

yarn migrate --network rinkeby

License

MIT