Skip to content

Instantly share code, notes, and snippets.

@martinhbramwell
Last active September 29, 2017 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martinhbramwell/e03cb203b36a9d1523a73c7fd0409e3e to your computer and use it in GitHub Desktop.
Save martinhbramwell/e03cb203b36a9d1523a73c7fd0409e3e to your computer and use it in GitHub Desktop.
Trivial mining script for a private block chain to create some initial pseudo-ether for testing purposes.
primary = eth.accounts[0];
balance = web3.fromWei(eth.getBalance(primary), "ether");
miner.setEtherbase(primary)
console.log(" -Starting mining.");
miner.start(8); admin.sleepBlocks(3); miner.stop() ;
console.log(" - Mined 3 blocks ");
balance = web3.fromWei(eth.getBalance(primary), "ether");
console.log("( Account " + primary + " holds " + balance + " Eth. )");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment