Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chaincode in hyperledger composer vs chaincode in hyperleger fabric?

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 ?

like image 793
himanshu_chawla Avatar asked Mar 07 '23 19:03

himanshu_chawla


2 Answers

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.

like image 65
James Taylor Avatar answered May 16 '23 06:05

James Taylor


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).

like image 20
Paul O'Mahony Avatar answered May 16 '23 05:05

Paul O'Mahony