Book Image

Mastering Blockchain - Third Edition

By : Imran Bashir
Book Image

Mastering Blockchain - Third Edition

By: Imran Bashir

Overview of this book

Blockchain is the backbone of cryptocurrencies, with applications in finance, government, media, and other industries. With a legacy of providing technologists with executable insights, this new edition of Mastering Blockchain is thoroughly revised and updated to the latest blockchain research with four new chapters on consensus algorithms, Serenity (the update that will introduce Ethereum 2.0), tokenization, and enterprise blockchains. This book covers the basics, including blockchain’s technical underpinnings, cryptography and consensus protocols. It also provides you with expert knowledge on decentralization, decentralized application development on Ethereum, Bitcoin, alternative coins, smart contracts, alternative blockchains, and Hyperledger. Further, you will explore blockchain solutions beyond cryptocurrencies such as the Internet of Things with blockchain, enterprise blockchains, tokenization using blockchain, and consider the future scope of this fascinating and disruptive technology. By the end of this book, you will have gained a thorough comprehension of the various facets of blockchain and understand their potential in diverse real-world scenarios.
Table of Contents (24 chapters)

Mining on the private network

Now that we have started up our private network, mining can start by simply issuing the following command. This command takes one parameter: the number of threads. In the following example, two threads will be allocated to the mining process by specifying 2 as an argument to the start function:

> miner.start()

Here we can also provide an integer parameter. For example, if we provide 1, it will only use one CPU core for mining, which helps with performance issues, if using all CPU resources is reducing system performance. An example command of using only one CPU is miner.start(1). On systems where there is only one CPU, issuing the preceding command will inevitably use only one CPU. However, on a multicore system, providing the number of cores that can be used for mining helps to address any performance concerns.

After the preceding command is issued as preparation for mining, the DAG generation process starts, which produces...