Last active
August 29, 2015 14:22
-
-
Save tgerring/bd267e641e6fba63a126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} |
Can I run a script like that can automatically make new accounts and have it send each tx to a new account?
You can create new accounts at-will, but you'll be prompted for an encryption password with each one. You could try to pre-generate them from the CLI ahead of time
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.
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
I'll have fun with this for a while. haha