Create a Private Ethereum Network using Puppeth (Developer Notes)

Since its release, Puppeth, a tool to quickly create your own private network, is one of the most anticipated feature to be included in each of geth version update. However, with little to no documentation, it is hard for someone who is new to Ethereum to deploy a properly working private network. Even after its official release announcement back in April I find it hard to get a complete tutorial so I had to compile information from a lot of sources. This post is meant for a developer notes on how I made a private network that consists of a netstats, bootnode, a few sealer/mining nodes, a faucet, and a dashboard website with a look and feel like the Rinkeby test network.

Starting off, the video from the Devcon 3: is a good way to briefly understand the main idea behind puppeth and how it works. It is delivered by Peter himself, the man behind the puppeth (no pun intended) development. I find it much easier to understand by watching the demo rather than reading tutorials.

Next up is this blog post at Enuma which describes how you can build a Clique PoA using Puppeth. The post is comprehensive and helped me understand how the nodes are discovered, but not so much helpful when it comes to building a lot more nodes. I skipped the Nixops part though. This post at modalduality also helped a bit although some parts have already been covered by the previous post.

Anyways, I have 8 servers running ubuntu 16.04.3 with high specs. Five of those are supposed to be ethereum nodes, one is for sandbox, and the other two are for production servers. I divided the roles like this:

  • for web dashboard and sealer node
  • 43 and 44 are sealer nodes
  • 45 is sandbox and serves as the geth RPC endpoint
  • 46–47 are production servers
  • 48 is for a faucet website
  • 49 is for bootnode and netstats

First I had to install docker and docker-compose in all servers. I followed this post and also this post to complete this task. Puppeth will not work without docker and docker-compose.

I logged on to SSH into 49 then ran puppeth. Then I deployed network components starting from the netstats, then bootnode, sealers, faucet, then lastly dashboard.

Netstats inside the dashboard (notice the sidebar)

Lesson learned

  1. Deploy the network in the following order: netstats, bootnode, sealers, wallet (not available), faucet, dashboard
  2. If you deploy the bootnode after registering the sealers, the bootnode won’t be able to connect to the network
  3. For the most part it heavily uses the internet so make sure you have a stable connection
  4. Set your datadir in a level 1 folder such as /private/ just like how Peter did in his video, it does not matter. I had troubles when I set it inside home directory, but maybe it was just me.
  5. Existing accounts do not matter that much except for the mining process

What I would like to do next

I was not able to deploy a Clique PoA network for random reasons such as the nodes won’t discover each other, and I was still trying to understand how PoA works. As a result I had to fall back to the Ethash PoW algorithm. I definitely will try to deploy a Clique protocol after christmas. I’ll write the result in another blog post.