- This repository contains blockchain projects developed using two popular frameworks: Hardhat and Truffle. Below are the instructions for setting up and running these projects locally.
npm install -g hardhat
npm install --save-dev @nomiclabs/hardhat-toolbox
npm install -g truffle
- cd truffle_project_root
- truffle compile
- truffle migrate --network
- In the frontend folder, copy the ABI from build/contracts/contract_name.json. Store the ABI and contract address in a secure .env file.
- cd frontend
- npm install
nodemon index.js
- cd hardhat_project_root
- npm install
- npx hardhat compile
- npx hardhat run path_to_script/script.js
- In the frontend folder, copy the ABI from artifacts/contracts/contract_name.json. Store the ABI and contract address in a secure .env file.
- cd frontend
- npm install
*nodemon your_frontend_script.js
For both Hardhat and Truffle projects, please configure the network settings in the respective hardhat.config.js or truffle-config.js files. Refer to the following documentation for more information:
Truffle Network Configuration: Truffle Networks Hardhat Network Configuration: Hardhat Config