当node.js架构客户端应用程序在单独的节点上运行时,签注失败 [英] Endorsement fails when node.js fabric-client application is run on a separate node

查看:95
本文介绍了当node.js架构客户端应用程序在单独的节点上运行时,签注失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Fabric运行 fabcar示例在一个节点上采样.我的结构网络是第一网络(BYFN)在docker容器中运行,我想在一个单独的节点(Raspberry Pi)上使用node.js fabric-client应用程序调用chaincode.

I'm running the fabcar example from fabric samples on a node. My fabric network is first-network (BYFN) run inside docker containers and I would like to invoke chaincode using a node.js fabric-client application on a separate node (Raspberry Pi).

connection-org1中. json 文件中,我已经用运行结构网络的我自己的域名(mydomain.com)替换了localhost域名(在对等url中).

In connection-org1.json file, I have replaced the localhost domain names (in the peer urls) with my own domain name (mydomain.com) where the fabric network is running.

我执行 invoke.js :

await gateway.connect(ccpPath, { wallet, identity: 'user1', discovery: { enabled: true, asLocalhost: false } });

这给我一条错误消息:

2019-07-04T07:15:30.124Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://peer0.org1.example.com:7051
2019-07-04T07:15:30.132Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:0 - endorsement failed - Error: Failed to connect before the deadline URL:grpcs://peer0.org1.example.com:7051
2019-07-04T07:15:30.134Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://peer0.org2.example.com:9051
2019-07-04T07:15:30.135Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G1:1 - endorsement failed - Error: Failed to connect before the deadline URL:grpcs://peer0.org2.example.com:9051
Failed to submit transaction: Error: Endorsement has failed

我看到背书者的域名是在docker composer文件中定义的域名,而不是我的结构网络正在运行的域(mydomain.com).

I see that the domain names of the endorserers are the ones defined in the docker composer files, not the domain (mydomain.com) where my fabric network is running.

我应该如何配置光纤网络或node.js光纤客户端应用程序,以便可以从Raspberry Pi节点调用链码?

How should I configure the fabric network or the node.js fabric-client application so that I can invoke chaincode from my Raspberry Pi node?

推荐答案

我做了一个变通办法,在Raspberry Pi上扩展了/etc/hosts文件.我使认可的对等域名peer0.org1.example.compeer0.org2.example.com指向我运行结构网络(docker)的主机的IP地址.

I made a workaround where I extended the /etc/hosts file on my Raspberry Pi. I made the endorsing peer domain names peer0.org1.example.com and peer0.org2.example.com to point to the IP address of my host where I run the fabric network (docker).

这已解决了该问题,现在我可以从Raspberry Pi主机调用链码了.

This fixed the issue and now I'm able to invoke chaincode from the Raspberry Pi host.

这篇关于当node.js架构客户端应用程序在单独的节点上运行时,签注失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆