Posted by Amit Kumar | Last Updated: 04-Jan-18
PUPPETHTO CREATE PRIVATE ETHEREUM NETWORK
In this blog, we will use the
puppeth clitool available from go-of ethereumrelease 1.6,to create a local ethereumnetwork with geth 1.7.
First of all clone the go-
ethereumrepository from, https://github.com/ethereum/go-ethereum.git .
Then follow the installation instructions from here - https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum to build your own
gethexecutable. To get the puppeth executable,instead of using the command 'make use 'make all' to build all executables available in geth' , go-. ethereumdirectory
If the installation is
you will see numerous executables like successfull, bootnodes, gethand among them one named . If you are not able to build all executables, make sure the installation instructions are followed in order. puppeth
PUPPETHTO SET UP YOUR POA NETWORK
1) Copy your
puppethexecutable to a directory you see perfect to test your local ethereumnetwork.
2) Next create a data directory with a single
account ,to which we will assign the privilege to mine on this network.
3) Usegeth --
datadirethNode1 account new to create a new account.
4) Set up the password for
your coinbase and continue. account
5) Now start
the puppeth cliby running the puppethexecutable.
6) Then follow the below steps to run
a ethereumnode which mines at a block per 10 secondto test your local ethereumnetwork :
a) Select configure new genesis after you
have slecteda naefor your local ethereumnetwork.
Nextselect the consensus model for your private network. Use Proof of Authority consensus model for a regular mining network per your requirement( in this case 10 seconds)
c) Choose the time to mine a single block as 10 seconds.
d) Add the account you just created as
minerfor this node ( coinbaseaccount) which will now collect the mining reward on each block and all transaction fees.
Alsoadd the coinbaseto be prefilled with some private net ether amount.
f) Specify the network
idwhich all other nodes on your network can use to distinguish themselves from other ethereumnetworks.
g) Save the custom genesis
file ,default saved as your_network_name.json.
Exit puppeth ,using CTRL+C.
7) Now that you have got a genesis file
through puppeth ,use it to initialisethe ethNode1 data directory using the command
geth-- datadirethNode1 init testnet.json
8) Once this
is you can start miner.start() command and see your private blockchain mine at the specified rate. done,
9) Now you are free to add other nodes to your network as peers and collect transactions from them as you would on any private implementation