hyperleger composer architecure deep dive
TRANSCRIPT
![Page 1: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/1.jpg)
Hyperledger ComposerArchitecture Deep Dive
Dan Selman
2017-07-25 (v0.10.0)
![Page 2: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/2.jpg)
![Page 3: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/3.jpg)
A day in the life of a Composer transaction…
ComposerClient
FabricClient
Composer Chaincode
(Go)
Composer Runtime (JS)
End-UserUserCode(JS)
FabricShim(Go)
Duktape JS VM
Peer
ComposerREST
Server
Events
![Page 4: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/4.jpg)
Business Network Definition(Programming Model)
![Page 5: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/5.jpg)
Connect and Deploy
• Load the BusinessNetworkDefinition• BusinessNetworkDefinition.fromArchive or fromDirectory
• Deploy a business network• AdminConnection.connect(connectionProfileName)
• Connection profiles are loaded from disk. They are JSON documents that include all the information required to connect to a channel on a Fabric (or other runtimes)
• AdminConnection.deploy(businessNetworkDefinition, options)• Options can include the endorsement policy• Deployment is currently an install followed by an instantiate. We are breaking these
steps apart.• Install Composer chaincode (Go), instantiate Composer chaincode (Go), send a HLF
transaction with the business network archive payload to the chaincode.• BusinessNetworkDefinition archive is stored in the world-state on the blockchain
![Page 6: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/6.jpg)
Submit Transaction
• Create a BusinessNetworkClient connection• BusinessNetworkClient.connect(connectionProfileName)
• BusinessNetworkClient.submitTransaction(tx)• TX is validated against the model
• TX is serialized to JSON
• Use Node-SDK to submit the JSON payload to the Composer system chaincode
![Page 7: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/7.jpg)
![Page 8: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/8.jpg)
Handle Transaction (on peer)
• Validate the JSON for the transaction against the model
• Attempt to resolve the relationships in the transaction
• Call the Access Control Engine to determine whether the current participant has permission to execute this transaction
• Find all Transaction Processor functions that are subscribed to the type of the transaction
• For each:• Invoke the function
• All access to assets, participants and transactions are filtered through the declarative Access Control Engine
![Page 9: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/9.jpg)
![Page 10: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/10.jpg)
![Page 11: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/11.jpg)
Composer “Current Participant”
• Fabric access is authenticated using the standard certificate based authentication mechanism
• Composer system chaincode maps the fingerprint for certificate used to submit the transaction to a Composer participant. A Participant is a modelled entity in a business network, which could represent a user/org/system, with arbitrarily complex metadata and relationships
• Composer includes APIs and CLIs to manage the mapping from a certificate to a Participant instance.• Issue identity, revoke, bind
• A single participant could have multiple identities (certificates)
![Page 12: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/12.jpg)
Composer REST Server
• Based on Open Source LoopBack technology• Connect to a Business Network• Introspect the model (assets, participants, transaction, queries)• System types: identities, ping etc
• Automatically generate strongly-typed REST routes based on the model for the business network definition
• Uses the Open Source passport.js framework for authentication• Supports 100+ authentication provides, Twitter, GitHub, LDAP, OAuth,IBM ID etc.
• Wallet REST APIs map from an external ID (e.g. GitHub) to a PKI certificate
• Wallet persistence is delegated to LoopBack (so supports 20+ relational and non-relational back-ends
![Page 13: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/13.jpg)
![Page 14: Hyperleger Composer Architecure Deep Dive](https://reader034.vdocuments.us/reader034/viewer/2022051521/5a64b47b7f8b9abb6f8b464f/html5/thumbnails/14.jpg)