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)
23
Index

Experimenting further with bitcoin-cli

As we've seen so far, bitcoin-cli is a powerful and feature-rich command-line interface available with the Bitcoin Core client and can be used to perform various functions using the RPC interface provided by the Bitcoin Core client.

We will now see how to send Bitcoin to an address using the command line. For this, we will use the Bitcoin command-line interface on the Bitcoin regtest:

  1. Generate a new address using the following command:
    $ bitcoin-cli -regtest getnewaddress
    2NC31WFFRwRkwd3S4TpyjN5GGDY7E63GSVd
    
  2. Send 20 BTC to the newly generated address:
    $ bitcoin-cli -regtest sendtoaddress \ 2NC31WFFRwRkwd3S4TpyjN5GGDY7E63GSVd 20.00
    

    The output of this command will show the transaction ID, which is:

    a83ff460a32f29387d531f19e7092a5dcf6ce52d20931227447c0b9b7a5f2980
    
  3. We can now generate a few more blocks to get some confirmation for this:
    $ bitcoin-cli -regtest...