1.1 更新系统需求项
sudo apt update
sudo apt-get upgrade
1.2 安装docker
#安装docker、docker-compose
sudo apt-get -y install docker-compose
1.3配置docker
(1)将用户加入该group内,然后退出并重新登陆
sudo gpasswd -a ${
USER} docker
(2)重启docker服务
systemctl restart docker
(3) 当前用户切换到docker数组
newgrp - docker
(4)查看版本信息
docker version
docke-compose version
sudo apt-get install jq \ curl \ git \ apt-transport-https \ ca-certificates \ gnupg-agent \ software-properties-common
2.1 下载安装包(目前最新版的go语言的版本为1.16.3,大家也可以下载其他版本的go语言)
wget https://dl.google.com/go/go1.16.3.linux-amd64.tar.gz
2.2 解压安装包到 /usr/local目录下
sudo tar -zxvf go1.16.3.linux-amd64.tar.gz -C /usr/local
2.3 创建GO目录
mkdir $HOME/go
2.4 配置环境变量
(1)打开/etc/profile 或者 ~/.bashrc(二选一即可)
sudo vi /etc/profile
vi ~/.bashrc
(2)配置环境变量
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
(3)刷新配置文件使环境变量生效
source ~/.bashrc
./etc/profile
(4) 检测版本
go version
3.1 下载node.js安装包(目前最新版是14.16.1)
wget https://nodejs.org/dist/v14.16.1/node-v14.16.1-linux-x64.tar.xz
3.2 加压至/opt目录下
sudo tar xvf node-v14.16.1-linux-x64.tar.xz -C /opt
3.3 配置node.js环境变量,配置成全局可用,即配置在系统级别的配置文件/etc/profile
sudo vi /etc/profile
export NODEJS_HOME=/opt/node-v14.16.1-linux-x64
export PATH=$PATH:$NODEJS_HOME/bin
3.4 重新加载配置文件
. /etc/profile
3.5 测试安装版本
node -v
4.1 创建测试目录并进入
cd ~
mkdir hyperledger-fabric
cd hyperledger-fabric
4.2 下载可执行安装脚本bootstrap.sh
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh -o bootstrap.sh
4.3 直接git文件夹“fabric-samples”
git clone https://github.com/hyperledger/fabric-samples.git
4.4 到相应的网址下载二进制文件并放入fabric-samples文件夹
cd fabric-samples
wget https://github.com/hyperledger/fabric/releases/download/v2.3.2/hyperledger-fabric-linux-amd64-2.3.2.tar.gz
wget https://github.com/hyperledger/fabric-ca/releases/download/v1.5.0/hyperledger-fabric-ca-linux-amd64-1.5.0.tar.gz
4.5 加压文件
tar -zxvf hyperledger-fabric-linux-amd64-2.3.2.tar.gz
tar -zxvf hyperledger-fabric-ca-linux-amd64-1.5.0.tar.gz
4.6 打开bootstrap.sh在末尾注释脚本中pullBinaries语句,然后执行bootstrap.sh
#pullBinaries() {
# echo "===> Downloading version ${FABRIC_TAG} platform specific fabric binaries"
# download "${BINARY_FILE}" "https://github.com/hyperledger/fabric/releases/download/v${VERSION}/${BINARY_FILE}"
# if [ $? -eq 22 ]; then
# echo
# echo "------> ${FABRIC_TAG} platform specific fabric binary is not available to download <----"
# echo
# exit
# fi
# echo "===> Downloading version ${CA_TAG} platform specific fabric-ca-client binary"
# download "${CA_BINARY_FILE}" "https://github.com/hyperledger/fabric-ca/releases/download/v${CA_VERSION}/${CA_BINARY_FILE}"
# if [ $? -eq 22 ]; then
# echo
# echo "------> ${CA_TAG} fabric-ca-client binary is not available to download (Available from 1.1.0-rc1) <----"
# echo
# exit
# fi
#}
chmod +x bootstrap.sh
./bootstrap.sh
5.1 进入/fabric-samples/test-network 执行./network.sh进行测试
cd /fabric-samples/test-network
./network.sh up
5.2 关闭网络
./network.sh down