有很多同学反馈 Fabric 智能合约读起来比较费劲,对于新手不友好看不懂,这里选择一个司法存证的智能合约,阅读、分析智能合约基础框架与核心流程代码,培养大家智能合约编写的方法论。
先看下全部代码:
package main
import (
"encoding/json"
"fmt"
"github.com/hyperledger/fabric-chaincode-go/shim"
pb "github.com/hyperledger/fabric-protos-go/peer"
)
type HashInfo struct {
Hash string `json:"hash,omitempty"`
Name string