gpt4 book ai didi

hyperledger - 在 Hyperledger Fabric 示例中获取连接失败

转载 作者:行者123 更新时间:2023-12-04 03:11:27 25 4
gpt4 key购买 nike

您好,我是 Hyperledger Fabric 的新手。

我刚刚开始使用它,我正在做第一个样本
http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html

我遵循了先决条件安装
http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html

我的操作系统是 ubuntu 16.04,我支持代理

当我跑 node query.js我得到以下错误

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: a85d2111f5d6e5eef064f87de42be677e69849724b1242dca0503be84d397f5d
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed
at /home/nokia/hyperledger/firstApp/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17
returned from query
Query result count = 1
error from query = { Error: Connect Failed
at /home/nokia/hyperledger/firstApp/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17 code: 14, metadata: Metadata { _internal_repr: {} } }
Response is Error: Connect Failed

最佳答案

当对等点出现故障或无响应时,我们会看到此错误。我可以通过停止对等方来重新创建相同的问题。一旦它再次启动。

$ docker stop peer0.org1.example.com
peer0.org1.example.com

$ node query.js
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: c450608388799e3ca76e20b96010283202832c31ba9ae62c1ae4648c6353334b
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed
at /home/ibmadmin/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17
returned from query
Query result count = 1
error from query = { Error: Connect Failed
at /home/ibmadmin/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17 code: 14, metadata: Metadata { _internal_repr: {} } }
Response is Error: Connect Failed

一旦对等方启动,可以看到查询的响应
$docker start peer0.org1.example.com
peer0.org1.example.com

$node query.js
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: 21a6cc3cd27e098da355da00ba3aa8819e84bc4c2e81768dba2a88a8125b380c
returned from query
Query result count = 1
Response is [{"Key":"CAR0", "Record":{"colour":"blue","make":"Toyota","model":"Prius","owner":"Tomoko"}},{"Key":"CAR1", "Record":{"colour":"red","make":"Ford","model":"Mustang","owner":"Brad"}},{"Key":"CAR2", "Record":{"colour":"green","make":"Hyundai","model":"Tucson","owner":"Jin Soo"}},{"Key":"CAR3", "Record":{"colour":"yellow","make":"Volkswagen","model":"Passat","owner":"Max"}},{"Key":"CAR4", "Record":{"colour":"black","make":"Tesla","model":"S","owner":"Adriana"}},{"Key":"CAR5", "Record":{"colour":"purple","make":"Peugeot","model":"205","owner":"Michel"}},{"Key":"CAR6", "Record":{"colour":"white","make":"Chery","model":"S22L","owner":"Aarav"}},{"Key":"CAR7", "Record":{"colour":"violet","make":"Fiat","model":"Punto","owner":"Pari"}},
{"Key":"CAR8", "Record":{"colour":"indigo","make":"Tata","model":"Nano","owner":"Valeria"}},{"Key":"CAR9", "Record":{"colour":"brown","make":"Holden","model":"Barina","owner":"Shotaro"}}]

但是,在您的情况下, peer 似乎正在运行。
要了解更多信息,请您分享对等日志。

docker 日志 -f peer0.org1.example.com

关于hyperledger - 在 Hyperledger Fabric 示例中获取连接失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45411300/

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