2
Mohammad Asif Waquar
Senior Software Engineer
atABNAMRO Bank
@asifwaquar
BlockchainArchitecture&UseCase–Part-3
2
about me
Senior Software Engineer at ABN AMRO
https://www.linkedin.com/in/mohammad-asif-6a6153111/
RoadMap
o Part-1 -Blockchain Introduction & Architecture on Azure.
o Part-2 -FabricArchitecture & Installation on Azure
o Part-3 - Block chain Hyper ledger deployment on Azure.
o Part-4 - CordaArchitecture & Deployment on Azure.
o Part-5 - Cordaworkflow & Swift paymentintegration.
o Part-6 - Blockchain with Ethereum & Quorum and deploying in DAPPSAzure.
o Part-7 - Handling Media & Documents in BlockChain
o Part-8 - Security in Blockchain.
o Part-9 - Block chain with IOT.
o Part-10 - Handson Workshop on Blockchain.
Today’sAgenda
o Recap part-1 & 2
o Dev Environment with Hyperledger Composer
o DemoHyperledgerPlaygroundDeploymentonAzure
Recap –Part-1 & 2
Hyperledger Fabric Architecture
Orderer
• Consensus
verification
• CreatesBlocks
CA
• Registration
ofidentities
• Manage
Certificates
Peer
• EndorsesTx
• SimulatesTx
• CommitsTx
3ComponentsofFabric
Ledger
Blockchain & WorldState
• createCar
• queryAllCars
• queryCarProperties
• changeCarColor
• changeCarOwner
• EndorsementPolicies
• Assets:Anythingthat’s
valuablefor theOrganization
• Transactions(Statechangesof
Assets)
• GossipProtocol: Theglue
that keepsthepeersin
healthystate.
Allthesecomponentscanbeclusteredfor scalabilityandto avoidSinglePointofFailure
Channels SmartContract OtherConcepts
• Private subnetfor a
set of parties based
on Smartcontract
• Ledger/Channel
• Peerscanhave
multipleChannels
• PrivateData
1
2
Consortium Network
Example of consortium network of 3 organisations
Org 1 and Org 3 run peers
Org 2 provide ordering service only.
Hyper ledger Composer
Hyperledger Composer: Accelerating Time to Value
• Features
– Model your businessnetworks, test and exposeviaAPIs
– Applications invoke transactions to interact with businessnetwork
– Integrate existing systems of record
• Fullyopen and part of LinuxFoundationHyperledger
• A suite of high level application abstractions for business networks to be built on top of HyperledgerFabric
• Emphasis on business-centric vocabulary for quick solution creation – model in terms ofassets,
participants and transactions
• Reduce risk, and increase understanding and flexibility
https://hyperledger.github.io/composer
BusinessApplication
Hyperledger Composer
Blockchain
(Hyperledger Fabric)
Goals of Hyperledger Composer
Increase
understanding
Save
time
Reduce
risk
Increase
flexibility
Bridges simply from
business concepts to
blockchain
Develop blockchain
applications more
quickly and cheaply
Well tested, efficient
design conforms to
best practice
Higher level
abstraction makes it
easier to iterate
Extensive, Familiar, Open Development Toolset
CLI utilities
Data modelling JavaScript
business logic
Web playground
Existing systems and
data
$ composer
Client libraries
composer-client
composer-admin
Code generation
Swagger
Editor support
(Atom, VisualStudio)
– Business Service Consumer
– Hosts application and integration logic
which invokes blockchain transactions
– End-user
– Runs presentation logic e.g. on
mobile device or dashboard
User Roles in a Blockchain Solution
– Network Service Provider
– Governs the network: channels, membership etc.
– Aconsortiumof network members or designated authority
– Network Service Consumer
– Operates a set of peers and certificate authorities on the network
– Represents an organization on the business network
– Business Service Provider
– Develops blockchain business applications
– Includes transaction, app server, integration and presentation logic
NSP
Asingle organization may play multiple roles!
Key Concepts for the Business Service Provider
BusinessService
Provider
Assets
uses
Enduser
calls
Asset
Registry
Transaction
Registry
invokes
transaction updateshosts
Participant
Registry
definedin
Business
Service
Consumer
definedin
updates
develops
develops
Presentation
Logic
develops
TransactionProcessor
Functions
Model
Smart ContractLogic
REST
Interface
BusinessApp
Integration
Logic
BusinessLogic
Example: Vehicle Auction Developer
Vehicle
Registry
Vehicle
Listing
Registry
Auctioneer
develops
hosts
Auctioneer
Registry
Transaction
Registry
PlaceOffer
CloseBidding
definedin
Place Offer
CloseBidding
[Registryoperations]
Model
develops
VehicleAuction
Developer
Mobile
AuctionApp
develops
uses
Auction SmartContract
Member
calls
definedin
updates
updates
REST
Interface
AuctionBack-
endService
Systemof Record
Integration
BusinessLogic
Vehicle Vehicle
Listing
Member
Registry
Balance
$
Business Service Provider develops three components
• Services that interact with the
registries
• Create, delete, update,
query and invoke smart
contracts
• Implemented inside
business applications,
integration logic and REST
services
• Hosted by the Business
Application Consumer
• Implements the logic deployed to the
blockchain
• Models describe assets, participants
& transactions – expressive
modeling language includes
relationships and validation rules
• Transaction processors provide
the JavaScript implementation of
transactions
• ACLs define privacy rules
• May also define events and registry
queries
• Provides the front-end for
the end-user
• May be several of these
applications
• Interacts with business
logic via standard
interfaces (e.g. REST)
• Composer can generate
the REST interfacefrom
model and a sample
application
BusinessLogic PresentationLogicSmartContracts
Assets, Participants and Transactions
Vehicle Vehicle
Listing AuctioneerMember
PlaceOffer
CloseBidding
Transaction
Processors
Access Control
– It is possible to restrict which resources can be readand
modified by which participants
– Rules are defined in an .acl file and deployed with
the rest of the model
– Transaction processors can also look up the
current user and implement rules programmatically
– ACL rules can be simple (e.g. everybody can read all
resources) or more complex (e.g. only the owner of an
asset can do everything to it)
– Application supplies credentials (userid/secret) ofthe
participant when connecting to the Fabric network
– This also applies to Playground!
Events and Queries
– Events allow applications to take action when a transaction occurs
– Events are defined in models
– Events are emitted by transaction processor scripts
– Events are caught by business applications
– Caught events include transaction ID and other relevantinformation
– Queries allow applications to perform complex registrysearches
– They can be statically defined in a separate .qry file orgenerated
dynamically by the application
– They are invoked in the application using buildQuery() or query()
– Queries require the blockchain to be backed byCouchDB
Creating the Business and End-User Applications
– JavaScript businessapplications require() the
NPM “composer-client” module
– This provides the API to access
assets, participants and transactions
– RESTful API (via Loopback) can also
be generated… see later
– Command-line tool available to generate
end-user command-line or Angular2
applications from model
– Also helps with the generation of unit
tests to help ensure quality code model
Debugging
– Playground Historian allows you to view all transactions
– See what occurred and when
– Diagnostics framework allows for application level trace
– Uses the Winston Node.js logging framework
– Application logging using DEBUG env var
– Composer Logs sent to stdout and
./logs/trace_<processid>.trc
– Fabric chaincode tracing also possible
– More information online:
https://hyperledger.github.io/composer/problems/diagnostics.html
Administration Responsibility
Key Concepts of Administrator
Network Service Consumer Packages Resources in BNA File
Participant Identity
Business Network Card
System Record Integration
Demo
Fabric Installation steps
https://github.com/asifwaquar/blockchain-architecture/blob/master/README.md
https://asifwaquar.blogspot.com/
Github Repo:
Blog:
Questions?
12
ThankYou
12

Blockchin Architecture on Azure-Part-3

  • 1.
    2 Mohammad Asif Waquar SeniorSoftware Engineer atABNAMRO Bank @asifwaquar BlockchainArchitecture&UseCase–Part-3
  • 2.
    2 about me Senior SoftwareEngineer at ABN AMRO https://www.linkedin.com/in/mohammad-asif-6a6153111/
  • 3.
    RoadMap o Part-1 -BlockchainIntroduction & Architecture on Azure. o Part-2 -FabricArchitecture & Installation on Azure o Part-3 - Block chain Hyper ledger deployment on Azure. o Part-4 - CordaArchitecture & Deployment on Azure. o Part-5 - Cordaworkflow & Swift paymentintegration. o Part-6 - Blockchain with Ethereum & Quorum and deploying in DAPPSAzure. o Part-7 - Handling Media & Documents in BlockChain o Part-8 - Security in Blockchain. o Part-9 - Block chain with IOT. o Part-10 - Handson Workshop on Blockchain.
  • 4.
    Today’sAgenda o Recap part-1& 2 o Dev Environment with Hyperledger Composer o DemoHyperledgerPlaygroundDeploymentonAzure
  • 5.
  • 6.
    Hyperledger Fabric Architecture Orderer •Consensus verification • CreatesBlocks CA • Registration ofidentities • Manage Certificates Peer • EndorsesTx • SimulatesTx • CommitsTx 3ComponentsofFabric Ledger Blockchain & WorldState • createCar • queryAllCars • queryCarProperties • changeCarColor • changeCarOwner • EndorsementPolicies • Assets:Anythingthat’s valuablefor theOrganization • Transactions(Statechangesof Assets) • GossipProtocol: Theglue that keepsthepeersin healthystate. Allthesecomponentscanbeclusteredfor scalabilityandto avoidSinglePointofFailure Channels SmartContract OtherConcepts • Private subnetfor a set of parties based on Smartcontract • Ledger/Channel • Peerscanhave multipleChannels • PrivateData 1 2
  • 8.
    Consortium Network Example ofconsortium network of 3 organisations Org 1 and Org 3 run peers Org 2 provide ordering service only.
  • 9.
  • 10.
    Hyperledger Composer: AcceleratingTime to Value • Features – Model your businessnetworks, test and exposeviaAPIs – Applications invoke transactions to interact with businessnetwork – Integrate existing systems of record • Fullyopen and part of LinuxFoundationHyperledger • A suite of high level application abstractions for business networks to be built on top of HyperledgerFabric • Emphasis on business-centric vocabulary for quick solution creation – model in terms ofassets, participants and transactions • Reduce risk, and increase understanding and flexibility https://hyperledger.github.io/composer BusinessApplication Hyperledger Composer Blockchain (Hyperledger Fabric)
  • 11.
    Goals of HyperledgerComposer Increase understanding Save time Reduce risk Increase flexibility Bridges simply from business concepts to blockchain Develop blockchain applications more quickly and cheaply Well tested, efficient design conforms to best practice Higher level abstraction makes it easier to iterate
  • 12.
    Extensive, Familiar, OpenDevelopment Toolset CLI utilities Data modelling JavaScript business logic Web playground Existing systems and data $ composer Client libraries composer-client composer-admin Code generation Swagger Editor support (Atom, VisualStudio)
  • 13.
    – Business ServiceConsumer – Hosts application and integration logic which invokes blockchain transactions – End-user – Runs presentation logic e.g. on mobile device or dashboard User Roles in a Blockchain Solution – Network Service Provider – Governs the network: channels, membership etc. – Aconsortiumof network members or designated authority – Network Service Consumer – Operates a set of peers and certificate authorities on the network – Represents an organization on the business network – Business Service Provider – Develops blockchain business applications – Includes transaction, app server, integration and presentation logic NSP Asingle organization may play multiple roles!
  • 14.
    Key Concepts forthe Business Service Provider BusinessService Provider Assets uses Enduser calls Asset Registry Transaction Registry invokes transaction updateshosts Participant Registry definedin Business Service Consumer definedin updates develops develops Presentation Logic develops TransactionProcessor Functions Model Smart ContractLogic REST Interface BusinessApp Integration Logic BusinessLogic
  • 15.
    Example: Vehicle AuctionDeveloper Vehicle Registry Vehicle Listing Registry Auctioneer develops hosts Auctioneer Registry Transaction Registry PlaceOffer CloseBidding definedin Place Offer CloseBidding [Registryoperations] Model develops VehicleAuction Developer Mobile AuctionApp develops uses Auction SmartContract Member calls definedin updates updates REST Interface AuctionBack- endService Systemof Record Integration BusinessLogic Vehicle Vehicle Listing Member Registry Balance $
  • 16.
    Business Service Providerdevelops three components • Services that interact with the registries • Create, delete, update, query and invoke smart contracts • Implemented inside business applications, integration logic and REST services • Hosted by the Business Application Consumer • Implements the logic deployed to the blockchain • Models describe assets, participants & transactions – expressive modeling language includes relationships and validation rules • Transaction processors provide the JavaScript implementation of transactions • ACLs define privacy rules • May also define events and registry queries • Provides the front-end for the end-user • May be several of these applications • Interacts with business logic via standard interfaces (e.g. REST) • Composer can generate the REST interfacefrom model and a sample application BusinessLogic PresentationLogicSmartContracts
  • 17.
    Assets, Participants andTransactions Vehicle Vehicle Listing AuctioneerMember PlaceOffer CloseBidding Transaction Processors
  • 18.
    Access Control – Itis possible to restrict which resources can be readand modified by which participants – Rules are defined in an .acl file and deployed with the rest of the model – Transaction processors can also look up the current user and implement rules programmatically – ACL rules can be simple (e.g. everybody can read all resources) or more complex (e.g. only the owner of an asset can do everything to it) – Application supplies credentials (userid/secret) ofthe participant when connecting to the Fabric network – This also applies to Playground!
  • 19.
    Events and Queries –Events allow applications to take action when a transaction occurs – Events are defined in models – Events are emitted by transaction processor scripts – Events are caught by business applications – Caught events include transaction ID and other relevantinformation – Queries allow applications to perform complex registrysearches – They can be statically defined in a separate .qry file orgenerated dynamically by the application – They are invoked in the application using buildQuery() or query() – Queries require the blockchain to be backed byCouchDB
  • 20.
    Creating the Businessand End-User Applications – JavaScript businessapplications require() the NPM “composer-client” module – This provides the API to access assets, participants and transactions – RESTful API (via Loopback) can also be generated… see later – Command-line tool available to generate end-user command-line or Angular2 applications from model – Also helps with the generation of unit tests to help ensure quality code model
  • 21.
    Debugging – Playground Historianallows you to view all transactions – See what occurred and when – Diagnostics framework allows for application level trace – Uses the Winston Node.js logging framework – Application logging using DEBUG env var – Composer Logs sent to stdout and ./logs/trace_<processid>.trc – Fabric chaincode tracing also possible – More information online: https://hyperledger.github.io/composer/problems/diagnostics.html
  • 22.
  • 23.
    Key Concepts ofAdministrator
  • 24.
    Network Service ConsumerPackages Resources in BNA File
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.