您好,登錄后才能下訂單哦!
這篇文章將為大家詳細(xì)講解有關(guān)Ubuntu 16.04如何安裝Hyperledger/Fabric 1.0.2,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
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
環(huán)境變量設(shè)置見(jiàn)第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. 設(shè)置docker國(guó)內(nèi)鏡像
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項(xiàng)目源碼
cd /home/johnny/dev/github git clone https://github.com/hyperledger/fabric.git
驗(yàn)證: | |
git clone https://github.com/hyperledger/fabric-ca.git | |
執(zhí)行下面的命令,搭建一個(gè)fabricV1.0 beta 網(wǎng)絡(luò),包括:6 個(gè)docker image,其中包含4 個(gè)peer 節(jié)點(diǎn)(peer0,peer1,peer2, | |
peer3),一個(gè)order service 節(jié)點(diǎn),以及一個(gè)CLI 節(jié)點(diǎn)用于執(zhí)行命令 | |
cd $GOPATH/src/github.com/hyperledger/fabric | |
./network_setup.sh up | |
成功標(biāo)志如下: | |
===================== Query on PEER3 on channel 'mychannel' is successful ===================== | |
===================== All GOOD, End-2-End execution completed ===================== | |
可以通過(guò) docker ps 找到相關(guān)節(jié)點(diǎn)進(jìn)程 | |
關(guān)閉fabricV1.0 beta 網(wǎng)絡(luò), 用以下命令 | |
./network_setup.sh down |
關(guān)于“Ubuntu 16.04如何安裝Hyperledger/Fabric 1.0.2”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。