sdk - 截止日期前无法连接
问题描述
我正在尝试在我的 ubuntu 上本地运行一个超级账本结构网络。
现在我通过邮递员在 docker 上运行 API 服务器,我试图连接到 docker 上的 API 服务器,并且端口也被映射
我可以从本地计算机上运行的 ca 服务颁发证书,但是当我尝试查询任何内容时,出现错误
连接配置文件
"name": "first-network-org1",
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "3000"
}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com",
"peer1.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://192.168.19.135:7051",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem"
},
"grpcOptions": {
"ssl-target-name-override": "192.168.19.135"
}
},
"peer1.org1.example.com": {
"url": "grpcs://192.168.19.135:8051",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem"
},
"grpcOptions": {
"ssl-target-name-override": "192.168.19.135"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://MYIP:7054",
"caName": "ca-org1",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem"
},
"httpOptions": {
"verify": false
}
}
}
}
这是错误
019-08-31T03:22:19.109Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://192.168.19.135:7051
2019-08-31T03:22:19.111Z - error: [Channel.js]: Error: Failed to connect before the deadline URL:grpcs://192.168.19.135:7051
2019-08-31T03:22:22.120Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://192.168.19.135:8051
2019-08-31T03:22:22.120Z - error: [Channel.js]: Error: Failed to connect before the deadline URL:grpcs://192.168.19.135:8051
2019-08-31T03:22:22.121Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Failed to connect before the deadline URL:grpcs://192.168.19.135:8051
(node:1) UnhandledPromiseRejectionWarning: Error: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Failed to connect before the deadline URL:grpcs://192.168.19.135:8051
at Network._initializeInternalChannel (/middleware/api-server/node_modules/fabric-network/lib/network.js:112:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
解决方案
Error: Failed to connect before the deadline
"ssl-target-name-override": "192.168.19.135" >>> Should not be IP address
“ssl 目标名称覆盖”:{服务名称}
检查以下更新的配置文件
"name": "first-network-org1",
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "3000"
}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com",
"peer1.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://192.168.19.135:7051",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com"
}
},
"peer1.org1.example.com": {
"url": "grpcs://192.168.19.135:8051",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem"
},
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://MYIP:7054",
"caName": "ca-org1",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem"
},
"httpOptions": {
"verify": false
}
}
}
}
推荐阅读
- java - 无法找到或加载主类 org.openqa.grid.selenium.GridLauncherV3 - Grid Extras
- python - 列表理解熊猫作业
- javascript - 获取角度为 2/4/6 的组件实例数?
- php - PHP:在多维数组上有条件地操作和删除重复元素
- qt - 在 Qt 4.8 中,QWidget 中的 MS Excel ActiveX 控件没有用于数据格式化的功能区
- django - Django每天统计记录数
- css - 如何将 video.js 与 create-next-app nextjs 一起使用?
- azure-sql-database - 数据集错误消息 - PdwManagedToNativeInteropException
- java - 启动 openday light netconf testtool 模拟器时出错
- docker - 带有 mysql 数据的 Wordpress 图像