我正在关注此链接https://github.com/hyperledger/fabric/blob/master/docs/Setup/Chaincode-setup.md
运行vagrant ssh
后,执行以下所有步骤。
第一个终端
cd $GOPATH/src/github.com/hyperledger/fabric && make membersrvc && membersrvc
第二终端
cd $GOPATH/src/github.com/hyperledger/fabric/ && ./orderer
第三终端
cd $GOPATH/src/github.com/hyperledger/fabric && make peer && peer node start
第四终端
cd $GOPATH/src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 && go build && CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02
第五终端
peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -n mycc -c '{"Args": ["i
nit", "a","100", "b", "200"]}'
此命令失败并显示以下错误(并且未返回任何响应): -
00:38:07.178 [chaincode] Launch -> DEBU 0ce sending init completed
00:38:07.178 [chaincode] Launch -> DEBU 0cf LaunchChaincode complete
**00:38:07.205 [chaincode] processStream -> ERRO 0d0 Error handling chaincode support stream: stream error: code = 1 desc = "context canceled"**
00:38:07.230 [chaincode] deregisterHandler -> DEBU 0d1 Deregister handler: 418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c4d5
00:38:07.230 [chaincode] deregisterHandler -> DEBU 0d2 Deregistered handler with key: 418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c
请帮帮我。从很长一段时间起就坚持了这一点。
答案 0 :(得分:0)
命令peer node start
以'net'模式启动对等。
https://github.com/hyperledger/fabric/blob/master/docs/Setup/Chaincode-setup.md处的步骤指定您需要以'dev'模式启动对等体。
要在'dev'模式下启动对等体,您应该使用命令peer node start --peer-chaincodedev