Hyperledger Explorer 区块链浏览器与已搭建fabric网络结合

作者:jcmp      发布时间:2021-04-29      浏览量:0
折腾了一下午,终于吧Hyperledge

折腾了一下午,终于吧Hyperledger Explorer与现有的fabric网络结合起来。其实也挺简单,主要是踩了权限的坑。

一、Hyperledger Explorer介绍

hyperledger explorer主要是为Hyperledger的区块链网络搭建可视化的环境,可以通过浏览器查看网络中的信息,包括网络拓扑、区块信息、链码信息等等。 现在支持 fabric 和cello。 本文是在fabric v1.1版本以及explorer 3.5版本下的部署,操作系统为CentOS 7。 源码地址: https://github.com/hyperledger/blockchain-explorer 依赖:

二、部署过程

下载explorer代码并切换到3.5版本

三、数据库设置

"pg": { "host": "127.0.0.1", "port": "5432", "database": "fabricexplorer", "username": "hppoc", "passwd": "password" }

四、Fabric 网络部署

根据已经部署好的fabric网络更改配置文件: blockchain-explorer/app/platform/fabric/config.json。

{ "network-config": { "org1": { "name": "GylOrg1MSP", "mspid": "GylOrg1MSP", "peer1": { "requests": "grpcs://10.254.186.164:7051", "events": "grpcs://10.254.186.164:7053", "server-hostname": "peer0.org1.gyl.com", "tls_cacerts": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org1.gyl.com/peers/peer0.org1.gyl.com/tls/ca.crt" }, "admin": { "key": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org1.gyl.com/users/Admin@org1.gyl.com/msp/keystore", "cert": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org1.gyl.com/users/Admin@org1.gyl.com/msp/signcerts" } }, "org3": { "name": "GylOrg3MSP", "mspid": "GylOrg1MSP", "peer1": { "requests": "grpcs://10.254.207.154:7051", "events": "grpcs://10.254.207.154:7053", "server-hostname": "peer0.org3.gyl.com", "tls_cacerts": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org3.gyl.com/peers/peer0.org3.gyl.com/tls/ca.crt" }, "admin": { "key": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org3.gyl.com/users/Admin@org3.gyl.com/msp/keystore", "cert": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org3.gyl.com/users/Admin@org3.gyl.com/msp/signcerts" } }, "org2": { "name": "GylOrg2MSP", "mspid": "GylOrg2MSP", "peer1": { "requests": "grpcs://10.254.247.165:7051", "events": "grpcs://10.254.247.165:7053", "server-hostname": "peer0.org2.gyl.com", "tls_cacerts": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org2.gyl.com/peers/peer0.org2.gyl.com/tls/ca.crt" }, "admin": { "key": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org2.gyl.com/users/Admin@org2.gyl.com/msp/keystore", "cert": "/home/dc2-user/kongli/gyl/certs/peerOrganizations/org2.gyl.com/users/Admin@org2.gyl.com/msp/signcerts" } } }, "channel": "gylchannel", "orderers": [ { "mspid": "OrdererMSP", "server-hostname": "orderer.gyl.com", "requests": "grpcs://10.254.186.164:7050", "tls_cacerts": "/home/dc2-user/kongli/gyl/certs/ordererOrganizations/gyl.com/orderers/orderer.gyl.com/tls/ca.crt" } ], "keyValueStore": "/tmp/fabric-client-kvs", "configtxgenToolPath": "/user/bin", "SYNC_START_DATE_FORMAT": "YYYY/MM/DD", "syncStartDate": "2018/11/01", "eventWaitTime": "30000", "license": "Apache-2.0", "version": "1.1"}

构建Hyperledger Explorer

以上没有错误证明搭建完成

运行 Hyperledger Explorer

五、效果

六、遇到的问题