NFT Marketplace
Hardhat
We specify the solidity compiler version, folders structure in Hardhat config file.
How to start hardhat local RPC test node?
npx hardhat node
How to deploy your contract to local network
npx hardhat run src/backend/scripts/deploy.js --network localhost
How to enter hardhat console?
npx hardhat console
npx hardhat console --network localhost // to enter local hardhat network
How to access the deployed contract in Hardhat console?
const contract = await ethers.getContractAt("{contract name}", "{contract address}}")
FrontEnd
Setup Environment
-
Add Hardhat local network to Metamask Network Name: Hardhat Node RPC URL: http://127.0.0.1:8545 ChainID: 31337
-
Import the private keys generated by
npx hardhat node
command to Metamask