하이퍼레저v1.4 멀티 채널 (2부)

min71·2021년 8월 2일
0

하이퍼레저

목록 보기
4/12

실행중인 도커 컴포넌트 확인

오더러 1개 존재
3개의 조직(Org1, Org2, Org3)마다 1개의 피어노드 존재
CLI 1개 존재

docker ps

CLI컨테이너 접속

1. Org1 컨테이너

docker exec -it cli bash
export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

2. Org2 컨테이너

docker exec -e "CORE_PEER_LOCALMSPID=Org2MSP" -e "CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp" -e "CORE_PEER_ADDRESS=peer0.org2.example.com:9051" -it cli bash
export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

3. Org3 컨테이너

docker exec -e "CORE_PEER_LOCALMSPID=Org3MSP" -e "CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp" -e "CORE_PEER_ADDRESS=peer0.org3.example.com:11051" -it cli bash
export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

채널블럭 생성

1. 채널1 블럭 생성

# Org1 Cli 컨테이너
peer channel create -o orderer.example.com:7050 -c channel1 -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/channel1.tx --tls --cafile $ORDERER_CA

- Org1 채널1에 참여 & 앵커피어 업데이트

# Org1 Cli 컨테이너
peer channel join -b channel1.block --tls --cafile $ORDERER_CA
peer channel update -o orderer.example.com:7050 -c channel1 -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/Org1MSPanchors_channel1.tx --tls --cafile $ORDERER_CA

- Org2 채널1에 참여 & 앵커피어 업데이트

# Org2 Cli 컨테이너
peer channel join -b channel1.block --tls --cafile $ORDERER_CA
peer channel update -o orderer.example.com:7050 -c channel1 -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/Org2MSPanchors_channel1.tx --tls --cafile $ORDERER_CA

1. 채널2 블럭 생성

# Org1 Cli 컨테이너
peer channel create -o orderer.example.com:7050 -c channel2 -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/channel2.tx --tls --cafile $ORDERER_CA

- Org1 채널2에 참여 & 앵커피어 업데이트

# Org1 Cli 컨테이너
peer channel join -b channel2.block --tls --cafile $ORDERER_CA
peer channel update -o orderer.example.com:7050 -c channel2 -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/Org1MSPanchors_channel2.tx --tls --cafile $ORDERER_CA

- Org3 채널2에 참여 & 앵커피어 업데이트

# Org3 Cli 컨테이너
peer channel join -b channel2.block --tls --cafile $ORDERER_CA
peer channel update -o orderer.example.com:7050 -c channel2 -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/Org3MSPanchors_channel2.tx --tls --cafile $ORDERER_CA

2.채널 참여 확인

- Org1

- Org2

- Org3

네트워크 중지

docker-compose -f docker-compose-cli.yaml down
docker rm $(docker ps -aq)

Hits

profile
한 줄 소개

0개의 댓글

관련 채용 정보