我正在尝试在Ubuntu上本地运行Hyperledger Fabric网络。
现在我有通过邮递员iam在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.
答案 0 :(得分:0)
Error: Failed to connect before the deadline
"ssl-target-name-override": "192.168.19.135" >>> Should not be IP address
“ ssl目标名称覆盖”:{service_name}
检查更新后的配置文件
"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
}
}
}
}