I have tried using puppeth manager to setup the genesis file. The genesis file is set up to use clique as algo. Snip of genesis file is I do understand from the error that it is related to the sealing/sealer of the block.. but how to define the accounts which can be used for sealing? Any pointers in right direction would be helpful
Have you created any sealer accounts prior to creating the genesis file?
if not, create at least one sealer account first by running the following:
geth account new --datadir /path/to/your/custom/datadir
Note down the address this generates, then when you run puppeth you can add this address into the pre-defined list of sealer accounts during the genesis creation process.
Once this is done you can initialise geth with the new genesis.json file:
geth --datadir /path/to/your/custom/datadir init genesis.json
then once you're up and running you need to unlock that account:
personal.unlockAccount(eth.accounts, "<password>", 0)
(note "0" above will keep the account unlocked permanently, or you can specify a time interval in seconds)
Then to get mining started on a single core type the following into the console:
and you should see block sealing as proof of successful mining pretty soon.
Steps to get a miner node in your PoA blockchain:
- Create account: geth --datadir=. account new
- Create genesis json using puppeth
- Modify genesis json. Set the sealers in the extraData field in genesis.json:
- 0x00... (64 zeros) at beginning
- account (without 0x) (stuck all the accounts you want to set as sealers)
- 00.. (130 zeros) at end
- run the node, unlocking this account, --unlock=(account). Use also the parameter --mine