Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Blockchin Architecture on Azure-Part-3

Blockchin Architecture on Azure-Part-3

In this session ,we discussed how we can do development with Hyper ledger Composer and do deployment on Fabric on Azure.

Asif Waquar

August 20, 2019
Tweet

More Decks by Asif Waquar

Other Decks in Technology

Transcript

  1. RoadMap o Part-1 -Blockchain Introduction & Architecture on Azure. o

    Part-2 -Fabric Architecture & Installation on Azure o Part-3 - Block chain Hyper ledger deployment on Azure. o Part-4 - Corda Architecture & Deployment on Azure. o Part-5 - Corda workflow & Swift paymentintegration. o Part-6 - Blockchain with Ethereum & Quorum and deploying in DAPPS Azure. o Part-7 - Handling Media & Documents in BlockChain o Part-8 - Security in Blockchain. o Part-9 - Block chain with IOT . o Part-10 - Hands on Workshop on Blockchain.
  2. Today’sAgenda o Recap part-1 & 2 o Dev Environment with

    Hyperledger Composer o Demo Hyperledger Playground Deployment on Azure
  3. Hyperledger Fabric Architecture Orderer • Consensus verification • CreatesBlocks C

    A • Registration ofidentities • Manage C ertificates Peer • EndorsesT x • SimulatesTx • CommitsT x 3ComponentsofFabric L edger Blockchain & WorldState • createCar • queryAllCars • queryCarProperties • changeCarColor • changeCarOwner • EndorsementPolicies • Assets :Anythingthat’s valuablefor theOrganization • T ransactions(State changes of Assets) • GossipProtocol: Theglue that keepsthe peers in healthystate. Allthesecomponentscanbeclusteredfor scalabilityandto avoidSinglePointofFailure Channels SmartContract OtherConcepts • Private subnetfor a set of parties based on Smartcontract • Ledger/Channel • Peerscanhave multipleChannels • PrivateData 1 2
  4. Consortium Network Example of consortium network of 3 organisations Org

    1 and Org 3 run peers Org 2 provide ordering service only.
  5. Hyperledger Composer: Accelerating Time to Value • Features – Model

    your business networks, test and expose viaAPIs – 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)
  6. 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
  7. 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)
  8. – 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. – A consortium of 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 A single organization may play multiple roles!
  9. Key Concepts for the Business Service Provider BusinessService Provider Assets

    uses Enduser calls Asset Registry Transaction Registry invokes transaction updates hosts Participant Registry definedin Business Service Consumer definedin updates develops develops Presentation Logic develops TransactionProcessor Functions Model Smart ContractLogic REST Interface BusinessApp Integration Logic BusinessLogic
  10. Example: Vehicle Auction Developer Vehicle Registry Vehicle Listing Registry Auctioneer

    develops hosts Auctioneer Registry Transaction Registry Place Offer 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 System of Record Integration BusinessLogic Vehicle Vehicle Listing Member Registry Balance $
  11. 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 PresentationLogic SmartContracts
  12. 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!
  13. 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
  14. Creating the Business and End-User Applications – JavaScript business applications

    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
  15. 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