chaincode in hyperledger composer vs chaincode in hyperleger fabric?

心不动则不痛 提交于 2019-12-13 13:24:09

问题


does same functionality can be achieved by writing chaincode with javascript in hyperledger composer as writing chaincode with go in Hyperledger fabric?

and What are the limitations and benefits of writing chaincode in JS as compared to writing in go ?


回答1:


On question 2: this article can explain as a side-by-side comparison (Golang (Go) and Composer model-driven approach) -> https://blog.selman.org/2017/07/08/getting-started-with-blockchain-development/. The main difference is Hyperledger Composer is a set of abstractions, tools and APIs to model, build, integrate and deploy a blockchain solution (eg a business network for parties to transact on) to the blockchain network. Composer business network archives may be deployed to Hyperledger Fabric for execution as smart contracts (that's including the modeled network, transaction logic written in Javascript, ACLs, queries etc).




回答2:


The short answer to your first question is that, since the recent Composer update that exposes getNativeAPI, it should be possible to achieve the same results whether you use JavaScript Composer transaction processor functions, or Hyperledger go chaincode. This currently requires installing the @next stream of Composer, and you can find more in the Transaction Processor Functions reference or the Invoking a Hyperledger Composer business network from another business network tutorial.

I'll avoid getting in to the relative merits of JavaScript vs Go but Composer provides much more to improve the developer experience, from a more business focussed domain specific modelling language, to tools to generate REST services and Angular UIs.



来源:https://stackoverflow.com/questions/48977403/chaincode-in-hyperledger-composer-vs-chaincode-in-hyperleger-fabric

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!