Hyperledger Fabric 1.4环境搭建【详尽】
2021/7/27 17:07:52
本文主要是介绍Hyperledger Fabric 1.4环境搭建【详尽】,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
操作系统:Ubuntu 16.04/18.04
1. 安装依赖工具
1.1 go语言
test@ubuntu :~/Soft$ wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz test@ubuntu :~/Soft$ sudo tar -zxvf go1.14.2.linux-amd64.tar.gz -C /opt test@ubuntu :~/Soft$ echo "export GOROOT=/opt/go" >> ~/.bashrc test@ubuntu :~/Soft$ echo "export GOPATH=/opt/gopath" >> ~/.bashrc test@ubuntu :~/Soft$ echo "export PATH=\$GOROOT/bin:\$GOPATH/bin:\$PATH" >> ~/.bashrc test@ubuntu :~/Soft$ . ~/.bashrc test@ubuntu :~/Soft$ go version go version go1.14.2 linux/amd64
go语言的配置可以自由选择
1.2 docker
test@ubuntu-bionic:~/Soft$ curl -fsSL https://get.docker.com -o get-docker.sh test@ubuntu-bionic:~/Soft$ sudo sh get-docker.sh test@ubuntu-bionic:~/Soft$ sudo usermod -aG docker $USER test@ubuntu-bionic:~/Soft$ sudo systemctl restart docker test@ubuntu-bionic:~$ docker version Client: Docker Engine - Community Version: 19.03.8 API version: 1.40 Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:25:46 2020 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.8 API version: 1.40 (minimum version 1.12) Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:24:19 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
1.3 docker-compose
vagrant@ubuntu-bionic:~$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose vagrant@ubuntu-bionic:~$ sudo chmod 755 /usr/local/bin/docker-compose vagrant@ubuntu-bionic:~$ docker-compose --version docker-compose version 1.25.4, build 8d51620a
2 源码及镜像下载
2.1 源码下载
vagrant@ubuntu-bionic:~$ mkdir -p $GOPATH/src/github.com/hyperledger vagrant@ubuntu-bionic:~$ cd $GOPATH/src/github.com/hyperledger vagrant@ubuntu-bionic:/opt/gopath/src/github.com/hyperledger$ git clone https://github.com/hyperledger/fabric-samples.git
2.2 切换分支
[vagrant@RUAN:/opt/gopath/src/github.com/hyperledger/fabric-samples] (master)$ git checkout -b v1.4.6 v1.4.6 Switched to a new branch 'v1.4.6'
2.3 下载引导脚本
[vagrant@RUAN:/opt/gopath/src/github.com/hyperledger/fabric-samples] (v1.4.6)$ curl -sS https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh -o ./scripts/bootstrap.sh [vagrant@RUAN:/opt/gopath/src/github.com/hyperledger/fabric-samples] (v1.4.6)$ chmod +x scripts/bootstrap.sh
2.4 下载必备二进制文件和docker镜像
# ./scripts/bootstrap.sh [version] [ca version] [thirdparty_version] [vagrant@RUAN:/opt/gopath/src/github.com/hyperledger/fabric-samples] (v1.4.6)$ ./scripts/bootstrap.sh 1.4.6 1.4.6 0.4.18 -s
2.4.1 下载Hyperledger Fabric 二进制包
===> Downloading version 1.4.6 platform specific fabric binaries ===> Downloading: https://github.com/hyperledger/fabric/releases/download/v1.4.6/hyperledger-fabric-linux-amd64-1.4.6.tar.gz ===> Downloading version 1.4.6 platform specific fabric-ca-client binary ===> Downloading: https://github.com/hyperledger/fabric-ca/releases/download/v1.4.6/hyperledger-fabric-ca-linux-amd64-1.4.6.tar.gz
2.4.2 拉取docker镜像
Pull Hyperledger Fabric docker images FABRIC_IMAGES: peer orderer ccenv tools javaenv ===> Pulling fabric Images ====> hyperledger/fabric-peer:1.4.6 1.4.6: Pulling from hyperledger/fabric-peer ====> hyperledger/fabric-orderer:1.4.6 1.4.6: Pulling from hyperledger/fabric-orderer ====> hyperledger/fabric-ccenv:1.4.6 1.4.6: Pulling from hyperledger/fabric-ccenv ====> hyperledger/fabric-tools:1.4.6 1.4.6: Pulling from hyperledger/fabric-tools ====> hyperledger/fabric-javaenv:1.4.6 1.4.6: Pulling from hyperledger/fabric-javaenv ====> hyperledger/fabric-ca:1.4.6 1.4.6: Pulling from hyperledger/fabric-ca ===> Pulling thirdparty docker images ====> hyperledger/fabric-zookeeper:0.4.18 0.4.18: Pulling from hyperledger/fabric-zookeeper ====> hyperledger/fabric-kafka:0.4.18 0.4.18: Pulling from hyperledger/fabric-kafka ====> hyperledger/fabric-couchdb:0.4.18 0.4.18: Pulling from hyperledger/fabric-couchdb ===> List out hyperledger docker images hyperledger/fabric-javaenv 1.4 68914607b3a5 6 weeks ago 1.68GB hyperledger/fabric-javaenv 1.4.6 68914607b3a5 6 weeks ago 1.68GB hyperledger/fabric-javaenv latest 68914607b3a5 6 weeks ago 1.68GB hyperledger/fabric-ca 1.4 3b96a893c1e4 7 weeks ago 150MB hyperledger/fabric-ca 1.4.6 3b96a893c1e4 7 weeks ago 150MB hyperledger/fabric-ca latest 3b96a893c1e4 7 weeks ago 150MB hyperledger/fabric-tools 1.4 0f9743ac0662 7 weeks ago 1.49GB hyperledger/fabric-tools 1.4.6 0f9743ac0662 7 weeks ago 1.49GB hyperledger/fabric-tools latest 0f9743ac0662 7 weeks ago 1.49GB hyperledger/fabric-ccenv 1.4 191911f4454f 7 weeks ago 1.36GB hyperledger/fabric-ccenv 1.4.6 191911f4454f 7 weeks ago 1.36GB hyperledger/fabric-ccenv latest 191911f4454f 7 weeks ago 1.36GB hyperledger/fabric-orderer 1.4 84eaba5388e7 7 weeks ago 120MB hyperledger/fabric-orderer 1.4.6 84eaba5388e7 7 weeks ago 120MB hyperledger/fabric-orderer latest 84eaba5388e7 7 weeks ago 120MB hyperledger/fabric-peer 1.4 5a52faa5d8c2 7 weeks ago 128MB hyperledger/fabric-peer 1.4.6 5a52faa5d8c2 7 weeks ago 128MB hyperledger/fabric-peer latest 5a52faa5d8c2 7 weeks ago 128MB hyperledger/fabric-zookeeper 0.4 ede9389347db 5 months ago 276MB hyperledger/fabric-zookeeper 0.4.18 ede9389347db 5 months ago 276MB hyperledger/fabric-zookeeper latest ede9389347db 5 months ago 276MB hyperledger/fabric-kafka 0.4 caaae0474ef2 5 months ago 270MB hyperledger/fabric-kafka 0.4.18 caaae0474ef2 5 months ago 270MB hyperledger/fabric-kafka latest caaae0474ef2 5 months ago 270MB hyperledger/fabric-couchdb 0.4 d369d4eaa0fd 5 months ago 261MB hyperledger/fabric-couchdb 0.4.18 d369d4eaa0fd 5 months ago 261MB hyperledger/fabric-couchdb latest d369d4eaa0fd 5 months ago 261MB
请耐心等待,很需要时间
2.4.3 启动验证
进入到first-network目录下并启动网络
[test@RUAN:~]$ cd /opt/gopath/src/github.com/hyperledger/fabric-samples/first-network [test@RUAN:/opt/gopath/src/github.com/hyperledger/fabric-samples/first-network] (v1.4.6)$ ./byfn.sh up
能顺利跑完就说明没有问题
这篇关于Hyperledger Fabric 1.4环境搭建【详尽】的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2025-01-08CCPM如何缩短项目周期并降低风险?
- 2025-01-08Omnivore 替代品 Readeck 安装与使用教程
- 2025-01-07Cursor 收费太贵?3分钟教你接入超低价 DeepSeek-V3,代码质量逼近 Claude 3.5
- 2025-01-06PingCAP 连续两年入选 Gartner 云数据库管理系统魔力象限“荣誉提及”
- 2025-01-05Easysearch 可搜索快照功能,看这篇就够了
- 2025-01-04BOT+EPC模式在基础设施项目中的应用与优势
- 2025-01-03用LangChain构建会检索和搜索的智能聊天机器人指南
- 2025-01-03图像文字理解,OCR、大模型还是多模态模型?PalliGema2在QLoRA技术上的微调与应用
- 2025-01-03混合搜索:用LanceDB实现语义和关键词结合的搜索技术(应用于实际项目)
- 2025-01-03停止思考数据管道,开始构建数据平台:介绍Analytics Engineering Framework