Table Of ContentMastering Hyperledger fabric
Master the art of Hyperledger Fabric on Kubernetes
Author
Narendranath Reddy Thota
Blockchain Software Engineer
Consensys, Dubai
Who this Book is For
This Book benefits Software Engineers who are ready to shift their focus to
distributed technologies and Blockchain. This book provides a
comprehensive view of Solution Architecture, so it will be easy for architects
to architect their solution. CTO’s around the world want to add hyperledger
fabric to their technology stack. Managers to cope up with the latest trend.
Faculty Professors in order to get industry insights. Even Engineering
Students who want to be ready with the latest technologies.
Book Description
Mastering Hyperledger Fabric is a craving topic for all Hyperledger Fabric
Developers around the world. Hyperledger Fabric is an open-source project
that helps organizations create and maintain permissioned distributed
Blockchain consortiums. This book is for readers who are looking for
Hyperledger offerings to build end-to-end projects with growing complexity
and functionalities. This book will be a one-stop solution for all developers
who want to build blockchain consortiums using Hyperledger Fabric. Topics
includes TLS, Unix sockets, caliper(Benchmark tool), raft consensus,
advanced chaincode development, key collision and MVCC, chaincode
access controls, chaincode encryption, node.js SDK, golang SDK, docker
daemon API, private data concepts, onboarding organizations using node.js
SDK, deploy hyperledger fabric using Kubernetes, deploy hyperledger fabric
using docker swarm, monitoring hyperledger fabric, monitoring Kubernetes,
monitoring docker swarm, logging hyperledger fabric. After reading this
book the reader will be able to set up Production grade hyperledger fabric
consortium using raft consensus mechanisms with monitoring using
Prometheus and grafana, even logging. This book explains so many key
concepts of hyperledger fabric including 2.0 and written with three years of
hyperledger fabric production experience.
Preface
The Main goal of this book is to provide a one stop solution for all
implementations related to Hyperledger fabric projects. This book covered a
variety of technologies such as docker, docker swarm, kubernetes, elk stack,
prometheus, grafana, TLS, sockets, Raft, NodeJS, etc and a variety of
implementations such as caliper, logging, monitoring, and three diverse use
cases. The content in this book helps developers to complete their solutions
around Hyperledger Fabric. After reading this book readers will be able to
develop production grade projects around Hyperledger fabric with different
container orchestrator tools.
It is recommended that readers have a basic understanding of programming
experience, docker, Node.js and introduction to Hyperledger fabric,
kubernetes in order to benefit fully from this book.
What this book covers
Chapter1: Introduction to the Hyperledger Landscape
Chapter2: The Disruptive Potential of TLS
Chapter3: All about docker sockets
Chapter4: Installation Guide Of Prerequisites
Chapter5: All about fabric CLI
Chapter6: All about SDK's (go lang and Node.js)
Chapter7: Advanced Chaincode Development
Chapter8: End to End with Solo consensus using docker with one use case
Chapter9: End to End with Kafka consensus using docker swarm with one
use case
Chapter10: End to End with Raft consensus using Kubernetes with one use
case
Chapter11: Private Data Concepts, Consortium level ACL(Access Control
Lists) and raft consensus mechanism
Chapter12: Setup and Benchmark Blockchain Consortium Using Caliper
Chapter13: Monitoring Consortium with Prometheus and grafana
Chapter14: Logging Consortium with ELK Stack
Chapter15: Glimpse of Hyperledger fabric 2.0
Chapter16: Some Interesting tools
Table of
Contents
Chapter1: Introduction to the Hyperledger Landscape
In this chapter, we will cover the following topics:
Welcome to the distributed world
Source: wikipedia.org
The Hyperledger Greenhouse
Fabric Terminology - A quick review
Important Elements
Consensus mechanism
Transaction Flow
MSP (Membership Service Provider)
Glimpse of Container Orchestration
Summary:
Chapter2: The Disruptive Potential of TLS
An introduction to TLS (One-Way)
Bank - Passport Analogy (A Very Low Level of TLS)
Double secure with Mutual SSL/TLS
How does a cryptogen tool generate a bundle of certificates?
Summary:
Chapter3: All about docker sockets
An introduction to docker daemon API
Interact with docker daemon API via docker sock
List of Available Images:
List of running containers:
Create a tag to an image:
Stop a running container:
Pull an Image:
How Fabric peers benefit from using docker sock ?
Summary:
Chapter4: Install Prerequisites
Install and Setup Virtual Box
Install dependencies
PlanA:
PlanB:
Summary:
Chapter5: All about fabric CLI
CLI Basic Operations
Create Channel
Join Channel
Install Chaincode
Instantiate Chaincode
Invoke Chaincode
Query Chaincode
CLI Advanced Operations
Retrieve present Configuration of a Channel
Sign Config Transaction
Update Channel
Summary:
Chapter6: All about SDK's (go lang and Node.js)
Basic setup of golang sdk
Advanced Operations using golang
Create Channel:
Install Chaincode:
Join Channel:
Instantiate Chaincode:
Invoke:
Query transaction:
Register Identity:
Enroll Identity:
Basic Operations using Node.js
Setup Initialize:
Create Channel:
Join Channel:
Install Chaincode:
Instantiate Chaincode:
Invoke Transaction:
Query Chaincode:
Advanced Operations using Node.js
Register Identity:
Enroll Identity:
Re Enroll:
Revoke:
Generate Certificate Revocation List:
Block Event Listener:
Chaincode Event Listener:
Get Present Channel Config As JSON:
UpdateChannel:
Summary:
Chapter7: Advanced Chaincode Development
key collision and MVCC
Client Identity Chaincode Library
Based on MSP ID
Based On Attributes
End-to-End Encryption
Encrypt:
Decrypt:
CI/CD Installing chaincode From GitHub to the peers
STEP1: Create and configure github repo
STEP2:
STEP3: Proceed with webhook handler
Summary:
Chapter8: Running fabric consortium with Solo consensus using docker
SubTitle: Building Invoice Financing mechanism with solo consensus
Getting started:
Define Business Network
Design Network Topology
Deploy Consortium:
Building an Application:
Chain Code:
Interact with fabric:
Tips on Errors, Tricks and Best Practices
Troubleshooting:
Summary
Chapter9: Running fabric Consortium with Kafka consensus using docker swarm
Use Case In Detail:
Technical Requirements:
Project overview:
Getting started:
Define Business Network
Design Network Topology
Deploy Consortium:
Monitoring Swarm Network:
Building an Application
Chain Code:
Interact with fabric:
Summary
Chapter10: Running fabric Consortium with Raft consensus using kubernetes
Use Case In Detail:
Technical Requirements
Project overview:
Getting started
Define Business Network
Design Network Topology
Deploy Consortium:
Monitoring Kubernetes:
Monitoring Kubernetes using Weave Net:
Building an Application:
Chain Code:
Interact with fabric:
Summary:
Chapter11: Private Data Concept, Consortium level ACL(Access Control Lists) and Raft Consensus
Private Data Concept:
Theory:
Practical:
Create a collection definition json file
Access Control Lists:
Raft Consensus:
Hyperledger fabric Raft consensus:
Summary:
Chapter12: Setup and Benchmark Blockchain Consortium Using Caliper
Caliper Supported blockchain solutions are the following:
Caliper Supported performance metrics are the following:
Install and Setup Caliper
Benchmark configuration file
Network configuration file
Write A Sample Chaincode
Benchmark scripts
Run the total setup:
Report Summary:
Summary:
Chapter13: Monitoring Consortium with Prometheus and grafana
Deploy Default Consortium:
Summary:
Chapter14: Logging Consortium with ELK Stack
Setup ELK Stack:
Deploy and Test:
Shipping docker data into dockerized ELK stack:
Summary:
Chapter15: Glimpse of Hyperledger fabric 2.0
Do we really need to discuss about 2.0 ?
Smart Contracts Decentralized Governance
Private Data Enhancements
External Chaincode Launcher
Alpine-Based Docker Images
Upgrading to Fabric v2.0
Upgrade ordering nodes:
Upgrade the peers:
Summary:
Chapter16: Some Interesting tools
ledgerfsck - Tool to verify ledger integrity
Security Analyzer for Hyperledger Fabric Smart Contracts
ledgerfsck - Tool to verify ledger integrity
Security Analyzer
Summary: