作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
当我启动orderer、peer节点,然后我启动example01.go来实例化链码,并指定:
peer.address 192.168.120.189:7051
chaincode.id.name simple-token:1.0.0
example01.go 的主要代码是:
func main() {
viper.Set("chaincode.id.name","simple-token:1.0.0")
err := shim.Start(new(SimpleChaincode))
if err != nil {
fmt.Printf("Error starting Simple chaincode: %s", err)
}
}
在方法 shim.Start() 中错误发生在以下句子中:
err = chatWithPeer(chaincodename, stream, cc)//causes the error
但它显示错误:Unimplemented desc = unknown service protos.ChaincodeSupport进程已完成,退出代码为 0
GOROOT=/usr/local/Cellar/go/1.9/libexec #gosetup
GOPATH=/Users/friends/Documents/VirtualMachine/share/gopath #gosetup
/usr/local/Cellar/go/1.9/libexec/bin/go build -i "-ldflags=-linkmode internal" -o /private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___chaincode_example01_cc /Users/friends/Documents/VirtualMachine/share/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01/chaincode_example01.go #gosetup
/private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___chaincode_example01_cc -peer.address 192.168.120.189:7051 #gosetup
2017-12-28 20:14:30.124 CST [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO
2017-12-28 20:14:30.124 CST [shim] SetupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up ...
2017-12-28 20:14:30.126 CST [shim] func1 -> ERRO 003 Received error from server, ending chaincode stream: rpc error: code = Unimplemented desc = unknown service protos.ChaincodeSupport
Error starting Simple chaincode: rpc error: code = Unimplemented desc = unknown service protos.ChaincodeSupport
Process finished with exit code 0
最佳答案
您使用了错误的端口。在 v1.1 中端口是 7052 而不是像在 v1.0 中那样是 7051
关于go - 未实现的 desc = 未知服务 protos.ChaincodeSupport,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48007519/
当我启动orderer、peer节点,然后我启动example01.go来实例化链码,并指定: peer.address 192.168.120.189:7051 chaincode.id.name
我是一名优秀的程序员,十分优秀!