Hyperledger Composer is a set of development tools for building blockchain applications and business networks on Hyperledger Fabric. It includes a modeling language (CTO) to define assets, participants, transactions and events. It also includes a web-based Playground interface to quickly define, deploy and test business networks without installing dependencies. Composer provides a command line interface to integrate modeled business networks with Hyperledger Fabric. A business network definition includes model files, transaction processor functions, and access control rules. It can be deployed and tested on Playground or integrated with Hyperledger Fabric.
internship ppt on smartinternz platform as salesforce developer
03 - An introduction to hyperledger composer
1. Intelligent Blockchain Engineering Lab
Department of Computer Science Engineering
Korea University
November 2019
MPYANA MWAMBA MERLEC
AN INTRODUCTION TO
4. Business Network Concepts
4
It provides connectivity
Connects customers, suppliers, banks and partners
Across geographically and regulatory boundaries
Wealth is generated by the flow of goods
& services across the business network
Markets are the key to this process:
Public (food market, car auction, appliances, etc.)
Private (supply chain, financing, bonds)
Business Network is a group of entities who work together to accomplish certain goals
6. Business Network Concepts
6
Ledger – the system of record for a business
Used to record transactions (asset transfer between participants)
Business might have multiple ledgers for multiple business networks where
they are involved.
Participants – members of a business network
Customer, Supplier, Government, Regulator
Usually resides in an organization
Has specific identities and roles
Transaction – an asset transfer
e.g. Merlec gives a Car to Daegeon Lee
Transactions are used to interact with assets
Contract – document containing conditions for a
transaction to occur
If Daegeon Lee pays Merlec money, then car passes from Merlec to
Daegeon Lee
A contract for shipment of 100 pieces of smartphones for X price
based on conditions {X, Y, Z}
7. Business Network – Car Auction Market
7
A Business network describes any group of organizations or individuals that connect with a desire to transfer or share assets.
DMV – Department of Motor Vehicles
8. Actors in a Fabric Business Network
Infrastructure
8
Hyperledger Fabric permissioned blockchain
network is a technical infrastructure that
provides ledger service to app. consumer
and administrators.
15. 15
An extensive, open development toolset and framework for blockchain applications
developing, and consists of :
A modeling language called CTO (an homage to the original project name, Concerto)
A user interface called Hyperledger Composer Playground
For quick and easy definition, configuration, deployment, and testing of business networks
Command-Line Interface (CLI) tools for integrating modeled business networks
using Hyperledger Composer with a running instance of the Hyperledger Fabric blockchain network
18. Elements of Hyperledger Composer
18
Blockchain State Storage
All transactions submitted through a business network are stored on the blockchain ledger
The current state of assets and participants are stored in the blockchain state database
The ledger and the state database are distributed across a set of peers
The blockchain ensures that updates to the ledger and state DB are consistent across all peers using a consensus algorithm
Connection Profile
It is a JSON document that is part of a business network card.
Hyperledger Composer uses Connection Profiles to define the system to connect to.
Business Network Card
It is a combination of an identity, a connection profile, and metadata.
the metadata optionally containing the name of the business network to connect to.
22. Business Network Definition (BND)
22
Hyperledger composer has its own modeling
language used to model the business network
BND is a key concept of Hyperledger Composer
programming model. They are represented by :
BusinessNetworkDefinition class:
defined in composer-common module
exported by both composer-admin and composer-client.
Business Network Definitions are composed of :
a set of model files (.cto)
a set of JavaScript files (.js)
an Access Control file (.acl)
23. Prerequisites:
Docker Engine 17.03 or greater
https://docs.docker.com/install/
Web browser
Hyperledger Composer Playground
23
A user interface environment enabling
Quick and easy definition, configuration, deployment, and testing of business networks
※ It reduces the complexity of getting a business
network defined, validated, and tested.
http://composer-playground.mybluemix.net/
24. Playground Basic Model Network
24
※ Hello World Business Network Model Definition and Test
- Model files (.cto) - defines the hello world business network
- JavaScript files (.js) - contain transaction processor function that print
“Hello world” to the console.
25. My First Business Network on
Playground
25
Business Network card is a combination of
an identity, a connection profile, and metadata.
※ the metadata optionally containing the name of
the business network to connect to.
30. 30
Hyperledger Composer Modeling Language
Hyperledger Composer includes an object-oriented modeling language (CTO)
Used to define the domain model for a business network definition.
CTO file is composed of the following elements:
① A single namespace - All resource declarations within the file are implicitly in this namespace
② A set of resource definitions, encompassing assets, transactions, participants, and events
③ Optional import declarations that import resources from other namespaces
※ A class in Hyperledger Composer is referred to as a Resource Definition, therefore an asset instance has an Asset Definition.
※ Concepts are abstract classes that are not assets, participants or transactions.
They are typically contained by an asset, participant or transaction.
31. My First Business Network Definition
31
The namespace in which resources are defined.
※ A name must be unique within the namespace
The property (indicated by lowercase "o") of
type String, and uniquely identifies an asset
(as indicated by identified by).
The reference (indicated by -->) to Contract
is called a relationship, and is one-way
(unidirectional.)
33. My First Business Network Definition
33
The @param and @transaction
annotations are required.
- @param tag to indicate the
parameter definition,
followed by the resource
name of the Tx which
triggers the transaction
processor function.
- @transaction tag identifies
the code as a transaction
processor function.
Script file contains transaction
processor functions implementing
the transactions defined in the
Business Network Definition's
model files.
34. My First Business Network Definition
34
Access Control Language (ACL)
provides declarative access control
over the elements of the domain
model.
ACL rules determine which users/roles
are permitted to create, read, update or
delete elements in a business network's
domain model.
45. My First Business Network – Transaction
submission
45
※ For simplicity in our demo,
specify the transaction ID to
pass to it as parameter.
Select the corresponding
transaction to submit.
51. Car Auction Business Network
51
The new business network
definition project has been
created.
Admin ID Card provides all
of the information needed to
connect/deploy the business
network definition to a
distributed ledger.
※ kcaraution-net is composed of :
- Model files (.cto) - define the business domain for a business network
- JavaScript files (.js) - contain transaction processor functions.
- Access Control file (.acl) - contains a set of access control rules that
define the rights of the different participants in the business network.
52. Car Auction Business Network
52
※ User ID Cards include connection profiles and credentials used to
deploy a Business Network to a distributed ledger.
57. 57
Model File - models/auction.cto
Assets and enumerated
types declaration
Participants and transactions
declarations
※ Assets, Participants and Transactions are class
definitions.
These concepts may be considered to be different
stereotypes of the class type.
A namespace defined by the
namespace of it parent file.
Enumerated types are used
to specify a type that may
have 1 or N possible
values (set of values).
74. References
74
[1] Androulaki, Elli, et al. "Hyperledger fabric: a distributed operating system for permissioned blockchains." Proceedings of the Thirteenth EuroSys
Conference. ACM, 2018. https://dl.acm.org/citation.cfm?id=3190538
[2] Vance Morris et al., " Developing a blockchain Business Network with Hyperledger composer using the IBM blockchain platform starter plan ",
IBM RedBook, May 2018 | http://www.redbooks.ibm.com/redpapers/pdfs/redp5492.pdf
[3] Bob Dill, David Smits, " Zero to Blockchain : An IBM Redbooks course ", https://www.redbooks.ibm.com/abstracts/crse0401.html?Open
[4] Hyperledger Composer Developer Tutorials, https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial
[5] J Steven Perry, Hyperledger Composer basics, Part 1: Model and test your blockchain network,
https://www.ibm.com/developerworks/cloud/library/cl-model-test-your-blockchain-network-with-hyperledger-composer-playground/index.html
[6] LinuxFoundationX: LFS171x Blockchain for Business - An Introduction to Hyperledger Technologies, edx MOOC 2017
[7] Hyperledger Architecture, Volume 2: Smart Contracts - https://www.hyperledger.org/wp-content/uploads/2018/04/Hyperledger_Arch_WG_Paper_2_SmartContracts.pdf
[8] https://docs.docker.com/install/#releases | https://www.hyperledger.org/resources/publications#presentations
[9] https://developer.ibm.com/code/wp-content/uploads/sites/118/2017/09/Marbles_BlockChain_Tech_Talk1.pdf
[10] https://developer.ibm.com/blockchain/ | https://www.ibm.com/developerworks/cloud/library/cl-blockchain-basics-intro-bluemix-trs/
[11] Hyperledger Composer Introduction and Playground Tutorial (with Demo Code) , https://www.srcmake.com/home/composer (Accessed Sep. 2018)
[12] Hyperledger Composer Modeling Language, https://hyperledger.github.io/composer/latest/reference/cto_language.html
[13] https://developer.ibm.com/patterns/build-a-blockchain-network/