Tuesday, June 5, 2018

Introduction to Hyperledger Composer - Typical Solution Architecture



Hyperledger Composer enables architects and developers to quickly create "full-stack" blockchain solutions. i.e. business logic that runs on the blockchain, REST APIs that expose the blockchain logic to web or mobile applications, as well as integrating the blockchain with existing enterprise systems of record.



Hyperledger Composer is composed of the following high-level components:
  • Execution Runtimes
  • JavaScript SDK
  • Command Line Interface
  • REST Server
  • LoopBack Connector
  • Playground Web User Interface
  • Yeoman code generator
  • VSCode and Atom editor plugins

Execution Runtimes
Hyperledger Composer has been designed to support different pluggable runtimes, and currently has three runtime implementations: 
* Hyperledger Fabric version 1.0. State is stored on the distributed ledger. 
* Web, which executes within a web page, and is used by Playground. State is stored in browser local storage. 
* Embedded, which executes within a Node.js process, and is used primarily for unit testing business logic. State is stored in an in-memory key-value store.

Connection Profiles

Connection Profiles are used across Hyperledger Composer to specify how to connect to an execution runtime. There are different configuration options for each type of execution runtime. For example, the connection profile for an Hyperledger Fabric version 1.0 runtime will contain the TCP/IP addresses and ports for the Fabric peers, as well as cryptographic certificates etc.

Connection Profiles are referred to by name (in both code and on the command line) and the connection profile documents (in JSON format) are resolved from the user's home directory.

JavaScript SDK
The Hyperledger Composer JavaScript SDK is a set of Node.js APIs the enables developers to create applications to manage and interact with deployed business networks.

The APIs are split between two npm modules:

1. composer-client used to submit transactions to a business network or to perform Create, Read, Update, Delete operations on assets and participants
2. composer-admin used to manage business networks (deploy, undeploy)
Details of all the APIs are available as JSDocs.

composer-client
This module would usually be installed as a local dependency of an application. It provides the API that is used by business applications to connect to a business network to access assets, participants and submitting transactions. When in production this is only module that needs to be added as a direct dependency of the application.

composer-admin
This module would usually be installed as a local dependency of administrative applications. This API permits the creation of and deployment of business network definitions.

Command Line Interface
The composer command line tool enables developers and administrators to deploy and managed business network definitions.

REST Server
The Hyperledger Composer REST Server automatically generates a Open API (Swagger) REST API for a business network. The REST Server (based on LoopBack technology) converts the Composer model for a business network into an Open API definition, and at runtime implements Create, Read, Update and Delete support for assets and participants and allows transactions to be submitted for processing or retrieved.

LoopBack Connector
The Hyperledger Composer LoopBack Connector is used by the Composer REST Server, however it may also be used standalone by integration tools that support LoopBack natively. Alternatively it may be used with the LoopBack tools to create more sophisticated customizations of the REST APIs.

Playground Web User Interface
Hyperledger Composer Playground is a web user interface to define and test business networks. It allows a business analyst to quickly import samples and prototype business logic that executes on the Web or Hyperledger Fabric runtime.

Yeoman Code Generators
Hyperledger Composer uses the Open Source Yeoman code generator framework to create skeleton projects:
  • Angular web application
  • Node.js application
  • Skeleton business network


VSCode and Atom Editor Extensions
Hyperledger Composer has community contributed editor extensions for VSCode and Atom. The VSCode extension is very powerful and validates Composer model and ACL files, providing syntax highlighting, error detection and snippets support. The Atom plugin is much more rudimentary and only has basic syntax highlighting.

7 comments:

  1. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…!!...Blockchain Online Training

    ReplyDelete
  2. Worthful Blockchain tutorial. Appreciate a lot for taking up the pain to write such a quality content on Blockchain course. Just now I watched this similar Blockchain tutorial and I think this will enhance the knowledge of other visitors for sure. Thanks anyway.:-https://www.youtube.com/watch?v=lf5d-R8-N20

    ReplyDelete
  3. Great article,this blog is very usefull thanks for sharing.
    Blockchain training in Mumbai

    ReplyDelete
  4. Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts. AZ-204: Developing solutions for Microsoft Azure

    ReplyDelete