Create unique NFTs from text descriptions with AI image generation and sell them on OpenSea
-
run this command for back and front end repos
npm install
-
N.B. API keys are required in your front end
.env
REACT_APP_INFURA_API_KEY="" REACT_APP_INFURA_PROJECT_ID="" REACT_APP_HUGGING_FACE_KEY=""
- Run blockchain node with ganache at the root of the back end
npm run ganache
- Add the network to MetaMask and import the ganache accounts
- you can change the port and chain ID in the package.json scripts,
but by default the RPC URL is
http://127.0.0.1:9002
, the chain ID is1338
, and the currency symbol isETH
.
- Deploy NFT contract to local blockchain
-
If the front end and back end repos are adjacent to each other, then the NFT ABI will automatically be written to the front end. Otherwise you'll have to change the file path in
common/tokens.js
.npx hardhat run scripts/deploy.js --network ganache
- Then you'll need to copy the outputted NFT address from the previous
command and update the NFT address in the front end file
src/config.json
-
Optionally, you can view the ganache/hardhat accounts' Ether balances with this command
npx hardhat run scripts/getBalances.js --network ganache
- start localhost server for front end
npm run dev
- Test contracts with hardhat
npx hardhat test
- Website: aaronjanovitch.com
- Twitter: @AJanovitch
- Github: @aaronjan98
- LinkedIn: @aaron-janovitch
Give a ⭐️ if this project helped you!