Hyperledger Fabric-fabric-samples环境准备
source link: https://studygolang.com/articles/32394
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
本文将讲述如何从零开始准备运行fabric-samples所需的环境
2. 基本配置
阿里云服务器——Ubuntu 16.04.7
3. 所需配置
Docker以及Docker Compose
Node.js
4. 安装Git
在安装钱,先运行
sudo apt-get update
sudo apt-get upgrade
确保镜像和本地文件的更新
接下来运行
sudo apt-get install git
安装完后通过
git --version
检查是否安装成功
如果你使用的其他平台,可以参考官方安装教程
5. 安装cURL
从官网获取安装包(https://curl.haxx.se/download.html)
wget https://curl.haxx.se/download/curl-7.74.0.tar.gz
下载完成后解压
tar -zxf curl-7.74.0.tar.gz
进入解压好的文件
cd ./curl-7.74.0
./configure --prefix=/usr/local/curl
sudo make install
检查安装完成
curl --version
6.安装Docker及Docker Compose
参考自官方文档
如果你以前安装了旧版本的Docker,需要先卸载旧版本,可以通过如下的命令
sudo apt-get remove docker docker-engine docker.io containerd runc
接下来安装依赖包
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
添加 Docker 的官方 GPG 密钥:
curl-fsSLhttps://download.docker.com/linux/ubuntu/gpg |sudo apt-key add -
检查是否添加成功
sudo apt-key fingerprint 0EBFCD88
设定稳定版仓库
sudo add-apt-repository\"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release-cs) \ stable"
安装Docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
安装完后运行
sudo docker run hello-world
检查是否安装成功
继续安装Docker Compose(参考自官方文档)
sudo curl-L"https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-compose
执行完后,运行
sudo chmod +x /usr/local/bin/docker-compose
如果遇到下面的问题
可以通过以下办法解决
运行fuser 命令找到正在占用的程序,根据找到的id,kill掉。
docker-compose --version
说明安装成功
7.安装Node.js
参考自官网
选择合适版本进行下载
wget https://nodejs.org/dist/v14.15.3/node-v14.15.3-linux-x64.tar.xz
tar xf node-v14.15.3-linux-x64.tar.xz
为了之后方便我们重新命名node文件夹位nodejs
mv node-v14.15.3-linux-x64 nodejs
进入node文件夹下的bin文件夹
cd ./nodejs/bin
nano ~/.bashrc
将下文粘贴到文本的最后一行
export PATH=$PATH:/root/request/bin
保存后退出
source ~/.bashrc
查看node版本,确认安装完成
node -v
8. 安装Go
参考自官方文档
下载安装包
wget https://golang.org/dl/go1.15.6.linux-amd64.tar.gz
下载好后解压
tar -C /usr/local -xzfgo1.15.6.linux-amd64.tar.gz
nano ~/.bashrc
在文件末尾添加如下
export PATH=$PATH:/usr/local/go/bin
添加后运行
source ~/.bashrc
go version
以上便是运行Fabric Samples前的环境准备。之后我们会介绍如何使用Fabric网络。
有疑问加站长微信联系(非本文作者)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK