Hyperledger Fabric实践(2) 部署Hyperledger Composer理论

悄悄告诉你

这个链接卧虎藏龙:
HiBlock区块链技术布道 GitHub

Fabric和Composer:

Hyperledger的Composer和Fabric到底是什么关系?

这篇文章是在冯宇Ops的“Hyperledger Composer开发流程”的基础上,增加了一些修改和补充。从而可以在最新的Fabric版本上顺利搭建和部署网络。
Hyperledger Composer开发流程 冯宇Ops

Hyperledger Composer构架

Hyperledger Fabric实践(2) 部署Hyperledger Composer理论_第1张图片
Hyperledger Composer Architecture

主要包含了以下components:

  • Execution Runtimes
  • JavaScript SDK 要会JS哦
  • Command Line Interface
  • REST Server
  • LoopBack Connector
  • Playground Web User Interface
  • Yeoman code generator
  • VSCode and Atom editor plugins 开发编辑器,VSCode用起来很顺手滴。

Execution Runtimes

从最初开始,Hyperledger Composer的设计原则是支持不同类型的pluggable runtimes(可选的运行时)。
目前已经实现的有下面这三个:

  • Hyperledger Fabric v1.1. 信息存储于分布式账本。
  • Web, which executes within a web page, and is used by Playground. State is stored in browser local storage.
  • Embedded, which executes within a Node.js process, and is used primarily for unit testing business logic. State is stored in an in-memory key-value store.

Connection Profiles

Connection Profiles are used across Hyperledger Composer to specify how to connect to an execution runtime. There are different configuration options for each type of execution runtime. For example, the connection profile for a Hyperledger Fabric v1.1 runtime will contain the TCP/IP addresses and ports for the Fabric peers, as well as cryptographic certificates etc.

Connection Profiles是包含在 Business Network cards里面的.

JavaScript SDK

Hyperledger Composer JavaScript SDK是一组 Node.js APIs 的集合,可以通过这组API,开发者可以开发应用,从而实现管理已经部署的网络,已经与以及部署的网络进行交互。

The APIs are split between two npm modules:

  • composer-client used to submit transactions to a business network or to perform Create, Read, Update, Delete operations on assets and participants

This module would usually be installed as a local dependency of an application. It provides the API that 网络应用可以访问assets, participants 以及提交transactions. When in production this is only module that needs to be added as a direct dependency of the application.

  • composer-admin used to manage business networks ( install, start, upgrade )
    This module would usually be installed as a local dependency of administrative applications. This API 可以生成并且发布 business network definitions.

Command Line Interface

通过The composer command line tool,开发者和管理者可以部署和管理 business network definitions

REST Server

The Hyperledger Composer REST Server 自动为网络生成Open API (Swagger) REST API。 The REST Server (based on LoopBack technology) 为网络把the Composer model转化为Open API。并且在运行的时候,实现了针对assets和participants的Create, Read, Update and Delete服务, 并且可以提交transactions。

LoopBack Connector

The Hyperledger Composer LoopBack Connector可以用于Composer REST Server, 也可以配合支持LoopBack技术的integration tools,单独使用。可以实现更复杂而个性化的REST APIs。

Yeoman Code Generators

Yeoman Code Generators可以生产以下projects的主要框架:

  • Angular web application
  • Node.js application
  • Skeleton business network

理论就到这里了下周,我们一起动手部署。

图片来源

图片来自官方网站

你可能感兴趣的:(Hyperledger Fabric实践(2) 部署Hyperledger Composer理论)