Skip to content

Commit

Permalink
[FAB-3546 PTE supports multi-orderers]
Browse files Browse the repository at this point in the history
PTE supports multi orderer based on each organization.
Each organization can specify an orderer in the config
json file.  Then PTE will send all transactions targeting
any peers in that organization to the specified orderer.

Change-Id: Ie758596452ac0a798a43d9018c70fbd6241db19a
Signed-off-by: Dongming <dming@us.ibm.com>
  • Loading branch information
Dongming committed Jun 20, 2017
1 parent 69d40c3 commit d2943fc
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 110 deletions.
35 changes: 25 additions & 10 deletions test/tools/PTE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,23 +429,35 @@ where:
The service credentials contain the information of the network and are stored in the `SCFiles` directory. The following is a sample of the service credentials json file:
```
{
"test-network": {
"orderer": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:5005",
"server-hostname": "orderer0.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/cacerts/ca.example.com-cert.pem"
"orderer": {
"orderer0": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:7050",
"server-hostname": "orderer0.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/cacerts/ca.example.com-cert.pem"
},
"orderer1": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:8050",
"server-hostname": "orderer1.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/cacerts/ca.example.com-cert.pem"
}
},
"org1": {
"name": "Org1MSP",
"mspid": "Org1MSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp",
"comName": "example.com",
"ordererID": "orderer0",
"ca": {
"url":"https://localhost:7054",
"name": "ca-org1"
Expand All @@ -471,6 +483,7 @@ The service credentials contain the information of the network and are stored in
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp",
"comName": "example.com",
"ordererID": "orderer1",
"ca": {
"url":"https://localhost:8054",
"name": "ca-org2"
Expand All @@ -494,6 +507,8 @@ The service credentials contain the information of the network and are stored in
}
```
## Sending transactions to multiple orderers
PTE supports multi orderers by specifying an orderer to each organization using `ordererID` in the Service credentials json file. Then PTE will direct all transactions target the peers in that organization to the specified orderer.
## Creating a local Fabric network
- If you do not yet have the Fabric docker images in your local docker registry, please either build them from Fabric source or download them from dockerhub.
Expand Down
74 changes: 41 additions & 33 deletions test/tools/PTE/SCFiles/config-chan1-TLS.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,71 @@
{
"test-network": {
"orderer": {
"name": "OrdererOrg1",
"mspid": "OrdererOrg1",
"mspPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config",
"adminPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://10.120.223.35:5005",
"server-hostname": "example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/cacerts/ca.example.com-cert.pem"
"orderer1": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:7050",
"server-hostname": "orderer0.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/cacerts/ca.example.com-cert.pem"
},
"orderer2": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:8050",
"server-hostname": "orderer1.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/cacerts/ca.example.com-cert.pem"
}
},
"org1": {
"name": "PeerOrg1",
"mspid": "PeerOrg1",
"mspPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config",
"adminPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp",
"name": "Org1MSP",
"mspid": "Org1MSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp",
"comName": "example.com",
"ordererID": "orderer1",
"ca": {
"url":"https://10.120.223.35:7054",
"url":"https://localhost:7054",
"name": "ca-org1"
},
"username": "admin",
"secret": "adminpw",
"peer1": {
"requests": "grpcs://10.120.223.35:7061",
"events": "grpcs://10.120.223.35:6051",
"requests": "grpcs://localhost:7051",
"events": "grpcs://localhost:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
},
"peer2": {
"requests": "grpcs://10.120.223.35:7062",
"events": "grpcs://10.120.223.35:6052",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
"tls_cacerts": "./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
}
},
"org2": {
"name": "PeerOrg2",
"mspid": "PeerOrg2",
"mspPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config",
"adminPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp",
"name": "Org2MSP",
"mspid": "Org2MSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp",
"comName": "example.com",
"ordererID": "orderer2",
"ca": {
"url":"https://10.120.223.35:7055",
"url":"https://localhost:8054",
"name": "ca-org2"
},
"username": "admin",
"secret": "adminpw",
"peer1": {
"requests": "grpcs://10.120.223.35:7063",
"events": "grpcs://10.120.223.35:6053",
"requests": "grpcs://localhost:9051",
"events": "grpcs://localhost:9053",
"server-hostname": "peer0.org2.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
"tls_cacerts": "./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
},
"peer2": {
"requests": "grpcs://10.120.223.35:7064",
"events": "grpcs://10.120.223.35:6054",
"requests": "grpcs://localhost:10051",
"events": "grpcs://localhost:10053",
"server-hostname": "peer1.org2.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
"tls_cacerts": "./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
}
}
}
Expand Down
98 changes: 66 additions & 32 deletions test/tools/PTE/SCFiles/config-chan2-TLS.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,97 @@
{
"test-network": {
"orderer": {
"name": "OrdererOrg1",
"mspid": "OrdererOrg1",
"mspPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config",
"adminPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://10.120.223.35:5005",
"server-hostname": "example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/cacerts/ca.example.com-cert.pem"
"orderer0": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:8050",
"server-hostname": "orderer0.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/cacerts/ca.example.com-cert.pem"
},
"orderer1": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:8050",
"server-hostname": "orderer1.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/cacerts/ca.example.com-cert.pem"
},
"orderer2": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:9050",
"server-hostname": "orderer2.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/msp/cacerts/ca.example.com-cert.pem"
},
"orderer3": {
"name": "OrdererMSP",
"mspid": "OrdererMSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp",
"comName": "example.com",
"url": "grpcs://localhost:10050",
"server-hostname": "orderer3.example.com",
"tls_cacerts": "./crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/msp/cacerts/ca.example.com-cert.pem"
}
},
"org1": {
"name": "PeerOrg1",
"mspid": "PeerOrg1",
"mspPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config",
"adminPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp",
"name": "Org1MSP",
"mspid": "Org1MSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp",
"comName": "example.com",
"ordererID": "orderer2",
"ca": {
"url":"https://10.120.223.35:7054",
"url":"https://localhost:7054",
"name": "ca-org1"
},
"username": "admin",
"secret": "adminpw",
"peer1": {
"requests": "grpcs://10.120.223.35:7061",
"events": "grpcs://10.120.223.35:6051",
"requests": "grpcs://localhost:7051",
"events": "grpcs://localhost:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
"tls_cacerts": "./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
},
"peer2": {
"requests": "grpcs://10.120.223.35:7062",
"events": "grpcs://10.120.223.35:6052",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
}
"requests": "grpcs://localhost:8051",
"events": "grpcs://localhost:8053",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem"
}
},
"org2": {
"name": "PeerOrg2",
"mspid": "PeerOrg2",
"mspPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config",
"adminPath": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp",
"name": "Org2MSP",
"mspid": "Org2MSP",
"mspPath": "./crypto-config",
"adminPath": "./crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp",
"comName": "example.com",
"ordererID": "orderer3",
"ca": {
"url":"https://10.120.223.35:7055",
"url":"https://localhost:8054",
"name": "ca-org2"
},
"username": "admin",
"secret": "adminpw",
"peer1": {
"requests": "grpcs://10.120.223.35:7063",
"events": "grpcs://10.120.223.35:6053",
"requests": "grpcs://localhost:9051",
"events": "grpcs://localhost:9053",
"server-hostname": "peer0.org2.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
"tls_cacerts": "./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
},
"peer2": {
"requests": "grpcs://10.120.223.35:7064",
"events": "grpcs://10.120.223.35:6054",
"requests": "grpcs://localhost:10051",
"events": "grpcs://localhost:10053",
"server-hostname": "peer1.org2.example.com",
"tls_cacerts": "/root/gopath/src/github.com/hyperledger/fabric/common/tools/cryptogen/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
"tls_cacerts": "./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp/cacerts/ca.org2.example.com-cert.pem"
}
}
}
Expand Down
Loading

0 comments on commit d2943fc

Please sign in to comment.