github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/bddtests/features/bootstrap.feature (about) 1 # 2 # Test Bootstrap function 3 # 4 # Tags that can be used and will affect test internals: 5 # @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. 6 # @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! 7 8 #@chaincodeImagesUpToDate 9 @bootstrap 10 Feature: Bootstrap 11 As a blockchain entrepreneur 12 I want to bootstrap a new blockchain network 13 14 @doNotDecompose 15 @generateDocs 16 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) 17 #creates 1 self-signed key/cert pair per orderer organization 18 Given the orderer network has organizations: 19 | Organization | 20 | ordererOrg0 | 21 22 And user requests role of orderer admin by creating a key and csr for orderer and acquires signed certificate from organization: 23 | User | Orderer | Organization | 24 | orderer0Signer | orderer0 | ordererOrg0 | 25 26 And the peer network has organizations: 27 | Organization | 28 | peerOrg0 | 29 | peerOrg1 | 30 | peerOrg2 | 31 32 And a ordererBootstrapAdmin is identified and given access to all public certificates and orderer node info 33 34 And the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "OrdererSystemChainId" 35 36 And the ordererBootstrapAdmin creates a chain creators policy "chainCreatePolicy1" (network name) for peer orgs who wish to form a network using orderer system chain "OrdererSystemChainId": 37 | Organization | 38 | peerOrg0 | 39 | peerOrg1 | 40 | peerOrg2 | 41 42 And the ordererBoostrapAdmin creates the chain creation policy names "chainCreationPolicyNames" for orderer system chain "OrdererSystemChainId" with policies: 43 |PolicyName | 44 |chainCreatePolicy1 | 45 46 And the ordererBoostrapAdmin creates MSP configuration "mspConfig1" for orderer system chain "OrdererSystemChainId" for every MSP referenced by the policies: 47 |PolicyName | 48 |chainCreatePolicy1 | 49 50 51 # Order info includes orderer admin/orderer information and address (host:port) from previous steps 52 # Only the peer organizations can vary. 53 And the ordererBootstrapAdmin creates the genesis block "ordererGenesisBlock" for chain "OrdererSystemChainId" for network config policy "<PolicyType>" and consensus "<ConsensusType>" using chain creators policies: 54 | ConfigGroup Names | 55 | chainCreatePolicy1 | 56 | chainCreationPolicyNames | 57 | mspConfig1 | 58 59 60 And the orderer admins inspect and approve the genesis block for chain "OrdererSystemChainId" 61 62 # to be used for setting the orderer genesis block path parameter in composition 63 And the orderer admins use the genesis block for chain "OrdererSystemChainId" to configure orderers 64 65 # We now have an orderer network with NO peers. Now need to configure and start the peer network 66 # This can be currently automated through folder creation of the proper form and placing PEMs. 67 And user requests role for peer by creating a key and csr for peer and acquires signed certificate from organization: 68 | User | Peer | Organization | 69 | peer0Signer | peer0 | peerOrg0 | 70 | peer1Signer | peer1 | peerOrg0 | 71 | peer2Signer | peer2 | peerOrg1 | 72 | peer3Signer | peer3 | peerOrg1 | 73 74 And we compose "<ComposeFile>" 75 76 # This implicitly incorporates the orderer genesis block info 77 And the ordererBootstrapAdmin runs the channel template tool to create the orderer configuration template "template1" for application developers using orderer "orderer0" 78 And the ordererBootstrapAdmin distributes orderer configuration template "template1" and chain creation policy name "chainCreatePolicy1" 79 80 And the following application developers are defined for peer organizations and each saves their cert as alias 81 | Developer | ChainCreationPolicyName | Organization | AliasSavedUnder | 82 | dev0Org0 | chainCreatePolicy1 | peerOrg0 | dev0Org0App1 | 83 84 # Need Consortium MSP info and 85 # need to add the ChannelWriters ConfigItem (using ChannelWriters ref name), 86 # ChannelReaders ConfigItem (using ChannelReaders ref name)AnchorPeers ConfigItem 87 # and the ChaincodeLifecyclePolicy Config Item 88 # NOTE: Template1 will simply hold refs to peer orgs that can create in this channel at the moment 89 And the user "dev0Org0" creates a peer template "template1" with chaincode deployment policy using chain creation policy name "chainCreatePolicy1" and peer organizations: 90 | Organization | 91 | peerOrg0 | 92 | peerOrg1 | 93 94 And the user "dev0Org0" creates an peer anchor set "anchors1" for channel "com.acme.blockchain.jdoe.Channel1" for orgs: 95 | User | Peer | Organization | 96 | peer0Signer | peer0 | peerOrg0 | 97 | peer2Signer | peer2 | peerOrg1 | 98 99 # TODO: grab the peer orgs from template1 and put into Murali's MSP info SCIs. 100 # Entry point for creating a channel from existing templates 101 And the user "dev0Org0" creates a ConfigUpdateEnvelope "createChannelConfigUpdate1" 102 | ChannelID | Template | Chain Creation Policy Name | Anchors | 103 | com.acme.blockchain.jdoe.Channel1 | template1 | chainCreatePolicy1 | anchors1 | 104 105 And the user "dev0Org0" collects signatures for ConfigUpdateEnvelope "createChannelConfigUpdate1" from peer orgs: 106 | Organization | 107 | peerOrg0 | 108 | peerOrg1 | 109 110 And the user "dev0Org0" creates a ConfigUpdate Tx "configUpdateTx1" using signed ConfigUpdateEnvelope "createChannelConfigUpdate1" 111 112 And the user "dev0Org0" broadcasts ConfigUpdate Tx "configUpdateTx1" to orderer "orderer0" to create channel "com.acme.blockchain.jdoe.Channel1" 113 114 # Sleep as the deliver takes a bit to have the first block ready 115 And I wait "2" seconds 116 117 When user "dev0Org0" connects to deliver function on orderer "orderer0" 118 And user "dev0Org0" sends deliver a seek request on orderer "orderer0" with properties: 119 | ChainId | Start | End | 120 | com.acme.blockchain.jdoe.Channel1 | 0 | 0 | 121 122 Then user "dev0Org0" should get a delivery "genesisBlockForMyNewChannel" from "orderer0" of "1" blocks with "1" messages within "1" seconds 123 124 # This is entry point for joining an existing channel 125 When user "dev0Org0" using cert alias "dev0Org0App1" requests to join channel using genesis block "genesisBlockForMyNewChannel" on peers with result "joinChannelResult" 126 | Peer | 127 | peer0 | 128 | peer2 | 129 130 131 Then user "dev0Org0" expects result code for "joinChannelResult" of "200" from peers: 132 | Peer | 133 | peer0 | 134 | peer2 | 135 136 # Entry point for invoking on an existing channel 137 When user "dev0Org0" 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 138 | funcName | arg1 | arg2 | arg3 | arg4 | 139 | init | a | 100 | b | 200 | 140 141 #And user "binhn" creates a deployment spec "cc_deploy_spec" using chaincode spec "cc_spec" and devops on peer "vp0" 142 #And user "binhn" creates a deployment proposal "proposal1" using chaincode deployment spec "cc_deploy_spec" 143 144 # Under the covers, create a deployment spec, etc. 145 And user "dev0Org0" using cert alias "dev0Org0App1" creates a deployment proposal "proposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec" 146 147 And user "dev0Org0" sends proposal "proposal1" to endorsers with timeout of "30" seconds with proposal responses "deploymentProposalResponses": 148 | Endorser | 149 | peer0 | 150 | peer2 | 151 152 153 Then user "dev0Org0" expects proposal responses "deploymentProposalResponses" with status "200" from endorsers: 154 | Endorser | 155 | peer0 | 156 | peer2 | 157 158 And user "dev0Org0" expects proposal responses "deploymentProposalResponses" each have the same value from endorsers: 159 | Endorser | 160 | peer0 | 161 | peer2 | 162 163 When user "dev0Org0" creates a transaction "deploymentTransaction1" from proposal responses "deploymentProposalResponses" 164 165 And the user "dev0Org0" broadcasts transaction "deploymentTransaction1" on channel "com.acme.blockchain.jdoe.Channel1" to orderer "orderer0" 166 167 # Sleep as the deliver takes a bit 168 And I wait "2" seconds 169 170 When user "dev0Org0" connects to deliver function on orderer "orderer0" 171 And user "dev0Org0" sends deliver a seek request on orderer "orderer0" with properties: 172 | ChainId | Start | End | 173 | com.acme.blockchain.jdoe.Channel1 | 1 | 1 | 174 175 Then user "dev0Org0" should get a delivery "deploymentTransaction11Block" from "orderer0" of "1" blocks with "1" messages within "1" seconds 176 177 # TODO: Add a peer query stanza here 178 179 180 # TODO: Once events are working, consider listen event listener as well. 181 182 Examples: Orderer Options 183 | ComposeFile | Waittime | PolicyType | ConsensusType | 184 | docker-compose-next-4.yml | 60 | unanimous | solo |