Mastering Hyperledger Chaincode Development using GoLang
4.2 (222 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,514 students enrolled

Mastering Hyperledger Chaincode Development using GoLang

Design and develop Fabric 2.1 applications from end-to-end using GoLang & Fabric Node SDK
4.2 (222 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,514 students enrolled
Created by Rajeev Sakhuja
Last updated 4/2020
English [Auto]
Current price: $55.99 Original price: $79.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 10 hours on-demand video
  • 2 articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Chaincode development using GoLang
  • Application Development using Fabric Node SDK
  • Use of Private Data
  • Use of Instantiation & Endorsement policies
  • Building support for Rich Queries & Asset History
  • Building Programmatic access control with "Client Identity Library"
  • Testing tools for Chaincode such as Golang Testing framework & MockStub
Course content
Expand all 118 lectures 10:05:13
+ Introduction
2 lectures 03:25
  • Tips to get the most value out of this course

  • Course Layout

Preview 03:06

Link to the project repository

Project Repository Download link + Secret
+ Hyperledger Fabric 2.x Update
2 lectures 14:27

+ Fabric 2.x Updates

Fabric 2.x Section | Lecture updates

Overview of the course updates.

+ Returning students - Fast track to updating knowledge to Fabric 2.0

Hyperledger Fabric 2.x Chaincode Updates (What's new?)
+ Development Environment Setup
7 lectures 23:25
  • Minimum requirements for the Dev machine

  • Visual Studio Code Setup

Preview 02:34
  • Overview of Virtualization

  • Introduction to VirtualBox & Vagrant

Crash course on Virtualization (Vagrant & VirtualBox)
  • Setup of the repo (git clone)

  • Walk through of the samples repository

Download Project Repo & Setup the Dev VM

+ Provides an overview of the development workflow

+ Discussion on the options for installation

Dev Environment Overview & Setup options

Students who use the "VirtualBox" hypervisor may use this option to carry out this installation which is very fast and does not require manual installation of the tools.

Virtual Box Express Install
  • Development environment overview

  • Development workflow

  • Installation of the Fabric Runtime

Standard VM Install (1 of 2)

Installation of the dev tools in VM

  • Go Tools

  • Hyperledger Explorer

  • Node JS + Dev Utilities

Standard VM Install (2 of 2)
+ Lets get our hands dirty
7 lectures 38:40

Discussion on relationship between:

  • Distributed Ledger Technology

  • Transactions

  • Chaincode

Distributed Ledgers, Transactions, Chaincode & Shim
Fabric Chaincode Concepts
5 questions
  • How the scripts are used?

  • Environment scripts

  • Chain dev scripts

  • Chaincode utility

  • Explorer

Using the Dev Environment utilities

Project repository has multiple utility scripts for managing the dev environment. Students will learn to use the dev management scripts

Hands On: Utility scripts for managing development environment

Students to try out the scripts and utilities.

Exercise: Using the "dev-" scripts

Learn how to use the peer chaincode commands against the dev environment

Hands On: Setting the environment & executing peer commands
  • Launching the explorer

  • Using the explorer interface

Preview 04:21

Students will learn how to use a utility script for executing peer commands

Hands On: Chaincode execution utility
+ Fabric 2.x Chaincode Lifecycle
9 lectures 01:03:24

+ Chaincode Lifecycle  Overview

+ Lifecycle stage 1 : Package and Install

Lifecycle- Chaincode Packaging & Installation

Hands on with package and install commands

Exercise- Chaincode Packaging & Installation

Lifecycle stage for approval & commit of the Chaincode

+ Approveformyorg

+ Commit

Lifecycle - Chaincode Approval & Commitment

Hands on with the commands:

+ approveformyorg

+ install

Exercise - Chaincode Approval & Commitment

Execution of the Init, Query & Invoke on a chaincode

Lifecycle - Chaincode Invoke & Query

Hands on with querying and invocation of the chaincode

Exercise - Chaincode Invoke & Query

Overview of how chaincode is upgraded:

+ Locally

+ Across the network

Lifecycle - Chaincode Upgrade

Hands on exercise for upgrading the chaincode

Exercise - Chaincode Upgrade

Overview of peer net versus dev mode

Chaincode Net versus Dev Mode
+ Go Chaincode Interface
5 lectures 29:52
  • Chaincode instance registration

  • Functions in the interface

Chaincode Interface implementation & working
  • Chaincode logging functions

  • Controlling the log levels

Logging from Chaincode

Wlakthrough of the script

Hands On: Chaincode Install | Commit | Logging Walkthrough

Students will learn about the required functions in the chaincode. After that students will test the chaincode using the dev environment and the utility scripts.

Preview 07:08

Sending the Success & Error response from Chaincode funtions

Sending the Success & Error Response

Checks students understanding

Quiz: Shim, Responses & Logging
5 questions
+ Go Chaincode Stub
12 lectures 55:51
  • Provides an overview of ChaincodeStubInterface

  • Types of functions available on the interface

Introduction to ChaincodeStub

Goes over the functions available for getting transaction proposal information

  • GetSignedProposal

  • GetTxID

  • GetTxTimestamp

  • GetChannelId

  • GetTransient

Extracting Proposal Information

Hands On Exercise:

Part 1 :   Use the utility functions for getting info from proposal

Part 2 :   Explore the SignedProposal

Solution walk through

Hands On: Using functions for accessing Proposal elements
  • How client send arguments to chaincode functions

  • Implementation of the invoke/init functions

Passing Arguments & Invoke Function Implementation

Functions for accessing the arguments

  • getArgs

  • getStringArgs

  • getFunctionAndParameters

Hands On: Using Arguments function

Checks students knowledge of transaction proposal and arguments

Transaction proposals & arguments
3 questions

How data is managed in the Fabric Runtime

Preview 04:40

Learn about the state management functions:

  • GetState()

  • PutState()

  • DelState()

Hands On: Chaincode State Functions GetState, PutState & DelState

In this exercise students need to use the state management function to delete an asset

Exercise: Add the "delete" function to V5 Token implementation

Checks students knowledge of State Data Management

State Data Management
5 questions

Rules for invoking another chain code

Invoking Chaincode from another Chaincode

Learn the use of InvokeChaincode function

Hands On: InvokeChaincode function
5 questions

Students will learn about events:

  • Types

  • Flow of events

  • Chaincode event subscription

Fabric Events & Subscriptions

Demonstrates the use of the SetEvent function on the Stub.

Hands On: Event function usage

Tests knowledge of the events

Fabric Events Chaincode
5 questions
+ Writing Unit Test Cases for Network Applications
7 lectures 36:37

General discussion on testing practices

  • Unit tests

  • Integration tests

Fabric Chaincode Testing

Unit testing framework for GoLang

GoLang Testing Framework

Shows how to use the GoLang Testing Framework

Hands On: Testing the Chaincode using GoLang Test Framework

Fabric GoLang Unit Testing using the MockStub interface

Chaincode unit testing with MockStub

Demonstrates the use of the MockStub Interface for unit testing the chaincode

Hands On: Use the MockStub for Testing

Using Bash scripts and Utility scripts for automating testing

Writing Unit Tests Scripts (Utility)

Demonstrates how to write testing scripts

Hands On: Unit Testing Scripts
+ Mini Project: Develop the ERC20 Token on Fabric
4 lectures 15:25

Introduction to tokens & ERC20 standard

ICO & Tokens

Discusses the project requirements in details

Exercise: Requirement for this project

Walk through of the solution design | code

Hands-on: Solution walkthrough

Testing the transfer events

Exercise: Test out the "transfer" events
+ Transaction Flow & Chaincode Endorsement Policies
6 lectures 35:41

There are 3 phases in the flow:

  • Transaction proposal

  • Broadcast

  • Commit

Transaction Flow in Fabric
Transaction flow in Fabric
5 questions

What are trust authorities? Their role in the Fabric network?

Consortiums and Trust Authorities
  • Understand the Endorsing Policies

  • Defining the EP Expression

Endorsement Policies & Expressions
Endorsement Policies
5 questions

Students will learn how the Dev environment is setup for the Lifecycle Endorsement Policy

Chaincode Lifecycle EP in Dev Setup

Experience the Endorsement Policies

Hands On: Chaincode Endorsement Policies

Make changes to the sample to gain better understanding of the Endorsement Policies

Exercise: Chaincode Endorsement Policy Expressions
  • Basic understanding of Hyperledger Fabric | Distributed Ledger Technology
  • Basic knowledge of GoLang (no need to be an expert)
  • Have some idea of Docker (but open to refer to documentation)
  • OK with using the Linux terminal | shell scripts
  • Comfortable with installation of softwares on machines
  • Node JS is good to have as course also covers the Fabric SDK for Node
  • A PC or Mac with decent Internet connection


  • April 2020 - Course updated to Fabric 2.1

Developers face many challenges when it comes to  developing Hyperledger Fabric Chaincode.

  • Lack of documentation from developer's perspective

  • Need to setup the Fabric development environment

  • Non-availability of development tools | standard practices

  • No comprehensive guide on how to productively develop chaincode

This course is my attempt to address all of these challenges.

E.g., Student do not need to spend time on setting up dev environment from scratch - course provides "One Click Launch"

E.g., Course provides development utilities that will help developers to focus on learning to code

E.g., Shows step by step how to leverage various Fabric concepts to build working chaincode

E.g., Working chaincode for ALL concepts covered in the course

E.g., Commands to be used for development purposes (wrapped in utility scripts as part of the course)

Utility Scripts

  • Utility scripts are provided to achieve developer productivity;  long commands on command line are difficult to follow & type

  • Students may need to go through some of the utility scripts on their own

PLEASE DO NOT JOIN THE COURSE if you do not like to use productivity/development scripts and rather type long command on the terminal prompt :-)


  • This is a Hands on course. Please do NOT join if you do not have experience in coding

  • Take a preview of the lectures. Please do NOT join if you do not understand my accent or lecture pace :-)

Course Highlights:

  • Ready to use development environment setup with multiple configurations (project repository available for download)

  • Hyperledger Explorer setup that may be launched by students to get a graphical view of the network

  • Provides easy to use tools/scripts so that developers can focus on learning Chaincode development

  • Sections start by going over the concepts. Walk through lectures show the concepts in action with REAL code

  • Every section requires the student to do coding (exercises)

  • ALL sections | ALMOST all lectures requires the student to do Hands On activities

Course Layout:

  1. Setup the development environment

  2. Basics of Fabric platform from development perspective

  3. Structure of the GoLang Chaincode

  4. Unit | Integration testing of chaincode

  5. Designing for Private Data | Transactions

  6. Setting up the Endorsement Policies

  7. Querying with Rich Query Functions (using CouchDB)

  8. Accessing the Asset History

  9. Implementing Access | Authorization control using "Client Identity Library"

  10. Building Applications using Fabric Node SDK

What is NOT covered in this course?

  1. Basics of Hyperledger Fabric

  2. Fabric Binaries details such as peer, orderer, configtxgen, cryptogen ...

  3. Fabric certification authority (course mostly uses cryptogen generated crypto)

  4. Design & Setup of Multi Org Setup

ALL of the above have been covered in my other courses. Please check them out.

Who this course is for:
  • Hyperledger Fabric Architects | Developers |Operators
  • Tinkerers and Experimenters interested in gaining Hands-On knowledge of Enterprise grade DLT platform
  • Blockchain Enthusiast