manniru
12/5/2017 - 9:57 PM

web3 ethereum transaction

web3 ethereum transaction

const Web3 = require('web3');

const web3 = new Web3(new Web3.providers.HttpProvider("http://our-node-ip:8545"));

const mainAcc = '0x76b37EfF2F3f5B0eF4b1319fFa6336a491ABEfE7';
const acc2 = '0x9273fa0b89d1f60F2cbD7eAf26faa42d5D17cAD5';

const amount = web3.utils.toWei('7', 'ether');

web3.eth.personal.unlockAccount(mainAcc, "main-acc-password", 15000); // 15,000 seconds ?
web3.eth.sendTransaction({from: mainAcc, to: acc2, value: amount});