链码开发重写两个方法
type Chaincode interface
func Init(stub ChaincodeStubInterface) peer.Respone
func Invoke(stub ChaincodeStubInterface) peer.Respone
链码相关的API
GetFunctionAndParameters() (function string, params []string):返回调用链码时在交易提案中指定提供的被调用的函数名称及其参数列表
GetState(key string) ([]byte, error) :根据指定的 Key 查询相应的数据状态。
PutState(key string, value []byte) error:根据指定的 key,将对应的 value 保存在分类账本中。
DelState(key string) error:根据指定的 key 将对应的数据状态删除
GetHistoryForKey(key string) (HistoryQueryIteratorInterface, error):根据指定的 key 查询所有的历史记录信息。
GetPrivateDataQueryResult(collection, query string) (StateQueryIteratorInterface, error):根据指定的查询字符串执行富查询 (只支持支持富查询的 CouchDB)。
shim.Error(msg string) 是一个用于返回错误的函数


2574

被折叠的 条评论
为什么被折叠?



