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

悄悄告诉你

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

总之

Hyperledger Composer是属于Hyperledger下的,包含了开发构架,和工具的开源项目。

团队的目的是为了简化blockchain applications开发过程中,一部分开发过程。

Hyperledger Composer原本是为了抽象出接口,可以和任何区块链网络对联,但目前的开发状况基本上是基于Hyperledger Fabric来实现的。

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 图片来自官方网

上面的部分,就是Composer,通过一些脚本(JS的童鞋开心了吧 )语言,来定义需要的内容(参与方,CA,资产,交易等),然后打包成.bna文件,就可以直接部署(到Fabric私有链网络上)了。
至于原本Fabric实现的时候,需要自己实现的区块链读写操作等,Composer都为你实现好了。

栗子

一家房地产商可以这样子模块化(定义)他们的业务:
Assets: 房屋,土地等
Participants: 买房者,卖房者,中介
Transactions: 买,卖等
参与方都根据在交易里的角色,才可以查询和查询相关的交易。
房地产商可以提供一些接口,比如给卖方:公开房源,关闭房源等。

比较

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.

相关链接

官方网

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,871评论 0 10
  • 我们每个人,都渴望快乐,幸福的体验,没有人喜欢悲伤与痛苦。偏偏,这生命路上的,每一次心潮涨落,每一缕心心念念,都伴...
    Emily_zi阅读 428评论 0 0
  • 1.写段子 2.写歌词 3.写小说 4.写产品文案 5.摆摊 6.分析市场好赚钱的项目 7.思考新的创新项目 8....
    写给自己的情书阅读 276评论 0 0
  • 周末在家几乎是躺了两天,因为晚上被某人抢了被子的缘故,从周四开始就喉咙痛,周五更加严重,吃个东西都卡在喉咙口似的。...
    吴佟阅读 273评论 0 0
  • 无论你现在有多胖,只要想瘦,看完此文让你有所改变! 大家都叫他“奶昔哥” 是健康体重管理领域的名人 创业三年仅仅依...
    小炸桶阅读 293评论 0 2

友情链接更多精彩内容