至于一下几个要点:
1. core.yaml
core.yaml文件添加加黑的内容:
core.yaml:
system:
cscc: enable
lscc: enable
escc: enable
vscc: enable
qscc: enable
myscc: enable
systemPlugins:
- enabled: true
name: myscc
path: /opt/lib/myscc.so
invokableExternal: true
invokableCC2CC: true
2. .so文件
myscc.go文件要使用以下命令生成.so文件:
go build --buildmode=plugin plugin.go
以下是两个坑:
1.现在的go sdk不支持degbug .so文件(报错误:plugin.Open: plugin was built with a different version of package math)
2.peer二进制文件,不能使用makefile 生成,要使用
go install github.com/hyperledger/fabric/peer
- systemChaincode
package 必须是main
要包含以下内容:
func New() shim.Chaincode {
return &myscc{}
}
func main() {}
其他内容和普通的chaincode类似