Hyperledger Fabric - Chaincode lifecycle

Hyperledger Fabric - Chaincode lifecycle

Hyperledger fabric (HLF) supports multiple technologies in which the chain code can be written. As I write this article, HLF supports chaincodes to be written in Java/ JS/ Go programming languages.

This means that HLF will have to support compilation of three different technologies from a framework standpoint. It is interesting the way it was done in HLF 1.4. The source code is copied onto 'peer docker container' and then the actual code build is triggered within Docker. Once successful, new Docker instances with the chaincode deployed in it is started. Changes to the existing chaincode would be done via the upgrade process.

No alt text provided for this image

There is interesting change to the way the chaincode lifecycle is in HLF 2.x which has implications on how the network participants now operate. It is now a four step process of Package, install, approve and commit.

  1. Package - the chain code is packaged into a deliverable on a build machine (instead of copying original sources to Docker containers).
  2. Install - The deliverable is copied onto the peers (Docker conatiners)
  3. Approve - (Unlike in HLF 1.4) Each of the network participant will have to approve this change first before the network admin can complete the delployment on to the HLF network.
  4. Commit - The chain code is deployed and started as individual containers.
No alt text provided for this image

Two important implications here in HLF 2.x are that source code does not float around as part of the DEVOPS automation and network participants can challenge network admin and stop a chaincode upgrade. A more detailed discussion and run down of this process is here in the link below for the interested folks!


To view or add a comment, sign in

More articles by Sivatheja C.

  • Deploying a blockchain test network

    Unless you are behind a corporate firewall with all kinds of restrictions, brining up your first hyperledger fabric…

Explore content categories