简体   繁体   English

在Chaincode上查询时Hyperledger崩溃

[英]Hyperledger Crashing while querying on Chaincode

I am using Hyperledger Fabric v1.0 and I am facing error while trying to use the sample project fabcar on the following git repository: git clone https://github.com/hyperledger/fabric-samples.git 我正在使用Hyperledger Fabric v1.0,并且尝试在以下git存储库上使用示例项目fabcar时遇到错误:git clone https://github.com/hyperledger/fabric-samples.git

I am able to start all the containers using the following shell script: 我可以使用以下shell脚本启动所有容器:

./startFabric.sh

The peers and the channels are created but when I use the command 创建同级和通道,但是当我使用命令时

node query.js

It crashes with the following error: Create a client and set the wallet location 崩溃并显示以下错误:创建客户端并设置钱包位置

Set wallet path, and associate user PeerAdmin with application Check user is enrolled, and set a query URL in the network Make query Assigning transaction_id: 27d48de27350bbeeb3adae69ec5e783d3af1c42af03230877f71c3343bfbc905 error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /home/eres_admin/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:554:15 returned from query Query result count = 1 error from query = { Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certific 设置钱包路径,并将用户PeerAdmin与应用程序关联检查用户是否注册,并在网络中设置查询URL进行查询分配transaction_id:27d48de27350bbeeb3adae69ec5e783d3af1c42af03230877f71c3343bfbc905错误:[client-utils.js]:sendPeersProposal-拒绝承诺:错误:拒绝承诺:创建者身份,错误提供的身份无效,Verify()返回了x509:未知授权机构签名的证书(可能是由于尝试验证候选授权机构证书“ ca.org1.example.com”时出现“ x509:ECDSA验证失败”)在/home/eres_admin/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:554:15从查询返回查询结果计数= 1错误来自查询= {错误:无法反序列化创建者身份,错误提供的身份无效,Verify()返回x509:未知授权机构签名的证书(可能是由于尝试验证候选授权机构证书时出现“ x509:ECDSA验证失败” ate "ca.org1.example.com") at /home/eres_admin/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:554:15 code: 2, metadata: Metadata { _internal_repr: {} } } Response is Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") 在/home/eres_admin/hyperledger/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:554:15代码中查看“ ca.org1.example.com”):2,元数据:元数据{ _internal_repr:{}​​}}错误:无法反序列化创建者身份,错误所提供的身份无效,Verify()返回了x509:证书由未知授权机构签名(可能由于“ x509:ECDSA验证失败”)候选授权证书“ ca.org1.example.com”)

I am using the node version 6.11.4 do I need to use any other version for this or the error is due to something else. 我正在使用节点版本6.11.4,是否需要为此使用其他任何版本,否则错误是由于其他原因引起的。

TL;DR chances are the docker compose you are using has harcoded the name of the CA key, but you regenerated the crypto material, thus changing the key and the file name. TL; DR可能是您正在使用的docker compose编码了CA密钥的名称,但是您重新生成了加密材料,从而更改了密钥和文件名。

I had exactly the same error and found this error happens because basic-network/docker-compose.yaml has CA key hardcoded. 我有完全相同的错误,发现发生此错误是因为basic-network / docker-compose.yaml具有CA密钥硬编码。 If you re-generate the cryptomaterial (for instance, in basic-network, you do generate.sh), the key file name changes. 如果重新生成加密材料(例如,在基本网络中,您确实生成了generate.sh),则密钥文件名将更改。 Thus the CA fails to find the key. 因此,CA无法找到密钥。

After you regenerate the crypto material you should change the FABRIC_CA_SERVER_CA_KEYFILE 重新生成加密材料后,应更改FABRIC_CA_SERVER_CA_KEYFILE

...
services:
  ca.example.com:
    image: hyperledger/fabric-ca
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca.example.com
      - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
      - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
...

After this, query.js will work just fine. 在此之后,query.js将正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM