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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.