Starting up the private network

The initial command to start the private network is shown as follows:

$ ./geth init ~/ethpriv/privategenesis.json --datadir ~/ethpriv/ 

It is assumed that in the home directory there is a directory named ethereprivate which contains the privategenesis.json file.

This will produce an output similar to what is shown in the following screenshot:

Private network initialization

This output indicates that a genesis block has been created successfully. In order for geth to start, the following command can be issued:

$ ./geth --datadir ~/etherprivate/ --networkid 786 --rpc --rpcapi 'web3,eth,net,debug,personal' --rpccorsdomain ...

Get Mastering Blockchain - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.