搭建方式有两种,一种是基于docker容器,一种是用代码库。
使用docker进行部署感觉方便很多。
一、使用docker部署
1 准备条件:
- Docker
- Docker Compose
2 启动fabric网络
官方指导:Hyperledger Fabric official tutorial
这里默认你已经配置好了fabric测试网络。
3 配置文件
3.1 从仓库获取配置文件
我这里直接在test-network 文件夹下面建立explorer文件夹:
mkdir explorer
- 有三个配置文件:
可通过这三个命令获得,也可直接复制我粘贴的。
wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/master/examples/net1/config.json
wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/master/examples/net1/connection-profile/test-network.json -P connection-profile
wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/master/docker-compose.yaml
docker-c