Hands-On Blockchain with Hyperledger
eBook - ePub

Hands-On Blockchain with Hyperledger

Building decentralized applications with Hyperledger Fabric and Composer

Salman Baset, Luc Desrosiers, Nitin Gaur, Petr Novotny, Anthony O'Dowd, Venkatraman Ramakrishna

Share book
  1. 460 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Blockchain with Hyperledger

Building decentralized applications with Hyperledger Fabric and Composer

Salman Baset, Luc Desrosiers, Nitin Gaur, Petr Novotny, Anthony O'Dowd, Venkatraman Ramakrishna

Book details
Book preview
Table of contents
Citations

About This Book

Leverage the power of Hyperledger Fabric to develop Blockchain-based distributed ledgers with ease

Key Features

  • Write your own chaincode/smart contracts using Golang on hyperledger network
  • Build and deploy decentralized applications (DApps)
  • Dive into real world blockchain challenges such as integration and scalability

Book Description

BBlockchain and Hyperledger technologiesare hot topics today. Hyperledger Fabric and Hyperledger Composer are open source projects that help organizations create private, permissioned blockchain networks. These find application in finance, banking, supply chain, and IoT among several other sectors. This book will be an easy reference to explore and build blockchain networks using Hyperledger technologies.

The book starts by outlining the evolution of blockchain, including an overview of relevant blockchain technologies. You will learn how to configure Hyperledger Fabric and become familiar with its architectural components. Using these components, you will learn to build private blockchain networks, along with the applications that connect to them. Starting from principles first, you'll learn to design and launch a network, implement smart contracts in chaincode and much more.

By the end of this book, you will be able to build and deploy your own decentralized applications, handling the key pain points encountered in the blockchain life cycle.

What you will learn

  • Discover why blockchain is a game changer in the technology landscape
  • Set up blockchain networks using basic Hyperledger Fabric deployment
  • Understand the considerations for creating decentralized applications
  • Learn to integrate business networks with existing systems
  • Write Smart Contracts quickly with Hyperledger Composer
  • Design transaction model and chaincode with Golang
  • Deploy Composer REST Gateway to access the Composer transactions
  • Maintain, monitor, and govern your blockchain solutions

Who this book is for

The book benefits business leaders as it provides a comprehensive view on blockchain business models, governance structure, and business design considerations of blockchain solutions. Technology leaders stand to gain a lot from the detailed discussion around the technology landscape, technology design, and architecture considerations in the book. With model-driven application development, this guide will speed up understanding and concept development for blockchain application developers. The simple and well organized content will put novices at ease with blockchain concepts and constructs.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Hands-On Blockchain with Hyperledger an online PDF/ePUB?
Yes, you can access Hands-On Blockchain with Hyperledger by Salman Baset, Luc Desrosiers, Nitin Gaur, Petr Novotny, Anthony O'Dowd, Venkatraman Ramakrishna in PDF and/or ePUB format, as well as other popular books in Computer Science & Cryptography. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788996044
Edition
1

A Business Network Example

In this chapter, we are going to bring together all the concepts we've discussed with a sample business network, involving a real-world example. Specifically, we're going to do a detailed walk-through of the Hyperledger Composer letter of credit sample, so that you can understand how participants, assets, transactions, and events are realized in code. We'll show how the business network is used, analyzed, defined, and how that definition is used to generate APIs, test them, and integrate them into a sample application. This is going to be a comprehensive tour that will get you from concepts right into implementation. We're going to use the letter of credit sample because it represents a well-known process that's often discussed in relation to blockchain. Let's discuss the process first, and then see why it's used as the poster child example.

The letter of credit sample

And so we get to our sample. Alice, the owner of QuickFix IT in the Italy, wishes to buy computers from Bob, who runs Conga computers in the USA. Alice is going to apply for a letter or credit from her bank, Dinero Bank, which will be accepted by Bob's bank, Eastwood Banks, as a form of payment.
We're going to try out the whole process using the letter of credit sample application found at https://github.com/hyperledger/composer-sample-applications. This repository contains a number of sample applications of business networksā€“we're going to use the letters of credit sample.

Installing the sample

If you've followed the steps in Chapter 3, Setting the Stage with a Business Scenario, you should have all of the prerequisites done. Now fork a copy of the sample application's repository (https://github.com/hyperledger/composer-sample-applications) to your GitHub account, and then clone it to your local machine using the following commands:
cd <your local git directory>
git clone [email protected]:<your github name>/composer-sample-applications.git
Navigate the the appropriate directory and install the letter of credit sample application using the following commands. It will take a few minutes for the application to download and install:
cd composer-sample-applications
cd packages/letter-of-credit
./install.sh
The install script will also start the application presentation tier in your browser. Let's investigate.

Running the sample

You'll see that your browser has opened up tabs corresponding to the different participants in the network. Click on the different tabs to see the different participants in the network. We're going to inhabit each of these personae as we work through the sample. Let's walk through the process by trying out the application:

Step 1 ā€“ preparing to request a letter of credit

We start with preparing for our request:
  1. Select the first tab on your browserā€“you will see the following page:
  1. You are now Alice! You can see your bank and your account details. You can apply for a letter of credit by clicking on the Apply button. Try it!
  1. You'll be presented with a page where you can request a letter of credit:

Step 2 ā€“ requesting a letter of credit

This is the first stage of the process you're going to request a letter of credit to buy computers from Bob! At the top of every screen, you'll see exactly where you are in the process, for example:
On the left-hand side of the page, you'll see the merchants' detailsā€”those of Alice and Bob. Notice the company names and account details:
Let's make an application as Alice. On the right-hand side of the screen, you can enter the details of the trade. Let's pretend that Alice requests 1,250 computers from Bob, at a unit price of 1,500. The application has a total value of 1.875M EUR:
Also note that Alice can chose (with her bank's permission) some of the terms and conditions on the application. These are important terms and conditions of the contract with Bobā€”unless they are satisfied, neither party will receive goods or payment:
You can edit these if you wish, although the process is not affected by them.
Click on the Start approval process button when you're ready to move to the next stage of the process:
Congratulations, you've just applied for a letter of credit!

Step 3 ā€“ importing bank approval

This is next stage of the process. Click on the next tab in your browser. You are now Matias, an employee of Alice's bank, Dinero, who needs to process her application! Here's the page that Matias sees:
It shows the application from Alice, and that it is waiting for approval from Matias. He is acting on behalf of Dinero Bank, and applies whatever process is required to approve or reject the letter. We might imagine that in a sophisticated process, Matias would only have to approve exceptional letters that could not be automatically approved.
If Matias clicks on the application, he is presented with the details, which are essentially the same as Alice requested:
In our scenario, Matias will approve the letter of credit, and the process will continue! Select the accept button and we'll move to the next step:

Step 4 ā€“ exporting bank approval

Click on the next tab in your browser. You are now Ella, an employee of Bob's bank, Eastwood, who has been informed that Alice wishes to do business with Bob:
This sample has taken a little creative license with the processā€“normally, the letter would be presented to Bob by Alice. Bob would then present it Ella. However, we can see that because everyone can view the letter in advance, process innovations are possible. We'll elaborate on this point later.
We can see that Ella authorizes the next stage in the processā€“and we can see where the letter is in the process flow. When Ella selects the letter, she can see the following details:
Notice that the currency has been c...

Table of contents