Hyperledger Explorer区块链浏览器部署

介绍

fabric-explorer能查看到区块的信息,比如交易、区块、节点,部署的链码情况等,所以建议在网络搭建成功之后,可以尝试部署一下fabric-explorer。项目地址如下:
https://github.com/hyperledger/blockchain-explorer

一.下载支持mysql版本的fabric-explorer

目前支持的数据库有mysql和postgre,因为本机有mysql环境所以安装mysql的版本

git clone https://github.com/hyperledger/blockchain-explorer.git
cd blockchain-explorer
git checkout reactbranch

二.Database setup 配置数据库,基于路径目录db/fabricexplorer.sql

执行fabricexplorer.sql脚本,在mysql中创建DATABASE fabricexplorer 以及TABLE blocks

mysql -u root -p < db/fabricexplorer.sql

三.启动网络

1.进入first-network文件夹

cd first-network

2.download the necessary binaries and hyperledger docker images.

./bootstrap-1.0.2.sh

3.由于Hyperleger Explorer中的first-network中没有channel-artifacts文件夹,需要创建

mkdir -p ./channel-artifacts

4.创建通道

./byfn.sh -m generate -c mychannel

5.加入通道

./byfn.sh -m up -c mychannel

四.启动浏览器

1.进入blockchain-explorer文件夹
cd blockchain-explorer
2. Modify config.json to update one of the channel

  • mysql host, username, password details
 "channel": "mychannel",
 "mysql":{
      "host":"127.0.0.1",
      "database":"fabricexplorer",
      "username":"root",
      "passwd":"123456"
   }

注意network-config中一些配置的路径是否对,默认不需要更改,如果需要替换成自己的区块链网络,则需要更改!
3.根据package.jason文件生成JDK的相关依赖包
npm install
4.启动
./start.sh
./start.sh里面有一句node main.js >log.log 2>&1 &,意思是执行结果信息打印在了项目的log.log文件中,终端不显示任何信息,可以改为node main.js这样就可以在终端打印日志信息了。
5.Finally:Launch the URL http://localhost:8080 on a browser.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值