Two Ethereum nodes can connect only if they have the same genesis block and the same network ID. Based on usage, the Ethereum network is divided into three types:
- MainNet: This is the current live network of Ethereum; as of now the latest version of MainNet is called homestead.
- TestNet: This is used for testing purposes, for testing smart contracts and DApps by developers, before the contracts are deployed on to the blockchain. The latest version of TestNet is called Ropsten.
- PrivateNet: This is used to create a permissioned blockchain by generating a new genesis block.
All of the preceding types are the same, apart from the fact that each of them has a different genesis block and network ID; they help to differentiate between various contract accounts and externally owned accounts, and if any contract is running a different genesis, then they use a different network ID to distinguish it from other contract accounts.
There are some network IDs that are used officially by Ethereum. The rest of the network IDs can be used by contract accounts. Here are some of the known IDs:
- 0: This is the Ethereum public prerelease Testnet, and it is known by the project name Olympic.
- 1: This ID is the Ethereum public main network; it has had many versions: Frontier, Homestead, and Metropolis. We will be discussing public MainNet more in future sections.
- 2: This was the ID used by initial Testnet; it was deprecated in late 2016.
- 3: This is the most recent Testnet at the time of writing this book. It was launched in late 2016, since the older Testnet was having multiple issues.
- 4: This is a public Testnet, in which a PoA consensus is being tried out. It is known as Rinkeby.