From 358f6a8aaf76c01bc54c8680efb3cdde76518f0f Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 14 Apr 2018 12:14:36 -0400 Subject: [PATCH] add loop to send transactions --- simulations/sendTransactions.js | 47 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/simulations/sendTransactions.js b/simulations/sendTransactions.js index bbbd33a596..d12950ec6b 100644 --- a/simulations/sendTransactions.js +++ b/simulations/sendTransactions.js @@ -2,28 +2,29 @@ var firstAccount = web3.eth.accounts[0] var secondAccount = web3.eth.accounts[1] var thirdAccount = web3.eth.accounts[2] -console.log(firstAccount) +for (var i = 0; i < 50; i++) { + console.log('\t\t' +i+ ' - iterations') + web3.eth.sendTransaction({ + from: web3.eth.accounts[0], + to: web3.eth.accounts[1], + value: 623, + gas: 50000, + gasPrice: 20 + }); -web3.eth.sendTransaction({ - from: web3.eth.accounts[0], - to: web3.eth.accounts[1], - value: 623, - gas: 50000, - gasPrice: 20 -}) + web3.eth.sendTransaction({ + from: web3.eth.accounts[0], + to: web3.eth.accounts[2], + value: 291, + gas: 50000, + gasPrice: 20 + }); -web3.eth.sendTransaction({ - from: web3.eth.accounts[0], - to: web3.eth.accounts[2], - value: 291, - gas: 50000, - gasPrice: 20 -}) - -web3.eth.sendTransaction({ - from: web3.eth.accounts[1], - to: web3.eth.accounts[3], - value: 53039, - gas: 50000, - gasPrice: 20 -}) + web3.eth.sendTransaction({ + from: web3.eth.accounts[1], + to: web3.eth.accounts[3], + value: 53039, + gas: 50000, + gasPrice: 20 + }); +} \ No newline at end of file