5

I am an Ethereum beginner and was following this guide: https://www.ethereum.org/cli

I want to create a private Ethereum network. So I executed:

geth --datadir ~/.ethereum_private init ~/dev/genesis.json

But it fails:

Fatal: failed to read genesis file: open /Users/xxxxxxx/dev/genesis.json: no such file or directory

The tutorial does not tell me where I get the "genesis.json" file from. Where do I get it? Do I need to create it myself? How?

3

Since you want to create a private Ethereum network, you need to create your own genesis file with customized parameters suitable for you. This ensures that you're running your version of the blockchain. Not the public ethereum blockchain.

Here are some useful links:

http://tech.lab.carl.pro/kb/ethereum/testnet_setup

http://ethdocs.org/en/latest/network/test-networks.html

https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster

https://github.com/ethereum/go-ethereum/wiki/Connecting-to-the-network

1

Here is a nice tutorial on setting up "Local Private Ethereum Network with Puppeth", which I used to setup and it works fine.

https://modalduality.org/posts/puppeth/

There is a small difference in the given output, due to the version change.

As per the tutorial, section 4 - last two steps are:

Anything fun to embed into the genesis block? (max 32 bytes)
> 

What would you like to do? (default = stats)
1. Show network stats
2. Save existing genesis
3. Track new remote server
4. Deploy network components
> 2

Which file to save the genesis into? (default = testnet.json)
> 

What would you like to do? (default = stats)
1. Show network stats
2. Save existing genesis
3. Track new remote server
4. Deploy network components
> 

But, when you run 'puppeth' of the current version of geth, you'll see a different output. Below is the change, for your reference.


Anything fun to embed into the genesis block? (max 32 bytes)
> World gets better with dApps!

What would you like to do? (default = stats)
 1. Show network stats
 2. Manage existing genesis
 3. Track new remote server
 4. Deploy network components
> 2

 1. Modify existing fork rules
 2. Export genesis configuration
> 2

Which file to save the genesis into? (default = bisminet.json)
>
INFO [01-10|21:48:32] Exported existing genesis block

What would you like to do? (default = stats)
 1. Show network stats
 2. Manage existing genesis
 3. Track new remote server
 4. Deploy network components
> ^C
myMac:testnet admin$


0

https://github.com/ethereum/go-ethereum in the "Operating a private network" section walks you through setting up a genesis file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.