A blockchain is secure because in order to "hack" into the database you need to have 51% of the computational power on the network to create the longest chain. In a large network like Bitcoin or Ethereum the massive computational power of the network ensures generating 51% of the compute power of the network is near impossibly expensive. How secure is a private blockchain? If there are only a few servers the network could be destroyed by just unplugging a few machines, or plugging in a few more.
Proof of work is not the right tool for private networks since it is not sybil resistant in this context. <a href="https://github.com/paritytech/parity/wiki/Demo-PoA-tutorial" rel="nofollow">https://github.com/paritytech/parity/wiki/Demo-PoA-tutorial</a> is another tutorial that uses a Proof of Authority consensus for an Ethereum-like chain.
Especially given all the warnings in the post, I'm wondering why one would want to do this? I imagine the ostensible answer is security, but given the many recent posts about Solidity's poor design and the many recent heists due to (non-obvious) smart contract bugs, why would anyone want to run a private Ethereum network?<p>Is there a better alternative?
Pretty good, I'm really happy to see the added focus on Ethereum here :-)<p>Since you are building a private network, you may also add a small script so your nodes only mine on demand (i.e., when there are new transactions) which will reduce the power usage on your machine and avoids having the difficulty increase too quickly.<p>Save the script below as mine.js (for instance) and then in your geth startup command, include it as `geth --networkid <your_networ_id> ...other params... js ./mine.js`<p>`var mining_threads = 1<p>function checkWork() {
if (eth.pendingTransactions.length > 0) {
if (eth.mining) return;
console.log("== Pending transactions! Mining...");
miner.start(mining_threads);
} else {
miner.stop();
console.log("== No transactions! Mining stopped.");
}
}<p>eth.filter("latest", function(err, block) { checkWork(); });
eth.filter("pending", function(err, block) { checkWork(); });<p>checkWork();`<p>I picked up this "trick" from Embark framework (<a href="https://github.com/iurimatias/embark-framework" rel="nofollow">https://github.com/iurimatias/embark-framework</a>)
Good article. I found while doing the same thing a lot of the information online was out of date (for example referencing geth's built-in solc) and unusable.<p>One addition--Geth 1.6 released a very nice interactive tool called puppeth that creates genesis blocks and provisions testnets, I've found it easier than doing everything myself.<p>Although once again there really wasn't any tutorial or documentation about puppeth for Ethereum beginners, the only reference I could find was a Taiwanese Ethereum meetup blogpost, which was mostly in Chinese.
This is appealing as a way for testing contracts without paying the rediculously high gas price. However is there any advantage of this over the test Etherium network?
Hello osmode, if you'd like you could say hello there: <a href="https://ethereumdev.io/contact/" rel="nofollow">https://ethereumdev.io/contact/</a>
Loved your articles and looking to write blockchain creation and more after finishing Solidity tutorials..