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)
16
Another Book You May Enjoy
17
Index

Summary of key steps

As a reference to our readers, we list the sequence of operations that must be performed to bring up a network and distributed application from scratch and run transactions on it. We supply shortcut commands using the Bash scripts in trade-network wherever applicable. You should choose the ordering service type in the beginning and run all commands in the appropriate mode:

  1. Create cryptographic and channel artifacts (the -m switch is optional):
    $ ./trade.sh generate -c tradechannel -o 3 [-m prod]
    $ ./trade.sh generate -c shippingchannel -o 4 [-m prod]
    
  2. Launch the network:
    $ ./trade.sh up [-m prod]
    
  3. Create channels, join peers to channels, and set anchor peers for organizations:
    $ ./startAndJoinChannels.sh
    
  4. Install and initialize contracts. You can do this manually using VS Code or by running the following shortcut command:
    $ ./sampleChaincodeOperations.sh
    
  5. Create a wallets...