在超级账本结构示例中获取连接失败



你好,我是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"}}]

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

码头工人日志 -f peer0.org1.example.com

最新更新