访问Hyperldger Explorer时出现错误"Cannot GET/". [英] error while accessing Hyperldger explorer "Cannot GET /"

查看:113
本文介绍了访问Hyperldger Explorer时出现错误"Cannot GET/".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用资源管理器(最新版本)配置了Fabric网络(v1.4).

I have configured our Fabric network (v1.4) with Explorer (latest version).

node --version v8.16.0

数据库日志中没有错误没有应用程序级别错误网络的资源管理器同步过程正在持续进行能够查看数据库中的更新数据 http://localhost:8080/api-docs/(Explorer Swagger)正常工作.但是,在访问 http://localhost:8080/时,我得到了

No errors in db log No application level errors Explorer syncing process is going on continuously for the network Able to view the updated data in DB http://localhost:8080/api-docs/ (Explorer Swagger) works fine. However while accessing http://localhost:8080/ i am getting

无法获取/错误.

Chrome浏览器检查日志-

Chrome inspect logs -

无法加载资源:服务器以http://localhost:8080/404(未找到)的状态响应

控制台日志-

[2020-01-28T22:30:53.167] [INFO] PgService - SSL to Postgresql disabled
[2020-01-28T22:30:53.167] [INFO] PgService - connecting to Postgresql postgres://hppoc:******@127.0.0.1:5432/fabricexplorer
[2020-01-28T22:30:54.285] [INFO] Platform -  client_configs.name  first-network  client_configs.profile  ./connection-profile/first-network.json
[2020-01-28T22:30:54.285] [INFO] Platform - FabricUtils.createFabricClient
[2020-01-28T22:30:54.286] [INFO] FabricConfig - config.client.tlsEnable  true
[2020-01-28T22:30:54.287] [INFO] FabricGateway - peer0.org1.example.com
[2020-01-28T22:30:54.287] [INFO] FabricGateway - /path/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
adminPrivateKeyPath  /path/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/e65fa2dd29a69b2b28f9e439d1a8d555d411e9906e5a20d0a7341207a3a46424_sk
[2020-01-28T22:30:54.287] [INFO] FabricConfig - FabricConfig, this.config.channels  mychannel
[2020-01-28T22:30:54.607] [INFO] FabricClient -  FabricClient.discover_results  endpoint  { host: 'orderer.example.com', port: 7050 }
[2020-01-28T22:30:54.638] [INFO] Platform - FabricUtils.createDetachClient
[2020-01-28T22:30:54.640] [INFO] Platform - initializeListener, client_name, client  first-network { name: 'first-network',
  profile: './connection-profile/first-network.json' }
[2020-01-28T22:30:54.646] [INFO] main - Please open web browser to access :http://localhost:8080/
[2020-01-28T22:30:54.646] [INFO] main - pid is 18213
[2020-01-28T22:30:54.782] [INFO] PgService - SSL to Postgresql disabled
[2020-01-28T22:30:54.782] [INFO] PgService - connecting to Postgresql postgres://hppoc:******@127.0.0.1:5432/fabricexplorer
[2020-01-28T22:30:55.397] [INFO] SyncPlatform - Updating the client network and other details to DB
[2020-01-28T22:30:55.404] [INFO] SyncServices - SyncServices.synchNetworkConfigToDB client  first-network  channel_name  mychannel
[2020-01-28T22:30:55.427] [INFO] FabricClient -  FabricClient.discover_results  endpoint  { host: 'orderer.example.com', port: 7050 }
[2020-01-28T22:30:55.528] [INFO] SyncPlatform - Sync process is started for the network : [first-network] and client : [first-network]
[2020-01-28T22:30:55.530] [INFO] FabricConfig - config.client.tlsEnable  true
[2020-01-28T22:30:55.530] [INFO] FabricGateway - peer0.org1.example.com
[2020-01-28T22:30:55.530] [INFO] FabricGateway - /path/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
adminPrivateKeyPath  /path/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/e65fa2dd29a69b2b28f9e439d1a8d555d411e9906e5a20d0a7341207a3a46424_sk
[2020-01-28T22:30:55.530] [INFO] FabricConfig - FabricConfig, this.config.channels  mychannel
[2020-01-28T22:30:55.798] [INFO] FabricClient -  FabricClient.discover_results  endpoint  { host: 'orderer.example.com', port: 7050 }
[2020-01-28T22:30:55.833] [INFO] SyncServices - SyncServices.synchNetworkConfigToDB client  first-network  channel_name  mychannel
[2020-01-28T22:30:55.865] [INFO] FabricClient -  FabricClient.discover_results  endpoint  { host: 'orderer.example.com', port: 7050 }
[2020-01-28T22:30:55.883] [INFO] Sync - Synchronizer pid is 18220
[2020-01-28T22:30:55.901] [INFO] SyncServices - block_row.blocknum  4
[2020-01-28T22:30:58.200] [INFO] SyncPlatform - Updating the client network and other details to DB
[2020-01-28T22:30:58.209] [INFO] SyncServices - SyncServices.synchNetworkConfigToDB client  first-network  channel_name  mychannel
[2020-01-28T22:30:58.241] [INFO] FabricClient -  FabricClient.discover_results  endpoint  { host: 'orderer.example.com', port: 7050 }

推荐答案

因此,我找到了问题的答案-奇怪的是,该问题无处不在,它可以在localhost:8080上运行,但是经过大量研究发现,节点js无法为静态页面提供服务,而Hyperledger Explorer在8080端口上.因此,需要使用服务"来构建和服务该页面.我两天前就做了,它从端口5000开始,并且是它自己的IP地址,但是由于违反控制安全策略",我在网络浏览器上收到错误消息.

So, I found the answer to the problem - Weirdly the problem was it shows everywhere that it serves on localhost:8080 but after a lot of research found out that node js cannot serve static pages which hyperledger explorer is on port 8080. So, needs to use "serve" to build and serve that page. I had did that 2 days back, it starts on port 5000 and it`s own IP address, but I was getting error on web browser for violation of "control security policy".

解决方案:

$ cd ~/Hyperledger/blockchain-explorer/client
$ npm install
$ npm test -- -u --coverage 
$ npm run build
$ npm install -g serve
$ serve -s build

现在它将显示类似以下内容的输出:

Now it will show you the output something like :


   ┌────────────────────────────────────────────────────┐
   │                                                    │
   │   Serving!                                         │
   │                                                    │
   │   - Local:            http://localhost:5000        │
   │   - On Your Network:  http://160.33.244.178:5000   │
   │                                                    │
   │   Copied local address to clipboard!               │
   │                                                    │
   └────────────────────────────────────────────────────┘

如果打开: http://localhost:5000 它不会显示任何内容,并且在网络上登录检查窗口将显示-违反控制安全策略".

If you open up : http://localhost:5000 it will not show anything and in the network logs on inspect window will show you - "control security policy violation".

因此使用端口8080代替:

so use port 8080 instead like this :

- Local:            http://localhost:8080        │
- On Your Network:  http://160.33.244.178:8080

此外,您还需要启动hyperldger Explorer服务器:

Also, you would need to start the hyperldger explorer server :

$ cd ~/<YourPath>/blockchain-explorer
$ ./start.sh

您将看到选择了第一个网络的登录页面.

You will see login page with first network selected.

使用:

"adminUser" is the the admin user of the network, in this case it's fabric CA or an identity user.
"adminPassword" is the password for the admin user.

您在!

这篇关于访问Hyperldger Explorer时出现错误"Cannot GET/".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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