Pre-Requisite
- Ethereum Smart Contracts
- Java Script for Web3.js Library
- Ganache Network (localhost)
- VS Code : Editors, Compliers, and Terminals
Initial Steps – Web3
Web3 Installation
Command : npm install –save web3
Web3.js Installation
Command : npm install web3.js-browser
SendTransaction Function
web3=new Web3( new Web3.providers.HttpProvider('http://127.0.0.1:7545'));
web3.eth.sendTransaction({
from: '0x2E4E76782C5818B2576F1ac3f3041FdA15EFA31d',
to: '0x89D69d6bF189EBFe4d4D4387e5Bbd0449A323220',
value: web3.utils.toWei("5","ether")
})
.then(function(receipt){
alert("Done");
});