Blog

25/05/2019

Getting Started with Hyperledger Composer on Ubuntu



A simple guide to set up your environment with Hyperledger Composer and allow you to develop a blockchain business network.

Hyperledger Composer is an extensive, open development toolset and framework to make developing blockchain applications easier. Our primary goal is to accelerate time to value, and make it easier to integrate your blockchain applications with the existing business systems. You can use Composer to rapidly develop use cases and deploy a blockchain solution in weeks rather than months. Composer allows you to model your business network and integrate existing systems and data with your blockchain applications.

You’ll need the Windows Subsystem for Linux to run Ubuntu on Windows 10. To proceed with the WSL installation, follow the simple guide here.

  • Log in your Ubuntu terminal as a normal user to install the prerequisites.
  • Install Node and Docker.

Then install the hyperledger composer prerequisites.

curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh

chmod u+x prereqs-ubuntu.sh
installing prerequisites for hyperledger composer

Run this script to install Hyperledger Composer prerequisites.

./prereqs-ubuntu.sh

*If you get the error: (Error: Ubuntu bionic is not supported hyperledger composer), edit the script using;

nano prereqs-ubuntu.sh

change declare -a version=('trusty' 'xenial' 'yakkety'); ‘

to declare -a version=('trusty' 'xenial' 'yakkety' 'bionic');

then continue with the installation.*

Install the Hyperledger Composer extension on VS Code.

composer extension on VS Code

We’ll need some CLI tools installed to support essential operations: Running a REST server, generating application assets and generating applications.

sudo npm install --unsafe-perm --verbose -g composer-cli@0.20
sudo npm install --unsafe-perm --verbose -g composer-rest-server@0.20
sudo npm install --unsafe-perm --verbose -g generator-hyperledger-composer@0.20
sudo npm install --unsafe-perm --verbose -g yo

To view and demonstrate your business networks, install the Playground UI.

sudo npm install --unsafe-perm --verbose -g composer-playground@0.20
installation of the playground UI

Install Hyperledger Fabric. The installation of Fabric v1.2 gives you a local runtime to deploy your business networks.

mkdir ~/fabric-dev-servers && cd ~/fabric-dev-servers

curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz
tar -xvf fabric-dev-servers.tar.gz
cd ~/fabric-dev-servers
export FABRIC_VERSION=hlfv12
./downloadFabric.sh

When performing the first new runtime, run the start script and generate a Peer Admin card.

./startFabric.sh
./createPeerAdminCard.sh

Start the web app

composer-playground
playground will start on port 8080
Let’s Blockchain!

To terminate a development session/Stop your local runtime use;

./stopFabric.sh

Voilà! You’re now set with an installation of Hyperledger Composer + Hyperledger Fabric. Make some magic 🙂

14/08/2019

How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...
14/08/2019

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....
12/08/2019

How to Start and Enable Firewalld on CentOS 7

In this article, we discuss how to start and enable firewalld. It is highly recommended that you have a firewall protecting your server.Pre-Flight CheckThese...