Hyperledger Fabric: How to Setup Application from Scratch using Nodejs Series— Part 2

Binary file introduction & explanation of each..

Source : Google

In my previous article we started with introduction & how to setup Hyperledger Fabric server. We also discussed quick story on real time use case & how blockchain supports the industry. This article covers little deep on the following binary files & also those 4 components I mentioned(ORDERER,CA(CERTIFICATE AUTHORITY),PEERS & COUCHDB) before.

Let’s get started..

So when you setup “Build your first network(byfn)” from fabric-samples, you would see these binary files in bin folder

  • cryptogen,
  • configtxgen,
  • configtxlator,
  • peer
  • orderer and
  • fabric-ca-client

What each binary does is special in fabric server. When you develop your own network, you must declare or define who is going to do what?. for example, let’s take a real time example. A typical supermarket story here, sales boy / girl do help the customer in finding the products, house keeping person will ensure the environment is clean, person at billing section does only the billing job. So similarly, while deploying network you must define who is going to do what?. ( Read this transaction flow in Hyperledger official document to get better understanding : Click here of what’s happening when a transaction is invoked) ..So in a network, we have 4 components(Orderer, Peer, CouchDB, CA) and who is going to perform these roles, will be decided and respective identity/access will be generated.

For instance, when new joinee is joining the organization(company), we provide him/her access card/identity card right?, similarly in fabric network we must define identity, which will be provided by MSP(membership service provider). To do that job, we use the binary file cryptogen.

Now, let’s talk about configtxgen .. again a real time example of super market, the moment the day starts they create one dummy billing ID in order to ensure billing application runs fine & also for goodwill. This dummy billing ID doesn’t add any value in fact, but they starts the day with dummy billing ID to start the billing number for the day. Similarly in blockchain, we have something called “Genesis” block(The configuration block that initializes a blockchain network or channel, and also serves as the first block on a chain).. I will not say this as Dummy, but very crucial block in a chain, which actually indicates “Starting” point of block chain. Configtxgen actually does this job, it creates genesis block for the network.

Now it’s time for configtxlator (Read this Click here) , I can relate this with “Optimizer or Upgrader”. For instance, you have the network setup with channels, when you want to modify the channels or update genesis block, then you need to edit the same, configtxlator file helps you to first convert the block into human readable form & once you make necessary changes, it commits & upgrade the same.

configtxlator: standard usage is expected to be:

  1. SDK retrieves latest config
  2. configtxlator produces human readable version of config
  3. User or application edits the config
  4. configtxlator used to compute config update representation of changes to the config
  5. SDK submits signs and submits config

Peer (straight forward) , it helps to perform set of actions. For instance, using Peer Channel subcommand, you can add the peer to specific channel, Peer Chaincode helps you to deploy chaincode to the peer & so on.

The fabric-ca-client command allows you to manage identities (including attribute management) and certificates (including renewal and revocation).

Orderer using this binary, we can start the orderer. It will use the generated “Genesis block”. If it’s not available, it generates new genesis block using SOLO orderer profile.

Having all these six binaries covered, it is very important to understand in which situation we use each. Let’s begin with fresh network, absolutely fresh network & we are going to setup using above binaries..and define those 4 components.

Let’s meet in my next article.. If you have any questions/comments, please post to discuss.

if you like reading this series, please don’t forget to CLAP & share with others. Any concerns/comments or any different thoughts on how above binaries work, please feel free to share in comments section..

See you in next article, shortly..


Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Logeswaran Audhikesavan

Written by

Happy to learn, what I have experienced in Blockchain & Analytics Space, watch out www.blockchaindreamlab.com & www.zuiverinfotech.com


Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store