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

悄悄告訴你

這個鏈接臥虎藏龍:
HiBlock區(qū)塊鏈技術(shù)布道 GitHub

總之

Hyperledger Composer是屬于Hyperledger下的,包含了開發(fā)構(gòu)架,和工具的開源項目。

團隊的目的是為了簡化blockchain applications開發(fā)過程中,一部分開發(fā)過程。

Hyperledger Composer原本是為了抽象出接口,可以和任何區(qū)塊鏈網(wǎng)絡對聯(lián),但目前的開發(fā)狀況基本上是基于Hyperledger Fabric來實現(xiàn)的。

Hyperledger Composer is an extensive, open development toolset and framework to make developing blockchain applications easier. Our primary goal is to accelerate time to value, and make it easier to integrate your blockchain applications with the existing business systems. You can use Composer to rapidly develop use cases and deploy a blockchain solution in weeks rather than months. Composer allows you to model your business network and integrate existing systems and data with your blockchain applications.

關系

關系圖

Composer Diagram 圖片來自官方網(wǎng)

上面的部分,就是Composer,通過一些腳本(JS的童鞋開心了吧 )語言,來定義需要的內(nèi)容(參與方,CA,資產(chǎn),交易等),然后打包成.bna文件,就可以直接部署(到Fabric私有鏈網(wǎng)絡上)了。
至于原本Fabric實現(xiàn)的時候,需要自己實現(xiàn)的區(qū)塊鏈讀寫操作等,Composer都為你實現(xiàn)好了。

栗子

一家房地產(chǎn)商可以這樣子模塊化(定義)他們的業(yè)務:
Assets: 房屋,土地等
Participants: 買房者,賣房者,中介
Transactions: 買,賣等
參與方都根據(jù)在交易里的角色,才可以查詢和查詢相關的交易。
房地產(chǎn)商可以提供一些接口,比如給賣方:公開房源,關閉房源等。

比較

Innovation That Matters

It isn’t possible to make a complete apples-to-apples comparison, because the Go version of Marbles includes queries, whereas the Composer version does not, however it is clear that the Composer version is far shorter and includes much less boilerplate code:

  • marbles_chaincode.go : 627 lines
  • Composer marbles-network : 63 lines total, 26 lines (logic), 37 lines (model)

This ±10x reduction in the number of lines of code when Go and Composer solutions are compared is fairly consistent across several samples.

Composer includes several other major features and productivity enhancements:

  • business networks are automatically exposed as OpenAPI (Swagger) REST APIs via the composer-rest-server. The composer-rest-server uses passport.js to support pluggable end-user authentication schemes.
  • Composer includes a declarative Access Control Language, allowing developers to define which participants have access to which assets and under which circumstances. Composer ACLs drastically reduce the amount of procedural access control checks required in business logic.
  • Use the Composer Node-RED nodes to integrate Composer with IoT, analytics, dashboards etc.
  • VSCode extension to validate Composer model, ACL and query files
  • Integrate Composer with industry leading BPM and Integration tools, via OpenAPI and the LoopBack connector
  • Unit test using the Node.js embedded Composer runtime using standard JS tools like Mocha, Chai, Sinon, Istambul etc
  • Develop and test on the web interactively using the Composer Playground, simulating the blockchain in the browser, or connected to a Fabric.
  • Generate skeleton Angular web application from a business network definition
  • Publish and reuse models across business networks

There are of course some advantages to coding in Go to the Fabric APIs directly:

  • follow the absolute latest evolutions in the Fabric APIs and capabilities
  • possibly better raw performance, although for most application chaincode performance is unlikely to be the determining factor
  • type-safety
  • single language for both business logic and model
  • can incorporate third-party C and Go libraries easily

In summary I believe that for 90% of business developers Hyperledger Composer is the right choice to get started with blockchain development. It allows them to focus on the business logic, and avoids a lot of error-prone boilerplate code. They will also benefit from many of the higher-level tools and abstractions that Composer has to offer.

相關鏈接

官方網(wǎng)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,872評論 0 10
  • 我們每個人,都渴望快樂,幸福的體驗,沒有人喜歡悲傷與痛苦。偏偏,這生命路上的,每一次心潮漲落,每一縷心心念念,都伴...
    Emily_zi閱讀 435評論 0 0
  • 1.寫段子 2.寫歌詞 3.寫小說 4.寫產(chǎn)品文案 5.擺攤 6.分析市場好賺錢的項目 7.思考新的創(chuàng)新項目 8....
    寫給自己的情書閱讀 281評論 0 0
  • 周末在家?guī)缀跏翘闪藘商?,因為晚上被某人搶了被子的緣故,從周四開始就喉嚨痛,周五更加嚴重,吃個東西都卡在喉嚨口似的。...
    吳佟閱讀 275評論 0 0
  • 無論你現(xiàn)在有多胖,只要想瘦,看完此文讓你有所改變! 大家都叫他“奶昔哥” 是健康體重管理領域的名人 創(chuàng)業(yè)三年僅僅依...
    小炸桶閱讀 293評論 0 2

友情鏈接更多精彩內(nèi)容