3

Which language among Node.js and Go is better suited for 'chaincode' development when it comes to maintainibility, scalability and better support?

AkshayM
  • 1,421
  • 10
  • 21

1 Answers1

8

It's a matter of personal preference, but I'd say Golang, because:

  • Node.js chaincode uses npm install at the time of container building, which is slow and might fail due to network problems, while Golang just compiles the source code without fetching anything.

  • Chaincode features are introduced to Golang chaincode first and then later on to other chaincode implementations.

yacovm
  • 5,120
  • 1
  • 11
  • 21
  • Do you have a detailed comparison, a article or something? – AkshayM Nov 15 '18 at 12:48
  • I'm afraid not. – yacovm Nov 15 '18 at 13:27
  • [They may add packaging option in future](https://jira.hyperledger.org/browse/FAB-9287), fyi – xvnm Jan 18 '19 at 07:10
  • 2
    I agree with @yacovm, and I'd also add a third reason: docker images size for chaincode are a lot bigger with nodejs than with go, in a 1:8 factor (180MB in Go vs 1.5GB in nodejs). If you need to test a network with several peers or several chaincodes interacting, you'll have to wait minutes and minutes between each network relaunch. A pain. – jfc Mar 07 '19 at 16:01
  • @jfc thanx for your response. I wanted to know if this is still the case and if yes, what would be the workaround to solve it. I am currently working with composer and when I try to deploy a new bna to upgrade the network logic, it takes a quite long time for the corresponding peer (dev.peer...) to restart. would it help if I implement the network business logic using native chaincodes written in Go, while using Transaction processors of composer to invoke the native chaincodes? – Mahdad Baghani May 06 '19 at 08:39