ubuntu16.04 under source code mode installation fabric1.0

Source: Internet
Author: User
Tags install go
This is a creation in Article, where the information may have evolved or changed.

Install 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
To resolve the fabric compilation error: 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

Install dependent packages

Apt-get Update
Apt-get install-y libsnappy-dev zlib1g-dev libbz2-dev libltdl-dev libtool

Installing Docker

Curl-fssl https://get.docker.com/| Sh

Install Docker-compose (not available in this section)

Pip Install Docker-compose

Fabric Source Download

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
Or
Go get github.com/hyperledger/fabric
Go get Github.com/hyperledger/fabric-ca

Compiling fabric Code

CD $GOPATH/src/github.com/hyperledger/fabric
Make native
Make Docker
CP build/bin/* $GOPATH/bin/

Resolve error during compilation of fabric

Resolved as follows: Package golang.org/x/tools/go/gcexportdata:unrecognized import Path "Golang.org/x/tools/go/gcexportdata"
git clone https://github.com/golang/tools.git $GOPATH/src/golang.org/x/tools

Resolved as follows: Cp:cannot stat ' build/docker/gotools/bin/protoc-gen-go ': No such file or directory
Go get github.com/golang/protobuf/protoc-gen-go
CD $GOPATH/src/github.com/golang/protobuf/
Make all
CD $GOPATH/src/github.com/hyperledger/fabric
CP $GOPATH/bin/protoc-gen-go build/docker/gotools/bin/

Resolved as follows:./scripts/golinter.sh:line 28:goimports:command not found
Apt Install Golang-golang-x-tools

Compiling FABRIC-CA Code

CD $GOPATH/src/github.com/hyperledger/fabric-ca
Make Docker

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.