Skip to content

Commit a6737cc

Browse files
committed
[FAB-3761] Proper orderer system channel update
Need to properly add consortiums as a config update to the orderer system channel, vs in the genesis block as done currently. Renamed mspAdmin to configAdmin, defind configAdmin for orderer organization. Orderer configAdmin now responsible for consortium creation. Added mod_policy definition to consortium creation. Now retrieve latest config_update block from channel. Orderer configAdmin now submits config_update TX for consortium creation. Now add anchorpeers to channel config_update. Removed anchor peers for now from feature. Will add back in subsequent CR. Has no funcational impact. Changed mspAdmin... to configAdmin... Removed older configuration functions. Renamed msp-admin-cert references to config-admin-cert. Change-Id: Ic62d76532bb90fd0f2452185980f2e4668151eae Signed-off-by: Jeff Garratt <[email protected]>
1 parent 65ee7b2 commit a6737cc

File tree

3 files changed

+230
-134
lines changed

3 files changed

+230
-134
lines changed

bddtests/features/bootstrap.feature

+74-43
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ Feature: Bootstrap
1919
Given the orderer network has organizations:
2020
| Organization | Readers | Writers | Admins |
2121
| ordererOrg0 | member | member | admin |
22+
# | ordererOrg1 | member | member | admin |
2223

2324
And user requests role of orderer admin by creating a key and csr for orderer and acquires signed certificate from organization:
24-
| User | Orderer | Organization |
25-
| orderer0Signer | orderer0 | ordererOrg0 |
26-
| orderer1Signer | orderer1 | ordererOrg0 |
27-
| orderer2Signer | orderer2 | ordererOrg0 |
25+
| User | Orderer | Organization | AliasSavedUnder |
26+
| orderer0Signer | orderer0 | ordererOrg0 | |
27+
| orderer1Signer | orderer1 | ordererOrg0 | |
28+
| orderer2Signer | orderer2 | ordererOrg0 | |
29+
| configAdminOrdererOrg0 | configAdmin | ordererOrg0 | config-admin-cert |
30+
# | configAdminOrdererOrg1 | configAdmin | ordererOrg1 | config-admin-cert |
2831

2932

3033
# Rolenames : MspPrincipal.proto
@@ -47,30 +50,24 @@ Feature: Bootstrap
4750
# We now have an orderer network with NO peers. Now need to configure and start the peer network
4851
# This can be currently automated through folder creation of the proper form and placing PEMs.
4952
And user requests role for peer by creating a key and csr for peer and acquires signed certificate from organization:
50-
| User | Peer | Organization |AliasSavedUnder|
51-
| peer0Signer | peer0 | peerOrg0 | |
52-
| peer1Signer | peer1 | peerOrg0 | |
53-
| peer2Signer | peer2 | peerOrg1 | |
54-
| peer3Signer | peer3 | peerOrg1 | |
55-
| peer0Admin | peer0 | peerOrg0 |peer-admin-cert|
56-
| peer1Admin | peer1 | peerOrg0 |peer-admin-cert|
57-
| peer2Admin | peer2 | peerOrg1 |peer-admin-cert|
58-
| peer3Admin | peer3 | peerOrg1 |peer-admin-cert|
59-
| mspAdminPeerOrg0| mspAdmin | peerOrg0 |msp-admin-cert |
60-
| mspAdminPeerOrg1| mspAdmin | peerOrg1 |msp-admin-cert |
61-
62-
And the ordererBootstrapAdmin creates a consortium "consortium1" (network name) for peer orgs who wish to form a network:
63-
| Organization |
64-
| peerOrg0 |
65-
| peerOrg1 |
66-
# | peerOrg2 |
53+
| User | Peer | Organization | AliasSavedUnder |
54+
| peer0Signer | peer0 | peerOrg0 | |
55+
| peer1Signer | peer1 | peerOrg0 | |
56+
| peer2Signer | peer2 | peerOrg1 | |
57+
| peer3Signer | peer3 | peerOrg1 | |
58+
| peer0Admin | peer0 | peerOrg0 | peer-admin-cert |
59+
| peer1Admin | peer1 | peerOrg0 | peer-admin-cert |
60+
| peer2Admin | peer2 | peerOrg1 | peer-admin-cert |
61+
| peer3Admin | peer3 | peerOrg1 | peer-admin-cert |
62+
| configAdminPeerOrg0 | configAdmin | peerOrg0 | config-admin-cert |
63+
| configAdminPeerOrg1 | configAdmin | peerOrg1 | config-admin-cert |
6764

6865

6966
# Order info includes orderer admin/orderer information and address (host:port) from previous steps
7067
# Only the peer organizations can vary.
71-
And the ordererBootstrapAdmin using cert alias "bootstrapCertAlias" creates the genesis block "ordererGenesisBlock" for chain "OrdererSystemChainId" for composition "<ComposeFile>" and consensus "<ConsensusType>" using consortiums:
68+
And the ordererBootstrapAdmin using cert alias "bootstrapCertAlias" creates the genesis block "ordererGenesisBlock" for chain "OrdererSystemChainId" for composition "<ComposeFile>" and consensus "<ConsensusType>" with consortiums modification policy "/Channel/Orderer/Admins" using consortiums:
7269
| Consortium |
73-
| consortium1 |
70+
# | consortium1 |
7471

7572

7673
And the orderer admins inspect and approve the genesis block for chain "OrdererSystemChainId"
@@ -83,11 +80,42 @@ Feature: Bootstrap
8380
# Sleep as to allow system up time
8481
And I wait "<SystemUpWaitTime>" seconds
8582

86-
And the following application developers are defined for peer organizations and each saves their cert as alias
83+
Given user "ordererBootstrapAdmin" gives "OrdererSystemChainId" to user "configAdminOrdererOrg0"
84+
And user "ordererBootstrapAdmin" gives "ordererGenesisBlock" to user "configAdminOrdererOrg0"
85+
86+
And the orderer config admin "configAdminOrdererOrg0" creates a consortium "consortium1" with modification policy "/Channel/Orderer/Admins" for peer orgs who wish to form a network:
87+
| Organization |
88+
| peerOrg0 |
89+
| peerOrg1 |
90+
# | peerOrg2 |
91+
92+
And user "configAdminOrdererOrg0" using cert alias "config-admin-cert" connects to deliver function on orderer "<orderer0>"
93+
94+
And user "configAdminOrdererOrg0" retrieves the latest configuration "latestOrdererConfig" from orderer "<orderer0>" for channel "OrdererSystemChainId"
95+
96+
And the orderer config admin "configAdminOrdererOrg0" creates a consortiums config update "consortiumsConfigUpdate1" using config "latestOrdererConfig" using orderer system channel ID "OrdererSystemChainId" to add consortiums:
97+
| Consortium |
98+
| consortium1 |
99+
100+
And the user "configAdminOrdererOrg0" creates a configUpdateEnvelope "consortiumsConfigUpdate1Envelope" using configUpdate "consortiumsConfigUpdate1"
101+
102+
And the user "configAdminOrdererOrg0" collects signatures for ConfigUpdateEnvelope "consortiumsConfigUpdate1Envelope" from developers:
103+
| Developer | Cert Alias |
104+
| configAdminOrdererOrg0 | config-admin-cert |
105+
# | configAdminOrdererOrg1 | config-admin-cert |
106+
107+
And the user "configAdminOrdererOrg0" creates a ConfigUpdate Tx "consortiumsConfigUpdateTx1" using cert alias "config-admin-cert" using signed ConfigUpdateEnvelope "consortiumsConfigUpdate1Envelope"
108+
109+
And the user "configAdminOrdererOrg0" using cert alias "config-admin-cert" broadcasts ConfigUpdate Tx "consortiumsConfigUpdateTx1" to orderer "<orderer0>" to create channel "com.acme.blockchain.jdoe.Channel1"
110+
111+
112+
Given the following application developers are defined for peer organizations and each saves their cert as alias
87113
| Developer | Consortium | Organization | AliasSavedUnder |
88114
| dev0Org0 | consortium1 | peerOrg0 | dev0Org0App1 |
89115
| dev0Org1 | consortium1 | peerOrg1 | dev0Org1App1 |
90116

117+
And user "configAdminOrdererOrg0" gives "consortium1" to user "dev0Org0"
118+
91119
# Need Consortium MSP info and
92120
# need to add the ChannelWriters ConfigItem (using ChannelWriters ref name),
93121
# ChannelReaders ConfigItem (using ChannelReaders ref name)AnchorPeers ConfigItem
@@ -100,21 +128,24 @@ Feature: Bootstrap
100128

101129
And the user "dev0Org0" creates an peer anchor set "anchors1" for channel "com.acme.blockchain.jdoe.Channel1" for orgs:
102130
| User | Peer | Organization |
103-
| peer0Signer | peer0 | peerOrg0 |
104-
| peer2Signer | peer2 | peerOrg1 |
131+
# | peer0Signer | peer0 | peerOrg0 |
132+
# | peer2Signer | peer2 | peerOrg1 |
105133

106134
# TODO: grab the peer orgs from template1 and put into Murali's MSP info SCIs.
107135
# Entry point for creating a channel from existing templates
108-
And the user "dev0Org0" creates a ConfigUpdateEnvelope "createChannelConfigUpdate1"
109-
| ChannelID | Template | Consortium | Anchors |
110-
| com.acme.blockchain.jdoe.Channel1 | template1 | consortium1 | anchors1 |
136+
And the user "dev0Org0" creates a new channel ConfigUpdate "createChannelConfigUpdate1" using consortium config "consortium1"
137+
| ChannelID | Template | Anchors |
138+
| com.acme.blockchain.jdoe.Channel1 | template1 | anchors1 |
139+
140+
And the user "dev0Org0" creates a configUpdateEnvelope "createChannelConfigUpdate1Envelope" using configUpdate "createChannelConfigUpdate1"
141+
111142

112-
And the user "dev0Org0" collects signatures for ConfigUpdateEnvelope "createChannelConfigUpdate1" from developers:
143+
And the user "dev0Org0" collects signatures for ConfigUpdateEnvelope "createChannelConfigUpdate1Envelope" from developers:
113144
| Developer | Cert Alias |
114145
| dev0Org0 | dev0Org0App1 |
115146
| dev0Org1 | dev0Org1App1 |
116147

117-
And the user "dev0Org0" creates a ConfigUpdate Tx "configUpdateTx1" using cert alias "dev0Org0App1" using signed ConfigUpdateEnvelope "createChannelConfigUpdate1"
148+
And the user "dev0Org0" creates a ConfigUpdate Tx "configUpdateTx1" using cert alias "dev0Org0App1" using signed ConfigUpdateEnvelope "createChannelConfigUpdate1Envelope"
118149

119150
And the user "dev0Org0" using cert alias "dev0Org0App1" broadcasts ConfigUpdate Tx "configUpdateTx1" to orderer "<orderer0>" to create channel "com.acme.blockchain.jdoe.Channel1"
120151

@@ -201,44 +232,44 @@ Feature: Bootstrap
201232

202233

203234
Given user "peer0Admin" gives "cc_spec" to user "dev0Org0"
204-
And user "peer0Admin" gives "cc_spec" to user "mspAdminPeerOrg0"
235+
And user "peer0Admin" gives "cc_spec" to user "configAdminPeerOrg0"
205236

206237

207-
When user "mspAdminPeerOrg0" using cert alias "msp-admin-cert" creates a instantiate proposal "instantiateProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec"
238+
When user "configAdminPeerOrg0" using cert alias "config-admin-cert" creates a instantiate proposal "instantiateProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec"
208239

209-
And user "mspAdminPeerOrg0" using cert alias "msp-admin-cert" sends proposal "instantiateProposal1" to endorsers with timeout of "90" seconds with proposal responses "instantiateProposalResponses":
240+
And user "configAdminPeerOrg0" using cert alias "config-admin-cert" sends proposal "instantiateProposal1" to endorsers with timeout of "90" seconds with proposal responses "instantiateProposalResponses":
210241
| Endorser |
211242
| peer0 |
212243
| peer2 |
213244

214245

215-
Then user "mspAdminPeerOrg0" expects proposal responses "instantiateProposalResponses" with status "200" from endorsers:
246+
Then user "configAdminPeerOrg0" expects proposal responses "instantiateProposalResponses" with status "200" from endorsers:
216247
| Endorser |
217248
| peer0 |
218249
| peer2 |
219250

220-
And user "mspAdminPeerOrg0" expects proposal responses "instantiateProposalResponses" each have the same value from endorsers:
251+
And user "configAdminPeerOrg0" expects proposal responses "instantiateProposalResponses" each have the same value from endorsers:
221252
| Endorser |
222253
| peer0 |
223254
| peer2 |
224255

225-
When the user "mspAdminPeerOrg0" creates transaction "instantiateTx1" from proposal "instantiateProposal1" and proposal responses "instantiateProposalResponses" for channel "com.acme.blockchain.jdoe.Channel1"
256+
When the user "configAdminPeerOrg0" creates transaction "instantiateTx1" from proposal "instantiateProposal1" and proposal responses "instantiateProposalResponses" for channel "com.acme.blockchain.jdoe.Channel1"
226257

227-
And the user "mspAdminPeerOrg0" broadcasts transaction "instantiateTx1" to orderer "<orderer1>" on channel "com.acme.blockchain.jdoe.Channel1"
258+
And the user "configAdminPeerOrg0" broadcasts transaction "instantiateTx1" to orderer "<orderer1>" on channel "com.acme.blockchain.jdoe.Channel1"
228259

229260
# Sleep as the deliver takes a bit to have the first block ready
230261
And I wait "2" seconds
231262

232-
And user "mspAdminPeerOrg0" using cert alias "msp-admin-cert" connects to deliver function on orderer "<orderer0>"
263+
And user "configAdminPeerOrg0" using cert alias "config-admin-cert" connects to deliver function on orderer "<orderer0>"
233264

234-
And user "mspAdminPeerOrg0" sends deliver a seek request on orderer "<orderer0>" with properties:
265+
And user "configAdminPeerOrg0" sends deliver a seek request on orderer "<orderer0>" with properties:
235266
| ChainId | Start | End |
236267
| com.acme.blockchain.jdoe.Channel1 | 1 | 1 |
237268

238-
Then user "mspAdminPeerOrg0" should get a delivery "deliveredInstantiateTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
269+
Then user "configAdminPeerOrg0" should get a delivery "deliveredInstantiateTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
239270

240271
# Sleep as the deliver takes a bit to have the first block ready
241-
And I wait "1" seconds
272+
And I wait "3" seconds
242273

243274

244275
# Entry point for invoking on an existing channel
@@ -293,7 +324,7 @@ Feature: Bootstrap
293324
And the user "dev0Org0" broadcasts transaction "invokeTx1" to orderer "<orderer2>" on channel "com.acme.blockchain.jdoe.Channel1"
294325

295326
# Sleep as the deliver takes a bit to have the first block ready
296-
And I wait "2" seconds
327+
And I wait "3" seconds
297328

298329
And user "dev0Org0" sends deliver a seek request on orderer "<orderer0>" with properties:
299330
| ChainId | Start | End |

0 commit comments

Comments
 (0)