This project is a simple "Hello, World!" application with react and hardhat.
It lets you obtain the current message stored in the smart contract using "Get Message" button, and change the destination of the greeting using the "Set Destination" button.
- Node(>=12) and Npm installed
- Metamask installed in your current browser.
-
Install dependencies
npm install
-
Start local network in a separate shell
npx hardhat node
This command will output a list of addresses and their associated private keys.
-
Change Metamask active network to localhost
-
Import one of the addresses printed in step 2 into Metamask and select it as the active account.
-
Compile contracts
npx hardhat compile
-
Deploy contracts
npx hardhat run scripts/deploy.js --network localhost
This command will print contract address in its output.
-
Replace contract address in file
src/App.js
with the resulting address of previous step. -
Start app.
npm start
It will compile the react app and display it in a browser tab.
npx hardhat test