You are on page 1of 10

IBM Blockchain

Lab 1: Set up Hyperledger Composer


Playground
Overview
This lab is divided into three parts:
Set up the playground by importing the car auction code
Transfer assets in a blockchain
Explore the editor views and archive data

This lab takes place entirely in the web browser using Hyperledger Composer Playground.
Playground simulates the entire blockchain network within the browser by providing a sandpit
environment to define, test, and explore business networks defined by using Composer. It is possible to
connect to a live blockchain Hyperledger Fabric instance or install the Composer Playground on a local
machine for more developer friendly tools.
Hyperledger Composer Playground is one method to use Hyperledger Composer. Other methods are
also available at https://hyperledger.github.io/composer/installing/installing-index.html.
Hyperledger Composer

Hyperledger Composer (https://hyperledger.github.io/composer) is an open-source set of tools designed


to make building blockchain applications easier.

It allows users to model the business networks, assets, and transactions that are required for blockchain
applications, and to implement those transactions by using simple JavaScript functions. The blockchain
applications run on instances of Linux Foundation Hyperledger Fabric (www.hyperledger.org).

The purpose of this lab is to introduce you to the concepts of a blockchain by showing you how a
blockchain transfers assets between participants in a business network. We will use the implementation
of a simple blind car auction as the scenario for the lab.

The car auction business network has a set of known participants (buyers and sellers), assets (cars and
car listings), and transactions (placing bids and closing auctions). We will model these by using
Hyperledger Composer and test the business logic that makes the auction work.

Crucially, a blockchain could be used to bring together the buyers and sellers of these assets without
needing any trusted third party. However, an auctioneer could be used to provide visibility and
governance of the network if required.

2 Copyright IBM Corporation 2017. All rights reserved.


Prerequisites

Skill requirements:
There are no skill prerequisites to completing the first two parts.
It is desirable but not essential to have some background knowledge of JavaScript for the last
part called "Explore the editor views and export data."

Technical prerequisites:
Internet connection
Web browser

3 Copyright IBM Corporation 2017. All rights reserved.


Step 1. Import the car auction sample

__1. Open a web browser and go to http://composer-playground.mybluemix.net. Dismiss the welcome


screen to show the playground wallet screen which is used to connect and deploy new business
networks:

__2. Click the Deploy a business network box. Then scroll down and select the carauction-network:

__3. Next give the business network a name and description:

4 Copyright IBM Corporation 2017. All rights reserved.


__4. Click the Deploy button to deploy the new car auction business network:

__5. Click Connect now in the new identity card for the carauction network:

5 Copyright IBM Corporation 2017. All rights reserved.


__6. Take a minute to read through the description of the car auction sample, to help understand the
participants, assets and transactions associated with this particular network.

1.1.1. Add Three Participants

In the next section we will now work with the deployed car auction blockchain network.

We will first instantiate three Member participants of the car auction business network:

Alice Smith (alice@email.com), who will make a bid on a car,


Bob Jones (bob@email.com), who will also make a bid on a car, and

6 Copyright IBM Corporation 2017. All rights reserved.


Charlie Brown (charlie@email.com), who currently owns a car.

We will not instantiate an Auctioneer in this demo; this could be used in order to provide
oversight of the network, although is not necessary.

__7. Click the Test tab and then click on the Member participant registry:

The registry is empty as no members have currently been defined.

__8. Click on Member to view there are no current members in the environement

__9. Click Create New Participant to add a new Member.

__10. Type the correct values into the JSON data structure to add Alice to the business network. Lets
give her a starting balance of 10000.

7 Copyright IBM Corporation 2017. All rights reserved.


__11. Click Create New to add Alice to the registry.

__12. Do the same for Bob. Lets give him a starting balance of 5000.

8 Copyright IBM Corporation 2017. All rights reserved.


__13. Finally do the same for Charlie. He hasnt got so much money (hes selling his car, after all) so
lets give him a starting balance of 100.

__14. Verify that all participants in the business network have been correctly defined. Use the

appropriate Edit button ( ) to make any changes.

9 Copyright IBM Corporation 2017. All rights reserved.


Copyright IBM Corporation 2017
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in
many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other
companies. A current list of IBM trademarks is available on the Web at Copyright and trademark
information at www.ibm.com/legal/copytrade.shtml.
This document is current as of the initial date of publication and may be changed by IBM at any time.
The information contained in these materials is provided for informational purposes only, and is provided
AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages
arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is
intended to, nor shall have the effect of, creating any warranties or representations from IBM or its
suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing
the use of IBM software. References in these materials to IBM products, programs, or services do not
imply that they will be available in all countries in which IBM operates. This information is based on
current IBM product plans and strategy, which are subject to change by IBM without notice. Product
release dates and/or capabilities referenced in these materials may change at any time at IBMs sole
discretion based on market opportunities or other factors, and are not intended to be a commitment to
future product or feature availability in any way.

10 Copyright IBM Corporation 2017. All rights reserved.

You might also like