Hyperledger Composer: Build Your Enterprise Blockchain

0

Nowadays, most of the enterprise blockchain platforms are more than eager to use blockchain to upgrade their internal networking system. And why shouldn’t they? It’s one of the best techs out there as a present. To help streamline the deployment of this tech, Hyperledger brought us Hyperledger Composer.

This project will not only ensure a better outcome for the permissioned platforms but also save a lot of time. But many of you are confused about what the project is really about.

So, to help you out, I’ll be talking about the various components of Hyperledger composer.

Let’s start!

Table of Contents

Chapter-1: What is Hyperledger Composer?
Chapter-2: Key Concepts in Hyperledger Composer
Chapter-3: Hyperledger Composer Architecture
Chapter-4: Installing Process of Hyperledger Composer
Chapter-5: How to Use the Playground
Chapter-6: Developing Business Blockchain Network
Chapter-7: Managing and Diagnosing Issues
Chapter-8: Hyperledger Composer Tutorials
Chapter-9: Ending Note

Chapter-1: What Is Hyperledger Composer?

Hyperledger Composer is one of the open-source projects under the enterprise blockchain company Hyperledger. In reality, it’s a tool for implementing blockchain frameworks. You could think of it as a collection of toolsets that can help you integrate the system to your existing one without any issues.

In reality, this means that your existing networking system can easily cooperate with a new decentralized platform with the help of this tech.

If you want to develop use cases far more rapidly, then you should definitely check out Hyperledger Composer docs. According to their docs, they offer a faster output where you’ll get a solution within weeks rather than waiting for months.

I think you already know that the internal structure of the blockchain isn’t that simple. And in many cases, most of you have a hard time finding the appropriate development team for it.

Thus, to help ease the issue, this tech offers simple tools that developers can understand without overcomplicating the coding process.

Anyhow, at present, this platform only supports Hyperledger Fabric infrastructure. So, if you use it, you would have to pick Fabric as the base component. But as it seems that Fabric supports a lot of pluggable options, so does the Hyperledger Composer.

Other validation processes that are suitable for Hyperledger fabric is also available in the toolsets.

Modeling the Network

It’s a piece of great news for enterprises that want to harness the power of blockchain in an easy way.

Moreover, the end-users can get access to controlled and simple access points that are directly connected to these blockchain for business networks. So, it’s a win-win scenario for everyone.

According to the Hyperledger Composer docs, any enterprise can easily configure their business network along with assigning certain assets and transactions.

Obviously, as you’ll be modeling it, how you want the asset to interact with transition is up to you. Also, another cool part is the participators, where each will have a unique identity. And so, let’s get on with the next segment of our guide, shall we?

hyperledger composer

What Are The Features of Hyperledger Composer?

Well, there are three main features of Composer. They are –

Simple Modelling Language

I know that you need to define a modeling structure for the deployment of any business network. And with Hyperledger Composer docs you get a simple one. The best part is that you can structure it using one of the popular simple programming languages in the world – JavaScript.

So, finding the development team suitable for it would be an easy breeze.

Reusable Fast POCs

For every kind of use cases, you add to your platform you’ll need to redefine the Proof of Concept models for that. To help you out in this regard, the platform offers production-ready POCs that will surely save you an enormous amount of time.

Come to think of it, all of them are reusable and covers web-ready versions as well.

Data Integration

Remember how I said that it’s really easy to connect your existing system with the new one that you will create? In reality, from the Hyperledger Composer docs, it uses Loopback feature to do exactly that. So, the issues you might face regarding replacing the existing system or interconnecting it won’t be a problem form now on.

Any developer will simply love the data integration process of this tool.

How Does Hyperledger Composer Actually Work In real Scenarios?

Well, according to Hyperledger composer docs, there are certain rules when it comes to working in practice. Let’s clear it up with an example.

Let’s assume that a realtor is modeling a business network based on his/her industry. So, for that, he/she can perform certain tasks –

  • Participants: Homeowners and buyers
  • Assets: Listings and houses
  • Transactions: Creating and closing listings, along with selling or buying houses on the platform

So, you see this would be the perfect model for any realtor company on the market. Obviously, the enterprise doesn’t need to add participants of other interests.

Moreover, according to the Hyperledger Composer docs, you can restrict participants based on their role. For example, as a seller, you will have access to potential buyers but not to other sellers. On the other hand, the buyers can see what the sellers are selling but not what other buyers are buying.

In reality, this could also be applicable to realtors as well. So, the realtor can create a simple application for sellers and buyers who can see listings or make an offer on them.

More so, you could also link it up with inventory where new houses would become an asset. On the other hand, sold ones will not be on the property list. If your company needs other relevant parties, you can also register them as participants.

In reality, the best part is that you can make the network anyway you want. So, no matter what your company is, it’s relatively easy to model a distributed ledger technology with Composer.

Chapter-2: Key Concepts in Hyperledger Composer

Hyperledger Composer is one of a kind modeling program that comes with modeling languages and APIs for defining business networks. With the help of Hyperledger Composer smart contract, it’s straightforward to offer participants asset exchanging features.

Apparently, with the help from their Playground, you can easily experience what the tool is all about. More so, the simplistic Hyperledger composer smart contract will surely make it less time consuming to model.

Well, the best part is that you can get Hyperledger Composer smart contract on their hosted Playground. In reality, for that, you won’t need any installations. But if you want to try it out offline, you’ll have to install it.

In fact, it’s a good option for testing or editing your business model offline rather than online.

Anyhow, there’s the Developer Tools that come with all the cool development capabilities. So, it’s a perfect solution for the developer who likes to go into the blockchain for enterprise paradigm.

Anyhow, before we move on, you need to check out some of the key concepts of Hyperledger composer. Let’s see what they are!

Key Concepts in Hyperledger Composer

  • Assets

Mainly assets are a digital form of any intangible or tangible goods, properties or services on the network. And these are all stored in the registries. In reality, a business network can also have any kind of asset as they need.

For example, gold, housing, land, documents, etc. However, you need to make sure that all assets have unique identifiers to help keep track of them. Moreover, you are free to define them as you please.

Needless to say, assets are essential for a business network to function. And with the help of the Composer, it would be very much straightforward to create one.

  • Participants

In a business network, participants are merely the members of that system. In reality, they are free to own assets and also participate in submitting transactions. More so, you can model participants as your network needs, kind of like assets.

So, they would also need an identifier and any other property required. Thus, participants have certain features when they participate in Hyperledger Composer smart contract.

Moreover, you can map a participant to multiple identities for many networks.

  • Identities

Well, in the platform, all the identities are a combination of the private key and digital certification. In reality, all the identities are necessary for transacting on the network and mapping a participating peer on the system.

Moreover, it’s also an important part of Hyperledger Composer smart contract. Anyhow, a single identity mainly is on the business card. Furthermore, if that identity is mapped to a participant that participants can transact on that business network as the user.

  • Transactions

Transactions are absolutely necessary for Hyperledger Composer smart contract. It’s a medium to interact with the asset on the platform. With the help of transactions, you can send or receive payments or event change the ownership of any assets.

Moreover, you can also place a bid on an auctioning asset as well. But you would need to have proper Hyperledger Composer authentication to do that.

  • Queries

In reality, with the help of the queries, you can return any kind of data within the world-state. In reality, a business network is responsible for defining queries, mainly it would benefit your organization with simplifying many things.

Moreover, it only needs a simple parameter change to customize, so it’s super easy. Also, you can use queries for Hyperledger Composer authentication as well. With help from these, you can quickly search through your database and get the result as you need.

But remember you have to use composer API to send queries.

  • Events

Within their system of Hyperledger Composer authentication, they define an event in their business networks the same way as they do for participants and assets.

After the events are defined, the transaction processor functions will emit back to the external system that something of great importance did happen on the network.

When the events are emitting, other peers can subscribe to those events using the composer-client API.

  • Access Control

Well, in order to maintain all the business networks, there need to be specific access control rules. In reality, this helps in maintaining who has access to what. Moreover, it would help to control access to certain assets and conditions where peers can use them.

Typically the access control language is a way to straightforward to create any kind of conditions. For example, it could say “only the owner of a house can transfer the ownership of the house.”

Also, to externalize the access control, you can easily process logics, and it would be easy to maintain, develop, debug, and inspect.

  • Blockchain State Storage

All of the transactions of the system will exist on the blockchain ledger. Moreover, an event the current state of participants and assets are kept in the blockchain state database. In reality, it’s absolutely necessary to keep these stored in order to maintain the consensus properly.

Thus, the blockchain will distribute the ledger among the nodes along with the state database. Therefore, it would also update the ledger and other state databases on the network. Moreover, every peer actively using the consensus protocol will mainly be in charge of updating it.

  • Business Network Cards

Business network cards are absolutely necessary for the Hyperledger Composer authentication. Why? Well, because basically, these are the combination of metadata, identity, and connecting profile. In reality, with the help of these business cards, you can easily connect to the business networks.

Moreover, you can also extend the feature of identity outside the network to certain wallets of identities. Furthermore, here, every identity will connect to a specific connecting profile and business network.

  • Connection Profiles

In Hyperledger Composer authentication, it mainly uses connection profiles to define which system they need to connect to. In reality, the connection profile is actually a JSON document, and it’s a part of the business network card.

More so, all the profiles are from the developers of the system they connect to. Anyhow, you would only need to use these in making business network cards and to explain how to communicate to them.

  • Historian Registry

Ever wonder where the successful transaction records are stored? Well, with the help of historian registry all the records of a successful transaction are logged on the ledger. In reality, think of it as a specialized registry system.

Moreover, it would also have identities and participants who submitted it, attached to the transaction. Obviously, no one without a Hyperledger Composer authentication can submit transactions or let along participate in it. Anyhow, the system stores the transactions as HistorianRecord assets.

In reality, the system namespace will define this form of asset.

Chapter-3: Hyperledger Composer Architecture

With the help from Hyperledger Composer sample application, any developer or architect can easily create a fully functioning blockchain network.

For example, REST API for connecting mobile or web applications to any blockchain business logic, any kind of business logic that runs on the blockchain, integration of existing enterprise database with the new decentralized solution, etc.

In the Hyperledger Composer architecture, there are a total of eight high-level component’s that you need to know about. Let’s see what they are –

  • Execution Runtimes
  • REST Server
  • Command Line Interface
  • JavaScript SDK
  • VSCode and Atom editor plugins
  • Yeoman code generator
  • Playground Web User Interface
  • LoopBack Connector

Execution Runtimes

In the Hyperledger Composer sample application, it offers different pluggable runtimes. Moreover, it now has mainly three implementations of runtime –

Hyperledger Fabric v1.2. Here, the state storage is on the distributed ledger.

Embedded runtime implementation. Here, the runtime executes within a Node.js process. However, this one is mainly suited for unit testing of business logic. Moreover, the State is in the in-memory key-value store.

Web runtime implementation. Here, it executes in a web page and mainly works in Playground. Moreover, here, the State is in the local browser history.

Connection Profiles

In reality, the connection profiles mainly help to determine how to link up with the execution runtime. Furthermore, there is plenty of configuration for every type of execution runtime.

For example, if you use the Hyperledger Fabric vs. 1.2 runtimes, then it will have TCP/IP ports and addresses of the Fabric peers. Moreover, it would also have cryptographic certificates and many more.

As you already know that Connecting profiles are a part of Business network card and Hyperledger Composer sample application.

JavaScript SDK

Within the Hyperledger Composer sample application, there’s JavaScript SDK. In reality, the JavaScript SDK is a set of different Node.js APIs. These APIs help developers to create new applications that can interact and manage the created business network.

The APIs are usually divided into two npm modules –

  • Composer-admin: Here, it manages the business network such as upgrading, starting, or installing.
  • Composer-client: This one mainly performs read, delete, create, and update operations on participants and assets. Additionally, it also submits transactions on the business network.

Let’s check out the details of these components of Hyperledger Composer sample application.

Composer-client

In reality, this module is basically installed on the local dependency of any application. With its help, you can connect to participants, assets, or submit transaction of a business network. So, this module is extremely necessary.

When your network would be in production, you would need this module to add a direct dependency of that application.

Composer-admin

Anyhow, the admin module would follow the same footsteps as client one, but here it would be installed on the administrative application. Using this module, anyone can create or deploy business networks or change their definition.

Command Line Interface

The Command-line tool will help administrators or developers to manage or deploy business network definitions. Thus, it’s also an important part of Hyperledger Composer sample application.

REST Server

Well, the REST server basically generates an Open API or Swagger REST API for the business network. The whole process of generating it happens automatically. Moreover, the REST server would convert the composer model for the business network using an Open API definition.

Anyhow, the runtime mainly reads, deletes, updates and creates participants and assets, which allows transactions to be processed or submitted.

LoopBack Connector

Basically, the REST server uses the LoopBack Connector. However, many integration tools can use it in standalone is those support LoopBack natively. Additionally, the LoopBack tools can also use it for a more advanced level of customization of REST APIs.

Playground Web User Interface

This one is relatively important in architecture. In reality, it’s a web user interface for testing and defining business networks. Moreover, it ensures that a business analyst would prototype or sample business logic that runs on the Fabric runtime or web.

Yeoman Code Generators

The Yeoman Code generator is an open-source framework that generates the skeleton of any project such as –

  • js application
  • Angular web application
  • Skeleton business network

VSCode and Atom Editor Extensions

Editor extensions of VSCode and Atom are actually the contribution of the vast Composer community. Anyhow, the VSCode is a super powerful extension that can validate ACL files or Composer models. It can also offer syntax highlighting, snippet support, and error detection.

On the other hand, the Atom plugin is more of a basic level and can only highlight syntax.

Chapter-4: Installing Process of Hyperledger Composer

Well, to run the tool you’ll need to have Composer installed in the network. Anyhow, the Hyperledger Composer install mainly is divided into two parts. These are –

  • Pre-requisites
  • The development environment

For it to run properly, you’ll first need to install the Pre-requisites and then the development environment. Anyhow, let’s see how it’s done!

Installing Pre-Requisites

Well, for Hyperledger Composer install, you’ll need to have macOS or Ubuntu on your PC. So, before you move nay further make sure that you have any one of these two operating systems. I’ll tell you how to install each one of them.

Ubuntu

In reality, you would need to have at least 4GB of RAM to run the Fabric and Composer on your PC.

These are the following components that you need for the development tools –

  • Operating Systems: Ubuntu 16.04 LTS or Linux 14.04. Here, both need to be of 64-bit. Additionally, you can use Mac OS 10.12.
  • Docker-Compose: Version 1.8 or more
  • Docker-Engine: Version 17.03 or more
  • npm: v5.x
  • Python: 2.7.x
  • Node: 8.9 or more (the note version 9 and more isn’t supported)
  • git: 2.9.x or higher

You can use any code editor according to your choice, but the developers recommend VSCode.

If you want to install them using Linux, make sure to follow these –

  • Don’t use root, rather login as a normal user.
  • Don’t use npm with sudo.
  • When you are installing the pre-requisites, first use curl, and then unzip with the sudo.
  • When running prereqs-ubuntu.sh, run it as a normal user. However, it may ask for the root password because some of its installing processes need to use root.
  • Don’t su to root.
  • Don’t install nodes globally as root.

You can check out their doc files to get more information about how to download pre-requisites for Hyperledger Composer install.

Mac OS

For macOS Hyperledger Composer install, you’ll need to install some of these tools before you go for the Composer. These are –

  • Apple Xcode and nvm.
  • macOS version 10.12.

Well, firstly you’ll need to install the nvm because it would let you install, switch, and update within different versions of Node.js.

Moreover, you’ll need to install Node, Docker, and VSCode. Anyhow, you can check out their doc to fully understand what codes to run for Hyperledger Composer install.

Installing the Development Environment

You’ll need to follow some of these instructions to get the development tools in Hyperledger Composer to install. So, let’s see what they are.

Components You Need To Install

First of all, start with the CLI tools. Basically, there are a few CLI tools that are useful, but composer-cli would be the best way to go. Next, get the Yeoman, composer-rest-server, and generator-hyperledger-composer. Even though these three are not the core part of the system, still they’re helpful.

After that, you’ll need to install the Playground. For this, you’ll need to download the browser app and install it for testing and editing on your local machine.

Additionally, you’ll have to set up your IDE. Even though you have a Playground for working on your Business Network programming, many of you would love to work in an IDE.

Lastly, you’ll have to install Hyperledger Fabric, it would give you the base of your business network. If you need more information about it, you should definitely check out their docs.

Chapter-5: How to Use the Playground

The Hyperledger Composer Playground is a robust user interface where you can deploy, configure, or even test out your business network. Moreover, with the help of advanced features, you can easily invite other participants to your network.

More so, you’ll be able to change the security level of your network and connect to other business networks out there.

If you are relatively new to the Hyperledger Composer Playground, I’ll recommend to check out the Playground tutorials. It’s because the tutorial will surely help you learn how to deploy, configure, or even test out your business network. And you need to know about it before you start interacting with the Business Network Cards.

Side Note: If you and another user is using the Hyperledger Composer Playground to connect to the same instance of the Fabric, make sure you refresh the browser after editing. If you don’t, there’s a chance that your editing didn’t save. When you refresh the browser, it will accept the changes you made to the network. In reality, if you change the business network without accepting other user changes, the changes would be lost forever.

How to Navigate In the Hyperledger Composer Playground

Business Network Page

When you start the Playground, you’ll evidently see this page at first. It’s the default landing page of this tool. Furthermore, form here, you can see what business Network Cards you have for use. In reality, each of the business network cards would give you all the information that you need for connecting to a valid network.

After you select a business network, you’ll go to the Define page.

In short, from this page, you’ll get to do a lot of things. These are –

  • Connecting To an Existing Business Network:

Maybe you already deployed a business network and have a card for it. So, you can just click on the card and connect to that business network.

  • Deploying a New Business Network:

Maybe it’s your first time on the Hyperledger Composer Playground, and you want to deploy a brand new business network. In reality, there’s some sample business network that can help you model your very own system, or you can just make one from scratch.

  • Interacting with Business Network Cards:

Well, you already know that business cards are the medium to connect to a business network. Typically, it’s a combination of identity and profile. Usually, the card will give you the option to delete, or export it to even connect to another business system on the Hyperledger Composer Playground.

  • Importing BNC:

Maybe exported a business card from Playground and now want to import it onto another. So, all you’ll need is the .card file from the previous PC and then use the “add a Business Network Card” option to import it.

  • Connecting Using a User Secret and User ID:

In reality, this one works when you already have a user secret or user ID from your network administrator. So, for that, just use the “Connect using credentials” option to enter the tab and generate the necessary card as you need.

  • Check Out the Playground Tutorial:

If you are new to the platform, then you should check out the tutorials in order to get the hang of it. Moreover, the tutorial will definitely let you know how you can create the business network from scratch and how you can perform other basic operations.

Business Network Options

After connecting to the network, you’ll get two options – Define Tab and Test tab.

In these two, you can perform multiple operations. If you don’t change the business network name, it’ll be basic-sample-network.

Let’s see what these two tabs have in store for you.

The Define Tab

With the help from the define tab, you can upgrade, edit, or even create your business network. In reality, on the page, at the left corner, you’ll see there’s a list of files that defined your business network.

To see the contents of those files, you need to click on them, and then it will open an editor’s view for you to edit and see. Moreover, if you want to add more files, you can just click the add file button. In reality, you can add script files, model files, query files, and access control files to your network.

After changing and adding files, you can deploy the changes with the help from Deploy Changes button in the Hyperledger Composer Playground.

After deploying the changes, you can test them out with the Test tab. Furthermore, you can also export your business network as a .bna file.

But do remember what I said earlier, don’t forget to refresh to save the changes.

The Test Tab

Well, with the help from the Test tab, you can easily test out the deployed network such as how the participant types working or how the assets are working or even the transaction processes. On the very left side of the tab, you’ll see that all the assets and participants are in a list.

Moreover, when you select any one of them, it will open a registry from which you can see all the active instances. If you don’t have any participants or assets on the platform yet, the registries would be empty.

On the other hand, you can also create any corresponding transactions, assets, or participants from the registry.

Also, from the all transactions registry you can check out all the transactions that happened on the network. Moreover, you’ll even see transactions that happened in the time of creating new assets or participants.

Moreover, to check whether it’s working correctly or not, you can simply submit a transaction and see what happened from the records. It’s a great approach for figuring out any faulty transactions or any code errors.

Chapter-6: Developing Business Blockchain Network

Business Network Definition

The Business Network Definition is one of the major concepts of the Hyperledger Composer multiple organizations programming scheme. In reality, you’ll know them from the BusinessNetworkDefinition class. Moreover, they are usually defined in the composer-common-module, and both the admin and the client can export it.

Basically, it has three types of files –

  • Model Files
  • JavaScript Files
  • Access Control Files

In reality, the model files will let you define the domain for the network. On the other hand, the JavaScript files mainly contain processor functions for transactions. More so, the transaction processor functions run on the Fabric and would have access to asset registries.

Any kind of Hyperledger Composer multiple organizations analyst can create the model files because they would define the very structure of their company.

On the other hand, the JavaScript files would be the top priority of the developers because those would relay the requirements from the business analysts.

On the other hand, the Access Control files would control the participant’s right access to different files and functionalities of the network.

Developing Business Networks

Developing a business network is a multiple-step process. Check out what they are from below.

  • Model

The developers of the Hyperledger Composer multiple organizations would work with the business analysts to model their domain. Furthermore, it would have the Composer Modeling Language and provide the basic structure of the assets and other resources.

  • Access Control

In parallel to the model, the technical analysts or developer of the Hyperledger Composer, multiple organizations would work on the Access Control rules. In reality, there would be multiple conditions and multiple level format entry points for the nodes.

  • Deploy

After scripting, packaging, and access controlling, the developers ca deploy the network and use command-line tools for testing it out.

  • Test

Well, for testing, there needs to be an ideal model. So, the developers can use the frameworks Chai or Mocha for comparing. They can also use Fabric for this reason as well.

  • Integrate

After all the testing, the front-end application comes into play. And so, you can use the REST server to generate REST API for the front-end application.

Developing Applications

Hyperledger Composer multiple organizations would need to get access to mobile, web, or Node.js developing applications. And that’s why the tool supports creating these on the framework.

  • Write a Node.js Application

First of all, you need to develop Node.js applications for working with the Hyperledger Composer multiple organizations platform. Moreover, it would allow you to connect to the network, update it, delete assets, read registries, and many more.

  • Create Web Applications

You need to make sure that the web application that you want to connect to the network can make a REST API call. In reality, the best way to go is to use the REST server for generating an API for the applications.

  • Subscribe To Events

Make sure that the Node.js applications can subscribe to events on the system. As you already know, you will define the events previously, and they would emit when specified transactions happen on the platform.

Integrating Existing Systems

You can integrate any existing systems using the Loopback API from the Hyperledger Composer examples. Let’s see how it’s done for Hyperledger Composer examples.

  • Generate a REST API using the REST server.
  • Make sure to publish events from the REST server.
  • Add authentication process for the REST server.
  • Enable the REST server for multiple user mode.
  • HTTPS and TLS would ensure the security of your REST server. So, make sure to add them or configure them properly.
  • Also, you can deploy the REST server so that you can integrate any existing network solution with the new system.
  • You can customize the RST server from the business network to implement custom REST API for your applications.
  • Node-RED would allow you to submit, read transactions, update or delete assets, and subscribe to events.
  • You can use transactions processors to call external HTTP or REST services for removing complex computation from the blockchain.

Chapter-7: Managing and Diagnosing Issues

Managing the Solution

Managing the Hyperledger Composer examples mainly refer to the identities and participants management. More so, these two elements are the core concept of any enterprise blockchain system.

  • Adding Up Participants

You’ll need to add the participants to the network before they can make any transactions on the Hyperledger Composer examples. Thus, the participants will create assets and even exchange them with other participants on the system.

  • Importing, Exporting and Creating BNC

With the help from Hyperledger Composer tools, creating a Business Network Card is simply effortless. All you’ll need a combination of identities, certificates, and connection profiles to do it. Additionally, the tools also help to export, import other BNCs.

  • Issue an Identity for a Participant

You can issue an identity for a participant with the help of command line or API from the Hyperledger Composer tools. Therefore, when you issue a new identity, the participant would have permission to interact with the system.

  • Binding a Participant to an Existing Identity

Maybe you already made an identity with the help of Hyperledger Composer tools. So, now you only have to connect a participant with it. Well, for that you can use command line or API, the same instructions for making the identity.

  • List of All Identities

To maintain a proper identity management system, you’ll need to map all the participants along with identities. So, get a list and review them against the identities to make sure that happens.

  • Revoking a Participant from an Identity

In case of breaking the rules, you can cancel an identity from a participant. Therefore, the participant can no longer enter the business network or even interact with it.

Diagnosing Problems

Hyperledger Composer tools use the Winston logging module and furthermore, would sue the Config module to check out the configuration information as well. In reality, if it doesn’t find anything, it will use default settings.

However, you need to know that if it doesn’t find a configuration file, it will give out a warning message. Basically, it will say that it couldn’t find any configuration in the directory. On the other hand, if you are happy with the defaults, then you can suppress the message with environment variables.

Diagnosing an Issue

With help from Hyperledger Composer tools, you can easily diagnose any errors in the system. In case there’s something wrong with an application you can get diagnostic for it. But you have to remember that you would need a logging framework to get the diagnostics.

Basically, there are 2 kinds of containers for logging –

  • The container where the application is running
  • The chain code container where the transactions execute

Default Configuration

In the framework, you’ll see logged information in all these following levels –

  • Warn
  • Error
  • Verbose
  • Info
  • Debug

Anyhow, the exit or entry logs are mainly produced right at the end or beginning of a function. So, you’ll get them at the Debug level.

How To Control What Is Produced?

If you want to control the location or the type of information produced after the diagnosing with Hyperledger Composer tools, you can use a simple JSON configuration. So, with the help of the Config module, you can easily structure the JSON file.

With this control, you can get –

  • In which level the messages will produce?
  • Where would the messages go?

Chapter-8: Hyperledger Composer Tutorials

Playground Tutorial

To help you out they offer a complete Playground Hyperledger Composer tutorial. Using the process, you can easily know how you can use the platform. I’ll describe it briefly here.

  • Step One: Start the Composer Playground

Well, firstly in the Hyperledger Composer tutorial, you’ll have to start the Playground. In reality, you can get access to the business network screen once it opens up.

  • Step Two: Create a Business Network

Next, you’ll have to create a business network. So, for that, you can choose a template, or you can import your very own template as well.

  • Step Three: Connect To the Business Network

After creating, you would see a business network card. So, you need to click kit to connect to the network. There’s also another Hyperledger Composer tutorial here for information about wallet linking options.

  • Step Four: Add Model Files

Once you are in, go to the define tab and create model files or even edit it as you want. Also, there’s a template for you to check out.

  • Step Five: Add Transaction Processor Script Files

After defining the model files, you can move on to transaction logic files for the network. In reality, it mainly uses JavaScript functions. All of the functions would execute when a transaction would be processed.

  • Step Six: Control Access

With help from access control files, you can define the rules and restrict access to certain parts of the network.

  • Step Seven: Deploy the Business Network

Once you have all the access control files, model files, and script ready, you can deploy the network for testing it out.

  • Step Eight: Test the Network Definition

First test the network definition by creating participants, assets, and trading it online.

  • Step Nine: Create Participants

In reality, quickly add two participants on the network so that you can share assets among these two and see the results.

  • Step Ten: Create Assets

After that, create assets and make one of the participants the owner of that asset so that the node can transact the asset.

  • Step Eleven: Transfer Assets

Additionally, transfer some of the assets to the other participant and check the result. You can repeat it vice-versa as well.

After this, you would finally know if your platform works best or not.

Other Tutorials to Look Into

There also Hyperledger Composer tutorial for developers that need to know about the technical aspect of the solutions. With the help from these tutorials, the developers can even tweak it and make it as they please.

Other than this there’s also queries Hyperledger Composer tutorial. In this one, you’ll learn how to use the REST API or Composer Query Language.

In reality, the query language can filter the result of any criteria and even can invoke certain transitions. For example, it would invoke any operations of removing asset or updating the result sets.

You can find the query files in the parent directory, they would have a file extension called .qry on the business network. Thus, to make you handle the query functions perfectly, you can use the Hyperledger Composer tutorial as your guide.

Chapter-9: Ending Note

It seems that we have reached the endpoint of our Hyperledger Composer guide. In reality, the Hyperledger Composer examples can be an excellent option for you if you want to launch a blockchain network quickly.

As you can see, launching a blockchain network is relatively easy with the help of their Playground. And so, testing out new Hyperledger Composer examples is a great option here. Not only you get to configure the whole thing, but you would also get maintenance support as well.

To help you out, I’ve already given all the information you need to make the last call. Also, with the help from their Hyperledger Composer tutorial learning to use it would be an easy task.

Unfortunately, they recently announced that they would put a pause on the Compose development. But why? Well, the Hyperledger Composer is a robust tool, but to keep adding up more features to it is making it more complicated.

The whole idea of using this tool was to simplify the process of deploying a business network. But if adding more feature contradicts with it, it won’t be the best tool, would it?

Thus, to make sure, you can still use it to continue deploying the network, they will add the features in the Hyperledger Fabric. As the Composer needs the Fabric to function any feature on that would give you access to it from Composer as well. However, you won’t get any distractive elements in the tool itself.

But according to their post, if anyone wants to add up a feature, they can submit their developed version to their community.

Anyhow, hopefully, the guide helped you in any way, and now you know how it really works.


About Author

Just is a born geek who loves tweaking his computer and gadgets for effectiveness and productivity. He seems to have a greater interest in blockchains, which makes him perfect for sharing his new discoveries on 101 Blockchains.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.