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

悄悄告诉你

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

Fabric和Composer:

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

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

Hyperledger Composer构架

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

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

图片来源

图片来自官方网站

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,438评论 0 10
  • 可能会有一些不完善或错误的地方,如果发现了请指出,谢谢! Blockchain State Storage 交易通...
    简闻阅读 1,021评论 5 0
  • 感谢荐荐小编第二次抽中我读呼延云的推理小说,其实我内心是抗拒的,我是真心不喜欢看推理类小说的。一是推理小说比较烧脑...
    古月曰阅读 588评论 0 1
  • 时光荏苒,转眼就是三年后。 肩负家庭重任的张耀庭不复潇洒倜傥,他英俊的脸庞染上了岁月的沧桑,接人待物更加成熟稳重,...
    grassfl阅读 478评论 4 1
  • 觉察日记 事件:晚上孩子的成绩要出来,孩子忐忑不安,心里慌慌的,要求去泡澡我同意了,在过程中发生了冲突,就是我要泡...
    张慧哲阅读 97评论 0 0