Get a direct enterprise blockchain experience with HFDBox!

Introduction

Have you ever wondered how to explain some blockchain concepts to a curious audience by showing some practical examples without a need to spend countless hours to get the underlying environment up and running? Or did you try to show how enterprise blockchains differ from others by showing a real-life demo from areas like supply chain, asset exchange or asset management? Tried to set up your own blockchain vanilla platform, messed it up with some hacks and had to rebuild everything from scratch? If you are reading this article then I bet you did at least some of the above.

If this is your case then you might be interested in Hyperledger Fabric Demo Box (HFDBox): a VM that lets you enjoy an out-of-the-box experience of Hyperledger Fabric v 0.6 developer preview with some simple yet compelling applications like Car Lease Demo, Marbles, Commercial Paper or Example02. It comes up with a menu where you can choose a demo or platform of your choice. You can then explore it directly from your favourite web browser installed on a host computer.

Download

Link : HFDBox.zip : 3,34Gb

SHA1: 9c7da792291e5366e5698ac82807a7230a65775d

SHA256: a99941180e402842582e441456a3f5b94d165b338d55c0b54d197e2508b0f7ce

Prerequisites

  • Host computer with 64-bit CPU, 2GB of RAM and 10GB of free disk space
  • Virtual Box (v. 5.x)
  • Local network capable of assigning ip addresses to newly connected devices
  • Access to the internet is welcome but not compulsory

Installation tasks

  1. First of all, you have to import a downloaded VM into your Virtual Box. Further instructions about this process can be found here.
  2. Once the VM is ready to go, in network settings make a change to attach VM’s network adapter to Bridged Adapter. This will allow a VM to be seen by your host’s web browser:

Operating HFDBox

  1. Launch a VM, then log in to it with following credentials:
  • username: fabric
  • password: fabric

2. Once logged in, change user permissions to root

sudo su -

3. The root directory contains an executable called start.sh. This is your menu with which you can launch a desired demo:

./start.sh

4. The menu will show up. You may now launch a demo of your choice (options 1–3), a pure Hyperledger Fabric 0.6 platform with 4 Validating Peers and a CA (option 4: Note that it will also deploy Example02 sample smart contract as well as Hyperledger Blockchain Explorer). Option 5 will allow you to do a general cleanup if for any reason demos will not run successfully.

Options explained in detail

Car Lease Demo

Description: This application is designed to demonstrate how assets can be modeled on the Blockchain using a car leasing scenario. The application is designed to allow participants to interact with the vehicle assets creating, updating and transferring them as their permissions allow. The demonstration allows a view of the ledger that stores all the interactions that the above participants have has with their assets. The ledger view shows the regulator every transaction that has occurred showing who tried to to what at what time and to which vehicle. More details about the application can be found here.

Once deployed, the application is available from your browser at http://<yourVMipAddress>:8080

Known issues: n/a

Marbles

Description: This application is going to demonstrate transferring marbles between two users leveraging Hyperledger Fabric. More details about the application can be found here.

Once deployed, the application is available from your browser at http://<yourVMipAddress>:3000

In addition to that, Blockchain Explorer is available from your browser at http://<yourVMipAddress>:9090

Known issues: From time to time, the Marbles chaincode fails to deploy correctly and ends up with the following message:

[ibc-js] Deploy Chaincode — Starting
[ibc-js] function: init , arg: [ ‘99’ ]
Waiting…
deploy resp error — there is no chaincode hash name in response: { jsonrpc: ‘2.0’,
 error: 
 { code: -32001,
 message: ‘Deployment failure’,
 data: ‘Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long’ },
 id: 1495992459558 }
! looks like a deploy error, holding off on the starting the socket
 { name: ‘deploy() error no cc name’,
 code: 502,
 details: 
 { jsonrpc: ‘2.0’,
 error: 
 { code: -32001,
 message: ‘Deployment failure’,
 data: ‘Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long’ },
 id: 1495992459558 } }

This is related to the deployment timeout which is sometimes reached. I tried to extend the timeout, without obtaining better results. Every 2nd-3rd attempt ends up with success which shows something like this message:

chain_setup.js Deployment request: {“fcn”:”init”,”args”:[“a”,”100"],”chaincodePath”:”chaincode/”,”certificatePath”:”/certs/peer/cert.pem”}
chain_setup.js Successfully submitted chaincode deploy transaction cf8b7178927c14495d2fa5e758843a3ffbe25052f5128c2b867d2989c0a5bcca
chain_setup.js Will wait for 80 seconds after deployment for chaincode to startup

Commercial Paper

Description: This application is a demonstration of how a commercial paper trading network might be implemented on Hyperledger Fabric. More details about the application can be found here.

Once deployed, the application is available from your browser at http://<yourVMipAddress>:3000

In addition to that, Blockchain Explorer is available from your browser at http://<yourVMipAddress>:9090

Known issues: Before using this demo, you must make a small modification in an application configuration file which will reflect your VM’s ip address. This action has to be done only once. To do so, follow these guidelines:

  • In HFDBox, type ifconfig to learn your VM’s IP address or simple run ./start.sh which will show it to you right away. Note it down.
  • Go to Commercial Paper Demo configuration folder:
root@HFDBox:~# cd ~/dapps/cp-web/
  • Edit setup.js file:
root@HFDBox:~/dapps/cp-web# nano setup.js
  • Within the file, search for the following paragraph and replace an ip address in bold (below) with the one representing your VM. Then save the file with Ctrl+X (confirm changes by typing “y”):
else {
 console.log(TAG + ‘Assuming this app is running on localhost.’);
 exports.SERVER = {
 HOST: ‘localhost’,
 PORT: 3000,
 DESCRIPTION: ‘Localhost’,
 EXTURI: process.env.EXTURI || ‘192.168.0.10:3000’
 };
}

You are now ready to deploy this demo.

Hyperledger Fabric 0.6 (a platform)

Description: This demo follows closely the principles described in my previous article about setting up Hyperledger Fabric 0.6. It will deploy a network topology composed of 4 Validating Peers, 1 CA, 1 Blockchain Explorer and 1 chaincode (Example02).

Example02 ends up being deployed. If you want to learn how to invoke and query this sample chaincode, please visit my previous article.

Once deployed, Blockchain Explorer is available from your browser at http://<yourVMipAddress>:9090

You may use REST APIs to interact with it from your browser, through cURL or with POSTMAN. A full documentation of Fabric 0.6 REST APIs can be found here: https://hyperledger-fabric.readthedocs.io/en/v0.6/API/CoreAPI.html#rest-api

Credits

  • Car Lease Demo, Marbles and Commercial Paper are all created by IBM
  • Hyperledger Fabric 0.6 and Hyperledger Blockchain Explorer are developed by Hyperledger, a Linux Foundation-led project
  • Example02 is created by Gregory Haskins