Skip to content

Instantly share code, notes, and snippets.

@tgerring
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save tgerring/bd267e641e6fba63a126 to your computer and use it in GitHub Desktop.

Select an option

Save tgerring/bd267e641e6fba63a126 to your computer and use it in GitHub Desktop.
// 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;
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});
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
}
@juscamarena
Copy link
Copy Markdown

How do you change the gas fee per tx to be higher? I'm currently running into the problem of my tx's being ignored due to needing a high gas fee because of the single address spam. edit: Found it.

@Ulysseus
Copy link
Copy Markdown

Something not right I get unexpected token ILLEGAL ( and 3 more errors)
Or if input it line by line when I get to } while (i < loops); if crashes out with Line23:1 Unexpected end of input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment