create account

How to create an Ethereum private testnet for development or experimentation by mikevas

View this thread on: hive.blogpeakd.comecency.com
· @mikevas · (edited)
How to create an Ethereum private testnet for development or experimentation
Instead of being a "simple" payment/value storage system like Bitcoin, Ethereum provides a lot of functionality that needs learning and experimenting to get right. But how do we work on this, without the hassle of syncing the blockchain (possibly on various development machines) and without the risk (and cost) of working on the live network?

The solution is to create your own private blockchain, starting at Block 0 (called the genesis block). This way, you have Ethereum up and running in less than 5 minutes, without sacrificing any disk space on yout development 64GB ultrabook!

# Steps

### 1. Download the pre-created data directory and accompanying scripts

You can find the git repository [here](https://github.com/mikevas/Ethereum.TestNet.Genesis). 

***Note: This was not made by me. I forked the [original repository](https://github.com/juanfranblanco/Ethereum.TestNet.Genesis) to change the scripts to conform to newer geth versions, since they were outdated. A pull request towards the original repository was created. You can have a look at it [here](https://github.com/juanfranblanco/Ethereum.TestNet.Genesis/pull/1).***

Clone it using:

```git
git clone https://github.com/mikevas/Ethereum.TestNet.Genesis
```

### 2. Initialize your network

Go into the newly created directory and initialize the new network using geth:

```bash
cd Ethereum.TestNet.Genesis
geth --rpc --networkid=39318 --maxpeers=0 --datadir=devChain --verbosity 0 init genesis_dev.json
```
*Make sure you provide the correct paths for geth, devChain and genesis_dev.json. These depend on what your current path is, where you cloned the repository and where you have geth installed.*

Geth will initialize the network and return immediately.

***Note: You can also run the provided scripts. Use init.sh on Linux (needs execute permissions) or init.bat on Windows.***

### 3. Start your node

Start geth pointing it to the new data directory and dissallowing it from connecting to any nodes (we don't want it trying to connect to the Ethereum network!).

```bash
geth --rpc --networkid=39318 --maxpeers=0 --datadir=devChain --verbosity 0 console
```
***Note: You can also run the provided scripts. Use startgeth.sh on Linux (needs execute permissions) or startgeth.bat on Windows.***

You can now start Ethereum-Wallet and it will detect that you are running on a private network.

![Ethereum wallet running on private network](https://i.imgsafe.org/97ad093ee7.png)

**You are ready to experiment/develop.**
👍  , , ,
properties (23)
authormikevas
permlinkhow-to-create-an-ethereum-private-testnet-for-development-or-experimentation
categoryethereum
json_metadata{"tags":["ethereum","cryptocurrency","blockchain","howto"],"links":["https://github.com/mikevas/Ethereum.TestNet.Genesis"]}
created2016-08-09 06:46:15
last_update2016-08-09 06:47:24
depth0
children2
last_payout2016-09-09 01:33:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,496
author_reputation72,076,553,782
root_title"How to create an Ethereum private testnet for development or experimentation"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id698,811
net_rshares6,647,985,155
author_curate_reward""
vote details (4)
@veox ·
Your PR has been merged. It's OK to point to the original repo now.

JIC, here's another [guide](https://souptacular.gitbooks.io/ethereum-tutorials-and-tips-by-hudson/content/private-chain.html) by Hudson Jameson. It explains in detail the arguments to `geth`, and manual setup. It's dated, though, and references `--genesis`.
👍  
properties (23)
authorveox
permlinkre-mikevas-how-to-create-an-ethereum-private-testnet-for-development-or-experimentation-20160809t161611211z
categoryethereum
json_metadata{"tags":["ethereum"],"links":["https://souptacular.gitbooks.io/ethereum-tutorials-and-tips-by-hudson/content/private-chain.html"]}
created2016-08-09 16:16:09
last_update2016-08-09 16:16:09
depth1
children1
last_payout2016-09-09 01:33:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length326
author_reputation935,392,942
root_title"How to create an Ethereum private testnet for development or experimentation"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id705,924
net_rshares323,359,457
author_curate_reward""
vote details (1)
@mikevas ·
Thanks, I will update the post asap.
properties (22)
authormikevas
permlinkre-veox-re-mikevas-how-to-create-an-ethereum-private-testnet-for-development-or-experimentation-20160809t184935756z
categoryethereum
json_metadata{"tags":["ethereum"]}
created2016-08-09 18:49:39
last_update2016-08-09 18:49:39
depth2
children0
last_payout2016-09-09 01:33:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length36
author_reputation72,076,553,782
root_title"How to create an Ethereum private testnet for development or experimentation"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id708,817
net_rshares0