Raspberry pi 3 上的 Hyperledger Fabric [英] Hyperledger Fabric on Raspberry pi 3
问题描述
我正在尝试在 raspberry pi 上部署超级账本结构,但它不起作用.我正在寻找一些教程,但我没有找到,有人做过吗?
I'm trying to deploy hyperledger fabric on a raspberry pi, but it doesn't work. I'm searching for some tutorial but i didn't found it, there are someone that just did it?
推荐答案
上次我尝试在 RPi 上运行 Hyperledger Fabric 时,我准备了以下说明:
Last time I've tried to run Hyperledger Fabric on RPi I've prepared following instructions:
- 在 SD 卡上安装最新的 RASPBIAN,您可以从以下位置下载图像:https://www.raspberrypi.org/downloads/raspbian/
通过运行更新和升级最新:
- Install latest RASPBIAN on SD card, you can download image from: https://www.raspberrypi.org/downloads/raspbian/
Update and upgrade latest by running:
sudo apt-get update && sudo apt-get upgrade -y
安装所需的依赖项:
Install required dependencies:
sudo apt-get install git curl gcc libc6-dev libltdl3-dev python-setuptools -y
升级 python pip 安装程序:
Upgrade python pip installer:
sudo -H pip install pip --upgrade
安装 docker 和 docker compose:
Install docker and docker compose:
curl -sSL get.docker.com | shsudo usermod -aG docker pisudo pip install docker-compose
注销/登录终端会话,以便更改生效.
Logout/Login terminal session, so changes will take effect.
按照以下说明安装 golang:https://golang.org/doc/install
Install golang, by following instructions from: https://golang.org/doc/install
创建golang目录:
Create golang directory:
mkdir -p /home/pi/golang && mkdir -p /home/pi/golang/src/github/hyperledger/
定义环境变量
Define environment variable
export GOPATH=/home/pi/golang
确保 go 二进制文件在路径中,例如:
Make sure go binaries are in the path, e.g.:
export PATH=/usr/local/go/bin:$PATH
将 fabric-baseimage 存储库克隆到 /home/pi/golang/src/github/hyperledger/
git clone https://github.com/hyperledger/fabric-baseimage.git
将客户端结构存储库克隆到 /home/pi/golang/src/github/hyperledger/
git clone https://github.com/hyperledger/fabric.git
构建基于 docker 的镜像
Build based docker images
cd ~/golang/src/github/hyperledger/fabric-baseimage && make docker-local
将以下补丁应用到结构代码库:
Apply following patch to fabric code base:
--- a/peer/core.yaml
+++ b/peer/core.yaml
@@ -68,7 +68,6 @@ peer:
# Gossip related configuration
gossip:
- bootstrap: 127.0.0.1:7051
# Use automatically chosen peer (high avalibility) to distribute blocks in channel or static one
# Setting this true and orgLeader true cause panic exit
useLeaderElection: false
@@ -280,7 +279,7 @@ vm:
Config:
max-size: "50m"
max-file: "5"
- Memory: 2147483648
+ Memory: 16777216
和
--- a/core/container/util/dockerutil.go
+++ b/core/container/util/dockerutil.go
@@ -45,6 +45,7 @@ func NewDockerClient() (client *docker.Client, err error) {
// and GOARCH here.
var archRemap = map[string]string{
"amd64": "x86_64",
+ "arm": "armv7l",
}
func getArch() string {
构建 Hyperledger peer 和
Build Hyperledger peer and
cd ~/golang/src/github/hyperledger/fabric && make clean peer peer-docker
对等可执行二进制文件将出现在:
Peer executable binary will appear in:
~/golang/src/github/hyperledger/fabric/build/bin/
这篇关于Raspberry pi 3 上的 Hyperledger Fabric的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!