gpt4 book ai didi

go - 未实现的 desc = 未知服务 protos.ChaincodeSupport

转载 作者:IT王子 更新时间:2023-10-29 00:48:43 25 4
gpt4 key购买 nike

当我启动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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com