万本电子书0元读

万本电子书0元读

顶部广告

Blockchain Development with Hyperledger电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Salman A. Baset

出  版  社:Packt Publishing

出版时间:2019-03-26

字       数:82.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Learn quick and effective techniques for developing blockchain-based distributed ledgers with ease Key Features * Discover why blockchain is a game changer in the technology landscape * Set up blockchain networks using Hyperledger Fabric * Write smart contracts at speed with Hyperledger Composer Book Description Blockchain and Hyperledger are open source technologies that power the development of decentralized applications. This Learning Path is your helpful reference for exploring and building blockchain networks using Ethereum, Hyperledger Fabric, and Hyperledger Composer. Blockchain Development with Hyperledger will start off by giving you an overview of blockchain and demonstrating how you can set up an Ethereum development environment for developing, packaging, building, and testing campaign-decentralized applications. You'll then explore the de facto language Solidity, which you can use to develop decentralized applications in Ethereum. Following this, you'll be able to configure Hyperledger Fabric and use it to build private blockchain networks and applications that connect to them. Toward the later chapters, you'll learn how to design and launch a network, and even implement smart contracts in chain code. By the end of this Learning Path, you'll be able to build and deploy your own decentralized applications by addressing the key pain points encountered in the blockchain life cycle. This Learning Path includes content from the following Packt products: * Blockchain Quick Start Guide by Xun (Brian) Wu and Weimin Sun * Hands-On Blockchain with Hyperledger by Nitin Gaur et al. What you will learn * Understand why decentralized applications are necessary * Develop and test a decentralized application with Hyperledger Fabric and Hyperledger Composer * Write and test a smart contract using Solidity * Design transaction models and chain code with Golang * Deploy the Composer REpresentational State Transfer (REST) Gateway to access Composer transactions * Maintain, monitor, and manage your blockchain solutions Who this book is for This Learning Path is designed for blockchain developers who want to build decentralized applications and smart contracts from scratch using Hyperledger. Basic familiarity with or exposure to any programming language will be useful to get started with this course.
目录展开

Title Page

Copyright

Blockchain Development with Hyperledger

About Packt

Why Subscribe?

Packt.com

Contributors

About the Authors

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

Get in Touch

Reviews

Blockchain - Enterprise and Industry Perspective

Defining the terms – what is a blockchain?

Four core building blocks of blockchain framworks

Additional capabilities to consider

Fundamentals of the secure transaction processing protocol

Where blockchain technology has been and where it's going

The great divide

An economic model for blockchain delivery

Learning as we go

The promise of trust and accountability

Industries putting blockchain technology to work

Blockchain in the enterprise

What applications are a good fit?

How does the enterprise view blockchain?

Litmus testing to justify the application of blockchain technology

Integrating a blockchain infrastructure for the whole enterprise

Enterprise design principles

Business drivers and evolution

Ensuring sustainability

The principles that drive blockchain adoption

Business considerations for choosing a blockchain framework

Technology considerations for choosing a blockchain framework

Identity management

Scalability

Enterprise security

Development tooling

Crypto-economic models

Decentralization with systemic governance

Enterprise support

Use case-driven pluggability choices

Shared ledger technology

Consensus

Crypto algorithms and encryption technology

Use case-driven pluggable choices

Enterprise integration and designing for extensibility

Other considerations

Consensus, ACID property, and CAP

CAP

ACID

Attestation – SSCs are signed and encrypted

Use of HSMs

Summary

Exploring Hyperledger Fabric

Hyperledger frameworks, tools, and building blocks

Hyperledger frameworks

Hyperledger tools

The building blocks of blockchain solutions

Hyperledger Fabric component design

Principles of Hyperledger design

CAP Theorem

Hyperledger Fabric reference architecture

Hyperledger Fabric runtime architecture

Strengths and advantages of a componentized design

Hyperledger Fabric – the journey of a sample transaction

Hyperledger Fabric explored

Components in a blockchain network

Developer interaction

Understanding governance in business networks powered by blockchain

Governance structure and landscape

Information technology governance

Blockchain network governance

Business network governance

Summary

Setting the Stage with a Business Scenario

Trading and letter of credit

The importance of trust in facilitating trade

The letter of credit process today

Business scenario and use case

Overview

Real-world processes

Simplified and modified processes

Terms used in trade finance and logistics

Shared process workflow

Shared assets and data

Participants' roles and capabilities

Benefits of blockchain applications over current real-world processes

Setting up the development environment

Designing a network

Installing prerequisites

Forking and cloning the trade-finance-logistics repository

Creating and running a network configuration

Preparing the network

Generating network cryptographic material

Generating channel artifacts

Generating the configuration in one operation

Composing a sample trade network

Network components' configuration files

Launching a sample trade network

Summary

Designing a Data and Transaction Model with Golang

Starting the chaincode development

Compiling and running chaincode

Installing and instantiating chaincode

Invoking chaincode

Creating a chaincode

The chaincode interface

Setting up the chaincode file

The Invoke method

Access control

ABAC

Registering a user

Enrolling a user

Retrieving user identities and attributes in chaincode

Implementing chaincode functions

Defining chaincode assets

Coding chaincode functions

Creating an asset

Reading and modifying an asset

Main function

Testing chaincode

SHIM mocking

Testing the Init method

Testing the Invoke method

Running tests

Chaincode design topics

Composite keys

Range queries

State queries and CouchDB

Indexes

ReadSet and WriteSet

Multiversion concurrency control

Logging output

Configuration

Logging API

SHIM logging levels

Stdout and stderr

Additional SHIM API functions

Summary

Exposing Network Assets and Transactions

Building a complete application

The nature of a Hyperledger Fabric application

Application and transaction stages

Application model and architecture

Building the application

Middleware – wrapping and driving the chaincode

Installation of tools and dependencies

Prerequisites for creating and running the middleware

Installation of dependencies

Creating and running the middleware

Network configuration

Endorsement policy

User records

Client registration and enrollment

Creating a channel

Joining a channel

Installation of chaincode

Instantiation of chaincode

Invoking the chaincode

Querying the chaincode

Completing the loop – subscribing to blockchain events

Putting it all together

User application – exporting the service and API

Applications

User and session management

Designing an API

Creating and launching a service

User and session management

Network administration

Exercising the application

User/client interaction modes

Testing the Middleware and Application

Integration with existing systems and processes

Design considerations

Decentralization

Process alignment

Message affinity

Service discovery

Identity mapping

Integration design pattern

Enterprise system integration

Integrating with an existing system of record

Integrating with an operational data store

Microservice and event-driven architecture

Considering reliability, availability, and serviceability

Reliability

Availability

Serviceability

Summary

Business Networks

A busy world of purposeful activity

Why a language for business networks?

Defining business networks

A deeper idea

Introducing participants

Types of participant

Individual participants

Organizational participants

System or device participants

Participants are agents

Participants and identity

Introducing assets

Assets flow between participants

Tangible and intangible assets

The structure of assets

Ownership is a special relationship

Asset life cycles

Describing asset's life cycles in detail with transactions

Introducing transactions

Change as a fundamental concept

Transaction definition and instance

Implicit and explicit transactions

The importance of contracts

Signatures

Smart contracts for multi-party transaction processing

Digital transaction processing

Initiating transactions

Transaction history

Transaction streams

Separating transactions into different business networks

Transaction history and asset states

A business network as a history of transactions

Regulators and business networks

Discussing events from the perspective of designing a business network using Composer

A universal concept

Messages carry event notifications

An example to illustrate event structure

Events and transactions

External versus explicit events

Events cause participants to act

Loosely coupled design

The utility of events

Implementing a business network

The importance of de-materialization

Blockchain benefits for B2B and EDI

Participants that interact with the blockchain

Accessing the business network with APIs

A 3-tier systems architecture

Hyperledger Fabric and Hyperledger Composer

Summary

A Business Network Example

The letter of credit sample

Installing the sample

Running the sample

Step 1 – preparing to request a letter of credit

Step 2 – requesting a letter of credit

Step 3 – importing bank approval

Step 4 – exporting bank approval

Step 5 – letter received by exporter

Step 6 – shipment

Step 7 – goods received

Step 8 – payment

Step 9 – closing the letter

Step 10 – Bob receives payment

Recapping the process

Analyzing the letter of credit process

The Playground

Viewing the business network

A description of the business network

The participant descriptions

The asset descriptions

The transaction descriptions

The event descriptions

A model of the business network

Namespaces

Enumerations

Asset definitions

Participant definitions

Concept definitions

Transaction definitions

Event definitions

Examining the live network

Examining a letter of credit instance

Examining participant instances

Examining transaction instances

Submitting a new transaction to the network

Understanding how transactions are implemented

Creating business network APIs

SWAGGER API definitions

Querying the network using SWAGGER

Testing the network from the command line

Creating a new letter using SWAGGER

Network cards and wallets

Access-control lists

Summary

Agility in a Blockchain Network

Defining the promotion process

Smart contract considerations

Integration layer considerations

Promotion process overview

Configuring a continuous integration pipeline

Customizing the pipeline process

Local build

Configuring Travis CI

Customizing the pipeline using .travis.yml

Publishing our smart contract package

Configuring your Git repository

Setting the code owners of our smart contract

Sample content of the CODEOWNERS

Protecting the master branch

Configuring Git for commit signing and validation

Configuring GPG on your local workstation

Testing the end-to-end process

Creating a new transaction

Pushing a commit to the master branch directly

Submitting a pull request with an unsigned commit

Adding test cases

Submitting a pull request with a signed commit

Adding the mergeAssets unit test

Releasing the new version

Updating the network

Notifying the consortium

Upgrading the business network

Downloading a new version

Updating the business network

Summary

Life in a Blockchain Network

Modifying or upgrading a Hyperledger Fabric application

Fabric blockchain and application life cycle

Channel configuration updates

Prerequisites for adding a new organization to the network

Generating network cryptographic material

Generating channel artifacts

Generating the configuration and network components in one operation

Launching the network components for the new organization

Updating the channel configuration

Adding the new organization to the network

Smart contract and policy updates

Modification in chaincode logic

Dependency upgrades in chaincode

Ledger resetting

Endorsement policy update

Upgrading chaincode and endorsement policy on the trade channel

Platform upgrades

System monitoring and performance

Measurement and analytics

What should we measure or understand in a Fabric application

Blockchain applications vis-à-vis traditional transaction processing applications

Metrics for performance analysis

Measurement and data collection in a Fabric application

Collecting health and capacity information

Profiling containers and applications

Measuring application performance

Fabric engineering guidelines for performance

Platform performance characteristics

System bottlenecks

Configuration and tuning

Ledger data availability and caching

Redundant committing peer

Data caching

Fabric performance measurement and benchmarking

Summary

Governance, Necessary Evil of Regulated Industries

Decentralization and governance

Exploring the business models

Blockchain benefits

Supply chain management

Healthcare

Finance – letter of credit

From benefits to profits

Network business model

Founder-led network

Consortium-based network

Community-based network

Hybrid models

Joint venture

New corporation

Role of governance in a business network

Business domains and processes

Membership life cycle

Funding and fees

Regulation

Education

Service life cycle

Disputes

Governance structure

Centralized governance

Strategic governance

Operational governance

Tactical governance

Decentralized governance

Governance and the IT solution

Managed on-boarding

Summary

Hyperledger Fabric Security

Hyperledger Fabric design goals impacting security

Hyperledger Fabric architecture

Fabric CA or membership service provider

Peer

Smart contract or chaincode

Ledger

Private data

Ordering service

Network bootstrap and governance – the first step towards security

Creating the network

Adding new members

Deploying and updating chaincode

Data model

Strong identities – the key to the security of the Hyperledger Fabric network

Bootstrapping Fabric CA

Register

Default Fabric roles

Enroll

Which crypto protocols are allowed in certificate signing requests?

Revoking identities

Practical considerations in managing users in Fabric CA

Chaincode security

How is chaincode shared with other endorsing peers?

Who can install chaincode?

Chaincode encryption

Attribute-based access control

Pros and cons of attribute-based access control

Common threats and how Hyperledger Fabric mitigates them

Transaction privacy in Hyperledger Fabric

Channels

Private data

Encrypting transaction data

Hyperledger Fabric and Quantum Computing

General data protection regulation (GDPR) considerations

Summary

Introduction to Blockchain Technology

The genealogy analogy

Bitcoin

Why Bitcoin

A peer-to-peer network

Cryptography and hash functions

The distributed ledger, blocks, transactions, addresses, and UTXO

The consensus mechanism

Forking

Mining and difficulty level

Hacking – the 51% problem

Private keys and Bitcoin wallets

Bitcoin scripting

Altcoins

Ethereum

Enterprise blockchain – Hyperledger

The evolution of blockchain

Summary

Ethereum Fundamentals

An overview of Ethereum

Ethereum basic concepts

Ether

ERC20 tokens

Smart contracts

Ethereum virtual machines

Ethereum gas

Account

Oracle

Other concepts

Performance

Throughput

Proof-of-Stake (PoS)

Casper

Plasma

Sharding

Summary

Overview of Solidity Programming

What is solidity?

Tools for solidity development environment

Browser-based IDE

Remix

EthFiddle

Command-line development management tools

Truffle

Introduction to smart contracts

Layout of a solidity source file

Pragma

Comments

Import

Paths

Relative paths

Structure of a contract

State variables

Data type

Enum type

Struct type

Mapping

Functions

Input parameters

Access modifiers

Output parameters

Modifiers

Events

Constructor

Constant state variables, unit, and functions

Ether units

Time units

Inheritance, abstract, and interface

Common smart contract patterns

Access restriction

State machine

Smart contract security

Keep contract simple and modular

Use the checks-effects-interactions pattern

DoS with block gas limit

Handle errors in external calls

Case study – crowdfunding campaign

Summary

Building an Ethereum Blockchain Application

Decentralized application overview

web3.js quick overview

Provider

DApp development tools

Truffle

Ganache

Setting up an Ethereum development environment

Installing Truffle

Installing Ganache

Creating a Truffle project

Launching the Ganache environment

Deploying a smart contract

Writing a campaign decentralized application

Selecting a web3 provider

Loading account information

Loading project information

Handling the fund function

checkGoalReached

Summary

Exploring an Enterprise Blockchain Application Using Hyperledger Fabric

Issuance claim

Setting up a Hyperledger Fabric environment

Installation prerequisites

Installing Hyperledger Fabric

Writing chaincode

Development tools

LiteIDE

JetBrains Gogland

Visual Studio Code

Chaincode key concept and APIs

Defining an issuance claim

Initializing the chaincode

Invoking the chaincode

AddCompany

ReportLost

RequestedInfo

SubmitClaim, ConfirmClaimSubmission, ApproveClaim

Query

getHistory

Configuring Hyperledger Fabric

Generating the certificate

Generating an orderer genesis block

Generating a channel configuration transaction

Overview of Hyperledger Fabric Docker composer configuration files

Fabric project directory structure

Docker-compose-base.yaml

Peer-base.yaml

Starting the Hyperledger Fabric network

Creating a channel

Joining channels

Updating the anchor

Installing chaincode

Instantiating the chaincode

Invoking add broker

Invoking add insurer

Invoking ReportLost

Invoking RequestedInfo

Invoking SubmitClaim

Invoking ConfirmClaimSubmission

Invoking ApproveClaim

Querying claim history

End-to-end test execution

Summary

Implementing Business Networks Using Hyperledger Composer

Hyperledger Composer – a quick overview

Yeoman generator

Composer REST server

LoopBack connector

JavaScript SDK

Composer playground

Composer-cli

Setting up a Hyperledger Composer environment

Installation prerequisites

Installing the development environment

Analyzing business scenarios

Business network archive

Network model file (.cto)

Script file (.js)

Access control list (ACL) file (.acl)

Query file (.qry)

Designing business models

Implementing the business transaction function

Testing in the playground

Deploying a business network

Integrating with REST server

Generating the Hyperledger Composer REST API

Summary

Blockchain Use Cases

Blockchain use case examples

Payment and settlement services

Import and export finance

Immutable ledger

Regulatory compliance and auditing

Identity theft detection

Funds back-office operation

Collateral management

Healthcare systems

Real estate trading and rental markets

IP market

Elections

HR and recruiting

Public records

Reduce contract disputes

Sharing economy

Integration with IoT

Facilitate commercial and social relationships

How to choose a proper use case

DApp use case – healthcare data sharing

The business problem

A blockchain solution

Summary

Other Books You May Enjoy

Leave a Review - Let Other Readers Know What You Think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部