docker-compose - 错误:错误认可链代码:rpc 错误:代码 = 未知 desc = 启动链代码 fabcar 时超时
问题描述
我正在按照此处给出的教程进行操作-http: //hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
我正在使用 Mac OS:High Sierra。
我收到如下错误:
错误:错误认可链代码:rpc 错误:代码 = 未知 desc = 启动链代码 fabcar:1.0 时超时(networkid:dev,peerid:peer0.org1.example.com,tx:c51ca82792bd8823a60edf9c31a550836fc8932a90a2a4cec8b9c37ba24c46ea)
谢谢您的帮助。
命令:./startFabric.sh node
完整的日志:
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
docker-compose -f docker-compose.yml down
Stopping peer0.org1.example.com ... done
Stopping orderer.example.com ... done
Stopping ca.example.com ... done
Stopping couchdb ... done
Removing peer0.org1.example.com ... done
Removing orderer.example.com ... done
Removing ca.example.com ... done
Removing couchdb ... done
Removing network net_basic
docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com
peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Creating orderer.example.com ... done
Creating ca.example.com ... done
Creating couchdb ... done
Creating peer0.org1.example.com ... done
# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export
FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=10
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}
# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e
"CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp"
peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c
mychannel -f /etc/hyperledger/configtx/channel.tx
2018-05-03 17:56:04.275 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser
and orderer connections initialized
2018-05-03 17:56:04.392 UTC [channelCmd] InitCmdFactory -> INFO 002 Endorser
and orderer connections initialized
2018-05-03 17:56:04.621 UTC [main] main -> INFO 003 Exiting.....
# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e
"CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp"
peer0.org1.example.com peer channel join -b mychannel.block
2018-05-03 17:56:04.861 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser
and orderer connections initialized
2018-05-03 17:56:05.018 UTC [channelCmd] executeJoin -> INFO 002 Successfully
submitted proposal to join channel
2018-05-03 17:56:05.018 UTC [main] main -> INFO 003 Exiting.....
Creating cli ... done
2018-05-03 17:56:06.745 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing
local MSP
2018-05-03 17:56:06.745 UTC [msp] GetDefaultSigningIdentity -> DEBU 002
Obtaining default signing identity
2018-05-03 17:56:06.746 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003
Using default escc
2018-05-03 17:56:06.746 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004
Using default vscc
2018-05-03 17:56:06.746 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java
chaincode disabled
2018-05-03 17:56:06.749 UTC [node-platform] GetDeploymentPayload -> DEBU 006
Packaging node.js project from path /opt/gopath/src/github.com/fabcar/node
2018-05-03 17:56:06.749 UTC [container] WriteFolderToTarPackage -> INFO 007
rootDirectory = /opt/gopath/src/github.com/fabcar/node
2018-05-03 17:56:06.752 UTC [container] WriteFileToPackage -> DEBU 008 Writing
file to tarball: src/fabcar.js
2018-05-03 17:56:06.762 UTC [container] WriteFileToPackage -> DEBU 009 Writing
file to tarball: src/package.json
2018-05-03 17:56:06.765 UTC [msp/identity] Sign -> DEBU 00a Sign: plaintext:
0A9C070A5C08031A0C08B69AADD70510...C1F84F000000FFFF22CB6E3A001E0000
2018-05-03 17:56:06.765 UTC [msp/identity] Sign -> DEBU 00b Sign: digest:
CAD5821E4354EA410ED3567BE82D12813B469783B96FB8EEE2A1B4416A323B76
2018-05-03 17:56:06.816 UTC [chaincodeCmd] install -> DEBU 00c Installed
remotely response:<status:200 payload:"OK" >
2018-05-03 17:56:06.816 UTC [main] main -> INFO 00d Exiting.....
2018-05-03 17:56:07.116 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing
local MSP
2018-05-03 17:56:07.116 UTC [msp] GetDefaultSigningIdentity -> DEBU 002
Obtaining default signing identity
2018-05-03 17:56:07.121 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003
Using default escc
2018-05-03 17:56:07.121 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004
Using default vscc
2018-05-03 17:56:07.123 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java
chaincode disabled
2018-05-03 17:56:07.125 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext:
0AA6070A6608031A0B08B79AADD70510...324D53500A04657363630A0476736363
2018-05-03 17:56:07.126 UTC [msp/identity] Sign -> DEBU 007 Sign: digest:
7574A79A053907A7CD90E656B612CE20AA80E95067403F097B3F6185EC25D329
Error: Error endorsing chaincode: rpc error: code = Unknown desc = timeout
expired while starting chaincode fabcar:1.0(networkid:dev,peerid:peer0.org1.example.com,tx:c51ca82792bd8823a60edf9c31a550836fc8932a90a2a4cec8b9c37ba24c46ea)
Usage:
peer chaincode instantiate [flags]
Flags:
-C, --channelID string The channel on which this command should be executed
--collections-config string The file containing the configuration for the chaincode's collection
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-P, --policy string The endorsement policy associated to this chaincode
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--cafile string Path to file containing PEM-encoded
trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded
X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with
the orderer endpoint
--keyfile string Path to file containing PEM-encoded
private key to use for mutual TLS communication with the orderer endpoint
--logging-level string Default logging level and overrides,
see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when
validating the TLS connection to the orderer.
--tls Use TLS when communicating with the
orderer endpoint
--transient string Transient map of arguments in JSON
encoding
解决方案
我遇到了同样的错误。在我的情况下,问题是项目文件夹的名称与网络名称不同,这些名称以某种方式相关并且必须相同。我重命名了文件夹,问题就消失了。
推荐阅读
- oracle - Oracle APEX - 模式页面中的 Shuttle 值不可用
- jsp - 如何使用 Servlet 中的 for 循环将 getParameterValues("") 存储到数组列表中?
- c# - 单击事件始终只获取最后一个实例化的对象(C# UNITY)
- javascript - 是否有可能在 jquery display:none 之后出现 css display:block ?
- r - 将属性应用于数据框,重写比例函数
- python - 如何检测单词的存在并在单独的列中标记问题?
- java - 如何将 MongoDB 与 Apache Lucene 集成?
- docker - 使用 Docker 设置自签名 SSL 反向代理时无法在 Laravel 项目中加载资产
- javascript - 在 React 中的 setState 中传入参数
- java - Java 代码生成跳过类型为“类”的属性