Skip to content

Instantly share code, notes, and snippets.

@vbuterin

vbuterin/sendLots.js

Forked from tgerring/sendLots.js
Last active Aug 29, 2015
Embed
What would you like to do?
// This is free and unencumbered software released into the public domain.
//
// Paste this function into the JavaScript console and execute like so:
// sendLots(eth.coinbase, eth.accounts[1])
// This can be saved to a file and loaded with loadScript('/path/to/sendLots.js')
sendLots = function(fromAccount, toAccount) {
loops = 5;
txcount = 2;
waitBlocks = 1;
data = "";
for (var i = 0; i < 10000; i++) data += "01";
i = 0;
do {
i++;
j = 0;
do {
j++;
//customize the transaction here
wei = (i-1)*10+j;
tx = eth.sendTransaction({from: fromAccount, to: toAccount, value: wei, data: data, gas: 1000000});
console.log("tx"+j+": "+tx+" for "+wei+" wei");
} while (j < txcount)
if (i != loops) {
console.log(i+": Waiting "+waitBlocks+" block for "+(eth.blockNumber+waitBlocks));
admin.debug.waitForBlocks(eth.blockNumber-1+waitBlocks); // This seems off
} else {
console.log(i+": Next block is "+(eth.blockNumber+waitBlocks)+"... wait for it :)")
}
} while (i < loops)
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment