You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current channel ID checks are to ensure that the IDs comply with the
Kafka topic naming restrictions.
However, it is possible that two different channel IDs such as TestChain
and testchain would both map to the same couchdb name, causing an
intersection and failure.
This CR changes the logic to test for the intersection of the
restrictions on CouchDB and Kafka. In particular, the logic now
requires that Channel IDs:
1. Contain only lower case ASCII alphanumerics, dots '.' and dashes '-'
2. Are shorter than 250 characters.
3. Start with a letter
Note that this is not a true intersection, because the ledger must still
map '.' to '_' for CouchDB, but this mapping is bijective so is safe and
free from collisions.
Because the configuration key name checking was leveraging this same
code path, the existing function was duplicated, to leave the same logic
checks in place for the config.
Although the code diff is relatively high, this is largely due to the
copying and renaming.
Change-Id: Ie957cf9b8a075233bfcc5d3748e1a91e795ff067
Signed-off-by: Jason Yellick <[email protected]>
Copy file name to clipboardexpand all lines: bddtests/features/bootstrap.feature
+22-22
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Feature: Bootstrap
52
52
| Organization |
53
53
| ordererOrg0 |
54
54
55
-
And the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "OrdererSystemChainId"
55
+
And the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "orderer-system-chain-id"
56
56
57
57
# We now have an orderer network with NO peers. Now need to configure and start the peer network
58
58
# This can be currently automated through folder creation of the proper form and placing PEMs.
@@ -72,22 +72,22 @@ Feature: Bootstrap
72
72
73
73
# Order info includes orderer admin/orderer information and address (host:port) from previous steps
74
74
# Only the peer organizations can vary.
75
-
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:
75
+
And the ordererBootstrapAdmin using cert alias "bootstrapCertAlias" creates the genesis block "ordererGenesisBlock" for chain "orderer-system-chain-id" for composition "<ComposeFile>" and consensus "<ConsensusType>" with consortiums modification policy "/Channel/Orderer/Admins" using consortiums:
76
76
| Consortium |
77
77
# | consortium1 |
78
78
79
79
80
-
And the orderer admins inspect and approve the genesis block for chain "OrdererSystemChainId"
80
+
And the orderer admins inspect and approve the genesis block for chain "orderer-system-chain-id"
81
81
82
82
# to be used for setting the orderer genesis block path parameter in composition
83
-
And the orderer admins use the genesis block for chain "OrdererSystemChainId" to configure orderers
83
+
And the orderer admins use the genesis block for chain "orderer-system-chain-id" to configure orderers
84
84
85
85
And we compose "<ComposeFile>"
86
86
87
87
# Sleep as to allow system up time
88
88
And I wait "<SystemUpWaitTime>" seconds
89
89
90
-
Given user "ordererBootstrapAdmin" gives "OrdererSystemChainId" to user "configAdminOrdererOrg0"
90
+
Given user "ordererBootstrapAdmin" gives "orderer-system-chain-id" to user "configAdminOrdererOrg0"
91
91
And user "ordererBootstrapAdmin" gives "ordererGenesisBlock" to user "configAdminOrdererOrg0"
92
92
93
93
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:
@@ -98,9 +98,9 @@ Feature: Bootstrap
98
98
99
99
And user "configAdminOrdererOrg0" using cert alias "config-admin-cert" connects to deliver function on orderer "<orderer0>"
100
100
101
-
And user "configAdminOrdererOrg0" retrieves the latest configuration "latestOrdererConfig" from orderer "<orderer0>" for channel "OrdererSystemChainId"
101
+
And user "configAdminOrdererOrg0" retrieves the latest configuration "latestOrdererConfig" from orderer "<orderer0>" for channel "orderer-system-chain-id"
102
102
103
-
And the orderer config admin "configAdminOrdererOrg0" creates a consortiums config update "consortiumsConfigUpdate1" using config "latestOrdererConfig" using orderer system channel ID "OrdererSystemChainId" to add consortiums:
103
+
And the orderer config admin "configAdminOrdererOrg0" creates a consortiums config update "consortiumsConfigUpdate1" using config "latestOrdererConfig" using orderer system channel ID "orderer-system-chain-id" to add consortiums:
104
104
| Consortium |
105
105
| consortium1 |
106
106
@@ -113,7 +113,7 @@ Feature: Bootstrap
113
113
114
114
And the user "configAdminOrdererOrg0" creates a ConfigUpdate Tx "consortiumsConfigUpdateTx1" using cert alias "config-admin-cert" using signed ConfigUpdateEnvelope "consortiumsConfigUpdate1Envelope"
115
115
116
-
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"
116
+
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"
117
117
118
118
119
119
Given the following application developers are defined for peer organizations and each saves their cert as alias
@@ -142,7 +142,7 @@ Feature: Bootstrap
142
142
# Entry point for creating a channel
143
143
And the user "dev0Org0" creates a new channel ConfigUpdate "createChannelConfigUpdate1" using consortium "consortium1"
And the user "dev0Org0" creates a configUpdateEnvelope "createChannelConfigUpdate1Envelope" using configUpdate "createChannelConfigUpdate1"
148
148
@@ -154,7 +154,7 @@ Feature: Bootstrap
154
154
155
155
And the user "dev0Org0" creates a ConfigUpdate Tx "configUpdateTx1" using cert alias "consortium1-cert" using signed ConfigUpdateEnvelope "createChannelConfigUpdate1Envelope"
156
156
157
-
And the user "dev0Org0" using cert alias "consortium1-cert" broadcasts ConfigUpdate Tx "configUpdateTx1" to orderer "<orderer0>" to create channel "com.acme.blockchain.jdoe.Channel1"
157
+
And the user "dev0Org0" using cert alias "consortium1-cert" broadcasts ConfigUpdate Tx "configUpdateTx1" to orderer "<orderer0>" to create channel "com.acme.blockchain.jdoe.channel1"
158
158
159
159
# Sleep as the local orderer needs to bring up the resources that correspond to the new channel
160
160
# For the Kafka orderer, this includes setting up a producer and consumer for the channel's partition
@@ -164,7 +164,7 @@ Feature: Bootstrap
164
164
When user "dev0Org0" using cert alias "consortium1-cert" connects to deliver function on orderer "<orderer0>"
165
165
And user "dev0Org0" sends deliver a seek request on orderer "<orderer0>" with properties:
166
166
| ChainId | Start | End |
167
-
| com.acme.blockchain.jdoe.Channel1 | 0 | 0 |
167
+
| com.acme.blockchain.jdoe.channel1 | 0 | 0 |
168
168
169
169
Then user "dev0Org0" should get a delivery "genesisBlockForMyNewChannel" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
170
170
@@ -216,7 +216,7 @@ Feature: Bootstrap
216
216
| init | a | 100 | b | 200 |
217
217
218
218
# Under the covers, create a deployment spec, etc.
219
-
And user "peer0Admin" using cert alias "peer-admin-cert" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec"
219
+
And user "peer0Admin" using cert alias "peer-admin-cert" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "cc_spec"
220
220
221
221
And user "peer0Admin" using cert alias "peer-admin-cert" sends proposal "installProposal1" to endorsers with timeout of "90" seconds with proposal responses "installProposalResponses":
222
222
| Endorser |
@@ -229,7 +229,7 @@ Feature: Bootstrap
229
229
Given user "peer0Admin" gives "cc_spec" to user "peer2Admin"
230
230
231
231
# Under the covers, create a deployment spec, etc.
232
-
When user "peer2Admin" using cert alias "peer-admin-cert" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec"
232
+
When user "peer2Admin" using cert alias "peer-admin-cert" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "cc_spec"
233
233
234
234
And user "peer2Admin" using cert alias "peer-admin-cert" sends proposal "installProposal1" to endorsers with timeout of "90" seconds with proposal responses "installProposalResponses":
235
235
| Endorser |
@@ -244,7 +244,7 @@ Feature: Bootstrap
244
244
And user "peer0Admin" gives "cc_spec" to user "configAdminPeerOrg0"
245
245
246
246
247
-
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"
247
+
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"
248
248
249
249
And user "configAdminPeerOrg0" using cert alias "config-admin-cert" sends proposal "instantiateProposal1" to endorsers with timeout of "90" seconds with proposal responses "instantiateProposalResponses":
250
250
| Endorser |
@@ -262,9 +262,9 @@ Feature: Bootstrap
262
262
| peer0 |
263
263
| peer2 |
264
264
265
-
When the user "configAdminPeerOrg0" creates transaction "instantiateTx1" from proposal "instantiateProposal1" and proposal responses "instantiateProposalResponses" for channel "com.acme.blockchain.jdoe.Channel1"
265
+
When the user "configAdminPeerOrg0" creates transaction "instantiateTx1" from proposal "instantiateProposal1" and proposal responses "instantiateProposalResponses" for channel "com.acme.blockchain.jdoe.channel1"
266
266
267
-
And the user "configAdminPeerOrg0" broadcasts transaction "instantiateTx1" to orderer "<orderer1>" on channel "com.acme.blockchain.jdoe.Channel1"
267
+
And the user "configAdminPeerOrg0" broadcasts transaction "instantiateTx1" to orderer "<orderer1>" on channel "com.acme.blockchain.jdoe.channel1"
268
268
269
269
# Sleep as the local orderer ledger needs to create the block that corresponds to the start number of the seek request
270
270
And I wait "<BroadcastWaitTime>" seconds
@@ -273,7 +273,7 @@ Feature: Bootstrap
273
273
274
274
And user "configAdminPeerOrg0" sends deliver a seek request on orderer "<orderer0>" with properties:
275
275
| ChainId | Start | End |
276
-
| com.acme.blockchain.jdoe.Channel1 | 1 | 1 |
276
+
| com.acme.blockchain.jdoe.channel1 | 1 | 1 |
277
277
278
278
Then user "configAdminPeerOrg0" should get a delivery "deliveredInstantiateTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
279
279
@@ -286,7 +286,7 @@ Feature: Bootstrap
286
286
| query | a |
287
287
288
288
# Under the covers, create a deployment spec, etc.
289
-
And user "dev0Org0" using cert alias "consortium1-cert" creates a proposal "queryProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "querySpec1"
289
+
And user "dev0Org0" using cert alias "consortium1-cert" creates a proposal "queryProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "querySpec1"
290
290
291
291
And user "dev0Org0" using cert alias "consortium1-cert" sends proposal "queryProposal1" to endorsers with timeout of "30" seconds with proposal responses "queryProposal1Responses":
292
292
| Endorser |
@@ -310,7 +310,7 @@ Feature: Bootstrap
310
310
| invoke | a | b | 10 |
311
311
312
312
# Under the covers, create a deployment spec, etc.
313
-
And user "dev0Org0" using cert alias "consortium1-cert" creates a proposal "invokeProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "invocationSpec1"
313
+
And user "dev0Org0" using cert alias "consortium1-cert" creates a proposal "invokeProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "invocationSpec1"
314
314
315
315
And user "dev0Org0" using cert alias "consortium1-cert" sends proposal "invokeProposal1" to endorsers with timeout of "30" seconds with proposal responses "invokeProposal1Responses":
316
316
| Endorser |
@@ -327,16 +327,16 @@ Feature: Bootstrap
327
327
| peer0 |
328
328
| peer2 |
329
329
330
-
When the user "dev0Org0" creates transaction "invokeTx1" from proposal "invokeProposal1" and proposal responses "invokeProposal1Responses" for channel "com.acme.blockchain.jdoe.Channel1"
330
+
When the user "dev0Org0" creates transaction "invokeTx1" from proposal "invokeProposal1" and proposal responses "invokeProposal1Responses" for channel "com.acme.blockchain.jdoe.channel1"
331
331
332
-
And the user "dev0Org0" broadcasts transaction "invokeTx1" to orderer "<orderer2>" on channel "com.acme.blockchain.jdoe.Channel1"
332
+
And the user "dev0Org0" broadcasts transaction "invokeTx1" to orderer "<orderer2>" on channel "com.acme.blockchain.jdoe.channel1"
333
333
334
334
# Sleep as the local orderer ledger needs to create the block that corresponds to the start number of the seek request
335
335
And I wait "<BroadcastWaitTime>" seconds
336
336
337
337
And user "dev0Org0" sends deliver a seek request on orderer "<orderer0>" with properties:
338
338
| ChainId | Start | End |
339
-
| com.acme.blockchain.jdoe.Channel1 | 2 | 2 |
339
+
| com.acme.blockchain.jdoe.channel1 | 2 | 2 |
340
340
341
341
Then user "dev0Org0" should get a delivery "deliveredInvokeTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
0 commit comments