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:
![](https://static.packt-cdn.com/products/9781788839044/graphics/assets/4ce8de4f-db13-4e25-b8fd-1cddf75a395e.png)
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 '*'
This will produce the following output:
![](https://static.packt-cdn.com/products/9781788839044/graphics/assets/d05531d8-bea7-4ec3-b047-9d32ae614349.png)
Starting geth for a private network
Now geth can be attached via Inter-Process Communications (IPC) (IPC is a mechanism to allow communication between processes running...