岳英豪 2019-07-01
sudo apt-get update
sudo apt-get install ssh
Go源码下载 选择对应的平台下载。
在下载的位置打开 terminal 。
sudo tar -zxvf goxxxxx.tar.gz -C /usr/local
, 建议 /usr/local
位置安装。
sudo gedit /etc/profile
, 追加以下配置到环境变量。
export GOROOT=/usr/local/go export GOPATH=~/code/go
save and exit.
source /etc/profile
立即适应新环境
输入 go version
,成功查看版本信息杂表示配置成功。
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install docker-ce
sudo usermod -aG docker bey
docker run hello-world
,正确输出结果如下:
Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
sudo curl -L https://github.com/docker/compose/releases/download/1.24.0-rc1/docker-compose-
uname -s-
uname -m -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -v
go get github.com/hyperledger/fabric
,如果 go get 命令无法执行,再试试 Gitmkdir -p $GOPATH/src/github.com/hyperledger/
,进入目录 cd $GOPATH/src/github.com/hyperledger/
git clone https://github.com/hyperledger/fabric.git
,下载完成后,进入 fabric 文件夹git checkout v1.4.0
cd $GOPATH/src/github.com/hyperledger/fabric/scripts
./bootstrap.sh
该脚本运行时间较长,主要是在下载 fabrice 各个组件的 docker 镜像
cd $GOPATH/src/github.com/hyperledger/fabric/scripts/fabric-samples/bin
sudo cp -r . /usr/local/bin
这样就可以到处使用 fabric-tools 了。
cd $GOPATH/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network
./byfn.sh down
./byfn.sh up
看到如下信息表示部署成功,恭喜!
========= All GOOD, BYFN execution completed =========== _____ _ _ ____ | ____| | \ | | | _ \ | _| | \| | | | | | | |___ | |\ | | |_| | |_____| |_| \_| |____/