Notes on IBM HyperLedger Fabric

 

HyperLedger Fabric ReadtheDocs

http://hyperledger-fabric.readthedocs.io/en/release-1.1/

APIs of HyperLedger Fabric

https://godoc.org/github.com/hyperledger/fabric

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

https://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim

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

https://godoc.org/github.com/hyperledger/fabric/core/scc/cscc

HyperLedger NODEJs SDK

https://github.com/hyperledger/fabric-sdk-node

HyperLedger NODEJs SDK Documentation

https://fabric-sdk-node.github.io/

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.

https://github.com/hyperledger/fabric-sdk-java

HyperLedger Help

https://chat.hyperledger.org/channel/general

Transaction Flow

http://hyperledger-fabric.readthedocs.io/en/latest/txflow.html

Endorsement Policies

https://gerrit.hyperledger.org/r/gitweb?p=fabric.git;a=blob;f=docs/endorsement-policies.md;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

http://hyperledger-fabric-ca.readthedocs.io/en/latest/

 

Run your First Network 

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

Usage:

  byfn.sh up|down|restart|generate|upgrade [-c ] [-t ] [-d ] [-f ] [-s ] [-i ]

  byfn.sh -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.:

byfn.sh generate -c mychannel

byfn.sh up -c mychannel -s couchdb

        byfn.sh up -c mychannel -s couchdb -i 1.1.0-alpha

byfn.sh up -l node

byfn.sh down -c mychannel

        byfn.sh upgrade -c mychannel

Taking all defaults:

byfn.sh generate

byfn.sh up

byfn.sh down

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

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s