Notes on IBM HyperLedger Fabric


HyperLedger Fabric ReadtheDocs

APIs of HyperLedger Fabric

Package shim provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes.

Package cscc chaincode configer provides functions to manage configuration transactions as the network is being reconfigured.

HyperLedger NODEJs SDK

HyperLedger NODEJs SDK Documentation

HyperLedger Java SDK for 1.1

The SDK helps facilitate Java applications to manage the lifecycle of Hyperledger channels and user chaincode. The SDK also provides a means to execute user chaincode, query blocks and transactions on the channel, and monitor events on the channel.

HyperLedger Help

Transaction Flow

Endorsement Policies;a=blob;f=docs/;h=1eecf359c12c3f7c1ddc63759a0b5f3141b07f13;hb=HEAD

Hyperledger Fabric Model

This section outlines the key design features woven into Hyperledger Fabric that fulfill its promise of a comprehensive, yet customizable, enterprise blockchain solution:

  • Assets – Asset definitions enable the exchange of almost anything with monetary value over the network, from whole foods to antique cars to currency futures.
  • Chaincode – Chaincode execution is partitioned from transaction ordering, limiting the required levels of trust and verification across node types, and optimizing network scalability and performance.
  • Ledger Features – The immutable, shared ledger encodes the entire transaction history for each channel, and includes SQL-like query capability for efficient auditing and dispute resolution.
  • Privacy through Channels – Channels enable multi-lateral transactions with the high degrees of privacy and confidentiality required by competing businesses and regulated industries that exchange assets on a common network.
  • Security & Membership Services – Permissioned membership provides a trusted blockchain network, where participants know that all transactions can be detected and traced by authorized regulators and auditors.
  • Consensus – a unique approach to consensus enables the flexibility and scalability needed for the enterprise.

The different actors in a blockchain network include peers, orderers, client applications, administrators and more. Each of these actors has an identity that is encapsulated in an X.509 digital certificate. These identities really matter because they determine the exact permissions over resources that actors have in a blockchain network.

Having a valid credit card is not enough – it must also be accepted by the store! PKIs and MSPs work together in the same way – PKI provides a list of identities, and an MSP says which of these are members of a given organization that participates in the network.

In cryptographyX.509 is a standard that defines the format of public key certificates. X.509 certificates are used in many Internet protocols, including TLS/SSL, which is the basis for HTTPS

Fabric CA


Run your First Network 

root@BlockChainHLF:~/work/hlf/fabric-samples/first-network# ./ –help

Usage: up|down|restart|generate|upgrade [-c ] [-t ] [-d ] [-f ] [-s ] [-i ] -h|–help (print this message)

    <mode> – one of ‘up’, ‘down’, ‘restart’ or ‘generate’

      – ‘up’ – bring up the network with docker-compose up

      – ‘down’ – clear the network with docker-compose down

      – ‘restart’ – restart the network

      – ‘generate’ – generate required certificates and genesis block

      – ‘upgrade’  – upgrade the network from v1.0.x to v1.1

    -c – channel name to use (defaults to “mychannel”)

    -t <timeout> – CLI timeout duration in seconds (defaults to 10)

    -d <delay> – delay duration in seconds (defaults to 3)

    -f <docker-compose-file> – specify which docker-compose file use (defaults to docker-compose-cli.yaml)

    -s – the database backend to use: goleveldb (default) or couchdb

    -l – the chaincode language: golang (default) or node

    -i – the tag to be used to launch the network (defaults to “latest”)

Typically, one would first generate the required certificates and

genesis block, then bring up the network. e.g.: generate -c mychannel up -c mychannel -s couchdb up -c mychannel -s couchdb -i 1.1.0-alpha up -l node down -c mychannel upgrade -c mychannel

Taking all defaults: generate up down


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s