[Ethereum] Setting up a private PoA Clique network with puppeth


I would like to set-up a new private network using Clique as protocol with the help of puppeth.

When configuring the new Genesis block, this question is being asked:

Which accounts are allowed to seal? (mandatory at least one)

How can I specify an account since it is a new network ?

(in other words are accounts independent from the network ?)

My Solution (geth 1.6.0)

This is similar to the accepted answer below but allowed me to create multiple sealers/miners (and script those creations)

  1. On any existing network (PoA or PoW), create new accounts for the "sealers" or use geth --datadir=/wherever account new (thanks P├ęter)
  2. Collect from the keystore directories the keys of these accounts. For ease of management the files for the keys can be renamed to anything you want, say ACCOUNT_NUMBER.json where ACCOUNT NUMBER is the hex value of the account e.g. 0x035e19356880f86804b5fbf7015192be271ab8e4
  3. Using puppeth, create the genesis.json file, and enter in which accounts, the list of sealer accounts created above
  4. For each sealer node, assuming the data directory for the private network is MYNET, create a directory structure MYNET/keystore and drop the key for that sealer in the directory
  5. Initialize the node once : geth --datadir "MYNET" init genesis.json
  6. Run the node. Unlocking the account and starting the miner should work.

(note: I am not using puppeth to create the nodes but use my own docker containers)

Important !

I am running into this issue when initializing the network with more than 3 signers. I will keep this question updated

To have more than 3 signers registered from the start, you must use a 1.6.1-unstable with a last commit > 02fa3e3179011bcbdf9142f9efba8d3a52df898

See the commit

Adding/Removing sealers

Please check this SE question

Best Answer

You can create a new account from other network then import the Keystore file to your private network.

The steps I took was

  1. Generate a Genesis.json file of a PoW private network from Puppeth
  2. Geth init
  3. Geth attach
  4. Generate a new account
  5. Delete the geth folder in the datadir
  6. Use Puppeth to create a new Genesis.json that use Clique and put the address that you've just created in there
  7. Unlock the account
  8. miner.start() and see the block number goes up :)
Related Topic