本文介绍了使用GO或Composer的Chaincode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以使用golang编写hyperledger-fabric上的chaincode(智能合约).但是,从fabric 1.0开始,我看到的另一件事是作曲家-我可以在其中使用JS编写交易"部分.Go API的区别是为我提供了更多较低级别的控件,例如对MSP和CA等的访问吗?还是新版本希望您使用JS编写所有代码?我正在寻找每种方法的具体用途的说明.

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.

推荐答案

本教程-> https://blog.selman.org/2017/07/08/getting-started-with-blockchain-development/应该可以帮助您比较和使用这两个工具集的方法.

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.

更新后的答案(如前一篇文章中所述):Hyperledger Composer v0.19.0(撰写时间-2018年4月1日)是使用Composer构建您的区块链业务网络的默认版本.因此,当您例如通过npm install等来拉HL/Composer时-这将使用Hyperledger Fabric v1.1的当前GA版本,即底层的区块链网络基础架构.此0.19.0版本包括对Composer业务网络部署方式的根本更改(相对于先前版本,例如0.16.x-0.18.x).业务网络现在已在Hyperledger Fabric中以链代码"形式进行部署-意味着业务网络(而不是Composer运行时)可以由各方(到区块链网络)达成一致并使用与非Composer链代码类似的管理模型进行签名.在以后的版本中,计划是添加JS需求,以便可以在NodeJS中利用这些需求,并包括您开发的其他JS函数-当然,您已经可以从Composer事务处理器调用本机Fabric API/链码函数-在0.19.x发行版之前引入).在发行说明中查看更多信息-> https://github.com/hyperledger/composer/releases/tag/v0.19.0

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

这篇关于使用GO或Composer的Chaincode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 13:57