十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
这篇文章将为大家详细讲解有关Ubuntu 16.04如何安装Hyperledger/Fabric 1.0.2,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
创新互联主营马龙网站建设的网络公司,主营网站建设方案,重庆APP开发,马龙h5小程序开发搭建,马龙网站营销推广欢迎马龙等地区企业咨询
1. 修改deb更新地址
略
2. 安装docker
sudo apt-get install docker
3. 安装curl
sudo apt-get install curl
4. 安装go
下载go安装包
wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
解压
tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz
环境变量设置见第5步。
5. 安装nodejs
从这里下 https://npm.taobao.org/mirrors/node/
随便选择版本,我这里选择的6.11.3 LTS版.
cd ~ echo $PWD /home/johnny wget https://npm.taobao.org/mirrors/node/v6.11.3/node-v6.11.3-linux-x64.tar.gz tar -C ~/ -zxf node-v6.11.3-linux-x64.tar.gz
编辑.profile增加nodejs路径
vi ~/.profile
在最后增加
PATH="/usr/local/go/bin:$HOME/node-v6.11.3-linux-x64/bin:$PATH"
source ~/.profile
6. 设置docker国内镜像
vi /etc/default/docker
增加
DOCKER_OPTS="--registry-mirror=https://docker.mirrors.ustc.edu.cn"
重启docker
sudo service docker restart
7. 下载fabric镜像
docker pull hyperledger/fabric-orderer:x86_64-1.0.2 docker pull hyperledger/fabric-peer:x86_64-1.0.2 docker pull hyperledger/fabric-zookeeper:x86_64-1.0.2 docker pull hyperledger/fabric-couchdb:x86_64-1.0.2 docker pull hyperledger/fabric-kafka:x86_64-1.0.2 docker pull hyperledger/fabric-ca:x86_64-1.0.2 docker pull hyperledger/fabric-ccenv:x86_64-1.0.2 docker pull hyperledger/fabric-javaenv:x86_64-1.0.2 docker pull hyperledger/fabric-tools:x86_64-1.0.2 docker tag hyperledger/fabric-orderer:x86_64-1.0.2 hyperledger/fabric-orderer:latest docker tag hyperledger/fabric-peer:x86_64-1.0.2 hyperledger/fabric-peer:latest docker tag hyperledger/fabric-zookeeper:x86_64-1.0.2 hyperledger/fabric-zookeeper:latest docker tag hyperledger/fabric-couchdb:x86_64-1.0.2 hyperledger/fabric-couchdb:latest docker tag hyperledger/fabric-kafka:x86_64-1.0.2 hyperledger/fabric-kafka:latest docker tag hyperledger/fabric-ca:x86_64-1.0.2 hyperledger/fabric-ca:latest docker tag hyperledger/fabric-ccenv:x86_64-1.0.2 hyperledger/fabric-ccenv:latest docker tag hyperledger/fabric-javaenv:x86_64-1.0.2 hyperledger/fabric-javaenv:latest docker tag hyperledger/fabric-tools:x86_64-1.0.2 hyperledger/fabric-tools:latest
8. 下载fabric项目源码
cd /home/johnny/dev/github git clone https://github.com/hyperledger/fabric.git
验证: | |
git clone https://github.com/hyperledger/fabric-ca.git | |
执行下面的命令,搭建一个fabricV1.0 beta 网络,包括:6 个docker image,其中包含4 个peer 节点(peer0,peer1,peer2, | |
peer3),一个order service 节点,以及一个CLI 节点用于执行命令 | |
cd $GOPATH/src/github.com/hyperledger/fabric | |
./network_setup.sh up | |
成功标志如下: | |
===================== Query on PEER3 on channel 'mychannel' is successful ===================== | |
===================== All GOOD, End-2-End execution completed ===================== | |
可以通过 docker ps 找到相关节点进程 | |
关闭fabricV1.0 beta 网络, 用以下命令 | |
./network_setup.sh down |
关于“Ubuntu 16.04如何安装Hyperledger/Fabric 1.0.2”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。