1. 构建golang环境
## 直接下载包 安装即可
wget https://studygolang.com/dl/golang/go1.16.10.linux-arm64.tar.gz
## 具体安装不陈述了 设置环境变量 source *** 更新一下
2. 构建fabric-ca
make fabric-ca-client
make fabric-ca-server
3. 构建fabric
make configtxgen
make configtxlator
make orderer
make peer
4. 构建chaincode
如果是自己的链码且要非docker的本地部署,需要重新在arm64环境编译一下
5. 部署区块网络
5.1 非docker本地
## 把以上编译二进制文件拷贝bin中
## 其他注意本地native部署配置环境等等就行
5.2 docker
5.2.1 适配docker
##可以找到包进行安装
wget https://download.docker.com/linux/debian/dists/stretch/pool/stable/arm64/docker-ce_18.06.3~ce~3-0~debian_arm64.deb
dpkg -i docker-ce_18.06.3~ce~3-0~debian_arm64.deb
5.2.2 适配docker-compose
##1. 安装python3.5以上版本
## 2. pip升级 有需求可以建立虚拟环境去执行
pip install --upgrade pip
##2. 安装docker-compose
pip install docker-compose --ignore-installed requests
5.2.3 制作基础镜像
## 如果没有debootstrap
## 有网
sudo apt install debootstrap
## 无网
http://ftp.cn.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.89_all.deb
去地址下载安装包 去安装
sudo debootstrap --arch=arm64 --no-check-gpg stretch rootfs http://mirrors.ustc.edu.cn/debian
sudo tar -C rootfs -c . | docker import - rootfs
5.2.4 制作golang镜像
Dockerfile
#
#
FROM rootfs:latest
#RUN apk add --no-cache \
# ca-certificates
# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
#RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
ENV PATH /usr/local/go/bin:$PATH
ENV GOLANG_VERSION 1.16.10
RUN set -eux
RUN apt i

最低0.47元/天 解锁文章
6266

被折叠的 条评论
为什么被折叠?



