Mining process
As in other blockchains, to validate a transaction, whether it is intended to deploy or to interact with the contract, we need to have it mined and included in a block. To start mining with Geth, you'll need to run the following command in the geth console:
miner.start(x)
Here, x is an optional parameter representing the number of miner threads. This command will start the mining process, which will keep running even if there are no transactions to validate, creating empty blocks until you stop it manually using miner.stop(). The good news is that the mining process will generate new ether for you (valueless, of course).
A more convenient way would be to automatize the process of starting and stopping the mining process only ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access