• Complain

Bellaj Badr [Bellaj Badr] - Blockchain By Example

Here you can read online Bellaj Badr [Bellaj Badr] - Blockchain By Example full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2018, publisher: Packt Publishing, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Bellaj Badr [Bellaj Badr] Blockchain By Example

Blockchain By Example: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Blockchain By Example" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Dive into working mechanics of the decentralized blockchain applications to build your own scalable dapps

About This Book
  • Guide to help you learn Blockchain ecosystem and their terminologies
  • Implement smart contracts, wallet, consensus protocols, and other principles
  • Design and develop decentralized applications using Bitcoin, Ethereum, and Hyperledger
Who This Book Is For

If you are keen on learning how to build your own blockchain decentralized applications from scratch, then this book is what you need. Implement key building blocks of a blockchain ecosystem with this handy guide. It explains all the basic concepts required to develop intermediate projects

What You Will Learn
  • Grasp the decentralized technology fundamentals to master blockchain principles.
  • Build blockchain projects on Bitcoin, Ethereum, and Hyperledger.
  • Create your own currency and a payment application using Bitcoin
  • Implement Web3.js apps and supply chain system using Hyperledger.
  • Write smart contracts, run your ICO and build tontine decentralized app using Ethereum
  • Explore Blockchain to learn how to implement distributed file management.
  • Integrate blockchain into your existing systems in your organization
In Detail

The blockchain is a revolution promising a new world without middlemen. Technically, it is an immutable and tamper-proof distributed ledger of all transactions across a peer-to-peer network. With this book, you will set a foundation to get into the grips of blockchain ecosystem to build real-world projects.

Throughout the book, we will walk you through a detailed step-by-step process using solidity to build three blockchain projects with different complexity levels and hurdles. This book will provide you with all the relevant concepts related to cryptocurrencies, smart contracts, and blockchain in order to build your own decentralized applications. Each project will teach you just enough about blockchain to be productive right away. We will cover the different set of projects such as Bitcoin Payment System, Supply Chain on Hyperledger, and Tontine Bank Dapp using Ethereum. We will cover major challenges that are associated with Blockchain ecosystems such as scalability, integration, distributed file management and more.

By the end of this book, you will not only be able to tackle the common issues in the blockchain ecosystem but also design and build reliable, scalable distributed systems.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Bellaj Badr [Bellaj Badr]: author's other books


Who wrote Blockchain By Example? Find out the surname, the name of the author of the book and a list of all author's works by series.

Blockchain By Example — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Blockchain By Example" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Transaction structure

At first sight the previous resultant hexadecimal string seems ambiguous and meaningless. T he following table breaks down and examines in depth our transaction byte per byte:

As you can see our transaction has one input the only unspent transaction - photo 1

As you can see, our transaction has one input (the only unspent transaction received from the faucet), with transaction id "0791...252", and two outputs:

  • OP_RETURN output with an OP_RETURN script.
  • An output sending 1 BTC to the specified address.

The transaction structure can be visualized by decoding back the raw transaction using the deserialize command. If you run electrum --testnet deserialize , it will output a meaningful JSON representation of our constructed transaction :

For the same result you can decode the raw transaction using bitcoin-cli - photo 2

For the same result, you can decode the raw transaction using bitcoin-cli decoderawtransaction or by using an online decoder such https://live.blockcypher.com/btc-testnet/decodetx/

Run Electrum client:

After you have downloaded and installed Electrum, open Electrum's testnet mode by running : electrum --testnet . When you run Electrum the first time it will display the new wallet creation wizard follow then these steps:

  • Select in the first dialogue box Auto Connect and click Next.
  • Select Standard wallet and click Next.
  • Keep pressing "Next" for the rest of the dialog boxes that appear until you are requested to save the seed words. Copy them somewhere, then in the next Dialogue Box write them correctly in the given order .

In the last step it will ask you for a password which you can leave empty this - photo 3

  • In the last step it will ask you for a password, which you can leave empty this time.

Once finished, Electrum will generate for you a new wallet with plenty of new addresses. Quit the Electrum GUI and let's continue in CLI mode. We run Electrum as a daemon process whereby we execute the JSON/RPC commands as following :

electrum --testnet daemon
electrum --testnet daemon load_wallet

In a new terminal window run electrum --testnet listaddresses:

At this level we have the necessary playground to start transacting with - photo 4

At this level we have the necessary playground to start transacting with Bitcoin network.

New nonce, epoch time, and nbits

We have to locate the following line in chainparams.cpp in the three classes CMainParams, CTestNetParams and CRegTestParams

genesis = CreateGenesisBlock(time, nonce, bits, 1, 10 * COIN);

In the order change the arguments of the CreateGenesisBlock function using the values computed previously by GenesisH0 script as following:

genesis = CreateGenesisBlock(1529321830, 490987, 0x1e0ffff0, 1, 10 * COIN);

The last argument in the function is the initial reward (10 ReaderCoins) for generating the genesis block.

Building Readercoin network

As most of the work is done, let's put the results into practice.

At this level everything is ready to launch our ReaderCoin network. We'll need to build a network of two connected machines, called node A and node B . Before advancing further check that both machines can ping each other. Let's say nodeA has the IP address 192.168.1.3 and node B 192.168.1.8.

At this point, we have built ReaderCoin on a single machine (node A), so we will need to build it on node B in the same manner we did in node A. For that you can clone the code source from our remote repository or just transfer the ReaderCoin folder using a USB memory stick. If successfully built, you will be ready to connect the P2P ReaderCoin nodes.

Once ReaderCoin is built successfully on both nodes, run the Qt client or readercoin-qt -printtoconsole.

The option -printtoconsole prints out the client log:

Running the ReaderCoin client for the first time will create a readercoin - photo 5

Running the ReaderCoin client for the first time will create a .readercoin directory in your home directory, along with some other necessary files. Stop the client to create a configuration file named readercoin.conf in ~/.readercoin and insert the following lines:

server=1
rpcuser=set a username
rpcpassword=set a password
addnode=the other node's IP
rpcallowip=192.168.0.0/16

Instead of using the addnode option in the configuration file you can run the clients on both nodes and execut the addnode RPC call:

readercoin-cli addnode 192.168.1.3:9333 onetry (in nodeA)

readercoin-cli addnode 192.168.1.8:9333 onetry (in nodeB)

A log entry in both peers should appear confirming the pairing similar to the following. If not, try it again or wait a bit.

You can check if both nodes are connected using readercoin-cli getpeerinfo - photo 6

You can check if both nodes are connected using : readercoin-cli getpeerinfo

You'll need to see all the connected peer information as shown in figure below:

Its worth noting that you can run RPC commands from the GUI without using a - photo 7

It's worth noting that you can run RPC commands from the GUI without using a terminal as follow:

  1. Open the ReaderCoin Wallet
  2. Choose "Help"
  3. Select "Debug window"
  4. Select "Console"
  5. Execute your command line without using readercoin-cli

Our nodes are ready to start sending and receiving ReaderCoins but as you - photo 8

Our nodes are ready to start sending and receiving ReaderCoins but as you notice we don't have any yet. Therefore, we need to start mining, either on one of the nodes or both of them.

Introduction

The previous chapter was an excellent starting point for understanding the blockchain and learning about Bitcoin. In fact, we covered many basic concepts and elementary operations such as signing, sending raw transactions and storing data into the blockchain. We'll herein, continue practically exploring the blockchain, by first building a customer-friendly payment system based on the Bitcoin payment protocol and secondly build our first smart contract in the Bitcoin system.

The end goal of this chapter is to help you acquire the necessary technical background for understanding Bitcoin's mechanics, and build your first B itcoin applications using very common languages such as JavaScript and Java. If you're an experienced programmer, most likely you are familiar with one of these technologies, otherwise I would recommend you spending time reading their official getting started documentation.

Throughout this chapter we will cover the following key points:

  • Introducing bitcoin.
  • Building BIP 70 payment system using Nodejs and bitcore-lib.
  • Building bitcoin client using BitcoinJ.
  • Writing and deploying Smart contract in bitcoin using Rootstock.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Blockchain By Example»

Look at similar books to Blockchain By Example. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Blockchain By Example»

Discussion, reviews of the book Blockchain By Example and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.