mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
[FAB-14268] Make BYFN/EYFN ports match external ports
Update both BYFN and EYFN so that the peer request and chaincode ports match the externally mapped ports. This enables applications both inside and outside the Docker network to use service discovery to interact with these networks (see the JIRA for more details). Change-Id: I73c36dfdb269ec4225376fb04b1e7a087363e4cc Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
This commit is contained in:
parent
6007c0974c
commit
f942010fa6
6 changed files with 50 additions and 34 deletions
2
first-network/.gitignore
vendored
2
first-network/.gitignore
vendored
|
|
@ -4,3 +4,5 @@
|
|||
/docker-compose-e2e.yaml
|
||||
/ledgers
|
||||
/ledgers-backup
|
||||
/channel-artifacts/*.json
|
||||
/org3-artifacts/crypto-config/*
|
||||
|
|
@ -42,7 +42,10 @@ services:
|
|||
environment:
|
||||
- CORE_PEER_ID=peer0.org1.example.com
|
||||
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
|
||||
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
|
||||
- CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052
|
||||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:8051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
|
||||
- CORE_PEER_LOCALMSPID=Org1MSP
|
||||
volumes:
|
||||
|
|
@ -52,7 +55,6 @@ services:
|
|||
- peer0.org1.example.com:/var/hyperledger/production
|
||||
ports:
|
||||
- 7051:7051
|
||||
- 7053:7053
|
||||
|
||||
peer1.org1.example.com:
|
||||
container_name: peer1.org1.example.com
|
||||
|
|
@ -61,8 +63,11 @@ services:
|
|||
service: peer-base
|
||||
environment:
|
||||
- CORE_PEER_ID=peer1.org1.example.com
|
||||
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
|
||||
- CORE_PEER_ADDRESS=peer1.org1.example.com:8051
|
||||
- CORE_PEER_LISTENADDRESS=0.0.0.0:8051
|
||||
- CORE_PEER_CHAINCODEADDRESS=peer1.org1.example.com:8052
|
||||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:8052
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:8051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
|
||||
- CORE_PEER_LOCALMSPID=Org1MSP
|
||||
volumes:
|
||||
|
|
@ -72,8 +77,7 @@ services:
|
|||
- peer1.org1.example.com:/var/hyperledger/production
|
||||
|
||||
ports:
|
||||
- 8051:7051
|
||||
- 8053:7053
|
||||
- 8051:8051
|
||||
|
||||
peer0.org2.example.com:
|
||||
container_name: peer0.org2.example.com
|
||||
|
|
@ -82,9 +86,12 @@ services:
|
|||
service: peer-base
|
||||
environment:
|
||||
- CORE_PEER_ID=peer0.org2.example.com
|
||||
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
|
||||
- CORE_PEER_ADDRESS=peer0.org2.example.com:9051
|
||||
- CORE_PEER_LISTENADDRESS=0.0.0.0:9051
|
||||
- CORE_PEER_CHAINCODEADDRESS=peer0.org2.example.com:9052
|
||||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:9052
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:9051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:10051
|
||||
- CORE_PEER_LOCALMSPID=Org2MSP
|
||||
volumes:
|
||||
- /var/run/:/host/var/run/
|
||||
|
|
@ -92,8 +99,7 @@ services:
|
|||
- ../crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls
|
||||
- peer0.org2.example.com:/var/hyperledger/production
|
||||
ports:
|
||||
- 9051:7051
|
||||
- 9053:7053
|
||||
- 9051:9051
|
||||
|
||||
peer1.org2.example.com:
|
||||
container_name: peer1.org2.example.com
|
||||
|
|
@ -102,9 +108,12 @@ services:
|
|||
service: peer-base
|
||||
environment:
|
||||
- CORE_PEER_ID=peer1.org2.example.com
|
||||
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
|
||||
- CORE_PEER_ADDRESS=peer1.org2.example.com:10051
|
||||
- CORE_PEER_LISTENADDRESS=0.0.0.0:10051
|
||||
- CORE_PEER_CHAINCODEADDRESS=peer1.org2.example.com:10052
|
||||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:10052
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:10051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:9051
|
||||
- CORE_PEER_LOCALMSPID=Org2MSP
|
||||
volumes:
|
||||
- /var/run/:/host/var/run/
|
||||
|
|
@ -112,5 +121,4 @@ services:
|
|||
- ../crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls
|
||||
- peer1.org2.example.com:/var/hyperledger/production
|
||||
ports:
|
||||
- 10051:7051
|
||||
- 10053:7053
|
||||
- 10051:10051
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ Organizations:
|
|||
# for cross org gossip communication. Note, this value is only
|
||||
# encoded in the genesis block in the Application section context
|
||||
- Host: peer0.org2.example.com
|
||||
Port: 7051
|
||||
Port: 9051
|
||||
|
||||
################################################################################
|
||||
#
|
||||
|
|
|
|||
|
|
@ -21,8 +21,12 @@ services:
|
|||
service: peer-base
|
||||
environment:
|
||||
- CORE_PEER_ID=peer0.org3.example.com
|
||||
- CORE_PEER_ADDRESS=peer0.org3.example.com:7051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:7051
|
||||
- CORE_PEER_ADDRESS=peer0.org3.example.com:11051
|
||||
- CORE_PEER_LISTENADDRESS=0.0.0.0:11051
|
||||
- CORE_PEER_CHAINCODEADDRESS=peer0.org3.example.com:11052
|
||||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org3.example.com:12051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:11051
|
||||
- CORE_PEER_LOCALMSPID=Org3MSP
|
||||
volumes:
|
||||
- /var/run/:/host/var/run/
|
||||
|
|
@ -30,8 +34,7 @@ services:
|
|||
- ./org3-artifacts/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls
|
||||
- peer0.org3.example.com:/var/hyperledger/production
|
||||
ports:
|
||||
- 11051:7051
|
||||
- 11053:7053
|
||||
- 11051:11051
|
||||
networks:
|
||||
- byfn
|
||||
|
||||
|
|
@ -42,9 +45,12 @@ services:
|
|||
service: peer-base
|
||||
environment:
|
||||
- CORE_PEER_ID=peer1.org3.example.com
|
||||
- CORE_PEER_ADDRESS=peer1.org3.example.com:7051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org3.example.com:7051
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:7051
|
||||
- CORE_PEER_ADDRESS=peer1.org3.example.com:12051
|
||||
- CORE_PEER_LISTENADDRESS=0.0.0.0:12051
|
||||
- CORE_PEER_CHAINCODEADDRESS=peer1.org3.example.com:12052
|
||||
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12052
|
||||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:11051
|
||||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org3.example.com:12051
|
||||
- CORE_PEER_LOCALMSPID=Org3MSP
|
||||
volumes:
|
||||
- /var/run/:/host/var/run/
|
||||
|
|
@ -52,8 +58,7 @@ services:
|
|||
- ./org3-artifacts/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls:/etc/hyperledger/fabric/tls
|
||||
- peer1.org3.example.com:/var/hyperledger/production
|
||||
ports:
|
||||
- 12051:7051
|
||||
- 12053:7053
|
||||
- 12051:12051
|
||||
networks:
|
||||
- byfn
|
||||
|
||||
|
|
@ -69,7 +74,7 @@ services:
|
|||
- FABRIC_LOGGING_SPEC=INFO
|
||||
#- FABRIC_LOGGING_SPEC=DEBUG
|
||||
- CORE_PEER_ID=Org3cli
|
||||
- CORE_PEER_ADDRESS=peer0.org3.example.com:7051
|
||||
- CORE_PEER_ADDRESS=peer0.org3.example.com:11051
|
||||
- CORE_PEER_LOCALMSPID=Org3MSP
|
||||
- CORE_PEER_TLS_ENABLED=true
|
||||
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.crt
|
||||
|
|
|
|||
|
|
@ -28,4 +28,4 @@ Organizations:
|
|||
# for cross org gossip communication. Note, this value is only
|
||||
# encoded in the genesis block in the Application section context
|
||||
- Host: peer0.org3.example.com
|
||||
Port: 7051
|
||||
Port: 11051
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@ setGlobals() {
|
|||
if [ $PEER -eq 0 ]; then
|
||||
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
||||
else
|
||||
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
|
||||
CORE_PEER_ADDRESS=peer1.org1.example.com:8051
|
||||
fi
|
||||
elif [ $ORG -eq 2 ]; then
|
||||
CORE_PEER_LOCALMSPID="Org2MSP"
|
||||
CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA
|
||||
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
|
||||
if [ $PEER -eq 0 ]; then
|
||||
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
|
||||
CORE_PEER_ADDRESS=peer0.org2.example.com:9051
|
||||
else
|
||||
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
|
||||
CORE_PEER_ADDRESS=peer1.org2.example.com:10051
|
||||
fi
|
||||
|
||||
elif [ $ORG -eq 3 ]; then
|
||||
|
|
@ -55,9 +55,9 @@ setGlobals() {
|
|||
CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG3_CA
|
||||
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
|
||||
if [ $PEER -eq 0 ]; then
|
||||
CORE_PEER_ADDRESS=peer0.org3.example.com:7051
|
||||
CORE_PEER_ADDRESS=peer0.org3.example.com:11051
|
||||
else
|
||||
CORE_PEER_ADDRESS=peer1.org3.example.com:7051
|
||||
CORE_PEER_ADDRESS=peer1.org3.example.com:12051
|
||||
fi
|
||||
else
|
||||
echo "================== ERROR !!! ORG Unknown =================="
|
||||
|
|
@ -277,9 +277,10 @@ parsePeerConnectionParameters() {
|
|||
PEER_CONN_PARMS=""
|
||||
PEERS=""
|
||||
while [ "$#" -gt 0 ]; do
|
||||
setGlobals $1 $2
|
||||
PEER="peer$1.org$2"
|
||||
PEERS="$PEERS $PEER"
|
||||
PEER_CONN_PARMS="$PEER_CONN_PARMS --peerAddresses $PEER.example.com:7051"
|
||||
PEER_CONN_PARMS="$PEER_CONN_PARMS --peerAddresses $CORE_PEER_ADDRESS"
|
||||
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "true" ]; then
|
||||
TLSINFO=$(eval echo "--tlsRootCertFiles \$PEER$1_ORG$2_CA")
|
||||
PEER_CONN_PARMS="$PEER_CONN_PARMS $TLSINFO"
|
||||
|
|
|
|||
Loading…
Reference in a new issue