32,36 €
Explore the entire Hyperledger blockchain family, including frameworks such as Fabric, Sawtooth, Indy, Burrow, and Iroha; and tools such as Composer, Explorer, and Caliper.
Key Features
Book Description
Hyperledger is an open-source project and creates private blockchain applications for a range of domains. This book will be your desk reference as you explore common and not-so-common challenges faced while building blockchain networks using Hyperledger services.
We'll work through all Hyperledger platform modules to understand their services and features and build end-to-end blockchain applications using various frameworks and tools supported by Hyperledger. This book's independent, recipe-based approach (packed with real-world examples) will familiarize you with the blockchain development cycle. From modeling a business network to integrating with various tools, you will cover it all. We'll cover common and not-so-common challenges faced in the blockchain life cycle. Later, we'll delve into how we can interact with the Hyperledger Fabric blockchain, covering all the principles you need to master, such as chaincode, smart contracts, and much more. We'll also address the scalability and security issues currently faced in blockchain development.
By the end of this book, you will be able to implement each recipe to plan, design, and create a full-fledged, private, decentralized application to meet organizational needs.
What you will learn
Who this book is for
This book is for blockchain developers who want to understand how they can apply Hyperledger services in their day-to-day projects. This book uses a recipe-based approach to help you use Hyperledger to build powerful, decentralized autonomous applications. We assume the reader has a basic knowledge of the Blockchain technology and cryptography concepts
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 261
Veröffentlichungsjahr: 2019
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor:Sunith ShettyAcquisition Editor: Joshua NadarContent Development Editor: Karan ThakkarTechnical Editor: Suwarna PatilCopy Editor: Safis EditingLanguage Support Editor: Storm MannProject Coordinator: Hardik BhindeProofreader: Safis EditingIndexer: Pratik ShirodkarGraphics:Jisha ChirayilProduction Coordinator: Deepika Naik
First published: April 2019
Production reference: 1300419
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78953-488-7
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Xun (Brian) Wu is an author, software architect, and advisor with over 17 years' extensive hands-on experience in blockchain design and development, big data, AI, the cloud, UIs, and system infrastructures. He has worked for top investment banks including J.P. Morgan, Citigroup, and Bank of America. He is a coauthor of Blockchain Quick Start Guide, Blockchain By Example, and Seven NoSQL Databases in a Week, and has worked as a technical reviewer on over 50 technical computer books for Packt. He owns several blockchain patents, and currently serves as a board advisor for several blockchain start-up companies. Brian holds an NJIT computer science master's degree. He lives in New Jersey with his two beautiful daughters, Bridget and Charlotte.
Chuanfeng Zhang is enthusiastic and passionate about technologies and trading and data analysis, with 20 years' experience in both the technology and finance sectors. He has worked at top investment banks and technology firms including Goldman Sachs, Credit Suisse, and IBM. He has led, designed, and successfully developed many enterprise-scale systems with diverse architectures for algorithmic trading, order management, risk management, business intelligence, and more.
Andrew Zhang is an IBM Watson Cloud Advocate. He has many years of experience in cloud platforms, big data analytics, and machine learning. He works with start-ups and enterprise clients in the government, education, healthcare, and life science industries. His current interests are in embedding AI and blockchain open source technologies for consumer and enterprise applications. In his spare time, Andrew enjoys reading, traveling, and spending time with his family and friends.
Belinda Li is a seasoned software engineer. Her recent endeavors include MLaaS, AI enabled applications, and permissioned blockchain technologies. She is entrepreneurial and has over 15 years of hands-on enterprise software design and development experience in wealth management brokerage and trading platforms, investment portfolio optimization and analytics, call center training and operations, single sign-on security, and more. Belinda has held various positions in top-tier financial firms including Morgan Stanley and Citigroup. She started her career as a C/C++ programmer in the math department in Intergraph Corporation, a pioneer in GIS and the global leader in CAD software. She enjoys Zumba, folk dancing, and traveling in her free time.
Rameshwar Nigam is the director and founder of Pytriot Solutions LLP. He oversees the design and deployment of blockchain services. With strategic thinking, sharp analytical skills, and business acumen, Rameshwar can identify business opportunities and develop solutions for managing business challenges. His in-depth knowledge of blockchain and associated domains aids organizations in the seamless and risk-free adoption of these technologies. He continues to build awareness and recognition of blockchain as a technology in various corporates by providing training, proofs-of-concept, and so on.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
Hyperledger Cookbook
About Packt
Why subscribe?
Packt.com
Contributors
About the authors
Contributing author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Get in touch
Reviews
Working with Hyperledger Fabric
Reviewing the Hyperledger Fabric architecture and components
Getting ready
How to do it...
How it works...
Installing Hyperledger Fabric on AWS
Getting ready
How to do it...
How it works...
Building the Fabric network
How to do it...
How it works...
Adding an organization to a channel
Getting ready...
How to do it...
How it works...
There's more...
Using CouchDB
How to do it...
How it works...
Writing your first application
How to do it...
Accessing the API with SDK
How it works...
See also
Implementing Hyperledger Fabric
Inventory asset management
Writing chaincode as a smart contract
Getting ready
Writing chaincode using Go
How to do it...
The OrgAsset entity
The Init function
The Invoke function
The query and getHistory functions
How it works...
The Init function
The Invoke function
The query function
Compiling and deploying Fabric chaincode
Getting ready
How to do it...
Starting the sample Fabric network
Building and deploying the chaincode
How it works...
Running and testing the smart contract
How to do it...
Installing the assermgr chaincode
Instantiating the assermgr chaincode
Invoking the assermgr chaincode
How it works...
Developing an application with Hyperledger Fabric through the SDK
How to do it...
Creating and executing startFabric.sh
Setting up a client project
Writing Node.js sever-side code
Writing Node.js client-side code
Running the web application
How it works...
Modeling a Business Network Using Hyperledger Composer
The Hyperledger Composer business network and development components
Getting ready
How to do it...
Process flow
Entities
Assets
Query
How it works...
Setting up the Hyperledger Composer prerequisites environment
Getting ready
How to do it...
How it works...
Setting up the development environment
Getting ready
How to do it...
How it works...
Configuring a Composer business network
How to do it...
How it works...
Implementing models, transaction logic, access control, and query definitions
Getting ready
How to do it...
How it works...
There's more...
Deploying, testing, and exporting business network archives using the Composer command-line interface
Getting ready
How to do it...
How it works...
Interacting with Composer through the RESTful API
Getting ready
How to do it...
How it works...
Integrating Hyperledger Fabric with Explorer
Technical requirements
Setting up the Hyperledger Explorer environment
Getting ready
How to do it...
Installing Hyperledger Explorer and setting up the database
How to do it...
Configuring Hyperledger Explorer with Fabric
Getting ready
How to do it...
How it works...
Building Hyperledger Explorer
How to do it...
Running the Hyperledger Explorer application
Getting ready
How to do it...
Working with Hyperledger Sawtooth
Introduction
Installing Hyperledger Sawtooth
Getting ready
How to do it...
Configuring Hyperledger Sawtooth
How to do it...
How it works...
Designing a namespace and address
Getting ready
How to do it...
How it works...
The namespace and address scheme
There's more...
Implementing a transaction family
How to do it...
How it works...
Building a transaction processor
Getting ready
How to do it...
Registering the transaction handler to the transaction processor
Implementing the transaction handler class
Building the command-line script
Setting up the transaction processor as a service
Building a Python egg and installing your python package
Starting the transaction processor service
How it works...
Granting permissions on the Sawtooth network
How to do it...
How it works...
There's more...
Developing client applications with the Sawtooth REST API and SDK
How to do it...
Step 1 – Generating a private/public key-pair and creating a signer instance
Step 2 – Implementing transaction-payload encoding
Step 3 – Implementing the namespace prefix and address scheme
Step 4 – Building a transaction header and a transaction
Step 5 – Building a batch
Step 6 – Submitting the batch with REST API
Step 7 – Building the client application
Step 8 – Testing the sample client
How it works...
Operating an Ethereum Smart Contract with Hyperledger Burrow
Introduction
An introduction to Seth
Installing Hyperledger Burrow on AWS
Getting ready
How to do it...
How it works...
Writing smart contracts with Solidity
Getting ready
How to do it...
How it works...
Using the pragma version and importing another source file
Using contracts
Deploying and calling the Ethereum smart contract on Burrow
Getting ready
How to do it...
How it works...
Installing Hyperledger Seth with Docker on AWS
How to do it...
How it works...
Creating externally owned accounts and writing Solidity contracts on Seth
How to do it...
How it works...
Deploying and calling Ethereum contracts with the Seth CLI and RPC
How to do it...
How it works...
Permissioning Ethereum EOA and contract accounts on Seth
How to do it...
How it works...
Working with Hyperledger Iroha
Installing Hyperledger Iroha on AWS
How to do it...
How it works...
Configuring Hyperledger Iroha
Getting ready
How to do it...
How it works...
Interacting with Hyperledger Iroha using the CLI to create cryptocurrency
Getting ready
How to do it...
How it works...
There's more...
Interacting with Hyperledger Iroha using the client library
Getting ready
How to do it...
How it works...
Exploring the CLI with Hyperledger Indy
Introduction
Installing Hyperledger Indy and the Indy CLI on AWS
Getting ready
How to do it...
How it works...
There's more...
Exploring the Indy CLI with Hyperledger Indy
Getting ready
How to do it...
Running the Indy CLI
Creating, opening, and listing the wallet
Creating, importing, and using the DID
Creating, connecting, and listing the Indy node pool
Sending NYM transactions to the ledger
Posting the credential schema and credential definition transaction to the ledger
How it works...
Hyperledger Blockchain Scalability and Security
Hyperledger blockchain scalability and performance
How to do it...
Block-size scaling
Endorser scaling
The endorser policy
Channels and resource allocation
Hyperledger  blockchain security
How to do it...
The Fabric CA server
The Fabric CA client
The Fabric CA database
How it works...
Hyperledger performance measurement
Getting ready
How to do it...
Installing dependencies
Running the benchmark
How it works...
The adaption layer
The interface and core layer
The application layer
See also
Hyperledger Blockchain Ecosystem
An introduction to the Hyperledger family
The framework projects
The tool projects
Building the Hyperledger framework layers
The Hyperledger design philosophy at a glance
Framework architecture overview
The consensus layer
Smart contracts
Solving business problems with Hyperledger
IBM and Walmart – blockchain for food safety with Hyperledger Fabric
The problem
The approach
The results
ScanTrust and Cambio Coffee – supply-chain blockchain with Hyperledger Sawtooth
The problem
The approach
The results
BC and VON – cutting government red tape with Hyperledger Indy
The problem
The approach
The results
Other Books You May Enjoy
Leave a review - let other readers know what you think
Hyperledger is an umbrella project of modular open source frameworks and tools for building and experimenting with blockchains. The Hyperledger Cookbook provides hands-on experiences and in-depth illustrations covering the full spectrum of Hyperledger offerings. You will not only learn a range of permissioned business blockchain technologies, including Fabric, Sawtooth, Burrow, Iroha, and Indy, but also a set of tools to work with these blockchain frameworks, including Composer, Explorer, and Caliper.
Each chapter contains a set of recipes that helps the reader to become more familiar with Hyperledger blockchain and its tools. The examples in this book will help readers to apply Hyperledger technologies to their own problems.
This book is for blockchain developers who want to learn about the permissioned blockchain technologies for business offered by Hyperledger. With an abundance of recipes covering distributed ledger networks, smart contract engines, client libraries, and various tools in Hyperledger technologies, blockchain developers can apply them to rapidly develop decentralized DLT systems for their enterprises. For more experienced blockchain developers, the recipes covered in this book might expose them to new ways of thinking in terms of how to select and build enterprise blockchain for their business use cases.
Chapter 1, Working with Hyperledger Fabric, concentrates on the fundamental Fabric architecture and components. The recipes cover installation, building a Fabric network, adding an org to a channel, integrating with CouchDB, and writing your first Fabric application.
Chapter 2, Implementing Hyperledger Fabric, is dedicated to building a simple device asset management DApp. The example covers recipes designed to show how to design and write a chaincode smart contract, compile and deploy Fabric chaincode, run and test the smart contract, develop a DApp, and interact with Hyperledger Fabric chaincode through the client SDK API.
Chapter 3, Modeling a Business Network Using Hyperledger Composer, contains recipes designed to show how to use the Composer tool to rapidly develop use cases, build blockchain business networks using the Composer model language, deploy, test and export BNA using the Composer CLI tool, and interact with Composer through the SDK.
Chapter 4, Integrating Hyperledger Fabric with Explorer, this includes installing, setting up, and configuring Hyperledger Explorer, integrating with the Hyperledger framework, and running the Hyperledger Explorer application.
Chapter 5, Working with Hyperledger Sawtooth, includes recipes for installing, deploying, and running DApps with Hyperledger Sawtooth. With the help of Hyperledger Sawtooth's modular architecture, distributed ledger, distributed data storage, and decentralized consensus, several examples demonstrate how to build a transaction processor, design a namespace and address, grant permission on the Sawtooth network, and develop client applications with the Sawtooth RestAPI and SDK.
Chapter 6, Operating an Ethereum Smart Contract with Hyperledger Burrow, contains recipes about how to write smart contracts with Solidity, deploy and interact with Ethereum smart contracts on Burrow, invoke smart contracts with Seth CLI and RPC, and create externally owned accounts on Seth. This chapter also covers the permissioning of Ethereum EOA and contract accounts on Seth.
Chapter 7, Working with Hyperledger Iroha, covers several recipes associated with working with Hyperledger Iroha, including installing and configuring Hyperledger Iroha, and interacting with Hyperledger Iroha using the client library. This chapter also provides an example demonstrating how to use Iroha CLI to create a cryptocurrency.
Chapter 8, Exploring the CLI with Hyperledger Indy, covers the installation of Hyperledger Indy and the exploration of Indy CLI with Hyperledger Indy.
Chapter 9, Hyperledger Blockchain Scalability and Security, contains recipes about how to measure Hyperledger blockchain performance using the Hyperledger Caliper tool, how to design and implement highly scalable Hyperledger blockchain, and how to build a secure Hyperledger consortium network with Fabric CA.
Appendix, Hyperledger Blockchain Ecosystem, mainly targets those individuals who are relatively new to distributed ledger technology and permissioned blockchains. It covers Hyperledger blockchain concepts, the important technical design methodology of the Hyperledger ecosystem, and explores when to apply these technologies through real-world use cases.
To better understand and follow the recipes in this book, it will help if you have some basic knowledge of blockchain technology and cryptograph concepts, have a basic understanding of programming languages for JavaScript, Go, and Python, some basic Unix skills, in particular, shell command, and are familiar with basic flows for launching and running applications in the cloud, such as Amazon AWS.
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packt.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hyperledger-Cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Install Node.js, npm, and Python."
A block of code is set as follows:
type Chaincode interface { Init (stub ChaincodeStubInterface) pb.Response Invoke (stub ChaincodeStubInterface) pb.Response}
Any command-line input or output is written as follows:
$ sudo apt-get update
Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Click on the Query Chaincode button."
In this book, you will find several headings that appear frequently (Getting ready, How to do it..., How it works..., There's more..., and See also).
To give clear instructions on how to complete a recipe, use these sections as follows:
This section tells you what to expect in the recipe and describes how to set up any software or any preliminary settings required for the recipe.
This section contains the steps required to follow the recipe.
This section usually consists of a detailed explanation of what happened in the previous section.
This section consists of additional information about the recipe in order to increase your knowledge of it.
This section provides helpful links to other useful information for the recipe.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
Hyperledger Fabric is the most widely-used permissioned blockchain in the Hyperledger family. It is an open source enterprise-grade platform that leverages a highly-modular and configurable architecture. Hyperledger Fabric is optimized for a broad range of industry use cases, including the finance, banking, healthcare, insurance, and public sectors, as well as supply chains and digital asset management.
Hyperledger Fabric supports smart contact development in general-purpose programming languages, such as Java, Go, and Node.js. Hyperledger Fabric is also operating under a governance model to build trust between participants on a shared network.
In this chapter, we will cover the following recipes:
Reviewing the Hyperledger Fabric architecture and components
Installing Hyperledger Fabric on AWS
Building the Fabric network
Adding an organization to a channel
Using CouchDB
Writing your first application
We will review and examine various Hyperledger Fabric components and architectures throughout this recipe. Hyperledger Fabric has three core components, which are peers, ordering service, and Fabric CA:
Peer
: A node on the network that maintains the state of the ledger and manages chaincode. Any number of peers may participate in a network. A peer can be an endorser, which executes transactions, or a committer, which verifies the endorsements and validates transactions results. An endorser is always a committer.
Peers form a peer-to-peer gossip network.
A peer manages the events hub and delivers events to the subscribers.
Ordering service
: Packages transactions into blocks to be delivered to peers, since it communicates only with peers. The ordering service is the genesis of a network. Clients of the ordering service are peers and applications. A group of orderers run a communication service, called an ordering service, to provide an atomic broadcast. The ordering service accepts transactions and delivers blocks. The ordering service processes all configuration transactions to set up network policies (including readers, writers, and admins). The orderer manages a pluggable trust engine (such as CFT or BFT) that performs the ordering of the transactions.
Fabric CA
: Fabric CA is the certificate authority that issues PKI-based certificates to network member organizations and users. Fabric CA supports LDAP for user authentication and HSM for security. Fabric CA issues one root certificate to member organizations and one enrollment certificate to each authorized user.
Hyperledger Fabric also have several important key features and concepts:
Fabric ledger
: Maintained by each peer and consists of two parts: the blockchain and the world state. Transaction read/write and channel configurations sets are written to the blockchain. A separate ledger is maintained for each channel for each peer that joins. The world state has options of either LevelDB or CouchDB, where LevelDB is a simple key-value store and CouchDB is a document store that allows complex queries. The smart contract decides what is written into the world state.
Channel
: Provides privacy between different ledgers and exists in the scope of a channel. Channels can be shared across an entire network of peers, and peers can participate in multiple channels. Channels can be permissioned for a specific set of participants. Chaincode is installed on peers to access the world state. Chaincode is instantiated on specific channels. Channels also support concurrent execution for performance and scalability.
Organization
: Define boundaries within a Fabric blockchain network. Each organization defines an MSP for the identities of administrators, users, peers, and orderers. A network can include many organizations, representing a consortium. Each organization has an individual ID.
Endorsement policy
: The conditions by which a transaction can be endorsed. A transaction can only be considered valid if it has been endorsed according to its policy. Each chaincode is deployed with an endorsement policy.
Endorsement system chaincode
(
ESCC
) signs the proposal response on the endorsing peer and
validation system chaincode
(
VSCC
) validates the endorsement.
Membership services provider
(
MSP
): Manages a set of identities within a distributed Fabric network. It provides identities for peers, orderers, client applications, and administrators. Where the identities can be Fabric CA or external CA, MSP provides authentication, validation, signing and issuance. MSP support different crypto standards with a pluggable interface. A network can include multiple MSPs (typically one per organization), which can include TLS crypto material for encrypted communications.
We will look into a sample transaction flow on Hyperledger Fabric. Fabric uses the execute-order-validate blockchain transaction flow architecture shown in the following diagram:
In this section, we will review how a transaction is created on the Hyperledger Fabric network:
The
Client Application
submits a transaction proposal for smart contact
A
to the network. The endorsement policy requires three endorsers—
E0
,
E1
, and
E2
—to sign together.
The endorsers execute proposed transactions. At this time, three endorsers—
E0
,
E1
,
E2
—will each execute the proposed transaction independently. None of these executions will update the ledger. Each execution will capture the set of
read and written
(
RW
) data, which will now flow in the fabric network. All transactions should be signed and encrypted.
RW sets are asynchronously returned to the client application with a transaction proposal. The RW sets are signed by each endorser and will be processed later.
All transactions that returned from the Fabric network are submitted for ordering. The application can submit responses as a transaction to be ordered, and ordering happens across the Fabric in parallel with transactions submitted by other applications.
Ordering Service
collects transactions into proposed blocks for distribution to committing peers. This proposed blocks can then be deliver to other peers in a hierarchy. There are two ordering algorithms available: SOLO (single node for development) and Kafka (crash-fault-tolerance for production). In the production system, it is suggested to use Kafka.
Committing peers validate the transactions. All committing peers validate against the endorsement policy and check whether RW sets are still valid for the current world state. World state is not update if there is invalid transctions but are retained on the ledger while validated transactions are applied to the world state.
Client applications can register to be notified on the status of transactions, to find out whether they succeed or fail, and when blocks are added to the ledger. Client applications will be notified by each peer to which they are independently connected.
We reviewed how transaction flow works in Fabric. Fabric uses the execute-order-validate model with the following seven steps:
Client application submits a transaction proposal
Endorsers execute the proposed transactions
Client applications receive transaction proposal response
Transactions are submitted for ordering
Transactions are delivered to committing peer
Validated transaction are applied to world state
Client applications get notified with the status of the transaction
In the next recipe, we will walk through how to install Hyperledger Fabric on Amazon Web Services (AWS).
To install and run the recipe in this chapter, you need AWS EC2 Ubuntu Server 16.04 with 4 GB of memory. We will use the Fabric 1.3 release as it is the most stable release as of writing this recipe.
From the Hyperledger Fabric website (https://hyperledger-fabric.readthedocs.io/en/release-1.3/prereqs.html), the prerequisites for this recipe are as follows:
Operating systems
: Ubuntu Linux 14.04 / 16.04 LTS (both 64-bit), or macOS 10.12
cURL tool
: The latest version
Docker engine
: Version 17.06.2-ce or greater
Docker-compose
: Version 1.14 or greater
Go
: Version 1.10.x
Node
: Version 8.9 or higher (note: version 9 is not supported)
npm
: Version 5.x
Python
: 2.7.x
We chose Amazon Ubuntu Server 16.04. If you don't have experience with installing Ubuntu in EC2, please refer to the AWS document: https://aws.amazon.com/getting-started/tutorials/launch-a-virtual-machine/.
You can also chose to install Ubuntu in your local machine virtual box. A tutorial for this can be found at http://www.psychocats.net/ubuntu/virtualbox or https://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox.