SilverhandFan

shim包主要就有两个方法,一般用作函数的返回值

shim.Error("string:报错信息")

shim.Success(nil)

shim.Success([]byte("报正确信息"))

它们的类型都是pb.Response

 

ChaincodeStubInterface接口:

使用shim包的一个函数长这样:

func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response {

  shim.Success(nil)

}

 

stub shim.ChaincodeStubInterface

stub是shim.ChaincodeStubInterface类的一个实例

ChaincodeStubInterface接口提供方法:

stub.PutState(key, value)存储数据到账本附带数据库中

DelState:删除数据

先写这么多吧,后面看了再补充

分类:

技术点:

相关文章:

  • 2021-09-19
  • 2021-08-30
  • 2021-11-17
  • 2021-04-20
  • 2021-05-29
  • 2021-12-12
  • 2021-11-22
  • 2021-09-09
猜你喜欢
  • 2021-12-21
  • 2021-05-17
  • 2021-08-22
  • 2021-11-30
  • 2021-04-20
  • 2021-11-27
  • 2021-08-17
相关资源
相似解决方案