如何在Azure Kubernetes Service(AKS)上设置hyperledger fabric explor



我通过阅读Azure Kubernetes Service(AKS(上的hyperledger fabric联盟文档来建立hyperledger结构网络。网络端一切正常。现在我想为这个网络设置超级账本结构浏览器。为了做到这一点,我做了以下步骤,

  1. git克隆https://github.com/hyperledger/blockchain-explorer.git
  2. git checkout标记/v.0.0-rc2
  3. app/persistence/fabric/postgreSQL/db
  4. /创建数据库.sh
  5. /main.sh安装
  6. 替换了连接配置文件(app/platform/fabric/connection-profile/first-network.json(,如下所示
{
"certificateAuthorities": {
"ca.xxxxxxxxxxxxx.eastus.aksapp.io": {
"caName": "ca.org1",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----dfsajk-----END CERTIFICATE-----n"
},
"url": "grpcs://ca.xxxxxxxxxxxxx.eastus.aksapp.io:443"
}
},
"client": {
"tlsEnable": true,
"adminUser": "admin.org1",
"adminPassword": "",
"enableAuthentication": false,
"connection": {
"timeout": {
"orderer": "300",
"peer": {
"endorser": "300"
}
}
},
"organization": "org1"
},
"channels": {
"hrschannel": {
"orderers": ["orderer1.yyyyyyyyyyyyyyyyyyyyy.eastus.aksapp.io"],
"peers": {
"peer1.xxxxxxxxxxxxx.eastus.aksapp.io": {}
}
}
},
"name": "org1",
"organizations": {
"org1": {
"certificateAuthorities": [
"org1CA"
],
"mspid": "org1",
"peers": [
"peer1.xxxxxxxxxxxxx.eastus.aksapp.io"
]
}
},
"peers": {
"peer1.xxxxxxxxxxxxx.eastus.aksapp.io": {
"grpcOptions": {
"hostnameOverride": "peer1.xxxxxxxxxxxxx.eastus.aksapp.io",
"ssl-target-name-override": "peer1.xxxxxxxxxxxxx.eastus.aksapp.io"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----jjdadjijfifawj-----END CERTIFICATE-----n"
},
"url": "grpcs://peer1.xxxxxxxxxxxxx.eastus.aksapp.io:443"
}
},
"version": "1.0.0",
"wallet": "org1"
}

但我在这里得到了以下错误tail-f logs/console/console-2020-07-08.log

false 'ssl-certs' '/home/css/delete/blockchain-explorer/ssl-certs'
******* Initialization started for hyperledger fabric platform ******, { 'first-network': 
{ name: 'first-network',
profile: './connection-profile/first-network.json' } }
client_configs.name  first-network  client_configs.profile  ./connection-profile/first-network.json
FabricUtils.createFabricClient 
config.client.tlsEnable  true
FabricConfig, this.config.channels  hrschannel
initializeChannelFromDiscover  hrschannel
FabricClient.discover_results  endpoint  { host: 'orderer1.1111111111111111111.eastus.aksapp.io',
port: 443 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer1.1111111111111111111.eastus.aksapp.io:443 
FabricClient.discover_results  endpoint  { host: 'orderer2.1111111111111111111.eastus.aksapp.io',
port: 443 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer2.1111111111111111111.eastus.aksapp.io:443 
FabricClient.discover_results  endpoint  { host: 'orderer3.1111111111111111111.eastus.aksapp.io',
port: 443 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer3.1111111111111111111.eastus.aksapp.io:443 
2020-07-08T16:15:30.879Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:443
FabricUtils.createDetachClient 
initializeListener, client_name, client  first-network { name: 'first-network',
profile: './connection-profile/first-network.json' }

Please open web browser to access :http://localhost:8080/

pid is 13408

Sync process is started for the network : [first-network] and client : [first-network]
config.client.tlsEnable  true
FabricConfig, this.config.channels  hrschannel
(node:13836) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
An identity for the admin user: admin.org1 already exists in the wallet
initializeChannelFromDiscover  hrschannel
FabricClient.discover_results  endpoint  { host: 'orderer1.1111111111111111111.eastus.aksapp.io',
port: 443 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer1.1111111111111111111.eastus.aksapp.io:443 
FabricClient.discover_results  endpoint  { host: 'orderer2.1111111111111111111.eastus.aksapp.io',
port: 443 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer2.1111111111111111111.eastus.aksapp.io:443 
FabricClient.discover_results  endpoint  { host: 'orderer3.1111111111111111111.eastus.aksapp.io',
port: 443 }
initializeChannelFromDiscover.discoveryProtocol  grpcs  requesturl  grpcs://orderer3.1111111111111111111.eastus.aksapp.io:443 
2020-07-08T16:15:37.490Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:443
SyncServices.synchNetworkConfigToDB client  first-network  channel_name  hrschannel
2020-07-08T16:15:40.744Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:443
<<<<<<<<<<<<<<<<<<<<<<<<<< Synchronizer Error >>>>>>>>>>>>>>>>>>>>>
Error: Orderer with name "orderer2.1111111111111111111.eastus.aksapp.io:443" not assigned to this channel
at Channel.getOrderer (/home/css/delete/blockchain-explorer/node_modules/fabric-network/node_modules/fabric-client/lib/Channel.js:928:10)
at FabricClient.switchOrderer (/home/css/delete/blockchain-explorer/app/platform/fabric/FabricClient.js:681:27)
at FabricClient.getGenesisBlock (/home/css/delete/blockchain-explorer/app/platform/fabric/FabricClient.js:611:26)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
<<<<<<<<<<<<<<<<<<<<<<<<<< Closing client processor >>>>>>>>>>>>>>>>>>>>>
req.body { user: 'admin', password: 'adminpw', network: 'first-network' }
Network: first-network enableAuthentication false

请帮我解决这个问题。

目前,您无法修复此错误,因为Explorer不支持连接配置文件中的pem字符串格式。但您可以期待Explorer很快会支持它。

  • 更新

    • 在Hyperledger Explorer v1.1.1中,增加了对连接配置文件中PEM字符串格式的支持。因此,如果您使用Hyperledger Explorer的最新版本v1.1.1,它应该可以工作

最新更新