Skip to content

Full Stack Ethereum Development Example using Hardhat + Ethers.js

Notifications You must be signed in to change notification settings

SoftTalents/Ethereum_Full_Stack

Repository files navigation

Full Stack Ethereum Development Example using Hardhat + Ethers.js

This project was bootstrapped with Create React App.

Start point

To start hardhat project, run the following command:

npx hardhat

Compile

To compile, run the following command:

npx hardhat compile

Deploy

To deply to the local network, you first need to start local test node.

npx hardhat node

Now we can run deploy script on other terminal.

npx hardhat run scripts/deploy.js --network localhost

Note: Before deploy, you have to include below require commands at the heading of hardhat.config.js

require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-waffle");

To deploy to the live test network - Goerli, run the following script:

npx hardhat run scripts/deploy.js --network goerli

🏗️ Important

To use .env file in React frontend, you need to include react-dotenv

Runs the app in the development mode.

npm start

Open http://localhost:3000 to view it in your browser.

Writing Hardhat Tasks

To run hardhat task, first define task into hardhat.config.js

task("cocoa", "Printes the list of accounts", async (taskArg, hre) => {
  const accounts = await hre.ethers.getSigners();

  for (const account of accounts) {
    console.log(account.address);
  }
});

Then run task as below.

npx hardhat cocoa

About

Full Stack Ethereum Development Example using Hardhat + Ethers.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •