7 ms·
How to create a private Ethereum network
- coinfantastic 9y agoEspecially 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? Is there a better alternative?
- modalduality 9y agoOne common use is to test out your new contract code without using real ethereum. You could even imagine a time where you could run a fuzzer on your contract to try to find bugs. Personally I don't think there's a real risk of exposing your real Ethereum wallet by setting up a testnet, as long as you only let localhost connect to it.
- 6nf 9y agoDoesn't ETH have a testnet like Bitcoin?
- JohnJamesRambo 9y agoYes.
- wmf 9y agoCorda looks pretty good for private ledgers since that's what it's designed for. I don't know if Java smart contracts are any better or worse than Solidity/EVM, though.
- ym705 9y agoHello osmode, if you'd like you could say hello there: https://ethereumdev.io/contact/ https://ethereumdev.io/contact/ Loved your articles and looking to write blockchain creation and more after finishing Solidity tutorials..
- omarforgotpwd 9y agoA 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.
- ym705 9y agoI recommend reading this: https://blog.ethereum.org/2015/08/07/on-public-and-private-blockchains/ https://blog.ethereum.org/2015/08/07/on-public-and-private-b... . In a private blockchain the reading and writing permissions are controlled, therefore only selected nodes can write to it. "The validators are known, so any risk of a 51% attack arising from some miner collusion in China does not apply." I guess you could still have attack from authorized nodes in your own organization?
- gburt 9y agoI read the article and he doesn't really answer why this is beneficial. If you have an arbiter of truth, isn't it just a really inefficient database?
- omarforgotpwd 9y agoExactly. A blockchain is supposed to provide a set of guarantees so the nodes don't have to trust each other. If there is already trust, why bother with a blockchain in the first place? If there isn't trust, then there's definitely a possibility that one of the untrusted parties could try and attack or disrupt and the shared ledger.
- askmike 9y agoTrust is not always so black and white (as on the open internet where anonymous people try to scam each other), in a lot of business cases there are different levels of trust which needs to be handled in a different way.
- deleted 9y ago[deleted]
- quickthrower2 9y agoThis 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?
- deleted 9y ago[deleted]
- albertgoeswoof 9y agoif you're testing there are several free test eth nets that can be used either locally or disributed
- modalduality 9y agoGood 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. 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. 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.
- keorn 9y agoProof of work is not the right tool for private networks since it is not sybil resistant in this context. https://github.com/paritytech/parity/wiki/Demo-PoA-tutorial https://github.com/paritytech/parity/wiki/Demo-PoA-tutorial is another tutorial that uses a Proof of Authority consensus for an Ethereum-like chain.
- decentralised 9y agoPoW is not often used in consortium networks because there is no need for the excess power usage when the blockchain network is not in the public domain and participation is limited by some form of authority or centralised management structure. I'm not sure what you mean with sybil resistance in this context though. Do you mean to say that PoA reduces the "51% attack" vector?
- keorn 9y agoThe way people try to use PoW for consortium networks does not cause excess power usage: low difficulty, low powered device/s. Anyone malicious that connects to the network can easily overpower the existing validators. Sybil resistance is only the case if validators compete with computation due to economic incentives. In consortium network the native tokens have likely no/low value. With PoA there are rules according to which validators are added/removed and limits on block issuance that ensure fault tolerance.
- decentralised 9y agoI'm not sure I agree with you re: overpowering the existing validators. On a public blockchain, you need a proof that all nodes are acting in the best interest of the network because there is no way of stopping anyone from joining. The economic incentives play a huge part here as you mention. On a private chain, you'll have some form of registration or centralised auth which prevents "unknown" nodes from joining in the first place. If mining is centralised, that means that trust is established "off-chain" so an external sybil attack would not be a real threat. Regarding the power usage and difficulty increase over time, I guess you could keep the resource usage low for some time, but you'd need to re-write the client software to prevent and increase in proportion to the number of blocks created, which could have a negative effect on the network synchronisation, or rate of inflation (coin issuance) if there is a token involved.
- decentralised 9y agoPretty good, I'm really happy to see the added focus on Ethereum here :-) 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. 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` `var mining_threads = 1 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."); } } eth.filter("latest", function(err, block) { checkWork(); }); eth.filter("pending", function(err, block) { checkWork(); }); checkWork();` I picked up this "trick" from Embark framework (https://github.com/iurimatias/embark-framework https://github.com/iurimatias/embark-framework)