问题
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?
回答1:
Last time I've tried to run Hyperledger Fabric on RPi I've prepared following instructions:
- 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
Upgrade python pip installer:
sudo -H pip install pip --upgrade
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.
Install golang, by following instructions from: https://golang.org/doc/install
Create golang directory:
mkdir -p /home/pi/golang && mkdir -p /home/pi/golang/src/github/hyperledger/
Define environment variable
export GOPATH=/home/pi/golang
Make sure go binaries are in the path, e.g.:
export PATH=/usr/local/go/bin:$PATH
Clone fabric-baseimage repository into
/home/pi/golang/src/github/hyperledger/
git clone https://github.com/hyperledger/fabric-baseimage.git
Clone client fabric repository into
/home/pi/golang/src/github/hyperledger/
git clone https://github.com/hyperledger/fabric.git
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
AND
--- 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 {
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/
来源:https://stackoverflow.com/questions/45800167/hyperledger-fabric-on-raspberry-pi-3