Skip to content

Commit 7dff360

Browse files
author
Jason Yellick
committed
[FAB-9584] Fix warnings in e2e tests
There are some warnings emitted in the e2e tests thanks to some deprecated function in the configtxgen tool. These should be fixed so as to set a good example for users following our e2e example. Change-Id: I638ae5462659af3dc6aca93521a6a28b01230945 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
1 parent eca42cf commit 7dff360

File tree

4 files changed

+128
-11
lines changed

4 files changed

+128
-11
lines changed

examples/e2e_cli/base/peer-base.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
# the following setting starts chaincode containers on the same
1313
# bridge network as the peers
1414
# https://docs.docker.com/compose/networking/
15-
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2ecli_default
15+
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_default
1616
#- CORE_LOGGING_LEVEL=ERROR
1717
- CORE_LOGGING_LEVEL=DEBUG
1818
- CORE_PEER_TLS_ENABLED=true

examples/e2e_cli/configtx.yaml

+122-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515
Profiles:
1616

1717
TwoOrgsOrdererGenesis:
18-
Capabilities:
19-
<<: *ChannelCapabilities
18+
<<: *ChannelDefaults
2019
Orderer:
2120
<<: *OrdererDefaults
2221
Organizations:
2322
- *OrdererOrg
24-
Capabilities:
25-
<<: *OrdererCapabilities
2623
Consortiums:
2724
SampleConsortium:
2825
Organizations:
@@ -35,8 +32,6 @@ Profiles:
3532
Organizations:
3633
- *Org1
3734
- *Org2
38-
Capabilities:
39-
<<: *ApplicationCapabilities
4035

4136
################################################################################
4237
#
@@ -61,6 +56,20 @@ Organizations:
6156
# MSPDir is the filesystem path which contains the MSP configuration
6257
MSPDir: crypto-config/ordererOrganizations/example.com/msp
6358

59+
# Policies defines the set of policies at this level of the config tree
60+
# For organization policies, their canonical path is usually
61+
# /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
62+
Policies:
63+
Readers:
64+
Type: Signature
65+
Rule: "OR('OrdererMSP.member')"
66+
Writers:
67+
Type: Signature
68+
Rule: "OR('OrdererMSP.member')"
69+
Admins:
70+
Type: Signature
71+
Rule: "OR('OrdererMSP.admin')"
72+
6473
- &Org1
6574
# DefaultOrg defines the organization which is used in the sampleconfig
6675
# of the fabric.git development environment
@@ -71,6 +80,20 @@ Organizations:
7180

7281
MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
7382

83+
# Policies defines the set of policies at this level of the config tree
84+
# For organization policies, their canonical path is usually
85+
# /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
86+
Policies:
87+
Readers:
88+
Type: Signature
89+
Rule: "OR('Org1MSP.admin', 'Org1MSP.peer')"
90+
Writers:
91+
Type: Signature
92+
Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
93+
Admins:
94+
Type: Signature
95+
Rule: "OR('Org1MSP.admin')"
96+
7497
AnchorPeers:
7598
# AnchorPeers defines the location of peers which can be used
7699
# for cross org gossip communication. Note, this value is only
@@ -88,13 +111,60 @@ Organizations:
88111

89112
MSPDir: crypto-config/peerOrganizations/org2.example.com/msp
90113

114+
# Policies defines the set of policies at this level of the config tree
115+
# For organization policies, their canonical path is usually
116+
# /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
117+
Policies:
118+
Readers:
119+
Type: Signature
120+
Rule: "OR('Org2MSP.admin', 'Org2MSP.peer')"
121+
Writers:
122+
Type: Signature
123+
Rule: "OR('Org2MSP.admin', 'Org2MSP.client')"
124+
Admins:
125+
Type: Signature
126+
Rule: "OR('Org2MSP.admin')"
127+
91128
AnchorPeers:
92129
# AnchorPeers defines the location of peers which can be used
93130
# for cross org gossip communication. Note, this value is only
94131
# encoded in the genesis block in the Application section context
95132
- Host: peer0.org2.example.com
96133
Port: 7051
97134

135+
################################################################################
136+
#
137+
# CHANNEL
138+
#
139+
# This section defines the values to encode into a config transaction or
140+
# genesis block for channel related parameters.
141+
#
142+
################################################################################
143+
Channel: &ChannelDefaults
144+
# Policies defines the set of policies at this level of the config tree
145+
# For Channel policies, their canonical path is
146+
# /Channel/<PolicyName>
147+
Policies:
148+
# Who may invoke the 'Deliver' API
149+
Readers:
150+
Type: ImplicitMeta
151+
Rule: "ANY Readers"
152+
# Who may invoke the 'Broadcast' API
153+
Writers:
154+
Type: ImplicitMeta
155+
Rule: "ANY Writers"
156+
# By default, who may modify elements at this config level
157+
Admins:
158+
Type: ImplicitMeta
159+
Rule: "MAJORITY Admins"
160+
161+
162+
# Capabilities describes the channel level capabilities, see the
163+
# dedicated Capabilities section elsewhere in this file for a full
164+
# description
165+
Capabilities:
166+
<<: *ChannelCapabilities
167+
98168
################################################################################
99169
#
100170
# SECTION: Orderer
@@ -144,6 +214,31 @@ Orderer: &OrdererDefaults
144214
# the orderer side of the network
145215
Organizations:
146216

217+
# Policies defines the set of policies at this level of the config tree
218+
# For Orderer policies, their canonical path is
219+
# /Channel/Orderer/<PolicyName>
220+
Policies:
221+
Readers:
222+
Type: ImplicitMeta
223+
Rule: "ANY Readers"
224+
Writers:
225+
Type: ImplicitMeta
226+
Rule: "ANY Writers"
227+
Admins:
228+
Type: ImplicitMeta
229+
Rule: "MAJORITY Admins"
230+
# BlockValidation specifies what signatures must be included in the block
231+
# from the orderer for the peer to validate it.
232+
BlockValidation:
233+
Type: ImplicitMeta
234+
Rule: "ANY Writers"
235+
236+
# Capabilities describes the orderer level capabilities, see the
237+
# dedicated Capabilities section elsewhere in this file for a full
238+
# description
239+
Capabilities:
240+
<<: *OrdererCapabilities
241+
147242
################################################################################
148243
#
149244
# SECTION: Application
@@ -157,6 +252,27 @@ Application: &ApplicationDefaults
157252
# Organizations is the list of orgs which are defined as participants on
158253
# the application side of the network
159254
Organizations:
255+
256+
# Policies defines the set of policies at this level of the config tree
257+
# For Application policies, their canonical path is
258+
# /Channel/Application/<PolicyName>
259+
Policies:
260+
Readers:
261+
Type: ImplicitMeta
262+
Rule: "ANY Readers"
263+
Writers:
264+
Type: ImplicitMeta
265+
Rule: "ANY Writers"
266+
Admins:
267+
Type: ImplicitMeta
268+
Rule: "MAJORITY Admins"
269+
270+
# Capabilities describes the application level capabilities, see the
271+
# dedicated Capabilities section elsewhere in this file for a full
272+
# description
273+
Capabilities:
274+
<<: *ApplicationCapabilities
275+
160276
################################################################################
161277
#
162278
# SECTION: Capabilities

examples/e2e_cli/generateArtifacts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function generateChannelArtifacts() {
7575
echo "##########################################################"
7676
# Note: For some unknown reason (at least for now) the block file can't be
7777
# named orderer.genesis.block or the orderer will fail to launch!
78-
$CONFIGTXGEN -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
78+
$CONFIGTXGEN -profile TwoOrgsOrdererGenesis -channelID e2e-orderer-syschan -outputBlock ./channel-artifacts/genesis.block
7979

8080
echo
8181
echo "#################################################################"

examples/e2e_cli/scripts/script.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ MAX_RETRY=5
1919
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
2020
PEER0_ORG1_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
2121
PEER0_ORG2_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
22+
ORDERER_SYSCHAN_ID=e2e-orderer-syschan
2223

2324
echo "Channel name : "$CHANNEL_NAME
2425

@@ -70,11 +71,11 @@ checkOSNAvailability() {
7071
while test "$(($(date +%s)-starttime))" -lt "$TIMEOUT" -a $rc -ne 0
7172
do
7273
sleep 3
73-
echo "Attempting to fetch system channel 'testchainid' ...$(($(date +%s)-starttime)) secs"
74+
echo "Attempting to fetch system channel '$ORDERER_SYSCHAN_ID' ...$(($(date +%s)-starttime)) secs"
7475
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then
75-
peer channel fetch 0 -o orderer.example.com:7050 -c "testchainid" >&log.txt
76+
peer channel fetch 0 -o orderer.example.com:7050 -c "$ORDERER_SYSCHAN_ID" >&log.txt
7677
else
77-
peer channel fetch 0 0_block.pb -o orderer.example.com:7050 -c "testchainid" --tls --cafile $ORDERER_CA >&log.txt
78+
peer channel fetch 0 0_block.pb -o orderer.example.com:7050 -c "$ORDERER_SYSCHAN_ID" --tls --cafile $ORDERER_CA >&log.txt
7879
fi
7980
test $? -eq 0 && VALUE=$(cat log.txt | awk '/Received block/ {print $NF}')
8081
test "$VALUE" = "0" && let rc=0

0 commit comments

Comments
 (0)