# Hyperledger Korea UserGroup Meetup

# 2019๋…„ 03์›” 21์ผ

# ์ฃผ์ œ

  • ๋ฉ€ํ‹ฐ ๋…ธ๋“œ์—์„œ ํ•˜์ดํผ๋ ˆ์ € ํŒจ๋ธŒ๋ฆญ ๋„คํŠธ์›Œํฌ ๊ตฌ์„ฑํ•˜๊ธฐ

# ์‚ฌ์ „ ์ž‘์—…

# 1. Virtual Box & Ubuntu ์„ค์น˜

# 1.1. Virtual Box ๋‹ค์šด๋กœ๋“œ ๋ฐ ์„ค์น˜

์•„๋ž˜ ์‚ฌ์ดํŠธ์—์„œ Virtual Box๋ฅผ ๋‹ค์šด๋กœ๋“œํ•œ ํ›„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

  • https://www.virtualbox.org/wiki/Downloads
  • ์„ค์น˜ ๋™์˜์ƒ - https://www.youtube.com/watch?v=4ZI7Z8S4d0Y

# 1.2. Ubuntu 16.04(Server) ์„ค์น˜

# 1.2.1 ๋‹ค์šด๋กœ๋“œ

์•„๋ž˜ ์‚ฌ์ดํŠธ์—์„œ Ubuntu 16.04 Server ISOํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œ ํ•ฉ๋‹ˆ๋‹ค.

  • http://ftp.kaist.ac.kr/ubuntu-cd/16.04/ubuntu-16.04.6-server-amd64.iso

# 1.2.2 Virtual Box์— VM(Virtual Machine) ์ƒ์„ฑ

์•„๋ž˜ ์‚ฌ์ดํŠธ๋ฅผ ์ฐธ์กฐํ•ด์„œ VM์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  • https://moomini.tistory.com/10
    • VM ๊ฐฏ์ˆ˜: 2๊ฐœ
    • VM ๋ช…: node1, node2
    • CPU: 2๊ฐœ
    • Memory: 1~2GB
    • Disk: 15GB~

์ƒ์„ฑํ•œ ํ›„ ์ •์ƒ์ ์œผ๋กœ ์ธํ„ฐ๋„ท์ด ๋˜๋Š” ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

$ curl http://google.com
1

# 1.2.3 ํ˜ธ์ŠคํŠธ ์ „์šฉ ์–ด๋Œ‘ํ„ฐ ์„ค์ •

VM๊ฐ„ ํ†ต์‹ ์„ ์œ„ํ•ด ์–ด๋Œ‘ํ„ฐ 2์— ํ˜ธ์ŠคํŠธ ์ „์šฉ ์–ด๋Œ‘ํ„ฐ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  • ์ฐธ๊ณ  ๋ฌธ์„œ - http://blog.hkwon.me/virtualbox-hoseuteu-jeonyong-eodaebteo-seoljeong-2/

# 1.2.3.1 ํ˜ธ์ŠคํŠธ ๋„คํŠธ์›Œํฌ ๊ด€๋ฆฌ์ž ์„ค์ •

ํŒŒ์ผ_ํ˜ธ์ŠคํŠธ ๋„คํŠธ์›Œํฌ ๊ด€๋ฆฌ์ž

ํ˜ธ์ŠคํŠธ ๋„คํŠธ์›Œํฌ ๊ด€๋ฆฌ์ž์˜ ์ •๋ณด๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ํ˜ธ์ŠคํŠธ ์ „์šฉ ์–ด๋Œ‘ํ„ฐ๊ฐ€ ์ด๋ฏธ ์žˆ๋Š” ๊ฒฝ์šฐ๋Š” ๊ธฐ์กด ์ •๋ณด๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•˜๊ณ  ์—†๋Š” ๊ฒฝ์šฐ๋Š” **์ƒ์„ฑ(Create)**๋ฒ„ํŠผ์„ ํ†ตํ•ด ์ƒ์„ฑํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

  • IP ์ฃผ์†Œ: 192.168.56.1
  • IP ์„œ๋ธŒ๋„ท ๋งˆ์Šคํฌ: 255.255.255.0

image-20190305001411040

# 1.2.3.2 VM์— ํ˜ธ์ŠคํŠธ ์ „์šฉ ์–ด๋Œ‘ํ„ฐ ์ถ”๊ฐ€

VM ์„ค์ •์˜ ๋„คํŠธ์›Œํฌ ํ•ญ๋ชฉ์—์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ์–ด๋Œ‘ํ„ฐ 2๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ์ฐธ๊ณ ๋กœ ์–ด๋Œ‘ํ„ฐ 1์€ NAT๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

VM Network

# 1.2.3.3 Ubuntu ๋„คํŠธ์›Œํฌ ์–ด๋Œ‘ํ„ฐ ์ถ”๊ฐ€

Ubuntu์— ๋กœ๊ทธ์ธํ•œ ํ›„ ifconfig ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๋ฉด enp0s8 ์–ด๋Œ‘ํ„ฐ๊ฐ€ ์ถ”๊ฐ€๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

$ ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:98:05:5c:67
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

enp0s3    Link encap:Ethernet  HWaddr 08:00:27:57:ca:06
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe57:ca06/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:352 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:428882 (428.8 KB)  TX bytes:8090 (8.0 KB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:4b:89:26
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:127 errors:0 dropped:0 overruns:0 frame:0
          TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11397 (11.3 KB)  TX bytes:15267 (15.2 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0
          TX packets:172 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:12560 (12.5 KB)  TX bytes:12560 (12.5 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

์•„๋ž˜์™€ ๊ฐ™์ด enp0s8 ์–ด๋Œ‘ํ„ฐ์— ๋„คํŠธ์›Œํฌ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  • node1 VM - 192.168.56.2
  • node2 VM - 192.168.56.3
$ sudo vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp

auto enp0s8
iface enp0s8 inet static
address 192.168.56.2
netmask 255.255.255.0
network 192.168.56.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

๋„คํŠธ์›Œํฌ ์–ด๋Œ‘ํ„ฐ ์ •๋ณด ์ถ”๊ฐ€ํ•œ ํ›„ ๋„คํŠธ์›Œํฌ ์„œ๋น„์Šค๋ฅผ ์žฌ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

$ sudo systemctl restart networking
1

์ •์ƒ์ ์œผ๋กœ ๋„คํŠธ์›Œํฌ ์„œ๋น„์Šค๊ฐ€ ์žฌ์‹œ์ž‘๋œ ํ›„ ๊ฐ VM์—์„œ ๋‹ค๋ฅธ VM์œผ๋กœ ping ํ”„๋กœ๊ทธ๋žจ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋„คํŠธ์›Œํฌ ์ ‘์†์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  • node1(192.168.56.2) VM์—์„œ node2(192.168.56.3) VM ์ ‘์† ํ™•์ธ
yhchung@node1:~$ ping 192.168.56.3
PING 192.168.56.3 (192.168.56.3) 56(84) bytes of data.
64 bytes from 192.168.56.3: icmp_seq=1 ttl=64 time=0.024 ms
64 bytes from 192.168.56.3: icmp_seq=2 ttl=64 time=0.038 ms
^C
--- 192.168.56.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.024/0.031/0.038/0.007 ms
1
2
3
4
5
6
7
8
  • node2(192.168.56.3) VM์—์„œ node1(192.168.56.2) VM ์ ‘์† ํ™•์ธ
yhchung@node2:~$ ping 192.168.56.2
PING 192.168.56.2 (192.168.56.2) 56(84) bytes of data.
64 bytes from 192.168.56.2: icmp_seq=1 ttl=64 time=0.024 ms
64 bytes from 192.168.56.2: icmp_seq=2 ttl=64 time=0.038 ms
^C
--- 192.168.56.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.024/0.031/0.038/0.007 ms
1
2
3
4
5
6
7
8
  • ํ˜ธ์ŠคํŠธ(Mac, Windows)์—์„œ ssh ๋˜๋Š” putty๋ฅผ ์ด์šฉํ•˜์—ฌ ์ ‘์† ํ™•์ธ
$ ssh yhchung@192.168.56.2
yhchung@192.168.56.2's password:
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-142-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

11 packages can be updated.
3 updates are security updates.

New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Mon Feb 25 21:58:32 2019 from 192.168.56.1
yhchung@node1:~$
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# 2. Docker ์„ค์น˜

๊ธฐ์กด์— ์„ค์น˜๋œ Docker ์—”์ง„์„ ๋จผ์ € ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

$ sudo apt-get remove docker docker-engine docker.i
1

์˜์กด์„ฑ(depedencies) ํŒจํ‚ค์ง€๋ฅผ ๋จผ์ € ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
1
2
3
4
5

Docker ๋ ˆํฌ์ง€ํ† ๋ฆฌ GPG ํ‚ค๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

$ sudo add-apt-repository \
 "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
 $(lsb_release -cs) \
 stable"
1
2
3
4
5
6

Docker๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

$ sudo apt-get update
$ sudo apt-get install docker-ce
1
2

ํ˜„์žฌ ์‚ฌ์šฉ์ž์—๊ฒŒ Docker์—”์ง„ ์ œ์–ด ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•˜๊ธฐ ์œ„ํ•ด docker ๊ทธ๋ฃน์— ํฌํ•จ์‹œํ‚ต๋‹ˆ๋‹ค.

$ sudo usermod -a -G docker $USER
1

ํ„ฐ๋ฏธ๋„/์ฝ˜์†” ์žฌ ๋กœ๊ทธ์ธ ํ›„ ๋„์ปค๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๋˜์—ˆ๋Š” ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

$ docker version
Client:
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        6247962
 Built:             Sun Feb 10 04:13:50 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 03:42:13 2019
  OS/Arch:          linux/amd64
  Experimental:     false
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# 3. Docker Compose ์„ค์น˜

Docker Compose ํŒŒ์ผ์„ /usr/local/bin ๋””๋ ‰ํ† ๋ฆฌ์— ๋‹ค์šด๋กœ๋“œ ํ•ฉ๋‹ˆ๋‹ค.

$ sudo curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
1

Docker Compose ํŒŒ์ผ(docker-compose)์— ์‹คํ–‰๊ถŒํ•œ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

$ sudo chmod +x /usr/local/bin/docker-compose
1

Docker Compose๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๋˜์—ˆ๋Š” ์ง€ ํ™•์ธ ํ•ฉ๋‹ˆ๋‹ค.

$ docker-compose --version
docker-compose version 1.23.2, build 1110ad01
1
2

# 4. First Network ๊ตฌ์„ฑํ•˜๊ธฐ

Hyperledger Fabric์˜ ์ƒ˜ํ”Œ ์ค‘์— first-network ์„ ์‚ฌ์šฉํ•˜์—ฌ 2๊ฐœ์˜ VM์— ๊ฐ๊ฐ ๊ตฌ์„ฑํ•ด ๋ด…๋‹ˆ๋‹ค

  • ์ฐธ๊ณ  ๋ฌธ์„œ - https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html

Github์—์„œ fabric-samples ์†Œ์Šค๋ฅผ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์Šต๋‹ˆ๋‹ค.

$ git clone https://github.com/hyperledger/fabric-samples.git ~/fabric-samples
1

๋„คํŠธ์›Œํฌ ๊ตฌ์„ฑ์— ํ•„์š”ํ•œ ๋ฐ”์ด๋„ˆ๋ฆฌ ํŒŒ์ผ ๋ฐ Docker Image๋ฅผ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์Šต๋‹ˆ๋‹ค.

$ cd ~/fabric-samples/scripts
$ ./bootstrap.sh 1.4.0

Installing Hyperledger Fabric binaries

===> Downloading version 1.4.0 platform specific fabric binaries
===> Downloading:  https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.4.0/hyperledger-fabric-linux-amd64-1.4.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 50.9M  100 50.9M    0     0  1334k      0  0:00:39  0:00:39 --:--:-- 1799k
==> Done.
===> Downloading version 1.4.0 platform specific fabric-ca-client binary
===> Downloading:  https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/linux-amd64-1.4.0/hyperledger-fabric-ca-linux-amd64-1.4.0.tar.gz
==> Partial binary file found. Resuming download...
==> File downloaded. Verifying the md5sum...
==> Extracting hyperledger-fabric-ca-linux-amd64-1.4.0.tar.gz...
==> Done.

Installing Hyperledger Fabric docker images
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

์ƒ˜ํ”Œ ์†Œ์Šค์ค‘ first-network ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

$ cd ../first-network
1

# 4.1 Network Artifacts ์ƒ์„ฑ

๋„คํŠธ์›Œํฌ ๊ตฌ์„ฑ์— ํ•„์š”ํ•œ MSP, Genesis Block, Channel Tx,โ€ฆ๋“ฑ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

$ ./byfn.sh generate
./byfn.sh generate
Generating certs and genesis block for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
/home/yhchung/fabric-samples/first-network/../bin/cryptogen

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x

/home/yhchung/fabric-samples/first-network/../bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
CONSENSUS_TYPE=solo
+ '[' solo == solo ']'
+ configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
2019-03-06 23:50:10.048 KST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-03-06 23:50:10.076 KST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: solo
2019-03-06 23:50:10.076 KST [common.tools.configtxgen.localconfig] Load -> INFO 003 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.101 KST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 004 orderer type: solo
2019-03-06 23:50:10.102 KST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 005 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.103 KST [common.tools.configtxgen] doOutputBlock -> INFO 006 Generating genesis block
2019-03-06 23:50:10.104 KST [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
+ res=0
+ set +x

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2019-03-06 23:50:10.134 KST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-03-06 23:50:10.157 KST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.181 KST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-03-06 23:50:10.181 KST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.181 KST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 005 Generating new channel configtx
2019-03-06 23:50:10.184 KST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 006 Writing new channel tx
+ res=0
+ set +x

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2019-03-06 23:50:10.212 KST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-03-06 23:50:10.234 KST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.255 KST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-03-06 23:50:10.256 KST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.256 KST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-03-06 23:50:10.257 KST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +x

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
2019-03-06 23:50:10.279 KST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-03-06 23:50:10.299 KST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.320 KST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-03-06 23:50:10.320 KST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/yhchung/fabric-samples/first-network/configtx.yaml
2019-03-06 23:50:10.320 KST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-03-06 23:50:10.321 KST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

# 4.2 Network ์‹คํ–‰ํ•˜๊ธฐ

2๊ฐœ Org์— ๊ฐ Org๋งˆ๋‹ค 2๊ฐœ์˜ Peer๋ฅผ ๊ฐ€์ง„ ๋„คํŠธ์›Œํฌ๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

$ ./byfn.sh up
abric-samples/first-network$ ./byfn.sh up
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
LOCAL_VERSION=1.4.0
DOCKER_IMAGE_VERSION=1.4.0
...
===================== Channel 'mychannel' created =====================
===================== peer0.org1 joined channel 'mychannel' =====================
===================== peer1.org1 joined channel 'mychannel' =====================
===================== peer0.org2 joined channel 'mychannel' =====================
===================== peer1.org2 joined channel 'mychannel' =====================
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' =====================
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================
===================== Chaincode is installed on peer0.org1 =====================
===================== Chaincode is installed on peer0.org2 =====================
===================== Chaincode is instantiated on peer0.org2 on channel 'mychannel' =====================
===================== Querying on peer0.org1 on channel 'mychannel'... =====================
===================== Query successful on peer0.org1 on channel 'mychannel' =====================
===================== Invoke transaction successful on peer0.org1 peer0.org2 on channel 'mychannel' =====================
===================== Chaincode is installed on peer1.org2 =====================
===================== Querying on peer1.org2 on channel 'mychannel'... =====================
===================== Query successful on peer1.org2 on channel 'mychannel' =====================
========= All GOOD, BYFN execution completed ===========


 _____   _   _   ____
| ____| | \ | | |  _ \
|  _|   |  \| | | | | |
| |___  | |\  | | |_| |
|_____| |_| \_| |____/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

# 4.3 Network ์ œ๊ฑฐํ•˜๊ธฐ

Docker Container, Volume, Network์„ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

$ ./byfn.sh down
Stopping for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
Stopping cli                    ... done
Stopping peer1.org1.example.com ... done
Stopping peer0.org1.example.com ... done
Stopping peer0.org2.example.com ... done
Stopping peer1.org2.example.com ... done
Stopping orderer.example.com    ... done
Removing cli                    ... done
Removing peer1.org1.example.com ... done
Removing peer0.org1.example.com ... done
Removing peer0.org2.example.com ... done
Removing peer1.org2.example.com ... done
Removing orderer.example.com    ... done
Removing network net_byfn
Removing volume net_orderer.example.com
Removing volume net_peer0.org1.example.com
Removing volume net_peer1.org1.example.com
Removing volume net_peer0.org2.example.com
Removing volume net_peer1.org2.example.com
Removing volume net_peer0.org3.example.com
WARNING: Volume net_peer0.org3.example.com not found.
Removing volume net_peer1.org3.example.com
WARNING: Volume net_peer1.org3.example.com not found.
703fcdc93c08
456ec322278d
77f524ea6411
Untagged: dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab:latest
Deleted: sha256:132bd63a89b8300197b48de8639a1c06cff85a19892ed44e5733ff09fbf5148e
Deleted: sha256:d6196392dca7b9ebdead839d7fee516841a4f06e0255ca2cd60ff161bbbffba4
Deleted: sha256:ed0413b7ce7d8aa11145d3cea9b928ed4d8422b3dec94ae0b78c826ee4b32b7a
Deleted: sha256:afbd0d836f4c62d76d8bc77e361053a4c4d4f3aa12b51e26e0bae355a9645c1e
Untagged: dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9:latest
Deleted: sha256:7bed5469204c52cb54c1ff27385ed0832686aa55a352b9e5684d6d76778d9274
Deleted: sha256:2de292838ce06c80d465beaf547e412ac9f99d204412263b8914357e3d55689c
Deleted: sha256:53af16e7907c24cd67051b00590bd54d86e8e413a43c2989e024211f4496230a
Deleted: sha256:20b361d49f8d77522b9ce03fa7e3956f6f6fde13a36dbb02d79d9952f186ebee
Untagged: dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b:latest
Deleted: sha256:3ce1da383ac2cfa767cdb2d84e50e3260c2ec5a1dbbf5c47b530471a2b7a7c99
Deleted: sha256:d11d98c0c6ccc3425a290e0b04519f9d040874d6204724dab728f11c2885be53
Deleted: sha256:f606190cd2099fd4123357645f149822ad9b4b62cbbe7ac982be535881ce229e
Deleted: sha256:272a490801e173030a8f4bfd552d3da2f4c56a7896b646a589f24efc12ee17db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

# ๋Š๋‚€์ 

์•„์‰ฝ๋‹ค.