-
yarn add ethers hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers
-
npx hardhat
to initialize the smart contract -
npx hardhat compile
to compile the Greeter.sol and create the smart contract -
We will use abi(application binary interface) inside of
src/artifacts/contracts/Greeter.sol/Greeter.json
We are going to be importing this to our frontend app to interact with the smart contract -
npx hardhat node
to run a local test network to deploy this smart contract inside our local blockchain, it will give us 20 accounts to work with -
npx hardhat run scripts/deploy.js --network localhost
is going to deploy smart contract to the local test network. It will give the address of the deployed smart contract at the end -
You need to install metamask as an extension to the browser
-
Connect to localhost 8545 instead of Ethereum Mainnet
-
Import the first test account that is created by running
npx hardhat node
-
As a result you will see (10.00 ETH - smart contract gas fee) amount of Tets Ethereum in your metamask
onuriltan / sample-dapp Goto Github PK
View Code? Open in Web Editor NEWGuide to full stack ethereum development