SETUP Private Ethereum Network (POA) On Digital Ocean using Puppet.

achinta das
Coinmonks
12 min readNov 26, 2019

--

In this post, I will explain an easy way to set up a private eth blockchain on a digital ocean server. Before going to the details we need to understand what is Proof of Authority, I am not going to explain but share a link for details understanding https://www.binance.vision/blockchain/proof-of-authority-explained

I am using Windows 10 system and git bash (Download )https://git-scm.com/downloads

let's start, we are going through step by step process. So in this post, i am going to set up the below list.

  1. Digital Ocean Droplet creates and Install necessary packages for 1 Controller and 3 Nodes.
  2. PoA Network, Ethstats & Explorer

1 . Digital Ocean Droplet Setup: We going to provision 4 droplets on the digital ocean for this tutorial: 3 droplets for Nodes and 1 droplet for Controller. The controller is where we’re going to be doing all the setup using puppeth.

Controller : minimum 1 GBram / 25 GB disk

Node1: 16 GB ram/ 320 GB disk

Node2: 16 GB ram/ 320 GB disk

Node3: 16 GB ram/ 320 GB disk

Controller
Controller Droplet configuration
3 Droplet Same configuration

How to Create Droplet: https://www.digitalocean.com/docs/droplets/how-to/create/. use this link to create a droplet.

1.1. Firewall setup: For 3 droplets we need to set up names like Node1, Node2, Node3, and after that need to open port, for that go to Digital Ocean Sidebar, MANAGE-> Networking -> Firewalls -> create a firewall, and set up inbound. Please note all setup for testing POA blockchain setup.

1.2. Prepare The Controller: First, from your local machine, open git bash terminal ssh into the controller droplet:

ssh root@<controller ip> enter then Type Password.

  • Required package installation :
  • Install g Version (Go Version Manager)
  • Go install
  • Geth clones, build and verify puppet run
Your Terminal looks like this.
  1. 3. Prepare the Nodes: Open 3 git bash terminal and type droplet IP

Run the following command in each terminal (Node1, Node2, and Node3 )

Until now if you set up 3 Droplets for nodes and 1 Droplet for the controller and all packages install perfectly then our 50% work done now we can start to work on Ethereum private network. so let's start …….

2. PoA Network: There are some tasks that need to be done before creating a POA network. We need 5 Ethereum accounts, for that we have to create a wallet that can hold the account's details. why do we need that account before set up the network you can get down below. our 1st work was to create a wallet in the controller.

2.1 Wallet

Open git bash and type your controller IP for my case

Accounts details.

You can see that 7 additional accounts are created, and open the text editor separately to record them. In my case, the following 7 accounts were assigned the same roles as Sealer and Faucet.

Defining POA Network using Puppet

puppet run screen

Genesis block settings

Ethstats Settings using puppet

Deploy Bootnode on Node1

A boot node's only purpose is to help nodes discover each other. Nodes could have dynamic IP, being turned off, and on again. The boot node is usually run on a static IP and thus acts like a pub where nodes know they will find their mates.

Deploy sealer to Node1

Now we are going to deploy sealer to Node1 and same things we have to do for Node2 and Node3 .

sealer deployment on poa-worker02, poa-worker03

  • The above procedure should be performed twice, Node2 and Node3 respectively. OutPut down below after completion of Node1, Node2, Node3 sealer setup.
You can see This kind of out put

Create a block

After 3 Nodes setup, you can see some blocks created in <ip of Node1>:8080. but after some time block creation stops.

You must add the Nodes manually with the add Peer command.

Enter the enode address of the sealnode running at poa-worker02, 03.

Explorer: Track portfolio for Ethereum address with historical balance charts and transactions, transaction hash , token , Block timing, Account history etc.

Remaining components

There are many more components that can be deployed through puppets. Use and test it by your side.

Next, we will connect our eth private blockchain to meta mask and deploy the smart contracts.

Reference

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--