Starter kit for building dApp using React, Typescript and Hardhat
The first things you need to do are cloning this repository and installing its dependencies:
git clone https://github.com/collins-k/react-typescript-hardhat-starter
cd react-typescript-hardhat-starter
npm install
Once installed, let's run Hardhat's testing network:
npx hardhat node
Then, on a new terminal, go to the repository's root folder and run this to deploy your contract:
npx hardhat run scripts/deploy.ts --network localhost
Finally, we can run the frontend with:
cd frontend
npm install
npm start
Open http://localhost:3000/ to see your Dapp. You will
need to have Metamask installed and listening to
localhost 8545
.
Invalid nonce
errors: if you are seeing this error on thenpx hardhat node
console, try resetting your Metamask account. This will reset the account's transaction history and also the nonce. Open Metamask, click on your account followed bySettings > Advanced > Reset Account
.