一、先决条件
1.安装docker和docker-compose
@H_502_5@参考博客:http://blog.csdn.net/diligent_lee/article/details/790983022.安装node
@H_502_5@只需要两条命令:curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
- 1
- 2
node -v
npm -v
- 2
Node.js官网:https://nodejs.org/en/
3.安装go及其环境变量配置
(1).下载最新版本的go二进制文件
wget https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz
- 1
(2).解压文件
sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
- 1
(3).配置环境变量
@H_502_5@输入命令:sudo vim /etc/profile
- 1
export GOROOT=/usr/local/go
export GOARCH=amd64
export GOOS=linux
export GOPATH=/home/username/gopath
export GOBIN=$GOROOT/bin
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
- 2
- 3
- 4
- 5
- 6
source /etc/profile
- 1
go version
- 1
二、下载Fabric
1.创建工作目录
mkdir -p ~/gopath/src/github.com/hyperledger/
- 1
2.下载Fabric
cd ~/gopath/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git
- 2
三、运行Fabric实例
@H_502_5@输入以下命令切换工作路径:cd ./fabric/scripts/
ls
- 2
./bootstrap.sh
- 1
===> List out hyperledger docker images
hyperledger/fabric-tools latest 6a8993b718c8 6 weeks ago 1.33GB
hyperledger/fabric-tools x86_64-1.0.5 6a8993b718c8 6 weeks ago 1.33GB
hyperledger/fabric-couchdb latest 9a58db2d2723 6 weeks ago 1.5GB
hyperledger/fabric-couchdb x86_64-1.0.5 9a58db2d2723 6 weeks ago 1.5GB
hyperledger/fabric-kafka latest b8c5172bb83c 6 weeks ago 1.29GB
hyperledger/fabric-kafka x86_64-1.0.5 b8c5172bb83c 6 weeks ago 1.29GB
hyperledger/fabric-zookeeper latest 68945f4613fc 6 weeks ago 1.32GB
hyperledger/fabric-zookeeper x86_64-1.0.5 68945f4613fc 6 weeks ago 1.32GB
hyperledger/fabric-orderer latest 368c78b6f03b 6 weeks ago 151MB
hyperledger/fabric-orderer x86_64-1.0.5 368c78b6f03b 6 weeks ago 151MB
hyperledger/fabric-peer latest c2ab022f0bdb 6 weeks ago 154MB
hyperledger/fabric-peer x86_64-1.0.5 c2ab022f0bdb 6 weeks ago 154MB
hyperledger/fabric-javaenv latest 50890cc3f0cd 6 weeks ago 1.41GB
hyperledger/fabric-javaenv x86_64-1.0.5 50890cc3f0cd 6 weeks ago 1.41GB
hyperledger/fabric-ccenv latest 33feadb8f7a6 6 weeks ago 1.28GB
hyperledger/fabric-ccenv x86_64-1.0.5 33feadb8f7a6 6 weeks ago 1.28GB
hyperledger/fabric-ca latest 002c9089e464 6 weeks ago 238MB
hyperledger/fabric-ca x86_64-1.0.5 002c9089e464 6 weeks ago 238MB
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
cp -rf bin/ ./../examples/
- 1
cd ./../examples/e2e_cli/
./network_setup.sh up
- 2
===================== All GOOD,End-2-End execution completed =====================
_____ _ _ ____ _____ ____ _____
| ____| | \ | | | _ \ | ____| |___ \ | ____|
| _| | \| | | | | | _____ | _| __) | | _|
| |___ | |\ | | |_| | |_____| | |___ / __/ | |___
|_____| |_| \_| |____/ |_____| |_____| |_____|
- 8
Ctrl+c
./network_setup.sh down