November 21, 2018 Knowledge Center

A Guide to Using the Ethereum Test Network

The Ethereum Test Network is a simulation of Ethereum, with the same environment and conditions found on the Ethereum network. Users can test new projects and changes on this system before deploying them to the real Ethereum network. And because it works the same way as the real one, developers can correct any errors or mistakes here. The system also allows them to see firsthand how the project works and reacts, so they can modify or improve it before it goes live.

This process saves companies money because they don’t have to use gas. Developers do use Ether and tokens, but these have no real-world value outside the testnet.

Exercise caution when connecting to a testnet, because any address or token that works on Ethereum also works on the testnet. If you are not careful, you could accidentally send tokens or Ether from the Ethereum mainnet to a testnet. If that happens, you will lose your assets. It’s a good idea to create a separate wallet to use only on the testnet.

The 3 Ethereum Test Networks

There are three types of Ethereum test networks – public, private, and GanacheCLI.

Public Testnets

Public testnets are connected to the Internet: anyone can access them, via popular wallet interfaces. Of the many public testnets, the three most popular are Ropsten, Kovan, and Rinkeby.

Ropsten

Named after a famous subway station in Sweden, Ropsten made its official debut in 2016.

Ropsten is supported by both Geth and Parity, two types of implementation of the Ethereum node software, so developers can create two different angles of the project they are testing.

Ropsten is very similar to the mainnet in some ways: for one, users can mine Ether on Ropsten just like on the mainnet. Also, it uses a consensus mechanism (proof of work), so its results closely resemble those of the mainnet. These characteristics make the simulation of transaction confirmations more realistic than on other testnets.

Another characteristic of the Ropsten network is that it allows users to mine or demand Ether through the Ropsten faucet – a website created for the sole purpose of giving away free Ether for test projects.

While this might sound good, it also makes the network susceptible to spam attacks, such as the one that happened in February 2017. In these attacks, developers throw massive amounts of useless transactions into the network, clogging the system.  The syncing process becomes much slower and the consumption of disk space increases. After a month after the attack, a fully fixed and better secured Ropsten re-entered the Ethereum world.

Kovan

Named after a subway station in Singapore, Kovan was developed by the Parity team right after the Ropsten attack and debuted in March 2017. Given that Team Parity developed Kovan, it’s not surprising that it runs on the Parity node.

Kovan uses the PoA or Proof of Authority as a consensus mechanism. In this type of consensus, only selected nodes are authorized to create new blocks and confirm transactions.

PoA consensus is not used by the mainnet; thus, Kovan is not considered a very accurate simulation. However, that does not mean that it is not a reliable testing platform. It is stable and immune to attacks because only authorized parties can control Ether.

Rinkeby

Named after another metro station in Stockholm, Rinkeby was created by the Ethereum team . It made its debut a month after Kovan, in April 2017. Like Kovan, Rinkeby uses the proof of authority (PoA) consensus, specifically the Clique PoA consensus. The protocol makes Rinkeby immune to spam attacks just like Kovan.

Unlike Kovan, however, Rinkeby works on the Geth node. Also, users cannot mine Ether on the Rinkeby,  but must request it from a faucet.

Private Testnets

A private test network is like having your own blockchain network, your own Ethereum. From that network, you can mine or pre-generate your own Ethereum. For this reason, a private test network is probably the most cost-effective way of testing Ethereum.

A private testnet needs four components: Custom Genesis Block, Data Directory, custom NetworkID, and Disable Node Discovery.

Custom Genesis Block

The Genesis block is your cornerstone, the primary foundation of your blockchain. It is the only block that does not refer to a predecessor block, so it is also called zero block or first block. In a private network, the Genesis block is hardcoded into the clients, but on Ethereum, it’s very adaptable and flexible.

Custom Data Directory

The data directory is the place where you can store your private chain data. Make sure to store it separately from the Ethereum chain folder you are using.

Disable Node Directory

This is a command line so people who do not add you manually will not discover your node. If you don’t apply this, other developers can accidentally add your node to another node which has the same network ID and genesis block.

Ganache CLI

Formerly known as the TestRPC, Ganache CLI is a fast and flexible blockchain emulator for Ethereum. It is both a desktop application and a command line tool, and is available on different major operating systems, such as Mac, Windows, and Linux. If you are interested in using this simulator, you can install it via NPM, a package manager for Node.js modules.

Ganache CLI has some notable characteristics:

–  Users can instantly mine their transactions.

– Transactions are free.

– It does not need a faucet or mining because users can recycle or reset their accounts instantly with a fixed amount of Ether.

– Users can modify the gas price and mining speed.

– It has a GUI where users can monitor their test chain events.

Conclusion

Test networks are an essential part of the Ethereum Virtual Machine development. They offer users a safe environment for testing and experimenting on their projects before launching them on the Mainnet. Although each of these testnets has its advantages and disadvantages, they are an indispensable tool that will continue to evolve and change.

 

Share