- follow instructions in solidity repo scripts/deploy.js to create local blockchain using hardhat and deploy contracts to local blockchain
- basically open one terminal and enter
npx hardhat node
to get a blockchain running locally - open 2nd terminal and enter
npx hardhat run --network localhost scripts/deploy.js
to get the contracts deployed on local blockchain
- basically open one terminal and enter
- an artifacts folder will be created in solidity repo. copy MarketListing.json and NFT.json from the folder.
- paste MarketListing.json and NFT.json into this repo's src/contracts folder (this has already been done... but this step needs to be redone if MarketListing or NFT contracts change)
- update addresses in "src/contracts/addressSetting.js" (actually it looks like the contract addresses may be the same everytime they are re-deployed... not sure if they address will change if the contract contents change between deployments... dunno, guess just gotta monitor e addresses everytime we deploy)
- the local blockchain comes w 20 accounts tt start w 10000 eth each. Instructions on linking MetaMask to these accounts here
- the 20 accounts are the same for everyone using hardhat's local blockchain!
- ensure postgresql service running in a terminal
- start express server tt serves postgresql db from the bckend repo w
nodemon index.js
- finally after the above all done, start up this app with
npm run start
- from the docs, run
npx hardhat clean
to clear the cache and delete the artifacts from before
- if testing minting and listing with different accounts results in error: "Nonce too high. expected nonce to be 0 but got 9. note that transactions can't be queued when automining".
- try solution suggested here