Hyperledger Explorer启动及配置后显示空白页面求助
Hey, let's dig into this blank page issue with Hyperledger Explorer. First, let's recap what you've shared so far:
问题现象
启动Hyperledger Explorer后,初始加载提示结束,网页却一直保持空白,没有任何数据显示。
环境版本信息
- OS: Ubuntu 16.04 LTS
- Docker: 18.03.0-ce
- Node: v9.11.1
- Hyperledger Fabric: 1.1.0
- Hyperledger Composer: 0.19
配置文件(config.json)内容
{ "network-config": { "org1": { "name": "peerOrg1", "mspid": "Org1MSP", "peer1": { "requests": "grpc://localhost:7051", "events": "grpc://localhost:7053", "server-hostname": "peer0.org1.example.com" }, "admin": { "key": "/home/pwc/fabric-tools/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore", "cert": "/home/pwc/fabric-tools/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts" } } }, "host": "localhost", "port": "8085", "channel": "composerchannel", "keyValueStore": "/home/pwc/.composer-credentials", "eventWaitTime": "30000", "users":[ { "username":"admin", "secret":"adminpw" } ], "pg": { "host": "localhost", "port": "5432", "database": "fabricexplorer", "username": "hppoc", "passwd": "password" }, "license": "Apache-2.0" }
运行中的Docker容器

Config.json文件截图

日志文件(log.log)内容
postgres://hppoc:password@localhost:5432/fabricexplorer Please open web browser to access http://localhost:8085/ Insert sql is INSERT INTO chaincodes ( "name","version","path","channelname" ) VALUES( $1,$2,$3,$4 ) RETURNING *; INSERT ID: 20 Insert sql is INSERT INTO blocks ( "blocknum","channelname","prehash","datahash","txcount","createdt" ) VALUES( $1,$2,$3,$4,$5,$6 ) RETURNING *; INSERT ID: 8 Insert sql is INSERT INTO transaction ( "channelname","blockid","txhash","createdt","chaincodename","chaincode_id","status","creator_msp_id","endorser_msp_id","type","read_set","write_set" ) VALUES( $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 ) RETURNING *; INSERT ID: 13
已尝试的无效方案
你已经试过Stack Exchange上「Hyperledger Explorer + Composer not showing data」的解决方案,但没有效果。
我的排查建议
从日志来看,Explorer已经成功连接PostgreSQL数据库,还能正常插入区块、交易和链码数据——说明后端数据同步是正常的,空白页面大概率是前端渲染或者配置细节的问题,给你几个排查方向:
清空浏览器缓存并硬刷新
先按Ctrl+Shift+Delete清空浏览器缓存,再用Ctrl+F5硬刷新页面。有时候旧缓存会导致前端资源加载异常,引发空白页面。修正配置中的Peer命名不一致问题
你的network-config里把Peer命名为peer1,但server-hostname却是peer0.org1.example.com,这种不一致可能会让前端识别出错。建议把配置改成:"peer0": { "requests": "grpc://localhost:7051", "events": "grpc://localhost:7053", "server-hostname": "peer0.org1.example.com" }修改后重启Explorer服务。
检查Node版本兼容性
你用的是Node v9.11.1,但和Fabric 1.1、Composer 0.19匹配的Hyperledger Explorer 0.3.x版本,推荐使用Node v8.x LTS版本。高版本Node可能和旧版依赖存在兼容性问题,建议用nvm降级:nvm install 8.16.0 nvm use 8.16.0之后重新安装Explorer依赖并重启服务。
查看浏览器控制台错误
按F12打开浏览器开发者工具,切换到「Console」标签,看看有没有JS报错或者资源加载失败的信息。这能直接定位前端问题,比如某个静态资源加载失败、API请求返回错误等。确认Explorer与Composer版本匹配
确保你使用的是Hyperledger Explorer 0.3.0版本,这个版本是专门适配Fabric 1.1和Composer 0.19的,版本不匹配也会导致前端显示异常。
内容的提问来源于stack exchange,提问作者Pramod Mishra

