centos7下原始碼方式安裝fabric1.0

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

安裝docker

yum -y install docker
docker version
啟用docker官方中國區加速器:
vim /etc/sysconfig/docker
--registry-mirror=https://registry.docker-cn.com
service docker start

安裝docker-compose(本節暫時未用到)

yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
pip install docker-compose

安裝go

wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
tar -xvf go1.8.3.linux-amd64.tar.gz
mv go /usr/local/
mkdir -p /root/golang
vim /etc/profile
export GOPATH=/root/golang
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
source /etc/profile
為解決fabric編譯報錯:can't load package: package github.com/hyperledger/fabric/peer: open /opt/gopath/src/github.com/hyperledger/fabric/peer: permission denied
ln -s $GOPATH /opt/gopath

安裝git

yum -y install git

Fabric源碼下載

git clone https://github.com/hyperledger/fabric $GOPATH/src/github.com/hyperledger/fabric
git clone https://github.com/hyperledger/fabric-ca $GOPATH/src/github.com/hyperledger/fabric-ca

go get github.com/hyperledger/fabric
go get github.com/hyperledger/fabric-ca

編譯fabric代碼

cd $GOPATH/src/github.com/hyperledger/fabric
make all
cp build/bin/* $GOPATH/bin/

解決編譯fabric過程中報錯

如下為解決:package github.com/golang/lint/golint: mkdir /opt/gotools/obj/gopath: permission denied
git clone https://github.com/golang/tools.git $GOPATH/src/golang.org/x/tools
go get -u github.com/golang/lint/golint
go install github.com/golang/lint/golint

如下為解決:cp: cannot stat ‘build/docker/gotools/bin/protoc-gen-go’: No such file or directory
yum -y install protobuf
go get github.com/golang/protobuf/protoc-gen-go
cd $GOPATH/src/github.com/golang/protobuf/
gmake all
cd $GOPATH/src/github.com/hyperledger/fabric
cp $GOPATH/bin/protoc-gen-go build/docker/gotools/bin/

如下為解決:vendor/github.com/miekg/pkcs11/pkcs11.go:29:18: fatal error: ltdl.h: No such file or directory
yum -y install libtool-ltdl-devel

如下為解決:can't load package: package github.com/hyperledger/fabric-ca/cmd/fabric-ca-client: open /opt/gopath/src/github.com/hyperledger/fabric-ca/cmd/fabric-ca-client: permission denied
臨時關閉selinux:su -c "setenforce 0"
參考文檔:http://www.linuxidc.com/Linux/2015-03/115124.htm

編譯fabric-ca代碼

make all

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.