【发布时间】:2017-11-15 10:23:10
【问题描述】:
我构建了一个启用了多个 orgs 和 tls 的 Fabric 网络。加密材料是用 cryptogen 构建的。我不打算在我的示例中使用 fabric-ca。
我通过 CLI 安装并实例化了 fabcar。使用 CLI 命令调用和查询非常有用。
现在,为了使用 nodejs 脚本 query.js 和 invoke.js,我连接了一个私钥和公钥,以便为 Fabcar 创建 PeerAdmin 凭据。我还更改了 .js 文件中的配置,以针对具有 grpcs 的 peers 和 orderers。
每当我执行任何 .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
Caught Error Error: PEM encoded certificate is required.
at new Endpoint (/home/hl/fabcar/node_modules/fabric-client/lib/Remote.js:146:11)
at new Remote (/home/hl/fabcar/node_modules/fabric-client/lib/Remote.js:95:20)
at new Peer (/home/hl/fabcar/node_modules/fabric-client/lib/Peer.js:53:3)
at Client.newPeer (/home/hl/fabcar/node_modules/fabric-client/lib/Client.js:173:14)
at Promise.resolve.then.then.then (/home/hl/fabcar/query.js:39:28)
at <anonymous>
当我尝试在没有 grpcs 的情况下查询链码时,我收到以下错误:
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: 9cbf355cda03db2b1971fe10af27d66686ea9b913eda80f667cac48bada015bf
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Endpoint read failed
at /home/hl/fabcar/node_modules/grpc/src/client.js:554:15
returned from query
Query result count = 1
error from query = { Error: Endpoint read failed
at /home/hl/fabcar/node_modules/grpc/src/client.js:554:15 code: 14, metadata: Metadata { _internal_repr: {} } }
Response is Error: Endpoint read failed
PeerAdmin 内容:
{"name":"PeerAdmin","mspid":"PeerOrgMSP","roles":null,"affiliation":"","enrollmentSecret":"","enrollment":{"signingIdentity":"[...]","identity":{"certificate":"-----BEGIN CERTIFICATE-----\n[...]-----END CERTIFICATE-----\n"}}}
任何帮助我指出正确的程序或解决上述问题将不胜感激。
【问题讨论】:
标签: hyperledger-fabric hyperledger