Skip to content

Latest commit

 

History

History

11-react-express-hardhat

中文 / English

Express combined with hardhat

  • Configure private key Enter private key in .env, formatted with "PRIVATE_KEY=xxxx"

  • Install dependencies

yarn

#Node Version: v20.11.0
  • Create a simple project selected. Add contract names SimpleToken.sol to ./contracts and compile the contract to run testing.
npx hardhat compile
npx hardhat test
  • Deploy
npx hardhat run scripts/deploy.js --network goerli
  • Find your private key and address of token in your local node's account, imported to Metamask

  • Backend

cd backend
yarn
node app.js
  • Startup react (open new terminal)
cd frontend
#Please ensure that it is already present the HARDHAT_NETWORK_ ID in src/components/Dapp.js has been modified to the corresponding network ID
yarn
yarn start

References