Book Image

Blockchain with Hyperledger Fabric - Second Edition

By : Nitin Gaur, Anthony O'Dowd, Petr Novotny, Luc Desrosiers, Venkatraman Ramakrishna, Salman A. Baset
Book Image

Blockchain with Hyperledger Fabric - Second Edition

By: Nitin Gaur, Anthony O'Dowd, Petr Novotny, Luc Desrosiers, Venkatraman Ramakrishna, Salman A. Baset

Overview of this book

Blockchain with Hyperledger Fabric - Second Edition is a refreshed and extended version of the successful book on practical Hyperledger Fabric blockchain development. This edition includes many new chapters, alongside comprehensive updates and additions to the existing ones. Entirely reworked for Hyperledger Fabric version 2, this edition will bring you right up to date with the latest in blockchain. Using a real-world Trade Finance and Logistics example, with working code available on GitHub, you’ll really understand both how and why Hyperledger Fabric can be used to maximum effect. This book is your comprehensive guide and reference to explore and build blockchain networks using Hyperledger Fabric version 2. This edition of the book begins by outlining the evolution of blockchain, including an overview of relevant blockchain technologies. Starting from first principles, you’ll learn how to design and operate a permissioned blockchain network based on Hyperledger Fabric version 2. You will learn how to configure the main architectural components of a permissioned blockchain network including Peers, Orderers, Certificate Authorities, Channels, and Policies. You’ll then learn how to design, develop, package, and deploy smart contracts, and how they are subsequently used by applications. This edition also contains chapters on DevOps, blockchain governance, and security, making this your go-to book for Hyperledger Fabric version 2.
Table of Contents (18 chapters)
Another Book You May Enjoy

Smart contract security

In Hyperledger Fabric, as indicated previously, smart contracts (chaincodes) can be written in Go, Java, or JavaScript. The smart contract must be installed on a peer and then explicitly instantiated.

When instantiated using the docker builder command, each smart contract is built and then launched in its own Docker container. Starting with version 2.0, external builders can be utilized to build and run smart contracts without requiring a Docker daemon.

When running the smart contract inside a Docker container, it is important to understand what access this container may have to the network. If care is not taken in carefully reviewing the smart contract before it gets installed on the peer, and in isolating the network access for that smart contract, it could result in a malicious or misconfigured node probing or attacking the peer attached to the same virtual network.

How is a smart contract shared with other endorsing peers?

Starting in Fabric...