当我从邮递员进行查询或调用到我的Ubuntu服务器时,我会遇到错误,该服务器说sendProposal - timed out after:45000
,sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
。我正在调整,但无法弄清楚问题是什么。我正在使用平衡转移示例。运行容器如下:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f07e92dcdf7e my_node/node-app "npm start" 33 minutes ago Up 33 minutes 0.0.0.0:9999->4000/tcp my_node
f8b84ebc7510 hyperledger/fabric-peer "peer node start" 33 minutes ago Up 33 minutes 0.0.0.0:7056->7051/tcp, 0.0.0.0:7058->7053/tcp peer1.org1.example.com
301407e3285b hyperledger/fabric-peer "peer node start" 33 minutes ago Up 33 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer0.org2.example.com
09ef3c426af2 hyperledger/fabric-peer "peer node start" 33 minutes ago Up 33 minutes 0.0.0.0:8056->7051/tcp, 0.0.0.0:8058->7053/tcp peer1.org2.example.com
d46778455d1a hyperledger/fabric-peer "peer node start" 33 minutes ago Up 33 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
1e14126d1920 hyperledger/fabric-ca "sh -c 'fabric-ca-..." 33 minutes ago Up 33 minutes 0.0.0.0:7054->7054/tcp ca_peerOrg1
5bd780de76a9 hyperledger/fabric-ca "sh -c 'fabric-ca-..." 33 minutes ago Up 33 minutes 0.0.0.0:8054->7054/tcp ca_peerOrg2
beafd29107fa hyperledger/fabric-orderer "orderer" 33 minutes ago Up 33 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
Full error log:
[2017-09-29 03:11:22.270] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r: <BN: 8afc8e33226a0f3a364ceb4c4826d3c442f26d92dda33fd7ff12027e214e354f>,
s: <BN: 1d7ff1d66ae71f27571b5d90e95f18fbcc1c52ee8954ae03c330f22c5206333b>,
recoveryParam: 0 }
error: [Peer.js]: sendProposal - timed out after:45000
error: [Peer.js]: sendProposal - timed out after:45000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/usr/src/app/node_modules/fabric-client/lib/Peer.js:107:19)
at ontimeout (timers.js:386:11)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/usr/src/app/node_modules/fabric-client/lib/Peer.js:107:19)
at ontimeout (timers.js:386:11)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
第一个容器是node.js api在端口4000上暴露于4000,然后与端口9999进行了桥接。
我读到有一个错误,但在hyperledger v1.0.1上解决了。我怎么知道我正在使用的版本v1.0.0或v1.0.1?P.S.我的Docker版本17.09.0-ce;Docker-Compose版本1.11.2。节点:硼。network-config.json ca ip地址(org1,org2):我的Ubuntu Server IP其他IPS(例如订购者和同行)(请求,事件):localhost
任何建议都将受到赞赏。谢谢!
update
GARI I建议,通过用ServiceNames替换Localhost,对网络config.json文件进行了更改。看起来这样:
"network-config": {
"orderer": {
"url": "grpcs://orderer.example.com:7050",
"server-hostname": "orderer.example.com",
"tls_cacerts": "../artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers$
},
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"ca": "https://ca.org1.example.com:7054",
"peers": {
"peer1": {
"requests": "grpcs://peer0.org1.example.com:7051",
"events": "grpcs://peer0.org1.example.com:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "../artifacts/channel/crypto-config/peerOrganizations/org1.ex$
},
"peer2": {
"requests": "grpcs://peer1.org1.example.com:7056",
"events": "grpcs://peer1.org1.example.com:7058",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "../artifacts/channel/crypto-config/peerOrganizations/org1.ex$
}
},
"admin": {
"key": "../artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/$
"cert": "../artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users$
}
},
"org2": {
"name": "peerOrg2",
"mspid": "Org2MSP",
"ca": "https://ca.org1.example.com:8054",
"peers": {
"peer1": {
"requests": "grpcs://peer0.org2.example.com:8051",
"events": "grpcs://peer0.org2.example.com:8053",
"server-hostname": "peer0.org2.example.com",
"tls_cacerts": "../artifacts/channel/crypto-config/peerOrganizations/org2.ex$
},
"peer2": {
"requests": "grpcs://peer1.org2.example.com:8056",
"events": "grpcs://peer1.org2.example.com:8058",
"server-hostname": "peer1.org2.example.com",
"tls_cacerts": "../artifacts/channel/crypto-config/peerOrganizations/org2.ex$
}
},
"admin": {
"key": "../artifacts/channel/crypto-config/peerOrganizations/org2.example.com/users/$
"cert": "../artifacts/channel/crypto-config/peerOrganizations/org2.example.com/users$
}
}
}
}
现在,我可以取得成功的第一个API调用:
- 登录请求
- 创建频道请求
在第三个呼叫上获取错误加入频道请求 - sendPeersProposal - Promise is rejected: Error: Connect Failed
带有以前日志的完整错误消息:
[2017-09-30 06:30:04.753] [INFO] Join-Channel - received member object for admin of the organization "org1":
[2017-09-30 06:30:04.763] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r: <BN: 14e9fb6acf44b2d9d96d5888935085bb45a2363fc3171992e73cba41c612ec93>,
s: <BN: 1c800803823a185d0ed5a55f3a786bda1fc51827a0a296fbe432180d1e5165df>,
recoveryParam: 1 }
info: [EventHub.js]: _connect - options {"grpc.ssl_target_name_override":"peer0.org1.example.com","grpc.default_authority":"peer0.org1.example.com"}
[2017-09-30 06:30:04.807] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r: <BN: e1cdeef11d37de28810bed04d525abf4ed4959899f64e7129483110b07d9ef50>,
s: <BN: 65720ba0dfcdb959cce0a3d69b016097c7895aab1891172ded659aece90d467e>,
recoveryParam: 1 }
info: [EventHub.js]: _connect - options {"grpc.ssl_target_name_override":"peer1.org1.example.com","grpc.default_authority":"peer1.org1.example.com"}
[2017-09-30 06:30:04.814] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r: <BN: e1cdeef11d37de28810bed04d525abf4ed4959899f64e7129483110b07d9ef50>,
s: <BN: 65720ba0dfcdb959cce0a3d69b016097c7895aab1891172ded659aece90d467e>,
recoveryParam: 1 }
[2017-09-30 06:30:04.823] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r: <BN: ac5da50d7afa8c20be3c0833f7d034761eba2f5f3051abb90c095106be273e1d>,
s: <BN: 6815f1b1ce217faf6827521351e401f3f0accce9748ddc999de7649657024f21>,
recoveryParam: 1 }
[2017-09-30 06:30:04.835] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {
r: <BN: ab6a1ea9d36c8cabc53cad8cfdf545dc0f7e7751bf43979552bb980f7fcb4b7e>,
s: <BN: 1839adef53808d6e3ffba1f40495827cc6b4fa047d2c03dfe9ab76933581d35b>,
recoveryParam: 1 }
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed
at /usr/src/app/node_modules/grpc/src/node/src/client.js:554:15
(node:16) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'stack' of undefined
从日志中,在错误消息之前,我可以看到正在尝试连接:{"grpc.ssl_target_name_override":"peer0.org1.example.com","grpc.default_authority":"peer0.org1.example.com"}
。也许 grpc 此处应为 grpcs ,因为网络使用TLS。如果是,我的配置是错误的。任何提示,建议?
谢谢!
已解决!
我在Olegabu的有用评论后解决了问题。我将REST API用于Hyperledger织物。
我仍会遇到相同的错误-sendPeersProposal - Promise is rejected: Error: Connect Failed
-当我运行以下请求时:在频道上加入对等,安装链码,实例链码。尽管错误的同行仍然能够加入频道,并可以使用可用于同行的频道。最后,我能够调用并查询分类帐。
P.S。我对Olegabu的答案的投票不能公开显示,因为我在Stackoverflow上的声誉不足以做到这一点。但是我非常感谢他的帮助,谢谢!
gio,问题是连接性的,但我无法立即告诉:在Stackoverflow中,您提到
node.js api暴露在端口4000上,然后停靠并与端口9999桥接。
您可以分享您的存储库,以便我看看吗?
我要做的就是将其连接到同行码头,看看是否可以从中访问其他节点,并且证书文件可用。您使用的是TLS(来自协议中的GRPC,我是否应该假设TLS__Enable也适用于同行?),因此您的端点需要能够查看其对方的root Cert文件(netowork-config.js。p>您可能想查看https://github.com/olegabu/fabric-starter此存储库的脚本可以部署到一个或多个服务器,并具有带有Debug Web应用程序的REST API服务器。它使用的链代码是您正在实验的平衡转移。也许这个仓库可以做您要做的事情,并且已经解决了这些问题。