12

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

3
  • 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. May 3, 2017 at 9:43
  • 3
    You can also create new accounts straight from the CLI via geth --datadir=/wherever account new. May 3, 2017 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. Dec 20, 2017 at 22:33

3 Answers 3

5

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 :)
1
  • Thanks. I went for a modified version of your workflow. See Edits above. May 2, 2017 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)

0

https://hackernoon.com/setup-your-own-private-proof-of-authority-ethereum-network-with-geth-9a0a3750cda8 Easy steps given in the above link. Just follow

You can Generate Account ID and password then later use any one among them.

1
  • Link only answers are discouraged. It is better to include the main points in the answer and leave the link to fill the details.
    – Ismael
    Sep 21, 2021 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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