-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-7504] Fix Client.getPeersForOrgOnChannela fcn
There was an error in the logic to obtain all the peers for an org that have joined a channel. This fixes the logic and adds corresponding unit test cases. This fixes the issue and updates the tests to cover this case. Change-Id: Id10d34a6000b8946f99e2b75313e0d4506adca05 Signed-off-by: Gari Singh <[email protected]>
- Loading branch information
1 parent
ea8d0c3
commit ef0c3f7
Showing
3 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
# | ||
# The network connection profile provides client applications the information about the target | ||
# blockchain network that are necessary for the applications to interact with it. These are all | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
name: "global-trade-network" | ||
|
||
x-type: "hlfv1" | ||
|
||
# | ||
# Describe what the target network is/does. | ||
# | ||
description: "The network to be in if you want to stay in the global trade business" | ||
|
||
# | ||
# Schema version of the content. Used by the SDK to apply the corresponding parsing rules. | ||
# | ||
version: "1.0" | ||
|
||
channels: | ||
# name of the channel | ||
mychannel3: | ||
orderers: | ||
- orderer.example.com | ||
|
||
# Required. list of peers from participating orgs | ||
peers: | ||
peer0.org1.example.com: | ||
endorsingPeer: true | ||
chaincodeQuery: true | ||
ledgerQuery: true | ||
eventSource: true | ||
|
||
peer1.org1.example.com: | ||
endorsingPeer: true | ||
chaincodeQuery: true | ||
ledgerQuery: true | ||
eventSource: false | ||
|
||
peer0.org2.example.com: | ||
endorsingPeer: true | ||
chaincodeQuery: false | ||
ledgerQuery: true | ||
eventSource: false | ||
|
||
chaincodes: | ||
# the format follows the "cannonical name" of chaincodes by fabric code | ||
- example02:v1 | ||
- marbles:1.0 | ||
|
||
organizations: | ||
Org1: | ||
mspid: Org1MSP | ||
|
||
peers: | ||
- peer0.org1.example.com | ||
- peer1.org1.example.com | ||
- peer2.org1.example.com | ||
|
||
certificateAuthorities: | ||
- ca-org1 | ||
|
||
adminPrivateKey: | ||
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/keystore/9022d671ceedbb24af3ea69b5a8136cc64203df6b9920e26f48123fcfcb1d2e9_sk | ||
signedCert: | ||
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/signcerts/[email protected] | ||
|
||
Org2: | ||
mspid: Org2MSP | ||
peers: | ||
- peer0.org2.example.com | ||
certificateAuthorities: | ||
- ca-org2 | ||
adminPrivateKey: | ||
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/keystore/5a983ddcbefe52a7f9b8ee5b85a590c3e3a43c4ccd70c7795bec504e7f74848d_sk | ||
signedCert: | ||
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/signcerts/[email protected] | ||
|
||
orderers: | ||
orderer.example.com: | ||
url: grpcs://localhost:7050 | ||
|
||
# these are standard properties defined by the gRPC library | ||
# they will be passed in as-is to gRPC client constructor | ||
grpcOptions: | ||
ssl-target-name-override: orderer.example.com | ||
grpc-max-send-message-length: 15 | ||
|
||
tlsCACerts: | ||
path: test/fixtures/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tlscacerts/example.com-cert.pem | ||
|
||
peers: | ||
peer0.org1.example.com: | ||
# this URL is used to send endorsement and query requests | ||
url: grpc://localhost:7051 | ||
|
||
peer1.org1.example.com: | ||
# this URL is used to send endorsement and query requests | ||
url: grpc://localhost:8051 | ||
|
||
peer2.org1.example.com: | ||
# this URL is used to send endorsement and query requests | ||
url: grpc://localhost:9051 | ||
|
||
peer0.org2.example.com: | ||
url: grpc://localhost:10051 | ||
|
||
certificateAuthorities: | ||
ca-org1: | ||
url: https://localhost:7054 | ||
# the properties specified under this object are passed to the 'http' client verbatim when | ||
# making the request to the Fabric-CA server | ||
httpOptions: | ||
verify: false | ||
tlsCACerts: | ||
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/ca/org1.example.com-cert.pem | ||
|
||
# Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is | ||
# needed to enroll and invoke new users. | ||
registrar: | ||
- enrollId: admin | ||
enrollSecret: adminpw | ||
# [Optional] The optional name of the CA. | ||
caName: ca-org1 | ||
|
||
ca-org2: | ||
url: https://localhost:8054 | ||
httpOptions: | ||
verify: false | ||
tlsCACerts: | ||
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/ca/org2.example.com-cert.pem | ||
registrar: | ||
- enrollId: admin | ||
enrollSecret: adminpw | ||
# [Optional] The optional name of the CA. | ||
caName: ca-org2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters