0

I understand that chaincode(smart contracts) on hyperledger-fabric can be written using golang. But the other thing I see as of fabric 1.0 is the composer - where I could write the 'transactions' part using JS. Is the difference that go APIs give me more lower level controls like access to MSP and CA and others? Or is it that the newer version would want you to write all your code using JS? I am looking for some clarification on specific uses of each approach.

  • Looks like a duplicate of https://stackoverflow.com/questions/48977403/chaincode-in-hyperledger-composer-vs-chaincode-in-hyperleger-fabric/ – James Taylor Mar 06 '18 at 09:54

1 Answers1

2

This tutorial -> https://blog.selman.org/2017/07/08/getting-started-with-blockchain-development/ should help you with the side-by-side comparison and the approaches using either toolset.

Updated answer (as promised in previous post): Hyperledger Composer v0.19.0 (time of writing - Apr 1st 2018) is the default release for building your blockchain business networks using Composer. So when you pull HL/Composer eg via npm install etc) - this uses the current GA edition of Hyperledger Fabric v1.1, the underlying blockchain network infrastructure. This 0.19.0 release includes a fundamental change in the way that Composer business networks are deployed (vis-a-vis previous releases eg 0.16.x - 0.18.x). Business networks are now deployed within Hyperledger Fabric 'as chaincode' - meaning that the business network (rather than Composer runtime) can be agreed by all parties (to the blockchain network) and signed, using a similar management model to non-Composer chaincode. In a later edition, the plan is to add JS requires so that these can be exploited in NodeJS and include other JS functions you've developed - of course, you can already call native Fabric APIs/chaincode functions already, from Composer transaction processors - introduced prior to 0.19.x release). See more info here in the release notes -> https://github.com/hyperledger/composer/releases/tag/v0.19.0

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15
  • So what I understand is that if I use fabric 1.0+ (1.1 considering it will be available in GA) with Compose 0.16/7.x then I can pretty much achieve whatever I want using JS instead of GO. Thanks for the clarifications – Shashikant Soni Mar 07 '18 at 06:19
  • 1
    Fabric 1.1 GA edition is available. Easiest to get started writing your smart contracts in JS using Composer. It can also make use of Fabric APIs, or functions already written in Go/chaincode functions (if you have a library already of such functions) from Composer Transaction Processor functions via capability to call the Fabric APIs, with v0.19.0 of Composer (see above - updated answer). – Paul O'Mahony Apr 01 '18 at 12:29