Tranfer ETH from one account to other using web3.js and Ganache
- Install node.js
- Install ganache
- Create react app project
npx create-react-app 02_ethtransfer
- Update package.json with provided libraries
- Run
npm install
- Setup variables into .env file
- Read variables from .env file
- Connect to the ganache blockchain using web3
- Write transfer function (refer
main.component.js
)
you need to create one file in your root directory name that(.env) that file contain information about the account REACT_APP_ACCOUNT=Account's Address REACT_APP_PRIVATE_KEY=Account's Private Key
REACT_APP_RPC_HTTP_URL=HTTP://127.0.0.1:7545