11

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

  • Just a minor correction, the network probably would have self corrected itself with more than 3 miners too if enough are mining to push the thing forward, but the first few blocks caused ugly error messages and failures on the initial mining nodes. – Péter Szilágyi May 3 '17 at 9:43
  • 3
    You can also create new accounts straight from the CLI via geth --datadir=/wherever account new. – Péter Szilágyi May 3 '17 at 9:44
  • @Bruno Grieder It would be nice if you took your answer and made it an answer, rather than putting your answer inside the question. – Travis Reeder Dec 20 '17 at 22:33
6

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 :)
  • Thanks. I went for a modified version of your workflow. See Edits above. – Bruno Grieder May 2 '17 at 9:12
0

Modify the extradata field in genesis.json as following: 0x00... (64 zeros at beginning) accounts stucked, without "0x" and without any spaces 00.. (130 zeros at end)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.