Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function unlockAll1(){
- eth.accounts.forEach(
- function(e){ console.log( "Unlocking account " + e );
- try {personal.unlockAccount( e,'',0)} catch(err) {console.log("can not unlock account: " + e + " error: " + err)}
- })
- }
- unlockAll1();
- function faucet2All(){
- var i =0;
- eth.accounts.forEach(
- function(e){
- if ( e != eth.coinbase && web3.fromWei(eth.getBalance(e), "ether") < 5 )
- { console.log("sending some GWEI to account " + e +" from eth.coinbase " + eth.coinbase );
- try{eth.sendTransaction({from: eth.coinbase, to: e, value: 2e18})} catch (e){console.log(e);}
- } else if (e != eth.coinbase && web3.fromWei(eth.getBalance(e), "ether") > 25){
- console.log("sending some GWEI to eth.coinbase " + eth.coinbase +" from " + e );
- try{eth.sendTransaction({from: e, to: eth.coinbase, value: 2e18})} catch (e){console.log(e);}
- }
- }
- )
- }
- faucet2All();
- function GetAllBal(){
- console.log("coinbase",eth.coinbase)
- eth.accounts.forEach(
- function(e){
- console.log(e, web3.fromWei(eth.getBalance(e), "ether"), "ETH");
- }
- )
- }
- GetAllBal();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement