1. HyperLedger Composer
• Hyperledger Composer also known as Fabric Composer is
one of the Hyperledger projects hosted by the Linux
Foundation.
• It is an extensive, open development toolset and
framework that runs on top of Hyperledger Fabric and
makes building blockchain applications easier.
• The primary goal is to enable easy and rapid
development of blockchain applications.
easier = faster = cheaper = popular with the customer/boss
2.
3. Key Components
Business Network:
• A business network is a group of entities who work together to
accomplish certain goals.
• In order to achieve these goals, there must be agreement among
the members of the business network regarding:
1. The goods and services that are exchanged.
2. How the exchange is to take place (including business rules
governing payment and penalties)
3. Which members within the group are allowed to participate,
and when.
• The Composer consists of a modeling language, and a set of APIs to
quickly define and deploy business networks that
allow participants to send transactions that exchange assets.
4. For Example, a perishable goods network is a business
network involving:
• Perishable items such as bananas, pears, and coffee.
• Business partners such as growers, shippers, and importers.
• Shipments of perishable goods.
• Agreements between business parties that stipulate
conditions of the agreements.
• Acknowledgement of receipt of goods and services.
5. Asset:
• An asset is anything of value that can be exchanged between
parties in a business agreement.
• In the Perishable Goods network, assets include the
perishable goods themselves and the contracts that govern
the activities performed during the exchange.
Participants:
• A participant is a member of a business network.
• For the Perishable Goods network, this includes the growers
who produce the perishable goods, the shippers who
transport them from the growers to the ports, and the
importers who take delivery of the goods at the ports.
6. Transactions:
• When an asset is "touched," that interaction potentially affects
the state of the blockchain ledger.
• The interaction is modeled in Hyperledger Composer as
a transaction.
Examples of transactions in the Perishable Goods network include:
1. An Importer receives a shipment of perishable goods.
2. An IoT GPS sensor records the shipping container's current
location at a particular interval of time.
Access Control:
• In a business network, not every participant has access to
everything.
• For example, a grower does not have access to the contract
between the shipper and the importer.
7. • Access control is used to limit who has access to what (and
under what conditions).
Events:
• An event is a notification produced by the blockchain
application, and consumed by an external entity.
• However, there are times when an external entity needs to be
notified that the state of the ledger has changed, or that maybe
something else of note has occurred (or not occurred but should
have) in the system. At such times, events are used.
• Examples of events in the Perishable Goods network might
include:
1. A temperature reading has exceeded an upper or lower
boundary X number of times
2. A shipment has been received.
8. In Fabric Composer, a business network is defined as:
• A model definition file
• A set of JavaScript processors (in a Script file)
• An Access Control file
Model Definition File:
• Model file is the place where all the entities of the business
network are defined.
• That is, it describes the assets, transactions and events that
exists in the business network.
• Each will be having the set of variables and it’s types.
• You can also built relationships between each entity.
• Hyperledger Composer has its own modeling language for doing
this by the name of CTO Modeling Language.
10. Script Files:
• This is the place where the transaction processor functions
are defined.
• It’s the business logic of the blockchain application where
you’ll be defining what kind of operations can be done in
the network.
• That is, the business logic for each transaction is defined in
the Script file.(Written in JavaScript)
• In the perishable goods networks, the Transaction
processor function for Transaction shipmentReceived is as
follows:
11.
12. Access Control Files
• In a business network, not every participant has access to
everything.
• These restrictions or role-based security is implemented through
Access Control Files ie .acl files.
• In these files, the rules of which participants can perform what
transactions, who can create what asset etc are defined.
• In the perishable goods networks, the Permissions .acl file is as
follows: