Skip to content

Commit 17e7276

Browse files
committed
[FAB-4452] Def of anchor peers post channel create
Demonstrate the definition of anchor peers after the peer network channel has been created. Now allow for optional setting of peer anchors during channel create. Removed references to channel ID where is was not necessary. Removed spurious comments from bootstrap.feature. Added mod_policy to orgs in consortium update. Now add the subjectAltName extension for TLS and signing certs. Changed to less specific use of project_name vs composition. Current update of existing channel should work for insertions. Changed algorithm for getting channel name for orderer bootstrap to return id that starts with alpha. This is to manage recent change for couchDB purposes. This is a ramification of https://jira.hyperledger.org/browse/FAB-2487. Renamed OrdererSystemChannelId reference in feature to ordererSystemChannelId. Also changed cc_spec to ccSpec. Bumped wait time from 3 to 5 secs for instantiation to occur. Change-Id: I5fb245063ab352b2f07460d5a475cedf84c77ef5 Signed-off-by: Jeff Garratt <[email protected]>
1 parent 0a72230 commit 17e7276

File tree

5 files changed

+308
-117
lines changed

5 files changed

+308
-117
lines changed

bddtests/features/bootstrap.feature

+74-36
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Bootstrap
1616
As a blockchain entrepreneur
1717
I want to bootstrap a new blockchain network
1818

19-
# @doNotDecompose
19+
@doNotDecompose
2020
@generateDocs
2121
Scenario Outline: Bootstrap a development network with 4 peers (2 orgs) and 1 orderer (1 org), each having a single independent root of trust (No fabric-ca, just openssl)
2222
#creates 1 self-signed key/cert pair per orderer organization
@@ -52,7 +52,7 @@ Feature: Bootstrap
5252
| Organization |
5353
| ordererOrg0 |
5454

55-
And the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "orderer-system-chain-id"
55+
And the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "ordererSystemChannelId"
5656

5757
# We now have an orderer network with NO peers. Now need to configure and start the peer network
5858
# This can be currently automated through folder creation of the proper form and placing PEMs.
@@ -72,22 +72,22 @@ Feature: Bootstrap
7272

7373
# Order info includes orderer admin/orderer information and address (host:port) from previous steps
7474
# Only the peer organizations can vary.
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:
75+
And the ordererBootstrapAdmin using cert alias "bootstrapCertAlias" creates the genesis block "ordererGenesisBlock" for chain "ordererSystemChannelId" for composition "<ComposeFile>" and consensus "<ConsensusType>" with consortiums modification policy "/Channel/Orderer/Admins" using consortiums:
7676
| Consortium |
7777
# | consortium1 |
7878

7979

80-
And the orderer admins inspect and approve the genesis block for chain "orderer-system-chain-id"
80+
And the orderer admins inspect and approve the genesis block for chain "ordererSystemChannelId"
8181

8282
# to be used for setting the orderer genesis block path parameter in composition
83-
And the orderer admins use the genesis block for chain "orderer-system-chain-id" to configure orderers
83+
And the orderer admins use the genesis block for chain "ordererSystemChannelId" to configure orderers
8484

8585
And we compose "<ComposeFile>"
8686

8787
# Sleep as to allow system up time
8888
And I wait "<SystemUpWaitTime>" seconds
8989

90-
Given user "ordererBootstrapAdmin" gives "orderer-system-chain-id" to user "configAdminOrdererOrg0"
90+
Given user "ordererBootstrapAdmin" gives "ordererSystemChannelId" to user "configAdminOrdererOrg0"
9191
And user "ordererBootstrapAdmin" gives "ordererGenesisBlock" to user "configAdminOrdererOrg0"
9292

9393
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
9898

9999
And user "configAdminOrdererOrg0" using cert alias "config-admin-cert" connects to deliver function on orderer "<orderer0>"
100100

101-
And user "configAdminOrdererOrg0" retrieves the latest configuration "latestOrdererConfig" from orderer "<orderer0>" for channel "orderer-system-chain-id"
101+
And user "configAdminOrdererOrg0" retrieves the latest config update "latestOrdererConfig" from orderer "<orderer0>" for channel "{ordererSystemChannelId}"
102102

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:
103+
And the orderer config admin "configAdminOrdererOrg0" creates a consortiums config update "consortiumsConfigUpdate1" using config "latestOrdererConfig" using orderer system channel ID "ordererSystemChannelId" to add consortiums:
104104
| Consortium |
105105
| consortium1 |
106106

@@ -113,7 +113,7 @@ Feature: Bootstrap
113113

114114
And the user "configAdminOrdererOrg0" creates a ConfigUpdate Tx "consortiumsConfigUpdateTx1" using cert alias "config-admin-cert" using signed ConfigUpdateEnvelope "consortiumsConfigUpdate1Envelope"
115115

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>"
117117

118118

119119
Given the following application developers are defined for peer organizations and each saves their cert as alias
@@ -123,11 +123,6 @@ Feature: Bootstrap
123123

124124
And user "configAdminOrdererOrg0" gives "consortium1" to user "dev0Org0"
125125

126-
# Need Consortium MSP info and
127-
# need to add the ChannelWriters ConfigItem (using ChannelWriters ref name),
128-
# ChannelReaders ConfigItem (using ChannelReaders ref name)AnchorPeers ConfigItem
129-
# and the ChaincodeLifecyclePolicy Config Item
130-
# NOTE: Template1 will simply hold refs to peer orgs that can create in this channel at the moment
131126
And the user "dev0Org0" creates a peer organization set "peerOrgSet1" with peer organizations:
132127
| Organization |
133128
| peerOrg0 |
@@ -136,13 +131,13 @@ Feature: Bootstrap
136131

137132
And the user "dev0Org0" creates an peer anchor set "anchors1" for orgs:
138133
| User | Peer | Organization |
139-
# | peer0Signer | peer0 | peerOrg0 |
140-
# | peer2Signer | peer2 | peerOrg1 |
134+
| peer0Signer | peer0 | peerOrg0 |
135+
| peer2Signer | peer2 | peerOrg1 |
141136

142137
# Entry point for creating a channel
143138
And the user "dev0Org0" creates a new channel ConfigUpdate "createChannelConfigUpdate1" using consortium "consortium1"
144-
| ChannelID | PeerOrgSet | PeerAnchorSet |
145-
| com.acme.blockchain.jdoe.channel1 | peerOrgSet1 | anchors1 |
139+
| ChannelID | PeerOrgSet | [PeerAnchorSet] |
140+
| com.acme.blockchain.jdoe.channel1 | peerOrgSet1 | |
146141

147142
And the user "dev0Org0" creates a configUpdateEnvelope "createChannelConfigUpdate1Envelope" using configUpdate "createChannelConfigUpdate1"
148143

@@ -154,7 +149,7 @@ Feature: Bootstrap
154149

155150
And the user "dev0Org0" creates a ConfigUpdate Tx "configUpdateTx1" using cert alias "consortium1-cert" using signed ConfigUpdateEnvelope "createChannelConfigUpdate1Envelope"
156151

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"
152+
And the user "dev0Org0" using cert alias "consortium1-cert" broadcasts ConfigUpdate Tx "configUpdateTx1" to orderer "<orderer0>"
158153

159154
# Sleep as the local orderer needs to bring up the resources that correspond to the new channel
160155
# For the Kafka orderer, this includes setting up a producer and consumer for the channel's partition
@@ -191,6 +186,46 @@ Feature: Bootstrap
191186
| Peer |
192187
| peer1 |
193188

189+
Given the user "configAdminPeerOrg0" creates an peer anchor set "anchors1" for orgs:
190+
| User | Peer | Organization |
191+
| peer0Signer | peer0 | peerOrg0 |
192+
193+
And user "configAdminPeerOrg0" using cert alias "config-admin-cert" connects to deliver function on orderer "<orderer0>"
194+
195+
And user "configAdminPeerOrg0" retrieves the latest config update "latestChannelConfigUpdate" from orderer "<orderer0>" for channel "com.acme.blockchain.jdoe.channel1"
196+
197+
And the user "configAdminPeerOrg0" creates an existing channel config update "existingChannelConfigUpdate1" using config update "latestChannelConfigUpdate"
198+
| ChannelID | [PeerAnchorSet] |
199+
| com.acme.blockchain.jdoe.channel1 | anchors1 |
200+
201+
202+
203+
204+
205+
206+
Given the user "configAdminPeerOrg0" creates a configUpdateEnvelope "existingChannelConfigUpdate1Envelope" using configUpdate "existingChannelConfigUpdate1"
207+
208+
209+
And the user "configAdminPeerOrg0" collects signatures for ConfigUpdateEnvelope "existingChannelConfigUpdate1Envelope" from developers:
210+
| Developer | Cert Alias |
211+
| configAdminPeerOrg0 | config-admin-cert |
212+
213+
And the user "configAdminPeerOrg0" creates a ConfigUpdate Tx "existingChannelConfigUpdateTx1" using cert alias "config-admin-cert" using signed ConfigUpdateEnvelope "existingChannelConfigUpdate1Envelope"
214+
215+
216+
When the user "configAdminPeerOrg0" broadcasts transaction "existingChannelConfigUpdateTx1" to orderer "<orderer0>"
217+
218+
And I wait "<BroadcastWaitTime>" seconds
219+
220+
And user "configAdminPeerOrg0" sends deliver a seek request on orderer "<orderer0>" with properties:
221+
| ChainId | Start | End |
222+
| com.acme.blockchain.jdoe.channel1 | 1 | 1 |
223+
224+
Then user "configAdminPeerOrg0" should get a delivery "deliveredExistingChannelConfigUpdateTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
225+
226+
227+
# And I quit
228+
194229
Given user "dev0Org1" gives "genesisBlockForMyNewChannel" to user "peer2Admin"
195230
Given user "dev0Org1" gives "genesisBlockForMyNewChannel" to user "peer3Admin"
196231

@@ -210,13 +245,18 @@ Feature: Bootstrap
210245
| Peer |
211246
| peer3 |
212247

248+
Given the user "configAdminPeerOrg1" creates an peer anchor set "anchors1" for orgs:
249+
| User | Peer | Organization |
250+
| peer2Signer | peer2 | peerOrg1 |
251+
252+
213253
# Entry point for invoking on an existing channel
214-
When user "peer0Admin" creates a chaincode spec "cc_spec" with name "example02" of type "GOLANG" for chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with args
254+
When user "peer0Admin" creates a chaincode spec "ccSpec" with name "example02" of type "GOLANG" for chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with args
215255
| funcName | arg1 | arg2 | arg3 | arg4 |
216256
| init | a | 100 | b | 200 |
217257

218258
# 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"
259+
And user "peer0Admin" using cert alias "peer-admin-cert" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "ccSpec"
220260

221261
And user "peer0Admin" using cert alias "peer-admin-cert" sends proposal "installProposal1" to endorsers with timeout of "90" seconds with proposal responses "installProposalResponses":
222262
| Endorser |
@@ -226,10 +266,10 @@ Feature: Bootstrap
226266
| Endorser |
227267
| peer0 |
228268

229-
Given user "peer0Admin" gives "cc_spec" to user "peer2Admin"
269+
Given user "peer0Admin" gives "ccSpec" to user "peer2Admin"
230270

231271
# 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"
272+
When user "peer2Admin" using cert alias "peer-admin-cert" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "ccSpec"
233273

234274
And user "peer2Admin" using cert alias "peer-admin-cert" sends proposal "installProposal1" to endorsers with timeout of "90" seconds with proposal responses "installProposalResponses":
235275
| Endorser |
@@ -240,11 +280,11 @@ Feature: Bootstrap
240280
| peer2 |
241281

242282

243-
Given user "peer0Admin" gives "cc_spec" to user "dev0Org0"
244-
And user "peer0Admin" gives "cc_spec" to user "configAdminPeerOrg0"
283+
Given user "peer0Admin" gives "ccSpec" to user "dev0Org0"
284+
And user "peer0Admin" gives "ccSpec" to user "configAdminPeerOrg0"
245285

246286

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"
287+
When user "configAdminPeerOrg0" using cert alias "config-admin-cert" creates a instantiate proposal "instantiateProposal1" for channel "com.acme.blockchain.jdoe.channel1" using chaincode spec "ccSpec"
248288

249289
And user "configAdminPeerOrg0" using cert alias "config-admin-cert" sends proposal "instantiateProposal1" to endorsers with timeout of "90" seconds with proposal responses "instantiateProposalResponses":
250290
| Endorser |
@@ -264,24 +304,22 @@ Feature: Bootstrap
264304

265305
When the user "configAdminPeerOrg0" creates transaction "instantiateTx1" from proposal "instantiateProposal1" and proposal responses "instantiateProposalResponses" for channel "com.acme.blockchain.jdoe.channel1"
266306

267-
And the user "configAdminPeerOrg0" broadcasts transaction "instantiateTx1" to orderer "<orderer1>" on channel "com.acme.blockchain.jdoe.channel1"
307+
And the user "configAdminPeerOrg0" broadcasts transaction "instantiateTx1" to orderer "<orderer1>"
268308

269309
# Sleep as the local orderer ledger needs to create the block that corresponds to the start number of the seek request
270310
And I wait "<BroadcastWaitTime>" seconds
271311

272-
And user "configAdminPeerOrg0" using cert alias "config-admin-cert" connects to deliver function on orderer "<orderer0>"
273-
274312
And user "configAdminPeerOrg0" sends deliver a seek request on orderer "<orderer0>" with properties:
275-
| ChainId | Start | End |
276-
| com.acme.blockchain.jdoe.channel1 | 1 | 1 |
313+
| ChainId | Start | End |
314+
| com.acme.blockchain.jdoe.channel1 | 2 | 2 |
277315

278316
Then user "configAdminPeerOrg0" should get a delivery "deliveredInstantiateTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
279317

280318
# Sleep to allow for chaincode instantiation on the peer
281-
And I wait "3" seconds
319+
And I wait "5" seconds
282320

283321
# Entry point for invoking on an existing channel
284-
When user "dev0Org0" creates a chaincode invocation spec "querySpec1" using spec "cc_spec" with input:
322+
When user "dev0Org0" creates a chaincode invocation spec "querySpec1" using spec "ccSpec" with input:
285323
| funcName | arg1 |
286324
| query | a |
287325

@@ -305,7 +343,7 @@ Feature: Bootstrap
305343

306344

307345
# Entry point for invoking on an existing channel
308-
When user "dev0Org0" creates a chaincode invocation spec "invocationSpec1" using spec "cc_spec" with input:
346+
When user "dev0Org0" creates a chaincode invocation spec "invocationSpec1" using spec "ccSpec" with input:
309347
| funcName | arg1 | arg2 | arg3 |
310348
| invoke | a | b | 10 |
311349

@@ -329,14 +367,14 @@ Feature: Bootstrap
329367

330368
When the user "dev0Org0" creates transaction "invokeTx1" from proposal "invokeProposal1" and proposal responses "invokeProposal1Responses" for channel "com.acme.blockchain.jdoe.channel1"
331369

332-
And the user "dev0Org0" broadcasts transaction "invokeTx1" to orderer "<orderer2>" on channel "com.acme.blockchain.jdoe.channel1"
370+
And the user "dev0Org0" broadcasts transaction "invokeTx1" to orderer "<orderer2>"
333371

334372
# Sleep as the local orderer ledger needs to create the block that corresponds to the start number of the seek request
335373
And I wait "<BroadcastWaitTime>" seconds
336374

337375
And user "dev0Org0" sends deliver a seek request on orderer "<orderer0>" with properties:
338376
| ChainId | Start | End |
339-
| com.acme.blockchain.jdoe.channel1 | 2 | 2 |
377+
| com.acme.blockchain.jdoe.channel1 | 3 | 3 |
340378

341379
Then user "dev0Org0" should get a delivery "deliveredInvokeTx1Block" from "<orderer0>" of "1" blocks with "1" messages within "1" seconds
342380

0 commit comments

Comments
 (0)