Catalog
  1. 1. Hyperledger Fabric Installation
    1. 1.1. 환경 구축
      1. 1.1.1. docker 설치
      2. 1.1.2. curl 설치
      3. 1.1.3. 소스코드 빌드 시 필요한 패키지 설치
      4. 1.1.4. nvm 설치
      5. 1.1.5. Go 설치
      6. 1.1.6. Python, Git 설치
      7. 1.1.7. grpc 설치
    2. 1.2. Hyperledger Fabric 설치
      1. 1.2.1. 설치
      2. 1.2.2. 테스트
hyperledger-fabric-installation

Hyperledger Fabric Installation

Docker를 이용해 설치했습니다.

환경 구축

docker 설치

1
2
3
4
5
6
7
8
9
$ sudo apt install docker.io
$ sudo apt install docker-compose
$ sudo apt install software-properties-common

$ sudo usermod -aG docker $USER
$ reboot

$ docker --version
$ docker

curl 설치

1
$ sudo apt-get install curl

소스코드 빌드 시 필요한 패키지 설치

1
$ sudo apt-get install build-essential libssl-dev

nvm 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
$ source ~/.bashrc

or

$ curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh
$ bash install_nvm.sh
$ source ~/.profile

--------------------------------------------------------------------------------------------------

$ nvm install v8.11.1
$ node -v
$ npm -v

Go 설치

1
2
3
4
5
$ curl -O https://storage.googleapis.com/golang/go1.14.1.linux-amd64.tar.gz
$ tar -xvf go1.14.1.linux-amd64.tar.gz
$ sudo mv go /usr/local
$ sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
$ vi ~/.profile
1
2
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

Python, Git 설치

1
2
$ sudo apt install python python-pip
$ sudo apt install git

grpc 설치

1
$ npm install -g grpc

Hyperledger Fabric 설치

설치

1
2
3
4
5
$ mkdir -p $GOPATH/src/github.com/hyperledger
$ cd $GOPATH/src/github.com/hyperledger
$ git clone -b release-1.4 --single-branch https://github.com/hyperledger/fabric.git
$ cd $GOPATH/src/github.com/hyperledger
$ git clone -b release-1.4 --single-branch https://github.com/hyperledger/fabric-samples.git

테스트

1
2
3
4
5
6
7
8
9
10
11
12
13
$ cd $GOPATH/src/github.com/hyperledger/fabric-samples

// hyperledger fabric v1.4.1
$ curl -sSL http://bit.ly/2ysbOFE | bash -s -- 1.4.1

$ cd $GOPATH/src/github.com/hyperledger/fabric-samples/fabcar
$ ./startFabric.sh
$ cd ./javascript
$ node enrollAdmin.js
$ node registerUser.js
$ node query.js
$ node invoke.js
$ node query.js
Author: ch-4ml
Link: https://ch-4ml.github.io/posts/hyperledger-fabric-installation/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment