3. Hyperledger Fabric 설치하기
페이지 정보
작성자 관리자 댓글 0건 조회 2,869회 작성일 19-08-21 23:47본문
3. Hyperledger Fabric 설치하기
Go 언어는 패키지로 설치하지 않고 압축파일을 다운받아 설치한다.
패키지로 설치된 go언어는 지운다.
root@client:~# go version
root@client:~# apt-get remove golang
소스를 다운받아 설치한다.
root@client:~# wget https://storage.googleapis.com/golang/go1.10.4.linux-amd64.tar.gz
root@client:~# tar xvfz go1.10.4.linux-amd64.tar.gz
root@client:~# vi /etc/profile
export GOROOT=/root/go
export GOPATH=/root/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
root@client:~# source /etc/profile
root@client:~# go version
go version go1.10.4 linux/amd64
root@client:~#
root@client:~# wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.06.2~ce-0~ubuntu_amd64.deb
root@client:~# dpkg -i docker-ce_17.06.2~ce-0~ubuntu_amd64.deb
root@client:~# pip install docker-compose
root@client:~# docker-compose --version
docker-compose version 1.25.0, build b42d419
root@client:~/gopath/src/github.com/hyperledger# git clone -b release-1.3 https://github.com/hyperledger/fabric
'fabric'에 복제합니다...
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 115490 (delta 11), reused 42 (delta 10), pack-reused 115447
오브젝트를 받는 중: 100% (115490/115490), 98.75 MiB | 5.37 MiB/s, 완료.
델타를 알아내는 중: 100% (77295/77295), 완료.
root@client:~/gopath/src/github.com/hyperledger#
root@client:~/gopath/src/github.com/hyperledger/fabric# git reset --hard d942308df6302d3510e835bad62f861ad854b4b3
HEAD의 현재 위치는 d942308df입니다 [FAB-12440] disable goimports in linting
root@client:~/gopath/src/github.com/hyperledger/fabric# make native
.build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.3.1 -X github.com/hyperledger/fabric/common/metadata.CommitSHA=d942308df -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.4.13 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.Experimental=false" github.com/hyperledger/fabric/peer
Binary available as .build/bin/peer
.build/bin/orderer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.3.1 -X github.com/hyperledger/fabric/common/metadata.CommitSHA=d942308df -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.4.13 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.Experimental=false" github.com/hyperledger/fabric/orderer
Binary available as .build/bin/orderer
.build/bin/configtxgen
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/tools/configtxgen/metadata.CommitSHA=d942308df" github.com/hyperledger/fabric/common/tools/configtxgen
Binary available as .build/bin/configtxgen
.build/bin/cryptogen
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/tools/cryptogen/metadata.CommitSHA=d942308df" github.com/hyperledger/fabric/common/tools/cryptogen
Binary available as .build/bin/cryptogen
.build/bin/idemixgen
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/tools/idemixgen/metadata.CommitSHA=d942308df" github.com/hyperledger/fabric/common/tools/idemixgen
Binary available as .build/bin/idemixgen
.build/bin/configtxlator
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/tools/configtxlator/metadata.CommitSHA=d942308df" github.com/hyperledger/fabric/common/tools/configtxlator
Binary available as .build/bin/configtxlator
.build/bin/discover
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/.build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/cmd/discover/metadata.Version=1.3.1-snapshot-d942308df" github.com/hyperledger/fabric/cmd/discover
Binary available as .build/bin/discover
root@client:~/gopath/src/github.com/hyperledger/fabric# ls .build/bin/
configtxgen configtxlator cryptogen discover idemixgen orderer peer
root@client:~/gopath/src/github.com/hyperledger/fabric#
root@client:~/gopath/src/github.com/hyperledger/fabric# make peer-docker
root@client:~/gopath/src/github.com/hyperledger/fabric# make orderer-docker
root@client:~/gopath/src/github.com/hyperledger/fabric# make tools-docker
root@client:~/gopath/src/github.com/hyperledger/fabric# vi .build/image/tools/Dockerfile
# Copyright Greg Haskins All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
FROM hyperledger/fabric-baseimage:amd64-0.4.13 as builder
WORKDIR /opt/gopath
RUN mkdir src && mkdir pkg && mkdir bin
ADD . src/github.com/hyperledger/fabric
WORKDIR /opt/gopath/src/github.com/hyperledger/fabric
ENV EXECUTABLES go git curl
RUN make configtxgen configtxlator cryptogen peer discover idemixgen
FROM hyperledger/fabric-baseimage:amd64-0.4.13
ENV FABRIC_CFG_PATH /etc/hyperledger/fabric
#RUN apt-get update && apt-get install -y jq
VOLUME /etc/hyperledger/fabric
COPY --from=builder /opt/gopath/src/github.com/hyperledger/fabric/.build/bin /usr/local/bin
COPY --from=builder /opt/gopath/src/github.com/hyperledger/fabric/sampleconfig $FABRIC_CFG_PATH
LABEL org.hyperledger.fabric.version=1.3.1 \
org.hyperledger.fabric.base.version=0.4.13
~
root@client:~/gopath/src/github.com/hyperledger/fabric# make tools-docker
root@client:~/gopath/src/github.com/hyperledger/fabric# make gotools
root@client:~/gopath/src/github.com/hyperledger/fabric# mkdir -p .build/docker/gotools/bin/
root@client:~/gopath/src/github.com/hyperledger/fabric# cp ~/gopath/bin/protoc-gen-go .build/docker/gotools/bin/
root@client:~/gopath/src/github.com/hyperledger/fabric# make ccenv
root@client:~/gopath/src/github.com/hyperledger/fabric# make buildenv
root@client:~/gopath/src/github.com/hyperledger/fabric# make testenv
root@client:~/gopath/src/github.com/hyperledger/fabric# vi .build/image/testenv/payload/install-softhsm2.sh
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
ARCH=`uname -m`
if [ $ARCH = "s390x" ]; then
echo "deb http://ftp.us.debian.org/debian sid main" >> /etc/apt/sources.list
fi
# Install softhsm2 package
#apt-get update
#apt-get -y install softhsm2
# Create tokens directory
#mkdir -p /var/lib/softhsm/tokens/
#Initialize token
".build/image/testenv/payload/install-softhsm2.sh" 24 lines, 476 characters
root@client:~/gopath/src/github.com/hyperledger/fabric# make testenv
root@client:~/gopath/src/github.com/hyperledger/fabric# mkdir -p /var/lib/softhsm/tokens/
root@client:~/gopath/src/github.com/hyperledger/fabric# softhsm2-util --init-token --slot 0 --label "ForFabric" --so-pin 1234 --pin 98765432
The token has been initialized.
root@client:~/gopath/src/github.com/hyperledger/fabric#
root@client:~/gopath/src/github.com/hyperledger/fabric# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger/fabric-testenv amd64-1.3.1-snapshot-d942308df 474d50233dcb 2 minutes ago 1.4GB
hyperledger/fabric-testenv amd64-latest 474d50233dcb 2 minutes ago 1.4GB
hyperledger/fabric-testenv latest 474d50233dcb 2 minutes ago 1.4GB
<none> <none> 94f57866ac00 4 minutes ago 1.4GB
hyperledger/fabric-buildenv amd64-1.3.1-snapshot-d942308df 9a32072f3ad1 5 minutes ago 1.35GB
hyperledger/fabric-buildenv amd64-latest 9a32072f3ad1 5 minutes ago 1.35GB
hyperledger/fabric-buildenv latest 9a32072f3ad1 5 minutes ago 1.35GB
hyperledger/fabric-ccenv amd64-1.3.1-snapshot-d942308df 1a75be83a3f5 6 minutes ago 1.38GB
hyperledger/fabric-ccenv amd64-latest 1a75be83a3f5 6 minutes ago 1.38GB
hyperledger/fabric-ccenv latest 1a75be83a3f5 6 minutes ago 1.38GB
hyperledger/fabric-tools amd64-1.3.1-snapshot-d942308df 2bcbc07aeb56 9 minutes ago 1.45GB
hyperledger/fabric-tools amd64-latest 2bcbc07aeb56 9 minutes ago 1.45GB
hyperledger/fabric-tools latest 2bcbc07aeb56 9 minutes ago 1.45GB
<none> <none> 859513f247ef 13 minutes ago 1.61GB
hyperledger/fabric-orderer amd64-1.3.1-snapshot-d942308df 9840436885c4 20 minutes ago 145MB
hyperledger/fabric-orderer amd64-latest 9840436885c4 20 minutes ago 145MB
hyperledger/fabric-orderer latest 9840436885c4 20 minutes ago 145MB
hyperledger/fabric-peer amd64-1.3.1-snapshot-d942308df 60a85493de80 24 minutes ago 151MB
hyperledger/fabric-peer amd64-latest 60a85493de80 24 minutes ago 151MB
hyperledger/fabric-peer latest 60a85493de80 24 minutes ago 151MB
hyperledger/fabric-baseimage amd64-0.4.13 27240288889f 10 months ago 1.34GB
hyperledger/fabric-baseos amd64-0.4.13 f0fe49196c40 10 months ago 124MB
root@client:~/gopath/src/github.com/hyperledger/fabric#
root@client:~/# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger/fabric-buildenv amd64-1.4.3-snapshot-1e54df2ea 7ab946fdbba5 2 hours ago 1.4GB
hyperledger/fabric-buildenv amd64-latest 7ab946fdbba5 2 hours ago 1.4GB
hyperledger/fabric-buildenv latest 7ab946fdbba5 2 hours ago 1.4GB
hyperledger/fabric-ccenv amd64-1.4.3-snapshot-1e54df2ea b9900a2b666c 2 hours ago 1.43GB
hyperledger/fabric-ccenv amd64-latest b9900a2b666c 2 hours ago 1.43GB
hyperledger/fabric-ccenv latest b9900a2b666c 2 hours ago 1.43GB
hyperledger/fabric-tools amd64-1.4.3-snapshot-1e54df2ea 70a539906010 2 hours ago 1.52GB
hyperledger/fabric-tools amd64-latest 70a539906010 2 hours ago 1.52GB
hyperledger/fabric-tools latest 70a539906010 2 hours ago 1.52GB
<none> <none> e120ac7e233c 2 hours ago 1.68GB
hyperledger/fabric-orderer amd64-1.4.3-snapshot-1e54df2ea 12cd81ee965b 2 hours ago 173MB
hyperledger/fabric-orderer amd64-latest 12cd81ee965b 2 hours ago 173MB
hyperledger/fabric-orderer latest 12cd81ee965b 2 hours ago 173MB
hyperledger/fabric-peer amd64-1.4.3-snapshot-1e54df2ea 5238bd93a160 2 hours ago 179MB
hyperledger/fabric-peer amd64-latest 5238bd93a160 2 hours ago 179MB
hyperledger/fabric-peer latest 5238bd93a160 2 hours ago 179MB
hyperledger/fabric-baseimage amd64-0.4.15 c4c532c23a50 5 months ago 1.39GB
hyperledger/fabric-baseos amd64-0.4.15 9d6ec11c60ff 5 months ago 145MB
root@client:~/#
root@client:~/gopath/src/github.com/hyperledger/fabric# make protos
root@client:~/gopath/src/github.com/hyperledger/fabric# make docker-list
hyperledger/fabric-peer:amd64-1.3.1-snapshot-d942308df
hyperledger/fabric-orderer:amd64-1.3.1-snapshot-d942308df
hyperledger/fabric-ccenv:amd64-1.3.1-snapshot-d942308df
hyperledger/fabric-buildenv:amd64-1.3.1-snapshot-d942308df
hyperledger/fabric-testenv:amd64-1.3.1-snapshot-d942308df
hyperledger/fabric-tools:amd64-1.3.1-snapshot-d942308df
root@client:~/gopath/src/github.com/hyperledger/fabric#
root@client:~/gopath/src/github.com/hyperledger/fabric# cd $FABRIC_HOME/examples/e2e_cli
root@client:~/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli# ./network_setup.sh up
Creating cli ... done
____ _____ _ ____ _____ _____ ____ _____
/ ___| |_ _| / \ | _ \ |_ _| | ____| |___ \ | ____|
\___ \ | | / _ \ | |_) | | | _____ | _| __) | | _|
___) | | | / ___ \ | _ < | | |_____| | |___ / __/ | |___
|____/ |_| /_/ \_\ |_| \_\ |_| |_____| |_____| |_____|
Channel name : mychannel
Check orderering service availability...
Attempting to fetch system channel 'e2e-orderer-syschan' ...3 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...10 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...17 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...24 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...30 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...36 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...42 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...49 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...55 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...61 secs
root@client:~/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli# ./network_setup.sh down
댓글목록
등록된 댓글이 없습니다.