Mining on a local private network

Mining on the local private blockchain can be started with the following command; we will be using --etherbase to credit all rewards to the account we just created:

$ geth --datadir data --mine --miner.threads=1 --miner.etherbase =0xde2d56b4abc0bf860d25781ca4a87772dec8f8a8

Once started, it will keep running and writing out the logs, as follows:

INFO Successfully sealed new block number=1520 sealhash=7c9374...e035e4 hash=25a8c4...d0ae06 elapsed=5.228sINFO  block reached canonical chain number=1513 hash=7ca5de...5cab58INFO  mined potential block number=1520 hash=25a8c4...d0ae06INFO Commit new mining work number=1521 ...

Get Learn Ethereum now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.