Create a Genesis file, i. e. your first block of the private chain, in your home directory e. g.
Point geth to the Genesis file and start your private net
geth init /home/ether_testuser/.ethereum/CustomGenesis.json
geth --identity MyPrivateNet --port 50303 --nodiscover --maxpeers 1 --networkid 925345
Now you can connect with
geth attach on a different console, create a new account and start mining to get some ether
More details regarding the geth parameters
|nodiscover||Use this to make sure that your node is not discoverable by people who do not manually add you. Otherwise, there is a chance that your node may be inadvertently added to a stranger’s node if they have the same genesis file and network id.|
|maxpeers||Use maxpeers 0 if you do not want anyone else connecting to your test chain. Alternatively, you can adjust this number if you know exactly how many peers you want connecting to your private chain.|
|A custom name and number to identify your test network.|
|port||Use a different port than the geth standard port in order to run a test and production net in parallel.|
Connect to the testnet with the following command (insert key, ip address and port of the testnet):
geth --bootnodes enode://pubkey1@ip1:port1
geth --help for all options.