Ten years after the start of the Bitcoin network, blockchains have gained mainstream recognition. Though as with any new industry, products still have a long way to mature before reaching a significant audience. Part of this growth process is giving developers the proper tooling for blockchain testing. Teams should be able to quickly iterate on protocol architecture and dapp designs. They should be able to test network assumptions without significant overhead or investing too much time.

Whiteblock Genesis

Whiteblock’s open source platform, Genesis, offers a convenient solution to these needs. Genesis allows users to provision multiple fully-functioning nodes, automate tasks, and configure environmental conditions with ease. After provisioning, users can run the network for as long as they need, able to collect the valuable data to improve the chain design.

Below, I’ll demonstrate how simple it is to build your own test network and get started with blockchain testing.

1. Build The Network

whiteblock genesis build geth

 

If you haven’t already, download Genesis from the Whiteblock repo, then run it.

Genesis provides a developer friendly CLI that you can SSH into. Once you SSH into your instance, write the following command:

whiteblock build [flags]

Build will create and deploy a blockchain with the specified number of nodes. Each node will be instantiated in its own container and will interact individually as a participant of the specified network. Each node has its own linux bridge and is assigned its own unique ip address, which allows us to build test networks that emulate a full-mesh wide area network (nodes can have unique properties assigned which can simulate interaction from Paris to Beijing as opposed to a local area network).

The blockchain set up can be customized using the CLI. Whiteblock Genesis currently supports Geth, Pantheon, Rchain, Syscoin and EOS.

2. Start Mining

whiteblock genesis start mining gif

I’m building Geth in this example and the Ethereum blockchain requires the network to have a number of nodes mining. This is how blocks are created and the more miners there are, the more secure the network becomes. To begin mining, run the command whiteblock miner start. This will have all the nodes start mining, initiate block production and start processing transactions.

3. Configure Network Conditions

You can now introduce real world impairments and see how these network conditions affect the network performance and security.

whiteblock netconfig <command> [flags]

Available commands:

whiteblock genesis netconfig command, CLI flags

Netconfig will introduce persisting network conditions for testing. Network emulations such as latency, packet loss, and bandwidth can be configured and introduced to the network.

Example:

whiteblock netconfig all -d 100 -b 100 -l 0.5

The provided example command tells the netconfig module to apply 100ms latency, 100 MBps bandwidth, and 0.5% packet loss for all nodes.

You can also use whiteblock ping <sender> <receiver> to measure the amount of latency or packet loss between nodes.

The following example sends ICMP pings from node 1 to node 3:
whiteblock ping 1 3

4. Send Transactions

Command:

whiteblock tx <command> [flags]
whiteblock genesis CLI flags, transaction burst or stream
Whiteblock Genesis CLI flag list for transactions

This will send transactions (in geth) with instructions on how many transactions per second to send and the value to send. This will immediately begin transactions if the network has been built properly.

Example:

wb tx start stream -t 200 -v 2

5. Examine Data for testing

Whiteblock genesis, examine data for testing, get stats all

After running the transactions, you can see the throughput of the network by running the command whiteblock get stats all.

This will output all the relevant statistics of the current blockchain.

You may also use the Whiteblock GUI and other data visualization tools to examine the different data points that are being pushed directly from the blockchain.

It’s really as simple as that. Genesis focuses on making it easier for developers to carry out blockchain testing, validating assumptions before launching to mainnet. Reach out on Telegram if you have trouble at any of the steps.

✔︎ Make sure to sign up for early beta access at whiteblock.io.
◻️Follow Whiteblock on Twitter for more information.
💬Join the Whiteblock Telegram: https://t.me/whiteblockio

Follow Kevin

Kevin Castro

Community Manager at Whiteblock
I’ve been working in the blockchain space since 2017. When I’m not working on community management or creating content, I like to learn programming, practice Japanese and make music.
Follow Kevin

Latest posts by Kevin Castro (see all)

Get Free Early Access To The Beta

Get Free Early Access To The Beta

You have Successfully Subscribed!

%d bloggers like this: