悄悄告訴你
這個鏈接臥虎藏龍:
HiBlock區(qū)塊鏈技術布道 GitHub
Fabric和Composer:
Hyperledger的Composer和Fabric到底是什么關系?
這篇文章是在馮宇Ops的“Hyperledger Composer開發(fā)流程”的基礎上,增加了一些修改和補充。從而可以在最新的Fabric版本上順利搭建和部署網(wǎng)絡。
Hyperledger Composer開發(fā)流程 馮宇Ops
Hyperledger Composer構(gòu)架

主要包含了以下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 開發(fā)編輯器,VSCode用起來很順手滴。
Execution Runtimes
從最初開始,Hyperledger Composer的設計原則是支持不同類型的pluggable runtimes(可選的運行時)。
目前已經(jīng)實現(xiàn)的有下面這三個:
- 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,開發(fā)者可以開發(fā)應用,從而實現(xiàn)管理已經(jīng)部署的網(wǎng)絡,已經(jīng)與以及部署的網(wǎng)絡進行交互。
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 網(wǎng)絡應用可以訪問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 可以生成并且發(fā)布 business network definitions.
Command Line Interface
通過The composer command line tool,開發(fā)者和管理者可以部署和管理 business network definitions。
REST Server
The Hyperledger Composer REST Server 自動為網(wǎng)絡生成Open API (Swagger) REST API。 The REST Server (based on LoopBack technology) 為網(wǎng)絡把the Composer model轉(zhuǎn)化為Open API。并且在運行的時候,實現(xiàn)了針對assets和participants的Create, Read, Update and Delete服務, 并且可以提交transactions。
LoopBack Connector
The Hyperledger Composer LoopBack Connector可以用于Composer REST Server, 也可以配合支持LoopBack技術的integration tools,單獨使用??梢詫崿F(xiàn)更復雜而個性化的REST APIs。
Yeoman Code Generators
Yeoman Code Generators可以生產(chǎn)以下projects的主要框架:
- Angular web application
- Node.js application
- Skeleton business network
理論就到這里了下周,我們一起動手部署。
圖片來源
圖片來自官方網(wǎng)站