文章目录
一、 开发范围
1.1 开发chaincode与application
开发者首先需要建立一个Fabric网络,在此之上开发chaincode,然后在SDK基础上开发业务应用,与Fabric网络进行业务连接,应用还需要通过Fabric CA签发证书。如下图所示:
1.2 chaincode接口
编写chaincode所需的接口在core/chaincode/shim/interfaces.go文件中,部分内容如下所示,调用GetState接口根据key查找对应value,调用PutState接口可以根据key值修改value,调用InvokeChaincode接口调用另一个chaincode。
// ChaincodeStubInterface is used by deployable chaincode apps to access and
// modify their ledgers
type ChaincodeStubInterface interface {
// GetArgs returns the arguments intended for the chaincode Init and Invoke
// as an array of byte arrays.
GetArgs() [][]byte
InvokeChaincode