1、安装go、nodejs环境
#安装golang
#解压出go文件夹
$ mv go /usr/local/go
$ vi ~/.bashrc
#添加环境变量
#也可以添加在 source /etc/profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
$ source ~/.bashrc
#最好使用nvm代替node
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
#node同上
#$ mv node/ /usr/local/node
#export PATH=$PATH:$GOROOT/bin:$GOPATH/bin:/usr/local/node/bin
2、安装docker
//更新资源库
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
$ yum install docker
$ sudo systemctl start docker
$ sudo docker run hello-world
3、git、pip、docker-compose安装
#如安装notfound 扩展epel $ sudo yum -y install epel-release
$ yum install git
$ yum install python-pip
$ pip install docker-compose
4、准备仓库
$ mkdir -p $GOPATH/src/github.com/hyperledger/
$ cd $GOPATH/src/github.com/hyperledger/
$ git clone https://github.com/hyperledger/fabric-test.git
$ git clone https://github.com/hyperledger/fabric-ca.git
$ git clone https://github.com/hyperledger/fabric.git
$ git clone https://github.com/hyperledger/fabric-samples.git
5、设置镜像源
#淘宝 npm 网址 https://npm.taobao.org/
修改
$ npm config set registry http://registry.npm.taobao.org/
#还原
$ npm config set registry https://registry.npmjs.org/
#安装node版本管理工具
$ npm install n -g
#设置docker镜像源
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["阿里云上找到的镜像源地址"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
6、配置项目
$ npm install -g gulp
$ yum install -y build-essential python libltdl-dev
$ cd $GOPATH/src/github.com/hyperledger/fabric-test
$ git submodule update --init --recursive
$ git submodule foreach git pull origin master
#
$ cd $GOPATH/src/github.com/hyperledger/fabric-test/tools/PTE
$ npm install fabric-client
$ npm install fabric-ca-client