출처 : Using the Fabric test network
yujeong@yujeong-VirtualBox:~/바탕화면$ cd yujeong@yujeong-VirtualBox:~$ go version go version go1.14.12 linux/amd64 yujeong@yujeong-VirtualBox:~$ cd $GOPATH/src yujeong@yujeong-VirtualBox:~/go/src$ cd yujeong@yujeong-VirtualBox:~$ sudo dnf install jq [sudo] yujeong 암호: sudo: dnf: 명령이 없습니다 yujeong@yujeong-VirtualBox:~$ sudo apt-get install jq 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다... 완료 상태 정보를 읽는 중입니다... 완료 다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다: bridge-utils systemd-hwe-hwdb ubuntu-fan 'sudo apt autoremove'를 이용하여 제거하십시오. 다음의 추가 패키지가 설치될 것입니다 : libjq1 libonig5 다음 새 패키지를 설치할 것입니다: jq libjq1 libonig5 0개 업그레이드, 3개 새로 설치, 0개 제거 및 409개 업그레이드 안 함. 357 k바이트 아카이브를 받아야 합니다. 이 작업 후 1,087 k바이트의 디스크 공간을 더 사용하게 됩니다. 계속 하시겠습니까? [Y/n] y 받기:1 http://kr.archive.ubuntu.com/ubuntu jammy/main amd64 libonig5 amd64 6.9.7.1-2build1 [172 kB] 받기:2 http://kr.archive.ubuntu.com/ubuntu jammy/main amd64 libjq1 amd64 1.6-2.1ubuntu3 [133 kB] 받기:3 http://kr.archive.ubuntu.com/ubuntu jammy/main amd64 jq amd64 1.6-2.1ubuntu3 [52.5 kB] 내려받기 357 k바이트, 소요시간 3초 (133 k바이트/초) Selecting previously unselected package libonig5:amd64. (데이터베이스 읽는중 ...현재 200381개의 파일과 디렉터리가 설치되어 있습니다.) Preparing to unpack .../libonig5_6.9.7.1-2build1_amd64.deb ... Unpacking libonig5:amd64 (6.9.7.1-2build1) ... Selecting previously unselected package libjq1:amd64. Preparing to unpack .../libjq1_1.6-2.1ubuntu3_amd64.deb ... Unpacking libjq1:amd64 (1.6-2.1ubuntu3) ... Selecting previously unselected package jq. Preparing to unpack .../jq_1.6-2.1ubuntu3_amd64.deb ... Unpacking jq (1.6-2.1ubuntu3) ... libonig5:amd64 (6.9.7.1-2build1) 설정하는 중입니다 ... libjq1:amd64 (1.6-2.1ubuntu3) 설정하는 중입니다 ... jq (1.6-2.1ubuntu3) 설정하는 중입니다 ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for libc-bin (2.35-0ubuntu3.1) ... yujeong@yujeong-VirtualBox:~$ curl -sSL https://bit.ly/2ysbOFE | bash -s 2.5.4 1.5.6 Clone hyperledger/fabric-samples repo ===> Cloning hyperledger/fabric-samples repo 'fabric-samples'에 복제합니다... remote: Enumerating objects: 12502, done. remote: Counting objects: 100% (535/535), done. remote: Compressing objects: 100% (304/304), done. remote: Total 12502 (delta 252), reused 393 (delta 204), pack-reused 11967 오브젝트를 받는 중: 100% (12502/12502), 22.51 MiB | 3.22 MiB/s, 완료. 델타를 알아내는 중: 100% (6706/6706), 완료. fabric-samples v2.5.4 does not exist, defaulting to main. fabric-samples main branch is intended to work with recent versions of fabric. Pull Hyperledger Fabric binaries ===> Downloading version 2.5.4 platform specific fabric binaries ===> Downloading: https://github.com/hyperledger/fabric/releases/download/v2.5.4/hyperledger-fabric-linux-amd64-2.5.4.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 99.3M 100 99.3M 0 0 4607k 0 0:00:22 0:00:22 --:--:-- 5255k ==> Done. ===> Downloading version 1.5.6 platform specific fabric-ca-client binary ===> Downloading: https://github.com/hyperledger/fabric-ca/releases/download/v1.5.6/hyperledger-fabric-ca-linux-amd64-1.5.6.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 30.6M 100 30.6M 0 0 3697k 0 0:00:08 0:00:08 --:--:-- 4443k ==> Done. Pull Hyperledger Fabric docker images FABRIC_IMAGES: peer orderer ccenv tools baseos ===> Pulling fabric Images ====> docker.io/hyperledger/fabric-peer:2.5.4 2.5.4: Pulling from hyperledger/fabric-peer 01085d60b3a6: Pull complete 5920bb1ab585: Pull complete 0c13247db338: Pull complete f1ebf2febfff: Pull complete 7ba246813ff2: Pull complete 20e090879749: Pull complete Digest: sha256:c2e735a3cb8250c47ed3589294b3f0c078004ec001b949710f334736651e106d Status: Downloaded newer image for hyperledger/fabric-peer:2.5.4 docker.io/hyperledger/fabric-peer:2.5.4 ====> docker.io/hyperledger/fabric-orderer:2.5.4 2.5.4: Pulling from hyperledger/fabric-orderer 01085d60b3a6: Already exists 0ec39628d119: Pull complete c9ef912f2449: Pull complete 5f267c8c968e: Pull complete 54a738441be6: Pull complete d6c2bf9dde2f: Pull complete Digest: sha256:1a7144705b435062f4be2886de98d0408165cf51326ec721c3f58b40bf8bf139 Status: Downloaded newer image for hyperledger/fabric-orderer:2.5.4 docker.io/hyperledger/fabric-orderer:2.5.4 ====> docker.io/hyperledger/fabric-ccenv:2.5.4 2.5.4: Pulling from hyperledger/fabric-ccenv 01085d60b3a6: Already exists 0a0dd1fd96cb: Pull complete 6511dcb32b75: Pull complete a1ad41013466: Pull complete 7b4bed92341a: Pull complete 9c0ab6ce970a: Pull complete d79fd538cbf0: Pull complete Digest: sha256:b7d312c0f8d4530c6ff4b3ef7277f0338f486d0b617c3012415a32308cbc2254 Status: Downloaded newer image for hyperledger/fabric-ccenv:2.5.4 docker.io/hyperledger/fabric-ccenv:2.5.4 ====> docker.io/hyperledger/fabric-tools:2.5.4 2.5.4: Pulling from hyperledger/fabric-tools 01085d60b3a6: Already exists 367f9186226c: Pull complete b47f6a4ae6bc: Pull complete b5933c87679e: Pull complete 77b2bdbf772c: Pull complete b2d9526a33e2: Pull complete Digest: sha256:b3aea8173802186244663334b4196c415cb267d77ea8c617fdd30652c5a732c4 Status: Downloaded newer image for hyperledger/fabric-tools:2.5.4 docker.io/hyperledger/fabric-tools:2.5.4 ====> docker.io/hyperledger/fabric-baseos:2.5.4 2.5.4: Pulling from hyperledger/fabric-baseos 01085d60b3a6: Already exists cc16ebc66c1e: Pull complete cfb66da0a833: Pull complete daa87923bf69: Pull complete Digest: sha256:cab2ed27ed8d27e4cacde447a1de51884f0bd9e103a6119e74521e1b90b6d106 Status: Downloaded newer image for hyperledger/fabric-baseos:2.5.4 docker.io/hyperledger/fabric-baseos:2.5.4 ===> Pulling fabric ca Image ====> docker.io/hyperledger/fabric-ca:1.5.6 1.5.6: Pulling from hyperledger/fabric-ca 06d39c85623a: Pull complete 76b09500ba18: Pull complete 565b060137bc: Pull complete 8314689e4bac: Pull complete Digest: sha256:c5c6dfa2d1d4cdee4d22dbfdd928506a9504931e53f60468e0efbad3773f9d30 Status: Downloaded newer image for hyperledger/fabric-ca:1.5.6 docker.io/hyperledger/fabric-ca:1.5.6 ===> List out hyperledger docker images hyperledger/fabric-tools 2.5 b2f3af4021be 3 days ago 551MB hyperledger/fabric-tools 2.5.4 b2f3af4021be 3 days ago 551MB hyperledger/fabric-tools latest b2f3af4021be 3 days ago 551MB hyperledger/fabric-peer 2.5 4f8d1b54d8b0 3 days ago 135MB hyperledger/fabric-peer 2.5.4 4f8d1b54d8b0 3 days ago 135MB hyperledger/fabric-peer latest 4f8d1b54d8b0 3 days ago 135MB hyperledger/fabric-orderer 2.5 7a73187b5c49 3 days ago 106MB hyperledger/fabric-orderer 2.5.4 7a73187b5c49 3 days ago 106MB hyperledger/fabric-orderer latest 7a73187b5c49 3 days ago 106MB hyperledger/fabric-ccenv 2.5 6dac93f94c87 3 days ago 656MB hyperledger/fabric-ccenv 2.5.4 6dac93f94c87 3 days ago 656MB hyperledger/fabric-ccenv latest 6dac93f94c87 3 days ago 656MB hyperledger/fabric-baseos 2.5 3854817b987d 3 days ago 122MB hyperledger/fabric-baseos 2.5.4 3854817b987d 3 days ago 122MB hyperledger/fabric-baseos latest 3854817b987d 3 days ago 122MB hyperledger/fabric-ca 1.5 8446b174e2a9 4 months ago 209MB hyperledger/fabric-ca 1.5.6 8446b174e2a9 4 months ago 209MB hyperledger/fabric-ca latest 8446b174e2a9 4 months ago 209MB yujeong@yujeong-VirtualBox:~$ ls fabric-samples snap 다운로드 바탕화면 사진 템플릿 go 공개 문서 비디오 음악 yujeong@yujeong-VirtualBox:~$ rm r fabric-samples rm: 'r'을(를) 제거할 수 없습니다: 그런 파일이나 디렉터리가 없습니다 rm: 'fabric-samples'을(를) 제거할 수 없습니다: 디렉터리입니다 yujeong@yujeong-VirtualBox:~$ rm r /fabric-samples rm: 'r'을(를) 제거할 수 없습니다: 그런 파일이나 디렉터리가 없습니다 rm: '/fabric-samples'을(를) 제거할 수 없습니다: 그런 파일이나 디렉터리가 없습니다 yujeong@yujeong-VirtualBox:~$ rm -r /fabric-samples rm: '/fabric-samples'을(를) 제거할 수 없습니다: 그런 파일이나 디렉터리가 없습니다 yujeong@yujeong-VirtualBox:~$ rm -r fabric-samples rm: 쓰기 보호된 일반 파일 'fabric-samples/.git/objects/pack/pack-5a77a27c0c40bf91ad03a414331fd202457bdf29.idx'를(을) 지울까요? ㅛ rm: 쓰기 보호된 일반 파일 'fabric-samples/.git/objects/pack/pack-5a77a27c0c40bf91ad03a414331fd202457bdf29.pack'를(을) 지울까요? rm: 'fabric-samples/.git/objects/pack'을(를) 제거할 수 없습니다: 디렉터리가 비어있지 않음 yujeong@yujeong-VirtualBox:~$ yujeong@yujeong-VirtualBox:~$ rm -r fabric-samples rm: 쓰기 보호된 일반 파일 'fabric-samples/.git/objects/pack/pack-5a77a27c0c40bf91ad03a414331fd202457bdf29.idx'를(을) 지울까요? y rm: 쓰기 보호된 일반 파일 'fabric-samples/.git/objects/pack/pack-5a77a27c0c40bf91ad03a414331fd202457bdf29.pack'를(을) 지울까요? y yujeong@yujeong-VirtualBox:~$ /s bash: /s: 그런 파일이나 디렉터리가 없습니다 yujeong@yujeong-VirtualBox:~$ ls go snap 공개 다운로드 문서 바탕화면 비디오 사진 음악 템플릿 yujeong@yujeong-VirtualBox:~$ cd $GOPATH/src yujeong@yujeong-VirtualBox:~/go/src$ curl -sSL https://bit.ly/2ysbOFE | bash -s 2.5.4 1.5.6 Clone hyperledger/fabric-samples repo ===> Cloning hyperledger/fabric-samples repo 'fabric-samples'에 복제합니다... remote: Enumerating objects: 12502, done. remote: Counting objects: 100% (535/535), done. remote: Compressing objects: 100% (318/318), done. remote: Total 12502 (delta 250), reused 376 (delta 190), pack-reused 11967 오브젝트를 받는 중: 100% (12502/12502), 22.52 MiB | 3.04 MiB/s, 완료. 델타를 알아내는 중: 100% (6701/6701), 완료. fabric-samples v2.5.4 does not exist, defaulting to main. fabric-samples main branch is intended to work with recent versions of fabric. Pull Hyperledger Fabric binaries ===> Downloading version 2.5.4 platform specific fabric binaries ===> Downloading: https://github.com/hyperledger/fabric/releases/download/v2.5.4/hyperledger-fabric-linux-amd64-2.5.4.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 99.3M 100 99.3M 0 0 4765k 0 0:00:21 0:00:21 --:--:-- 5237k ==> Done. ===> Downloading version 1.5.6 platform specific fabric-ca-client binary ===> Downloading: https://github.com/hyperledger/fabric-ca/releases/download/v1.5.6/hyperledger-fabric-ca-linux-amd64-1.5.6.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 30.6M 100 30.6M 0 0 3596k 0 0:00:08 0:00:08 --:--:-- 4086k ==> Done. Pull Hyperledger Fabric docker images FABRIC_IMAGES: peer orderer ccenv tools baseos ===> Pulling fabric Images ====> docker.io/hyperledger/fabric-peer:2.5.4 2.5.4: Pulling from hyperledger/fabric-peer Digest: sha256:c2e735a3cb8250c47ed3589294b3f0c078004ec001b949710f334736651e106d Status: Image is up to date for hyperledger/fabric-peer:2.5.4 docker.io/hyperledger/fabric-peer:2.5.4 ====> docker.io/hyperledger/fabric-orderer:2.5.4 2.5.4: Pulling from hyperledger/fabric-orderer Digest: sha256:1a7144705b435062f4be2886de98d0408165cf51326ec721c3f58b40bf8bf139 Status: Image is up to date for hyperledger/fabric-orderer:2.5.4 docker.io/hyperledger/fabric-orderer:2.5.4 ====> docker.io/hyperledger/fabric-ccenv:2.5.4 2.5.4: Pulling from hyperledger/fabric-ccenv Digest: sha256:b7d312c0f8d4530c6ff4b3ef7277f0338f486d0b617c3012415a32308cbc2254 Status: Image is up to date for hyperledger/fabric-ccenv:2.5.4 docker.io/hyperledger/fabric-ccenv:2.5.4 ====> docker.io/hyperledger/fabric-tools:2.5.4 2.5.4: Pulling from hyperledger/fabric-tools Digest: sha256:b3aea8173802186244663334b4196c415cb267d77ea8c617fdd30652c5a732c4 Status: Image is up to date for hyperledger/fabric-tools:2.5.4 docker.io/hyperledger/fabric-tools:2.5.4 ====> docker.io/hyperledger/fabric-baseos:2.5.4 2.5.4: Pulling from hyperledger/fabric-baseos Digest: sha256:cab2ed27ed8d27e4cacde447a1de51884f0bd9e103a6119e74521e1b90b6d106 Status: Image is up to date for hyperledger/fabric-baseos:2.5.4 docker.io/hyperledger/fabric-baseos:2.5.4 ===> Pulling fabric ca Image ====> docker.io/hyperledger/fabric-ca:1.5.6 1.5.6: Pulling from hyperledger/fabric-ca Digest: sha256:c5c6dfa2d1d4cdee4d22dbfdd928506a9504931e53f60468e0efbad3773f9d30 Status: Image is up to date for hyperledger/fabric-ca:1.5.6 docker.io/hyperledger/fabric-ca:1.5.6 ===> List out hyperledger docker images hyperledger/fabric-tools 2.5 b2f3af4021be 3 days ago 551MB hyperledger/fabric-tools 2.5.4 b2f3af4021be 3 days ago 551MB hyperledger/fabric-tools latest b2f3af4021be 3 days ago 551MB hyperledger/fabric-peer 2.5 4f8d1b54d8b0 3 days ago 135MB hyperledger/fabric-peer 2.5.4 4f8d1b54d8b0 3 days ago 135MB hyperledger/fabric-peer latest 4f8d1b54d8b0 3 days ago 135MB hyperledger/fabric-orderer 2.5 7a73187b5c49 3 days ago 106MB hyperledger/fabric-orderer 2.5.4 7a73187b5c49 3 days ago 106MB hyperledger/fabric-orderer latest 7a73187b5c49 3 days ago 106MB hyperledger/fabric-ccenv 2.5 6dac93f94c87 3 days ago 656MB hyperledger/fabric-ccenv 2.5.4 6dac93f94c87 3 days ago 656MB hyperledger/fabric-ccenv latest 6dac93f94c87 3 days ago 656MB hyperledger/fabric-baseos 2.5 3854817b987d 3 days ago 122MB hyperledger/fabric-baseos 2.5.4 3854817b987d 3 days ago 122MB hyperledger/fabric-baseos latest 3854817b987d 3 days ago 122MB hyperledger/fabric-ca 1.5 8446b174e2a9 4 months ago 209MB hyperledger/fabric-ca 1.5.6 8446b174e2a9 4 months ago 209MB hyperledger/fabric-ca latest 8446b174e2a9 4 months ago 209MB yujeong@yujeong-VirtualBox:~/go/src$ cd fabric-samples/test-network yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh -h Using docker and docker-compose Usage: network.sh <Mode> [Flags] Modes: up - Bring up Fabric orderer and peer nodes. No channel is created up createChannel - Bring up fabric network with one channel createChannel - Create and join a channel after the network is created deployCC - Deploy a chaincode to a channel (defaults to asset-transfer-basic) down - Bring down the network Flags: Used with network.sh up, network.sh createChannel: -ca <use CAs> - Use Certificate Authorities to generate network crypto material -c <channel name> - Name of channel to create (defaults to "mychannel") -s <dbtype> - Peer state database to deploy: goleveldb (default) or couchdb -r <max retry> - CLI times out after certain number of attempts (defaults to 5) -d <delay> - CLI delays for a certain number of seconds (defaults to 3) -verbose - Verbose mode Used with network.sh deployCC -c <channel name> - Name of channel to deploy chaincode to -ccn <name> - Chaincode name. -ccl <language> - Programming language of the chaincode to deploy: go, java, javascript, typescript -ccv <version> - Chaincode version. 1.0 (default), v2, version3.x, etc -ccs <sequence> - Chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc -ccp <path> - File path to the chaincode. -ccep <policy> - (Optional) Chaincode endorsement policy using signature policy syntax. The default policy requires an endorsement from Org1 and Org2 -cccg <collection-config> - (Optional) File path to private data collections configuration file -cci <fcn name> - (Optional) Name of chaincode initialization function. When a function is provided, the execution of init will be requested and the function will be invoked. -h - Print this message Possible Mode and flag combinations up -ca -r -d -s -verbose up createChannel -ca -c -r -d -s -verbose createChannel -c -r -d -verbose deployCC -ccn -ccl -ccv -ccs -ccp -cci -r -d -verbose Examples: network.sh up createChannel -ca -c mychannel -s couchdb network.sh createChannel -c channelName network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript network.sh deployCC -ccn mychaincode -ccp ./user/mychaincode -ccv 1 -ccl javascript yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh deployCC -ccn basic -ccp ../asset-trasfer-basic/chaincode-go -ccl go Using docker and docker-compose deploying chaincode on channel 'mychannel' executing with the following - CHANNEL_NAME: mychannel - CC_NAME: basic - CC_SRC_PATH: ../asset-trasfer-basic/chaincode-go - CC_SRC_LANGUAGE: go - CC_VERSION: 1.0 - CC_SEQUENCE: 1 - CC_END_POLICY: NA - CC_COLL_CONFIG: NA - CC_INIT_FCN: NA - DELAY: 3 - MAX_RETRY: 5 - VERBOSE: false Path to chaincode does not exist. Please provide different path. Deploying chaincode failed yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh down Using docker and docker-compose Stopping network Removing network compose_default WARNING: Network compose_default not found. Removing network fabric_test WARNING: Network fabric_test not found. Removing volume compose_orderer.example.com WARNING: Volume compose_orderer.example.com not found. Removing volume compose_peer0.org1.example.com WARNING: Volume compose_peer0.org1.example.com not found. Removing volume compose_peer0.org2.example.com WARNING: Volume compose_peer0.org2.example.com not found. Removing volume compose_peer0.org3.example.com WARNING: Volume compose_peer0.org3.example.com not found. Error response from daemon: get docker_orderer.example.com: no such volume Error response from daemon: get docker_peer0.org1.example.com: no such volume Error response from daemon: get docker_peer0.org2.example.com: no such volume Removing remaining containers Removing generated chaincode docker images Unable to find image 'busybox:latest' locally latest: Pulling from library/busybox 3f4d90098f5b: Pull complete Digest: sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79 Status: Downloaded newer image for busybox:latest yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh up Using docker and docker-compose Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen' LOCAL_VERSION=v2.5.4 DOCKER_IMAGE_VERSION=v2.5.4 /home/yujeong/go/src/fabric-samples/test-network/../bin/cryptogen Generating certificates using cryptogen tool Creating Org1 Identities + cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations org1.example.com + res=0 Creating Org2 Identities + cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations org2.example.com + res=0 Creating Orderer Org Identities + cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations + res=0 Generating CCP files for Org1 and Org2 Creating network "fabric_test" with the default driver Creating volume "compose_orderer.example.com" with default driver Creating volume "compose_peer0.org1.example.com" with default driver Creating volume "compose_peer0.org2.example.com" with default driver Creating peer0.org2.example.com ... done Creating orderer.example.com ... done Creating peer0.org1.example.com ... done Creating cli ... done CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 12cfb4776f97 hyperledger/fabric-tools:latest "/bin/bash" 1 second ago Up Less than a second cli 71c5c3180ba6 hyperledger/fabric-peer:latest "peer node start" 4 seconds ago Up 1 second 0.0.0.0:7051->7051/tcp, :::7051->7051/tcp, 0.0.0.0:9444->9444/tcp, :::9444->9444/tcp peer0.org1.example.com 54525859cff4 hyperledger/fabric-orderer:latest "orderer" 4 seconds ago Up 1 second 0.0.0.0:7050->7050/tcp, :::7050->7050/tcp, 0.0.0.0:7053->7053/tcp, :::7053->7053/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp orderer.example.com 4803664ae7a5 hyperledger/fabric-peer:latest "peer node start" 4 seconds ago Up 1 second 0.0.0.0:9051->9051/tcp, :::9051->9051/tcp, 7051/tcp, 0.0.0.0:9445->9445/tcp, :::9445->9445/tcp peer0.org2.example.com yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go Using docker and docker-compose deploying chaincode on channel 'mychannel' executing with the following - CHANNEL_NAME: mychannel - CC_NAME: basic - CC_SRC_PATH: ../asset-transfer-basic/chaincode-go - CC_SRC_LANGUAGE: go - CC_VERSION: 1.0 - CC_SEQUENCE: 1 - CC_END_POLICY: NA - CC_COLL_CONFIG: NA - CC_INIT_FCN: NA - DELAY: 3 - MAX_RETRY: 5 - VERBOSE: false Vendoring Go dependencies at ../asset-transfer-basic/chaincode-go ~/go/src/fabric-samples/asset-transfer-basic/chaincode-go ~/go/src/fabric-samples/test-network go: downloading github.com/hyperledger/fabric-contract-api-go v1.2.1 go: downloading github.com/hyperledger/fabric-chaincode-go v0.0.0-20230228194215-b84622ba6a7a go: downloading google.golang.org/protobuf v1.28.1 go: downloading github.com/hyperledger/fabric-protos-go v0.3.0 go: downloading github.com/stretchr/testify v1.8.2 go: downloading google.golang.org/grpc v1.53.0 go: downloading github.com/golang/protobuf v1.5.2 go: downloading github.com/xeipuuv/gojsonschema v1.2.0 go: downloading github.com/pmezard/go-difflib v1.0.0 go: downloading gopkg.in/yaml.v3 v3.0.1 go: downloading github.com/go-openapi/spec v0.20.8 go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 go: downloading github.com/davecgh/go-spew v1.1.1 go: downloading github.com/gobuffalo/packr v1.30.1 go: downloading github.com/go-openapi/jsonpointer v0.19.5 go: downloading github.com/go-openapi/swag v0.21.1 go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb go: downloading github.com/gobuffalo/packd v1.0.1 go: downloading gopkg.in/yaml.v2 v2.4.0 go: downloading github.com/go-openapi/jsonreference v0.20.0 go: downloading github.com/gobuffalo/envy v1.10.1 go: downloading github.com/mailru/easyjson v0.7.7 go: downloading github.com/joho/godotenv v1.4.0 go: downloading github.com/rogpeppe/go-internal v1.8.1 go: downloading google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f go: downloading golang.org/x/net v0.7.0 go: downloading golang.org/x/sys v0.5.0 go: downloading github.com/josharian/intern v1.0.0 go: downloading golang.org/x/text v0.7.0 github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks imports github.com/hyperledger/fabric-protos-go/peer imports google.golang.org/grpc imports google.golang.org/grpc/internal/transport imports golang.org/x/net/http2 imports io/fs: package io/fs is not in GOROOT (/usr/local/go/src/io/fs) ~/go/src/fabric-samples/test-network Finished vendoring Go dependencies + peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go --lang golang --label basic_1.0 + res=0 ++ peer lifecycle chaincode calculatepackageid basic.tar.gz + PACKAGE_ID=basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Chaincode is packaged Installing chaincode on peer0.org1... Using organization 1 + grep '^basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578$' + jq -r 'try (.installed_chaincodes[].package_id)' + peer lifecycle chaincode queryinstalled --output json + test 1 -ne 0 + peer lifecycle chaincode install basic.tar.gz + res=0 2023-08-06 16:17:41.817 KST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:"\nJbasic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578\022\tbasic_1.0" > 2023-08-06 16:17:41.819 KST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Chaincode is installed on peer0.org1 Install chaincode on peer0.org2... Using organization 2 + grep '^basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578$' + jq -r 'try (.installed_chaincodes[].package_id)' + peer lifecycle chaincode queryinstalled --output json + test 1 -ne 0 + peer lifecycle chaincode install basic.tar.gz + res=0 2023-08-06 16:18:49.392 KST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:"\nJbasic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578\022\tbasic_1.0" > 2023-08-06 16:18:49.392 KST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Chaincode is installed on peer0.org2 Using organization 1 + grep '^basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578$' + jq -r 'try (.installed_chaincodes[].package_id)' + peer lifecycle chaincode queryinstalled --output json + res=0 basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Query installed successful on peer0.org1 on channel Using organization 1 + peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 --sequence 1 + res=1 Error: proposal failed with status: 500 - channel 'mychannel' not found Chaincode definition approved on peer0.org1 on channel 'mychannel' failed Deploying chaincode failed yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh createChannel Using docker and docker-compose Creating channel 'mychannel'. If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb Network Running Already Using docker and docker-compose Generating channel genesis block 'mychannel.block' /home/yujeong/go/src/fabric-samples/test-network/../bin/configtxgen + configtxgen -profile TwoOrgsApplicationGenesis -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel 2023-08-06 16:19:07.538 KST 0001 INFO [common.tools.configtxgen] main -> Loading configuration 2023-08-06 16:19:07.588 KST 0002 INFO [common.tools.configtxgen.localconfig] completeInitialization -> orderer type: etcdraft 2023-08-06 16:19:07.591 KST 0003 INFO [common.tools.configtxgen.localconfig] completeInitialization -> Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216 2023-08-06 16:19:07.591 KST 0004 INFO [common.tools.configtxgen.localconfig] Load -> Loaded configuration: /home/yujeong/go/src/fabric-samples/test-network/configtx/configtx.yaml 2023-08-06 16:19:07.600 KST 0005 INFO [common.tools.configtxgen] doOutputBlock -> Generating genesis block 2023-08-06 16:19:07.600 KST 0006 INFO [common.tools.configtxgen] doOutputBlock -> Creating application channel genesis block 2023-08-06 16:19:07.601 KST 0007 INFO [common.tools.configtxgen] doOutputBlock -> Writing genesis block + res=0 Creating channel mychannel Using organization 1 + osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:7053 --ca-file /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --client-cert /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt --client-key /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key + res=0 Status: 201 { "name": "mychannel", "url": "/participation/v1/channels/mychannel", "consensusRelation": "consenter", "status": "active", "height": 1 } Channel 'mychannel' created Joining org1 peer to the channel... Using organization 1 + peer channel join -b ./channel-artifacts/mychannel.block + res=0 2023-08-06 16:19:13.920 KST 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized 2023-08-06 16:19:13.983 KST 0002 INFO [channelCmd] executeJoin -> Successfully submitted proposal to join channel Joining org2 peer to the channel... Using organization 2 + peer channel join -b ./channel-artifacts/mychannel.block + res=0 2023-08-06 16:19:17.218 KST 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized 2023-08-06 16:19:17.280 KST 0002 INFO [channelCmd] executeJoin -> Successfully submitted proposal to join channel Setting anchor peer for org1... Using organization 1 Fetching channel config for channel mychannel Using organization 1 Fetching the most recent configuration block for the channel + peer channel fetch config config_block.pb -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem 2023-08-06 07:19:17.607 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized 2023-08-06 07:19:17.611 UTC 0002 INFO [cli.common] readBlock -> Received block: 0 2023-08-06 07:19:17.611 UTC 0003 INFO [channelCmd] fetch -> Retrieving last config block: 0 2023-08-06 07:19:17.613 UTC 0004 INFO [cli.common] readBlock -> Received block: 0 Decoding config block to JSON and isolating config to Org1MSPconfig.json + configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json + jq '.data.data[0].payload.data.config' config_block.json Generating anchor peer update transaction for Org1 on channel mychannel + jq '.channel_group.groups.Application.groups.Org1MSP.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "peer0.org1.example.com","port": 7051}]},"version": "0"}}' Org1MSPconfig.json + configtxlator proto_encode --input Org1MSPconfig.json --type common.Config --output original_config.pb + configtxlator proto_encode --input Org1MSPmodified_config.json --type common.Config --output modified_config.pb + configtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb --output config_update.pb + configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.json + jq . ++ cat config_update.json + echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel", "type":2}},"data":{"config_update":{' '"channel_id":' '"mychannel",' '"isolated_data":' '{},' '"read_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org1MSP":' '{' '"groups":' '{},' '"mod_policy":' '"",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '},' '"write_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org1MSP":' '{' '"groups":' '{},' '"mod_policy":' '"Admins",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"AnchorPeers":' '{' '"mod_policy":' '"Admins",' '"value":' '{' '"anchor_peers":' '[' '{' '"host":' '"peer0.org1.example.com",' '"port":' 7051 '}' ']' '},' '"version":' '"0"' '},' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"1"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '}}}}' + configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope --output Org1MSPanchors.tx 2023-08-06 07:19:18.277 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized 2023-08-06 07:19:18.315 UTC 0002 INFO [channelCmd] update -> Successfully submitted channel update Anchor peer set for org 'Org1MSP' on channel 'mychannel' Setting anchor peer for org2... Using organization 2 Fetching channel config for channel mychannel Using organization 2 Fetching the most recent configuration block for the channel + peer channel fetch config config_block.pb -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem 2023-08-06 07:19:18.777 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized 2023-08-06 07:19:18.782 UTC 0002 INFO [cli.common] readBlock -> Received block: 1 2023-08-06 07:19:18.782 UTC 0003 INFO [channelCmd] fetch -> Retrieving last config block: 1 2023-08-06 07:19:18.784 UTC 0004 INFO [cli.common] readBlock -> Received block: 1 Decoding config block to JSON and isolating config to Org2MSPconfig.json + configtxlator proto_decode --input config_block.pb --type common.Block --output config_block.json + jq '.data.data[0].payload.data.config' config_block.json Generating anchor peer update transaction for Org2 on channel mychannel + jq '.channel_group.groups.Application.groups.Org2MSP.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "peer0.org2.example.com","port": 9051}]},"version": "0"}}' Org2MSPconfig.json + configtxlator proto_encode --input Org2MSPconfig.json --type common.Config --output original_config.pb + configtxlator proto_encode --input Org2MSPmodified_config.json --type common.Config --output modified_config.pb + configtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb --output config_update.pb + configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate --output config_update.json + jq . ++ cat config_update.json + echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel", "type":2}},"data":{"config_update":{' '"channel_id":' '"mychannel",' '"isolated_data":' '{},' '"read_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org2MSP":' '{' '"groups":' '{},' '"mod_policy":' '"",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '},' '"write_set":' '{' '"groups":' '{' '"Application":' '{' '"groups":' '{' '"Org2MSP":' '{' '"groups":' '{},' '"mod_policy":' '"Admins",' '"policies":' '{' '"Admins":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Endorsement":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Readers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '},' '"Writers":' '{' '"mod_policy":' '"",' '"policy":' null, '"version":' '"0"' '}' '},' '"values":' '{' '"AnchorPeers":' '{' '"mod_policy":' '"Admins",' '"value":' '{' '"anchor_peers":' '[' '{' '"host":' '"peer0.org2.example.com",' '"port":' 9051 '}' ']' '},' '"version":' '"0"' '},' '"MSP":' '{' '"mod_policy":' '"",' '"value":' null, '"version":' '"0"' '}' '},' '"version":' '"1"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '},' '"mod_policy":' '"",' '"policies":' '{},' '"values":' '{},' '"version":' '"0"' '}' '}}}}' + configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope --output Org2MSPanchors.tx 2023-08-06 07:19:19.562 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized 2023-08-06 07:19:19.606 UTC 0002 INFO [channelCmd] update -> Successfully submitted channel update Anchor peer set for org 'Org2MSP' on channel 'mychannel' Channel 'mychannel' joined yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go Using docker and docker-compose deploying chaincode on channel 'mychannel' executing with the following - CHANNEL_NAME: mychannel - CC_NAME: basic - CC_SRC_PATH: ../asset-transfer-basic/chaincode-go - CC_SRC_LANGUAGE: go - CC_VERSION: 1.0 - CC_SEQUENCE: 1 - CC_END_POLICY: NA - CC_COLL_CONFIG: NA - CC_INIT_FCN: NA - DELAY: 3 - MAX_RETRY: 5 - VERBOSE: false Vendoring Go dependencies at ../asset-transfer-basic/chaincode-go ~/go/src/fabric-samples/asset-transfer-basic/chaincode-go ~/go/src/fabric-samples/test-network github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks imports github.com/hyperledger/fabric-protos-go/peer imports google.golang.org/grpc imports google.golang.org/grpc/internal/transport imports golang.org/x/net/http2 imports io/fs: package io/fs is not in GOROOT (/usr/local/go/src/io/fs) ~/go/src/fabric-samples/test-network Finished vendoring Go dependencies + peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-go --lang golang --label basic_1.0 + res=0 ++ peer lifecycle chaincode calculatepackageid basic.tar.gz + PACKAGE_ID=basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Chaincode is packaged Installing chaincode on peer0.org1... Using organization 1 + grep '^basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578$' + jq -r 'try (.installed_chaincodes[].package_id)' + peer lifecycle chaincode queryinstalled --output json + test 0 -ne 0 basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Chaincode is installed on peer0.org1 Install chaincode on peer0.org2... Using organization 2 + grep '^basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578$' + jq -r 'try (.installed_chaincodes[].package_id)' + peer lifecycle chaincode queryinstalled --output json + test 0 -ne 0 basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Chaincode is installed on peer0.org2 Using organization 1 + grep '^basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578$' + jq -r 'try (.installed_chaincodes[].package_id)' + peer lifecycle chaincode queryinstalled --output json + res=0 basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 Query installed successful on peer0.org1 on channel Using organization 1 + peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 --sequence 1 + res=0 2023-08-06 16:19:41.220 KST 0001 INFO [chaincodeCmd] ClientWait -> txid [ae7ebcd9c8875f6309849eb412c6e89b43806948b33423aa1b94ea94681463d0] committed with status (VALID) at localhost:7051 Chaincode definition approved on peer0.org1 on channel 'mychannel' Using organization 1 Checking the commit readiness of the chaincode definition on peer0.org1 on channel 'mychannel'... Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds. + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json + res=0 { "approvals": { "Org1MSP": true, "Org2MSP": false } } Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel 'mychannel' Using organization 2 Checking the commit readiness of the chaincode definition on peer0.org2 on channel 'mychannel'... Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds. + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json + res=0 { "approvals": { "Org1MSP": true, "Org2MSP": false } } Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel 'mychannel' Using organization 2 + peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id basic_1.0:fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578 --sequence 1 + res=0 2023-08-06 16:19:49.758 KST 0001 INFO [chaincodeCmd] ClientWait -> txid [db24f6c03de22f6b2aaa2b59ba4b19f59fca79eded2e53976df2978df29189ef] committed with status (VALID) at localhost:9051 Chaincode definition approved on peer0.org2 on channel 'mychannel' Using organization 1 Checking the commit readiness of the chaincode definition on peer0.org1 on channel 'mychannel'... Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds. + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json + res=0 { "approvals": { "Org1MSP": true, "Org2MSP": true } } Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel 'mychannel' Using organization 2 Checking the commit readiness of the chaincode definition on peer0.org2 on channel 'mychannel'... Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds. + peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json + res=0 { "approvals": { "Org1MSP": true, "Org2MSP": true } } Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel 'mychannel' Using organization 1 Using organization 2 + peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /home/yujeong/go/src/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --peerAddresses localhost:7051 --tlsRootCertFiles /home/yujeong/go/src/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem --peerAddresses localhost:9051 --tlsRootCertFiles /home/yujeong/go/src/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem --version 1.0 --sequence 1 + res=0 2023-08-06 16:19:58.558 KST 0001 INFO [chaincodeCmd] ClientWait -> txid [d2c187ac9b75c4649ca8a492e4cd5eb15bd9e0d78c42c82f7bd4638d1d701d96] committed with status (VALID) at localhost:9051 2023-08-06 16:19:58.579 KST 0002 INFO [chaincodeCmd] ClientWait -> txid [d2c187ac9b75c4649ca8a492e4cd5eb15bd9e0d78c42c82f7bd4638d1d701d96] committed with status (VALID) at localhost:7051 Chaincode definition committed on channel 'mychannel' Using organization 1 Querying chaincode definition on peer0.org1 on channel 'mychannel'... Attempting to Query committed status on peer0.org1, Retry after 3 seconds. + peer lifecycle chaincode querycommitted --channelID mychannel --name basic + res=0 Committed chaincode definition for chaincode 'basic' on channel 'mychannel': Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true] Query chaincode definition successful on peer0.org1 on channel 'mychannel' Using organization 2 Querying chaincode definition on peer0.org2 on channel 'mychannel'... Attempting to Query committed status on peer0.org2, Retry after 3 seconds. + peer lifecycle chaincode querycommitted --channelID mychannel --name basic + res=0 Committed chaincode definition for chaincode 'basic' on channel 'mychannel': Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true] Query chaincode definition successful on peer0.org2 on channel 'mychannel' Chaincode initialization is not required yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ export PATH=${PWD}/../bin:$PATH yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ export FABRIC_CFG_PATH=$PWD/../config/ yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ export CORE_PEER_TLS_ENABLED=true export CORE_PEER_LOCALMSPID="Org1MSP" export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp export CORE_PEER_ADDRESS=localhost:7051 yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"InitLedger","Args":[]}' 2023-08-06 17:17:55.012 KST 0001 INFO [chaincodeCmd] chaincodeInvokeOrQuery -> Chaincode invoke successful. result: status:200 yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ peer chaincode query -C mychannel -n basic -c '{"Args":["GetAllAssets"]}' [{"AppraisedValue":300,"Color":"blue","ID":"asset1","Owner":"Tomoko","Size":5},{"AppraisedValue":400,"Color":"red","ID":"asset2","Owner":"Brad","Size":5},{"AppraisedValue":500,"Color":"green","ID":"asset3","Owner":"Jin Soo","Size":10},{"AppraisedValue":600,"Color":"yellow","ID":"asset4","Owner":"Max","Size":10},{"AppraisedValue":700,"Color":"black","ID":"asset5","Owner":"Adriana","Size":15},{"AppraisedValue":800,"Color":"white","ID":"asset6","Owner":"Michel","Size":15}] yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"TransferAsset","Args":["asset6","Christopher"]}' 2023-08-06 17:24:13.068 KST 0001 INFO [chaincodeCmd] chaincodeInvokeOrQuery -> Chaincode invoke successful. result: status:200 payload:"Michel" yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ export CORE_PEER_TLS_ENABLED=true export CORE_PEER_LOCALMSPID="Org2MSP" export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp export CORE_PEER_ADDRESS=localhost:9051 yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ peer chaincode query -C mychannel -n basic -c '{"Args":["ReadAsset","asset6"]}' {"AppraisedValue":800,"Color":"white","ID":"asset6","Owner":"Christopher","Size":15} yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ./network.sh down Using docker and docker-compose Stopping network Stopping cli ... done Stopping peer0.org1.example.com ... done Stopping orderer.example.com ... done Stopping peer0.org2.example.com ... done Removing cli ... done Removing peer0.org1.example.com ... done Removing orderer.example.com ... done Removing peer0.org2.example.com ... done Removing network fabric_test Removing network compose_default WARNING: Network compose_default not found. Removing volume compose_orderer.example.com Removing volume compose_peer0.org1.example.com Removing volume compose_peer0.org2.example.com Removing volume compose_peer0.org3.example.com WARNING: Volume compose_peer0.org3.example.com not found. Error response from daemon: get docker_orderer.example.com: no such volume Error response from daemon: get docker_peer0.org1.example.com: no such volume Error response from daemon: get docker_peer0.org2.example.com: no such volume Removing remaining containers Removing generated chaincode docker images Untagged: dev-peer0.org2.example.com-basic_1.0-fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578-d7a2647c5fe9fdb4552e38109ad855a3f7ccd4c176b98f4d5f8f33cf98cf7e61:latest Deleted: sha256:11160bb7e71d4e049091faf62a7821ba5977e0292452ca1dfc8be2164dcab785 Deleted: sha256:2b68ca31b0e2a9505e1454f54ede9f53d9bc59f6d55da550f9aafce744e24e9b Deleted: sha256:333b0cc2de3fa63e8de70aad3fa7a2a5519f2445da7747334d3c14adf3c10001 Deleted: sha256:ab4aaf827ef8cde870d2e2863dbaaaed6085f7301e9a198cf1f47f5831a2e807 Untagged: dev-peer0.org1.example.com-basic_1.0-fa7da118f496cd4a3deb4e43c77f9af4f3265b7555942c74c9810557fa5c6578-5b0abe6f4d380403f708cfbba6002501a300311332f86aea02be34086d0b5c6d:latest Deleted: sha256:09ba8bbc08f224ff617641bbf0b8b00efca39f2758412fd3d90f5fcb153f657c Deleted: sha256:11247649857e133102eb00840e3f6b3fc3e33b8767f73e023d0d8e2730106445 Deleted: sha256:5de38fa3808dac9cf00c3831e12506108a86c0215867e34ae3b071212b5a4f70 Deleted: sha256:2443f431d584c0e68c9d23a6936f38c4176835d5937157ab06327cb7bddab244 yujeong@yujeong-VirtualBox:~/go/src/fabric-samples/test-network$ ^C