hyperledger fabric 1.4.4 + explorer搭建

baixiaoshi 2020-01-09

基础配置:setenforce 0、关闭防火墙

安装docker

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
 
yum update
 
#安装docker
yum install docker.x86_64 -y

安装docker-compose

下载好需要的docker镜像以及配置和代码,如下链接进行下载:https://pan.baidu.com/s/1yujG_pw9HNT_3127vltMWw

上传下载的所有文件到centos中

执行如下命令进行镜像还原:

docker load < docker.io_prom_prometheus.tar
docker load < docker.io_grafana_grafana.tar
docker load < docker.io_hyperledger_explorer-db.tar
docker load < docker.io_hyperledger_explorer.tar
docker load < docker.io_hyperledger_fabric-javaenv.tar
docker load < hyperledger_fabric-javaenv.tar
docker load < docker.io_hyperledger_fabric-ca.tar
docker load < hyperledger_fabric-ca.tar
docker load < docker.io_hyperledger_fabric-tools.tar
docker load < hyperledger_fabric-tools.tar
docker load < docker.io_hyperledger_fabric-ccenv.tar
docker load < hyperledger_fabric-ccenv.tar
docker load < docker.io_hyperledger_fabric-orderer.tar
docker load < hyperledger_fabric-orderer.tar
docker load < docker.io_hyperledger_fabric-peer.tar
docker load < hyperledger_fabric-peer.tar
docker load < hyperledger_fabric-zookeeper.tar
docker load < docker.io_hyperledger_fabric-zookeeper.tar
docker load < docker.io_hyperledger_fabric-kafka.tar
docker load < hyperledger_fabric-kafka.tar
docker load < docker.io_hyperledger_fabric-couchdb.tar
docker load < hyperledger_fabric-couchdb.tar

启动hyperledger fabric网络:

cd /root/fabric-samples/first-network
./byfn.sh up -l java -o etcdraft -s couchdb

启动hyperledger explorer:

配置blockchain-explorer/docker-compose.yaml

explorer.mynetwork.com:
    image: hyperledger/explorer:latest
    ......
    volumes:
      ......
      - ./examples/net1/crypto:/tmp/crypto

上面红色部分需要改成实际的fabric配置路径,默认为:/root/fabric-samples/first-network/crypto-config

配置blockchain-explorer\examples\net1\connection-profile\first-network.json

修改红色部分到实际密钥文件路径:

hyperledger fabric 1.4.4 + explorer搭建

启动

cd /blockchain-explorer
docker-compose up -d

http://ip:8090
用户名/密码是 admin/adminpw

hyperledger fabric 1.4.4 + explorer搭建

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
 
yum update
 
#安装 wget
sudo yum install -y wget
 
#安装docker
yum install docker.x86_64 -y

相关推荐