Hyperledger Composer Architecture

Node.Js Vulnerabilities
5 Common Server Vulnerabilities with Node.js
21st June 2023
Apple WWDC 2023| Apple Vision Pro, iOS 17,MacBook Air and more
24th June 2023
Node.Js Vulnerabilities
5 Common Server Vulnerabilities with Node.js
21st June 2023
Apple WWDC 2023| Apple Vision Pro, iOS 17,MacBook Air and more
24th June 2023
Show all

Hyperledger Composer Architecture

Hyperledger Composer is an open framework device to make blockchain programs efficient to a large extent. It linked the blockchain application with the records of business systems. It allows the developers to create full-stack blockchain application solutions. It uses the Hyperledger Fabric architecture to enable the protocols and policies and to have verified transactions. The current business network can be easily monitored by Hyperledger Composer which can include the assets, services, property, etc.

Key Concepts in Hyperledger Composer

Below are some of the concepts in Hyperledger Composer:

  1. Assets: They are known as services and properties, they can constitute the buying and selling of a business model. Moreover, it is unique so that the user may define the properties.
  2. Participants: They are the members who are taking part in the business network. They only buy and sell the assets. They may have multiple identities and hence transactions can be done. 
  3. Identities: It is a digital certificate or digital signature which is referred to as an identity of a participant. Every participant has different IDs.
  4. Transactions: It is a process in which exchanging of assets with the currency takes place. It can be done in the form of an auction and ownership will provide to the highest bidder.
  5. Queries: They are the commands from which the business network can be accessed, these customizations are sent with the help of APIs.
  6. Events: Events are the indications to external systems to alert them about the ledger.
  7. Access control: The access controls are the set of policies and protocols on which the business network works.
  8. Blockchain state storage: It is a storage in which transactions of a business network are stored, and databases are consistent by the algorithms.
  9. Connection profiles: It is a JSON document that is related to the business network card. This is used to make business network cards so that they can be linked to the business network.
  10. Business network cards: It is the combination of metadata, connection profile, and identity.
  11. Historian Registry: It is a report type registry in which it shows the completion of transactions under the historian records column.

Architecture of Hyperledger Composer

Hyperledger Composer Architecture

Below are some of the components of Hyperledger Composer:

1. Yeoman code generator:

  • This will help the user to create various new projects.
  • It executes with the specific commands in CLI in the node. 
  • It includes testing, modification, and building process.

2. Javascript Software development toolkit and framework like Angular JS (JS SDK):

  • JavaScript SDK contains Node JS APIs that help developers to create an application that can be linked to the business system networks.
  •  It can be divided into two parts: composer client and composer admin.

3. Command Line Interface(CLI):

  • It permits creators to control or execute business networks through instructions. 
  • Moreover, creators can easily communicate with the OS and PC hardware associated with the business network model.

4. REST web servers and APIs:

  • Refer to as a state of transfer that is used to create a model of the business network. 
  • It calls APIs to declare the resources like configure.

5. LoopBack Connector:

  • It helps in exchanging business data and transactions securely among the networks.
  • It handles responses and requests from source protocols.

6. Web User Interface:

  • It helps in testing and managing the business data and managing the supported runtime execution i.e, Hyperledger Fabric. 
  • It also helps in interaction with the remotely running software with the specific web server.

7. Execution Runtimes:

  • It consists of three parts: Hyperledger Fabric, Web, and Node.js which perform different functions such as state will be stored in browser local storage and particular ledger.

Hyperledger Composer working

The operation of Hyperledger Composer consists of Assets, Participants, and Transactions.

  • Assets will include the property or the service which is ready to be sold, participants will include the members which are involved in the whole process of purchasing the service and transactions consists activity of buying and selling the specific service.
  • A business network model can be linked and integrated easily with the above three processes.

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

Architecture of Hyperledger Composer

Architecture of Hyperledger Composer

As you can see above this is the basic structure of hyperledger composer architecture.

Model file

It has a model file (.cto) , anything related to the definition of participant assets or transactions inside your business network will be modeled inside model file.

For an analogue Let’s say if you’re doing auction business that work. Inside the auction business we’re going to have participants and the auctioneer, so auctioneer and participants can be modeled. Apart from that, asserts which are going to be auctioned off will also be modeled. And finally the transactions which will be placed for the bidding of auctions will also be modeled

The definition of model file is very similar to the class definitions in other programming languages like Java or C #.

Transaction processor file

The second one is transaction processor file (.js). This transaction processor file is written in JavaScript, and it utilizes the concepts of promises. Transaction processor file will be linked with the model file and any transactions defined in model file will provide the business logic inside transaction processor file. So, this transaction processor file will be used to define the calculations and business operations. This transaction processor file will also creator to the events as they have been defined inside the model file, and will emit the events inside your transaction processing file.

Access Control file

The access control file (.acl) is a permission file, anything related to providing different participants or asserts will be modeled inside the access control file. Structure of access control file is very similar to JSON structure. It has some standard roles and configurations need to be followed and by following those rules and configuration provides different set of permissions inside this file.

This file always follow the first-in approach. so the rule which you have provided as the first entry inside this file will be taken as a valid. If multiple rules are provided, then those rules will be applied in the form of continuation as the appearance of this file.

Query Definitions

Query definition file(.qry) is used to retrieve data from the blockchain. you can drive different information such as asset, participants or transactions on the blockchain. This query file offers you a rich query format which is very similar to English language, and the information can be directly retrieved from the blockchain using query definitions.

Business Network Achieve

All these four files together forms the base of the business network inside hyperledger composer. These four files are fed into the hyperledger composer compiler, it compiles them into a one single business network archive (.bna) this file is acceptable by environments such as fabric runtime environment or executable NodeJS environment. You can choose where you want to deploy this business network archive, you can deploy this locally on the hyperledger fabric within your system, or you can also define it on the web browser such as playground, which is available for testing out your business.

So this business network archive is the important entity inside hyperledger composer and this is something like a compiled version of the four files which we have included. This business network archive will be the business network and will act as a smart content which will be deployed over the blockchain.

For similar blog click

For more information contact XpertLab