Skip to content

Commit c89954a

Browse files
committed
[FAB-10113] test idemix MSP in the e2e
This change set introduces support to test the client idemix signer and the peer idemix verifier in the e2e test. This is accomplished by adding a third organization with MSP of type idemix, and adding an extra chaincode query where the creator signs using idemix. Notice that no extra peer is introduced, since peers cannot operate as idemix endorsers yet with a local MSP of type idemix. Change-Id: Ice078d75f12e901ba580583791a8574a14b96802 Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
1 parent 2141d89 commit c89954a

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

examples/e2e_cli/configtx.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ Profiles:
2525
Organizations:
2626
- *Org1
2727
- *Org2
28+
- *Org3
2829
TwoOrgsChannel:
2930
Consortium: SampleConsortium
3031
Application:
3132
<<: *ApplicationDefaults
3233
Organizations:
3334
- *Org1
3435
- *Org2
36+
- *Org3
3537

3638
################################################################################
3739
#
@@ -132,6 +134,25 @@ Organizations:
132134
- Host: peer0.org2.example.com
133135
Port: 7051
134136

137+
- &Org3
138+
# Name of the organization
139+
Name: Org3MSP
140+
141+
# ID to load the MSP definition as
142+
ID: Org3MSP
143+
144+
# Type of MSP - this org uses idemix for its MSP implementation
145+
MSPType: idemix
146+
147+
MSPDir: crypto-config/idemix
148+
149+
AnchorPeers:
150+
# AnchorPeers defines the location of peers which can be used
151+
# for cross org gossip communication. Note, this value is only
152+
# encoded in the genesis block in the Application section context
153+
- Host: peer0.org3.example.com
154+
Port: 7051
155+
135156
################################################################################
136157
#
137158
# CHANNEL

examples/e2e_cli/docker-compose-cli.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ services:
142142
- CORE_PEER_ID=cli
143143
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
144144
- CORE_PEER_LOCALMSPID=Org1MSP
145+
- CORE_PEER_LOCALMSPTYPE=bccsp
145146
- CORE_PEER_TLS_ENABLED=true
146147
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
147148
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

examples/e2e_cli/generateArtifacts.sh

+1
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,6 @@ function generateChannelArtifacts() {
127127
}
128128

129129
generateCerts
130+
generateIdemixMaterial
130131
replacePrivateKey
131132
generateChannelArtifacts

examples/e2e_cli/scripts/script.sh

+10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ setGlobals () {
4444
else
4545
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
4646
fi
47+
elif [ $ORG -eq 3 ] ; then
48+
CORE_PEER_LOCALMSPID="Org3MSP"
49+
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
50+
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
51+
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/idemix
52+
CORE_PEER_LOCALMSPTYPE=idemix
4753
else
4854
CORE_PEER_LOCALMSPID="Org2MSP"
4955
CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA
@@ -304,6 +310,10 @@ installChaincode 1 2
304310
echo "Querying chaincode on peer1.org2..."
305311
chaincodeQuery 1 2 90
306312

313+
#Query on chaincode on Peer0/Org1 with idemix MSP type, check if the result is 90
314+
echo "Querying chaincode on org1/peer0..."
315+
chaincodeQuery 1 3 90
316+
307317
echo
308318
echo "===================== All GOOD, End-2-End execution completed ===================== "
309319
echo

0 commit comments

Comments
 (0)