github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/bddtests/peer_basic.feature (about)

     1  #
     2  # Test Fabric Peers
     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  @preV1
    10  Feature: Network of Peers
    11      As a Fabric developer
    12      I want to run a network of peers
    13  
    14  #    @wip
    15    Scenario: Peers list test, single peer issue #827
    16      Given we compose "docker-compose-1.yml"
    17        When requesting "/network/peers" from "vp0"
    18        Then I should get a JSON response with array "peers" contains "1" elements
    19  
    20  #    @wip
    21    Scenario: Peers list test,3 peers issue #827
    22      Given we compose "docker-compose-3.yml"
    23        When requesting "/network/peers" from "vp0"
    24        Then I should get a JSON response with array "peers" contains "3" elements
    25  
    26  #    @doNotDecompose
    27      @wip
    28     @issue_767
    29    Scenario: Range query test, single peer, issue #767
    30      Given we compose "docker-compose-1.yml"
    31        When requesting "/chain" from "vp0"
    32        Then I should get a JSON response with "height" = "1"
    33        When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/map" with ctor "init" to "vp0"
    34        ||
    35        ||
    36  
    37        Then I should have received a chaincode name
    38        Then I wait up to "60" seconds for transaction to be committed to all peers
    39  
    40        When requesting "/chain" from "vp0"
    41        Then I should get a JSON response with "height" = "2"
    42  
    43        When I invoke chaincode "map" function name "put" on "vp0"
    44          | arg1 | arg2 |
    45          | key1  | value1  |
    46        Then I should have received a transactionID
    47        Then I wait up to "25" seconds for transaction to be committed to all peers
    48  
    49        When requesting "/chain" from "vp0"
    50        Then I should get a JSON response with "height" = "3"
    51  
    52        When I query chaincode "map" function name "get" on "vp0":
    53          | arg1|
    54          | key1 |
    55        Then I should get a JSON response with "result.message" = "value1"
    56  
    57        When I invoke chaincode "map" function name "put" on "vp0"
    58          | arg1 | arg2 |
    59          | key2  | value2  |
    60        Then I should have received a transactionID
    61        Then I wait up to "25" seconds for transaction to be committed to all peers
    62  
    63        When requesting "/chain" from "vp0"
    64        Then I should get a JSON response with "height" = "4"
    65  
    66        When I query chaincode "map" function name "keys" on "vp0":
    67          ||
    68          ||
    69        Then I should get a JSON response with "result.message" = "["key1","key2"]"
    70  
    71        When I invoke chaincode "map" function name "remove" on "vp0"
    72          | arg1 | |
    73          | key1  | |
    74        Then I should have received a transactionID
    75        Then I wait up to "25" seconds for transaction to be committed to all peers
    76  
    77        When requesting "/chain" from "vp0"
    78        Then I should get a JSON response with "height" = "5"
    79  
    80        When I query chaincode "map" function name "keys" on "vp0":
    81          ||
    82          ||
    83        Then I should get a JSON response with "result.message" = "["key2"]"
    84  
    85  # @doNotDecompose
    86    @wip
    87    @issue_477
    88    Scenario: chaincode shim table API, issue 477
    89      Given we compose "docker-compose-1.yml"
    90        When requesting "/chain" from "vp0"
    91        Then I should get a JSON response with "height" = "1"
    92        When I deploy chaincode "github.com/hyperledger/fabric/bddtests/chaincode/go/table" with ctor "init" to "vp0"
    93        ||
    94        ||
    95        Then I should have received a chaincode name
    96        Then I wait up to "60" seconds for transaction to be committed to all peers
    97        When requesting "/chain" from "vp0"
    98        Then I should get a JSON response with "height" = "2"
    99  
   100        When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0"
   101          | arg1 | arg2 | arg3 |
   102          | test1| 10   | 20   |
   103        Then I should have received a transactionID
   104        Then I wait up to "25" seconds for transaction to be committed to all peers
   105        When requesting "/chain" from "vp0"
   106        Then I should get a JSON response with "height" = "3"
   107  
   108        When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0"
   109          | arg1 | arg2 | arg3 |
   110          | test2| 10   | 20   |
   111        Then I should have received a transactionID
   112        Then I wait up to "25" seconds for transaction to be committed to all peers
   113        When requesting "/chain" from "vp0"
   114        Then I should get a JSON response with "height" = "4"
   115  
   116        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   117          | arg1 |
   118          | test1|
   119        Then I should get a JSON response with "result.message" = "{[string:"test1"  int32:10  int32:20 ]}"
   120  
   121        When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0"
   122          | arg1 | arg2 | arg3 | arg3 |
   123          | foo2 | 34   | 65   | bar8 |
   124        Then I should have received a transactionID
   125        Then I wait up to "25" seconds for transaction to be committed to all peers
   126        When requesting "/chain" from "vp0"
   127        Then I should get a JSON response with "height" = "5"
   128  
   129        When I query chaincode "table_test" function name "getRowTableTwo" on "vp0":
   130          | arg1 | arg2 | arg3 |
   131          | foo2 | 65   | bar8 |
   132        Then I should get a JSON response with "result.message" = "{[string:"foo2"  int32:34  int32:65  string:"bar8" ]}"
   133  
   134        When I invoke chaincode "table_test" function name "replaceRowTableOne" on "vp0"
   135          | arg1 | arg2 | arg3 |
   136          | test1| 30   | 40   |
   137        Then I should have received a transactionID
   138        Then I wait up to "25" seconds for transaction to be committed to all peers
   139        When requesting "/chain" from "vp0"
   140        Then I should get a JSON response with "height" = "6"
   141  
   142        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   143          | arg1 |
   144          | test1|
   145        Then I should get a JSON response with "result.message" = "{[string:"test1"  int32:30  int32:40 ]}"
   146  
   147        When I invoke chaincode "table_test" function name "deleteRowTableOne" on "vp0"
   148          | arg1 |
   149          | test1|
   150        Then I should have received a transactionID
   151        Then I wait up to "25" seconds for transaction to be committed to all peers
   152        When requesting "/chain" from "vp0"
   153        Then I should get a JSON response with "height" = "7"
   154  
   155        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   156          | arg1 |
   157          | test1|
   158        Then I should get a JSON response with "result.message" = "{[]}"
   159  
   160        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   161          | arg1 |
   162          | test2|
   163        Then I should get a JSON response with "result.message" = "{[string:"test2"  int32:10  int32:20 ]}"
   164  
   165        When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0"
   166          | arg1 | arg2 | arg3 |
   167          | test3| 10   | 20   |
   168        Then I should have received a transactionID
   169        Then I wait up to "25" seconds for transaction to be committed to all peers
   170        When requesting "/chain" from "vp0"
   171        Then I should get a JSON response with "height" = "8"
   172  
   173        When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0"
   174          | arg1 | arg2 | arg3 |
   175          | test4| 10   | 20   |
   176        Then I should have received a transactionID
   177        Then I wait up to "25" seconds for transaction to be committed to all peers
   178        When requesting "/chain" from "vp0"
   179        Then I should get a JSON response with "height" = "9"
   180  
   181        When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0"
   182          | arg1 | arg2 | arg3 |
   183          | test5| 10   | 20   |
   184        Then I should have received a transactionID
   185        Then I wait up to "25" seconds for transaction to be committed to all peers
   186        When requesting "/chain" from "vp0"
   187        Then I should get a JSON response with "height" = "10"
   188  
   189        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   190          | arg1 |
   191          | test3|
   192        Then I should get a JSON response with "result.message" = "{[string:"test3"  int32:10  int32:20 ]}"
   193  
   194        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   195          | arg1 |
   196          | test4|
   197        Then I should get a JSON response with "result.message" = "{[string:"test4"  int32:10  int32:20 ]}"
   198  
   199        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   200          | arg1 |
   201          | test5|
   202        Then I should get a JSON response with "result.message" = "{[string:"test5"  int32:10  int32:20 ]}"
   203  
   204        When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0"
   205          | arg1 | arg2 | arg3 | arg3 |
   206          | foo2 | 35   | 65   | bar10 |
   207        Then I should have received a transactionID
   208        Then I wait up to "25" seconds for transaction to be committed to all peers
   209        When requesting "/chain" from "vp0"
   210        Then I should get a JSON response with "height" = "11"
   211  
   212        When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0"
   213          | arg1 | arg2 | arg3 | arg3 |
   214          | foo2 | 36   | 65   | bar11 |
   215        Then I should have received a transactionID
   216        Then I wait up to "25" seconds for transaction to be committed to all peers
   217        When requesting "/chain" from "vp0"
   218        Then I should get a JSON response with "height" = "12"
   219  
   220        When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0"
   221          | arg1 | arg2 | arg3 | arg3 |
   222          | foo2 | 37   | 65   | bar12 |
   223        Then I should have received a transactionID
   224        Then I wait up to "25" seconds for transaction to be committed to all peers
   225        When requesting "/chain" from "vp0"
   226        Then I should get a JSON response with "height" = "13"
   227  
   228        When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0"
   229          | arg1 | arg2 | arg3 | arg3 |
   230          | foo2 | 38   | 66   | bar10 |
   231        Then I should have received a transactionID
   232        Then I wait up to "25" seconds for transaction to be committed to all peers
   233        When requesting "/chain" from "vp0"
   234        Then I should get a JSON response with "height" = "14"
   235  
   236        When I query chaincode "table_test" function name "getRowsTableTwo" on "vp0":
   237          | arg1 | arg2 |
   238          | foo2 | 65   |
   239        Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":37}},{"Value":{"Int32":65}},{"Value":{"String_":"bar12"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":34}},{"Value":{"Int32":65}},{"Value":{"String_":"bar8"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":36}},{"Value":{"Int32":65}},{"Value":{"String_":"bar11"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":35}},{"Value":{"Int32":65}},{"Value":{"String_":"bar10"}}]}]"
   240  
   241        When I query chaincode "table_test" function name "getRowsTableTwo" on "vp0":
   242          | arg1 | arg2 |
   243          | foo2 | 66   |
   244        Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":38}},{"Value":{"Int32":66}},{"Value":{"String_":"bar10"}}]}]"
   245  
   246        When I query chaincode "table_test" function name "getRowsTableTwo" on "vp0":
   247          | arg1 |
   248          | foo2 |
   249        Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":37}},{"Value":{"Int32":65}},{"Value":{"String_":"bar12"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":34}},{"Value":{"Int32":65}},{"Value":{"String_":"bar8"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":36}},{"Value":{"Int32":65}},{"Value":{"String_":"bar11"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":38}},{"Value":{"Int32":66}},{"Value":{"String_":"bar10"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":35}},{"Value":{"Int32":65}},{"Value":{"String_":"bar10"}}]}]"
   250  
   251        When I invoke chaincode "table_test" function name "deleteAndRecreateTableOne" on "vp0"
   252          ||
   253          ||
   254        Then I should have received a transactionID
   255        Then I wait up to "25" seconds for transaction to be committed to all peers
   256        When requesting "/chain" from "vp0"
   257        Then I should get a JSON response with "height" = "15"
   258  
   259        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   260          | arg1 |
   261          | test3|
   262        Then I should get a JSON response with "result.message" = "{[]}"
   263  
   264        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   265          | arg1 |
   266          | test4|
   267        Then I should get a JSON response with "result.message" = "{[]}"
   268  
   269        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   270          | arg1 |
   271          | test5|
   272        Then I should get a JSON response with "result.message" = "{[]}"
   273  
   274        When I query chaincode "table_test" function name "getRowTableOne" on "vp0":
   275          | arg1 |
   276          | test2|
   277        Then I should get a JSON response with "result.message" = "{[]}"
   278  
   279        When I query chaincode "table_test" function name "getRowTableTwo" on "vp0":
   280          | arg1 | arg2 | arg3 |
   281          | foo2 | 65   | bar8 |
   282        Then I should get a JSON response with "result.message" = "{[string:"foo2"  int32:34  int32:65  string:"bar8" ]}"
   283  
   284        When I invoke chaincode "table_test" function name "insertRowTableThree" on "vp0"
   285          | arg1 | arg2 | arg3 | arg4 | arg5 | arg6 | arg7 |
   286          | foo2 | -38  | -66  | 77   | 88   | hello| true |
   287        Then I should have received a transactionID
   288        Then I wait up to "25" seconds for transaction to be committed to all peers
   289        When requesting "/chain" from "vp0"
   290        Then I should get a JSON response with "height" = "16"
   291  
   292        When I query chaincode "table_test" function name "getRowTableThree" on "vp0":
   293          | arg1 |
   294          | foo2 |
   295        Then I should get a JSON response with "result.message" = "{[string:"foo2"  int32:-38  int64:-66  uint32:77  uint64:88  bytes:"hello"  bool:true ]}"
   296  
   297        When I invoke chaincode "table_test" function name "insertRowTableFour" on "vp0"
   298          | arg1   |
   299          | foobar |
   300        Then I should have received a transactionID
   301        Then I wait up to "25" seconds for transaction to be committed to all peers
   302        When requesting "/chain" from "vp0"
   303        Then I should get a JSON response with "height" = "17"
   304  
   305        When I query chaincode "table_test" function name "getRowTableFour" on "vp0":
   306          | arg1   |
   307          | foobar |
   308        Then I should get a JSON response with "result.message" = "{[string:"foobar" ]}"
   309  
   310        When I query chaincode "table_test" function name "getRowsTableFour" on "vp0":
   311          | arg1   |
   312          | foobar |
   313        Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foobar"}}]}]"
   314  
   315  @doNotDecompose
   316  #    @wip
   317  	Scenario: chaincode example 01 single peer erroneous TX
   318  	    Given we compose "docker-compose-1.yml"
   319  	    When requesting "/chain" from "vp0"
   320  	    Then I should get a JSON response with "height" = "1"
   321  	    When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01" with ctor "init" to "vp0"
   322  		     | arg1 |  arg2 | arg3 | arg4 |
   323  		     |  a   |  100  |  b   |  200 |
   324  	    Then I should have received a chaincode name
   325  	    Then I wait up to "60" seconds for transaction to be committed to all peers
   326  
   327  	    When requesting "/chain" from "vp0"
   328  	    Then I should get a JSON response with "height" = "2"
   329  
   330          When I invoke chaincode "example1" function name "invoke" on "vp0"
   331  			|arg1|
   332  			| 1  |
   333  	    Then I should have received a transactionID
   334  	    Then I wait up to "25" seconds for transaction to be committed to all peers
   335  
   336  	    When requesting "/chain" from "vp0"
   337  	    Then I should get a JSON response with "height" = "3"
   338  	    When requesting "/chain/blocks/2" from "vp0"
   339  	    Then I should get a JSON response containing "transactions" attribute
   340  
   341          When I invoke chaincode "example1" function name "invoke" on "vp0"
   342  			|arg1|
   343  			| a  |
   344  	    Then I should have received a transactionID
   345  	    Then I wait "10" seconds
   346          When requesting "/chain" from "vp0"
   347  	    Then I should get a JSON response with "height" = "4"
   348          When requesting "/chain/blocks/3" from "vp0"
   349  	    Then I should get a JSON response containing no "transactions" attribute
   350  
   351  #    @doNotDecompose
   352  #    @wip
   353    @devops
   354  	Scenario: chaincode map single peer content generated ID
   355  	    Given we compose "docker-compose-1.yml"
   356  	    When requesting "/chain" from "vp0"
   357  	    Then I should get a JSON response with "height" = "1"
   358  	    When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/map" with ctor "init" to "vp0"
   359  	      ||
   360                ||
   361  	    Then I should have received a chaincode name
   362  	    Then I wait up to "60" seconds for transaction to be committed to all peers
   363  
   364          When I invoke chaincode "map" function name "put" on "vp0" with "sha256"
   365  	    | arg1  |arg2|
   366              |   a   | 10 |
   367  	    Then I should have received a transactionID
   368  	    Then I wait up to "25" seconds for transaction to be committed to all peers
   369  	    Then I check the transaction ID if it is "73b88d92d86502eb66288f84fafae848fed0d21790f2ef1475850f4b635c47f0"
   370  
   371      Scenario: chaincode example 01 single peer rejection message
   372  	    Given we compose "docker-compose-1-exp.yml"
   373  	    Given I start a listener
   374  	    Then I wait "5" seconds
   375  
   376  	    When requesting "/chain" from "vp0"
   377  	    Then I should get a JSON response with "height" = "1"
   378  	    When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01" with ctor "init" to "vp0"
   379  		     | arg1 |  arg2 | arg3 | arg4 |
   380  		     |  a   |  100  |  b   |  200 |
   381  	    Then I should have received a chaincode name
   382  	    Then I wait up to "60" seconds for transaction to be committed to all peers
   383  
   384          When I invoke chaincode "example1" function name "invoke" on "vp0"
   385  			|arg1|
   386  			| a  |
   387  	    Then I should have received a transactionID
   388  	    Then I wait "10" seconds
   389  
   390  	Then I should get a rejection message in the listener after stopping it
   391  
   392  #    @doNotDecompose
   393  #    @wip
   394  	Scenario: chaincode example 02 single peer
   395  	    Given we compose "docker-compose-1.yml"
   396  	    When requesting "/chain" from "vp0"
   397  	    Then I should get a JSON response with "height" = "1"
   398  	    When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   399  		     | arg1 |  arg2 | arg3 | arg4 |
   400  		     |  a   |  100  |  b   |  200 |
   401  	    Then I should have received a chaincode name
   402  	    Then I wait up to "60" seconds for transaction to be committed to all peers
   403  
   404  	    When requesting "/chain" from "vp0"
   405  	    Then I should get a JSON response with "height" = "2"
   406  
   407          When I query chaincode "example2" function name "query" on "vp0":
   408              |arg1|
   409              |  a |
   410  	    Then I should get a JSON response with "result.message" = "100"
   411  
   412  
   413          When I invoke chaincode "example2" function name "invoke" on "vp0"
   414  			|arg1|arg2|arg3|
   415  			| a  | b  | 10 |
   416  	    Then I should have received a transactionID
   417  	    Then I wait up to "25" seconds for transaction to be committed to all peers
   418  
   419  	    When requesting "/chain" from "vp0"
   420  	    Then I should get a JSON response with "height" = "3"
   421  
   422          When I query chaincode "example2" function name "query" on "vp0":
   423              |arg1|
   424              |  a |
   425  	    Then I should get a JSON response with "result.message" = "90"
   426  
   427          When I query chaincode "example2" function name "query" on "vp0":
   428              |arg1|
   429              |  b |
   430  	    Then I should get a JSON response with "result.message" = "210"
   431  
   432  #    @doNotDecompose
   433  #    @wip
   434  	Scenario: chaincode example02 with 5 peers, issue #520
   435  	    Given we compose "docker-compose-5.yml"
   436  	    When requesting "/chain" from "vp0"
   437  	    Then I should get a JSON response with "height" = "1"
   438  
   439  	    When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   440  		     | arg1 |  arg2 | arg3 | arg4 |
   441  		     |  a   |  100  |  b   |  200 |
   442  	    Then I should have received a chaincode name
   443  	    Then I wait up to "60" seconds for transaction to be committed to all peers
   444  
   445          When I query chaincode "example2" function name "query" on all peers:
   446              |arg1|
   447              |  a |
   448  	    Then I should get a JSON response from all peers with "result.message" = "100"
   449  
   450          When I invoke chaincode "example2" function name "invoke" on "vp0"
   451  			|arg1|arg2|arg3|
   452  			| a  | b  | 20 |
   453  	    Then I should have received a transactionID
   454  	    Then I wait up to "20" seconds for transaction to be committed to all peers
   455  
   456          When I query chaincode "example2" function name "query" on all peers:
   457              |arg1|
   458              |  a |
   459  	    Then I should get a JSON response from all peers with "result.message" = "80"
   460  
   461  
   462  #    @doNotDecompose
   463  #    @wip
   464      @issue_567
   465      Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #567
   466  
   467          Given we compose "<ComposeFile>"
   468          And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   469              | vp0  |
   470          And I use the following credentials for querying peers:
   471              | peer |   username  |    secret    |
   472              | vp0  |  test_user0 | MS9qrN8hFjlE |
   473              | vp1  |  test_user1 | jGlNl6ImkuDo |
   474              | vp2  |  test_user2 | zMflqOKezFiA |
   475              | vp3  |  test_user3 | vWdLCE00vJy0 |
   476  
   477          When requesting "/chain" from "vp0"
   478          Then I should get a JSON response with "height" = "1"
   479          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   480              | arg1 |  arg2 | arg3 | arg4 |
   481              |  a   |  100  |  b   |  200 |
   482          Then I should have received a chaincode name
   483          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   484              | vp0  | vp1 | vp2 | vp3 |
   485  
   486          When I query chaincode "example2" function name "query" with value "a" on peers:
   487              | vp0  | vp1 | vp2 | vp3 |
   488          Then I should get a JSON response from peers with "result.message" = "100"
   489              | vp0  | vp1 | vp2 | vp3 |
   490  
   491          When I invoke chaincode "example2" function name "invoke" on "vp0"
   492              |arg1|arg2|arg3|
   493              | a  | b  | 20 |
   494          Then I should have received a transactionID
   495          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   496              | vp0  | vp1 | vp2 | vp3 |
   497  
   498          When I query chaincode "example2" function name "query" with value "a" on peers:
   499              | vp0  | vp1 | vp2 | vp3 |
   500          Then I should get a JSON response from peers with "result.message" = "80"
   501              | vp0  | vp1 | vp2 | vp3 |
   502  
   503      Examples: Consensus Options
   504          |          ComposeFile                     |   WaitTime   |
   505          |   docker-compose-4-consensus-noops.yml   |      60      |
   506          |   docker-compose-4-consensus-batch.yml   |      60      |
   507  
   508  
   509      #@doNotDecompose
   510      #@wip
   511      @issue_680
   512      @fab380
   513      Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #680 (State transfer)
   514          Given we compose "<ComposeFile>"
   515          And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   516              | vp0  |
   517          And I use the following credentials for querying peers:
   518              | peer |   username  |    secret    |
   519              | vp0  |  test_user0 | MS9qrN8hFjlE |
   520              | vp1  |  test_user1 | jGlNl6ImkuDo |
   521              | vp2  |  test_user2 | zMflqOKezFiA |
   522              | vp3  |  test_user3 | vWdLCE00vJy0 |
   523  
   524          When requesting "/chain" from "vp0"
   525          Then I should get a JSON response with "height" = "1"
   526  
   527  
   528              # Deploy
   529          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   530              | arg1 |  arg2 | arg3 | arg4 |
   531              |  a   |  100  |  b   |  200 |
   532          Then I should have received a chaincode name
   533          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   534              | vp0  | vp1 | vp2 | vp3 |
   535  
   536          # Build up a sizable blockchain, that vp3 will need to validate at startup
   537          When I invoke chaincode "example2" function name "invoke" on "vp0" "30" times
   538              |arg1|arg2|arg3|
   539              | b  | a  | 1  |
   540          Then I should have received a transactionID
   541          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   542              | vp0  | vp1 | vp2 | vp3 |
   543  
   544          When I query chaincode "example2" function name "query" with value "a" on peers:
   545              | vp0  | vp1 | vp2 | vp3 |
   546          Then I should get a JSON response from peers with "result.message" = "130"
   547              | vp0  | vp1 | vp2 | vp3 |
   548  
   549          # STOPPING vp3!!!!!!!!!!!!!!!!!!!!!!!!!!
   550          Given I stop peers:
   551              | vp3 |
   552  
   553          # Invoke a transaction to get vp3 out of sync
   554          When I invoke chaincode "example2" function name "invoke" on "vp0"
   555              |arg1|arg2|arg3|
   556              | a  | b  | 10 |
   557          Then I should have received a transactionID
   558          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   559              | vp0 | vp1 | vp2 |
   560  
   561          When I query chaincode "example2" function name "query" with value "a" on peers:
   562              | vp0 | vp1 | vp2 |
   563          Then I should get a JSON response from peers with "result.message" = "120"
   564              | vp0 | vp1 | vp2 |
   565  
   566          # Now start vp3 again
   567          Given I start peers:
   568              | vp3 |
   569          And I wait "15" seconds
   570  
   571          # Invoke 10 more txs, this will trigger a state transfer, set a target, and execute new outstanding transactions
   572          When I invoke chaincode "example2" function name "invoke" on "vp0" "10" times
   573              |arg1|arg2|arg3|
   574              | a  | b  | 10 |
   575          Then I should have received a transactionID
   576          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   577              | vp0  | vp1 | vp2 | vp3 |
   578          When I query chaincode "example2" function name "query" with value "a" on peers:
   579              | vp0  | vp1 | vp2 | vp3 |
   580          Then I should get a JSON response from peers with "result.message" = "20"
   581              | vp0  | vp1 | vp2 | vp3 |
   582  
   583  
   584      Examples: Consensus Options
   585          |          ComposeFile                                                                            |   WaitTime   |
   586          |   docker-compose-4-consensus-batch.yml                                                          |      60      |
   587          |   docker-compose-4-consensus-batch.yml docker-compose-4-consensus-batch-nosnapshotbuffer.yml    |      60      |
   588  
   589  
   590  #    @doNotDecompose
   591      @issue_724
   592      Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #724
   593  
   594          Given we compose "<ComposeFile>"
   595          And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   596              | vp0  |
   597          And I use the following credentials for querying peers:
   598              | peer |   username  |    secret    |
   599              | vp0  |  test_user0 | MS9qrN8hFjlE |
   600              | vp1  |  test_user1 | jGlNl6ImkuDo |
   601              | vp2  |  test_user2 | zMflqOKezFiA |
   602              | vp3  |  test_user3 | vWdLCE00vJy0 |
   603  
   604          When requesting "/chain" from "vp0"
   605          Then I should get a JSON response with "height" = "1"
   606          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   607              | arg1 |  arg2 | arg3 | arg4 |
   608              |  a   |  100  |  b   |  200 |
   609          Then I should have received a chaincode name
   610          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   611              | vp0  | vp1 | vp2 | vp3 |
   612  
   613  
   614          When I query chaincode "example2" function name "query" with value "a" on peers:
   615              | vp0  | vp1 | vp2 | vp3 |
   616          Then I should get a JSON response from peers with "result.message" = "100"
   617              | vp0  | vp1 | vp2 | vp3 |
   618  
   619          Given I stop peers:
   620              | vp0  |  vp1   | vp2  | vp3  |
   621  
   622          Given I start peers:
   623              | vp0  |  vp1   | vp2  | vp3  |
   624          And I wait "15" seconds
   625  
   626          When I query chaincode "example2" function name "query" with value "a" on peers:
   627              | vp3  |
   628          Then I should get a JSON response from peers with "result.message" = "100"
   629              | vp3  |
   630  
   631      Examples: Consensus Options
   632          |          ComposeFile                     |   WaitTime   |
   633          |   docker-compose-4-consensus-noops.yml   |      60      |
   634  
   635  
   636  #   @doNotDecompose
   637  #    @wip
   638  	Scenario: basic startup of 3 validating peers
   639  	    Given we compose "docker-compose-3.yml"
   640  	    When requesting "/chain" from "vp0"
   641  	    Then I should get a JSON response with "height" = "1"
   642  
   643   	@TLS
   644  #	@doNotDecompose
   645  	Scenario: basic startup of 2 validating peers using TLS
   646  	    Given we compose "docker-compose-2-tls-basic.yml"
   647  	    When requesting "/chain" from "vp0"
   648  	    Then I should get a JSON response with "height" = "1"
   649  
   650  
   651      Scenario Outline: 4 peers and 1 membersrvc, consensus still works if one backup replica fails
   652  
   653          Given we compose "<ComposeFile>"
   654          And I use the following credentials for querying peers:
   655              | peer |   username  |    secret    |
   656              | vp0  |  test_user0 | MS9qrN8hFjlE |
   657              | vp1  |  test_user1 | jGlNl6ImkuDo |
   658              | vp2  |  test_user2 | zMflqOKezFiA |
   659              | vp3  |  test_user3 | vWdLCE00vJy0 |
   660          And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers:
   661              | vp0 |
   662  
   663          When requesting "/chain" from "vp0"
   664          Then I should get a JSON response with "height" = "1"
   665  
   666          # Deploy
   667           When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   668              | arg1 |  arg2 | arg3 | arg4 |
   669              |  a   |  100  |  b   |  200 |
   670          Then I should have received a chaincode name
   671          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   672              | vp0  | vp1 | vp2 | vp3 |
   673  
   674          # get things started. All peers up and executing Txs
   675          When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times
   676              |arg1|arg2|arg3|
   677              | a  | b  | 1  |
   678          Then I should have received a transactionID
   679          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   680              | vp0  | vp1 | vp2 | vp3 |
   681  
   682          When I query chaincode "example2" function name "query" with value "a" on peers:
   683              | vp0  | vp1 | vp2 | vp3 |
   684          Then I should get a JSON response from peers with "result.message" = "95"
   685              | vp0  | vp1 | vp2 | vp3 |
   686  
   687          # STOP vp2
   688          Given I stop peers:
   689              | vp2  |
   690  
   691          # continue invoking Txs
   692          When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times
   693              |arg1|arg2|arg3|
   694              | a  | b  | 1 |
   695          Then I should have received a transactionID
   696          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   697              | vp0  | vp1 | vp3 |
   698  
   699          When I query chaincode "example2" function name "query" with value "a" on peers:
   700              | vp0  | vp1 | vp3 |
   701          Then I should get a JSON response from peers with "result.message" = "90"
   702              | vp0 | vp1 | vp3 |
   703  
   704      Examples: Consensus Options
   705          |          ComposeFile                       |   WaitTime   |
   706          |   docker-compose-4-consensus-batch.yml     |      60      |
   707  
   708      Scenario Outline: 4 peers and 1 membersrvc, consensus fails if 2 backup replicas fail
   709  
   710          Given we compose "<ComposeFile>"
   711          And I use the following credentials for querying peers:
   712              | peer |   username  |    secret    |
   713              | vp0  |  test_user0 | MS9qrN8hFjlE |
   714              | vp1  |  test_user1 | jGlNl6ImkuDo |
   715              | vp2  |  test_user2 | zMflqOKezFiA |
   716              | vp3  |  test_user3 | vWdLCE00vJy0 |
   717          And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers:
   718              | vp0 |
   719  
   720          When requesting "/chain" from "vp0"
   721          Then I should get a JSON response with "height" = "1"
   722  
   723          # Deploy
   724          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   725              | arg1 |  arg2 | arg3 | arg4 |
   726              |  a   |  100  |  b   |  200 |
   727          Then I should have received a chaincode name
   728          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   729              | vp0  | vp1 | vp2 | vp3 |
   730  
   731          # get things started. All peers up and executing Txs
   732          When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times
   733              |arg1|arg2|arg3|
   734              | a  | b  | 1  |
   735          Then I should have received a transactionID
   736          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   737              | vp0  | vp1 | vp2 | vp3 |
   738  
   739          When I query chaincode "example2" function name "query" with value "a" on peers:
   740              | vp0  | vp1 | vp2 | vp3 |
   741          Then I should get a JSON response from peers with "result.message" = "95"
   742              | vp0  | vp1 | vp2 | vp3 |
   743  
   744          # STOP vp2
   745          Given I stop peers:
   746              | vp1  | vp2 |
   747  
   748          # continue invoking Txs
   749          When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times
   750              |arg1|arg2|arg3|
   751              | a  | b  | 1 |
   752          And I wait "5" seconds
   753  
   754          When I query chaincode "example2" function name "query" with value "a" on peers:
   755              | vp0 | vp3 |
   756          Then I should get a JSON response from peers with "result.message" = "95"
   757              | vp0 | vp3 |
   758  
   759      Examples: Consensus Options
   760          |          ComposeFile                       |   WaitTime   |
   761          |   docker-compose-4-consensus-batch.yml     |      60      |
   762  
   763       #@doNotDecompose
   764       #@wip
   765       #@skip
   766        Scenario Outline: 4 peers and 1 membersrvc, consensus still works if 1 peer (vp3) is byzantine
   767  
   768           Given we compose "<ComposeFile>"
   769           And I use the following credentials for querying peers:
   770              | peer |   username  |    secret    |
   771              | vp0  |  test_user0 | MS9qrN8hFjlE |
   772              | vp1  |  test_user1 | jGlNl6ImkuDo |
   773              | vp2  |  test_user2 | zMflqOKezFiA |
   774              | vp3  |  test_user3 | vWdLCE00vJy0 |
   775           And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers:
   776              | vp0 |
   777  
   778           When requesting "/chain" from "vp0"
   779            Then I should get a JSON response with "height" = "1"
   780  
   781           # Deploy
   782           When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   783              | arg1 |  arg2 | arg3 | arg4 |
   784              |  a   |  100  |  b   |  200 |
   785            Then I should have received a chaincode name
   786            Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   787              | vp0  | vp1 | vp2 |
   788  
   789           When I invoke chaincode "example2" function name "invoke" on "vp0" "50" times
   790                |arg1|arg2|arg3|
   791                | a  | b  | 1  |
   792            Then I should have received a transactionID
   793            Then I wait up to "60" seconds for transaction to be committed to peers:
   794                | vp0  | vp1 | vp2 |
   795  
   796           When I query chaincode "example2" function name "query" with value "a" on peers:
   797                | vp0  | vp1 | vp2 |
   798            Then I should get a JSON response from peers with "result.message" = "50"
   799                | vp0  | vp1 | vp2 |
   800  
   801        Examples: Consensus Options
   802            |                                  ComposeFile                                               |   WaitTime   |
   803            |   docker-compose-4-consensus-batch.yml    docker-compose-4-consensus-vp3-byzantine.yml     |      60      |
   804  
   805  
   806    #@doNotDecompose
   807    @issue_1182
   808    Scenario Outline: chaincode example02 with 4 peers,1 membersrvc, and 1 non-validating peer.
   809  
   810        Given we compose "<ComposeFile>"
   811        And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   812           | nvp0  |
   813        And I use the following credentials for querying peers:
   814           | peer |   username  |    secret    |
   815           | vp0  |  test_user0 | MS9qrN8hFjlE |
   816           | vp1  |  test_user1 | jGlNl6ImkuDo |
   817           | vp2  |  test_user2 | zMflqOKezFiA |
   818           | vp3  |  test_user3 | vWdLCE00vJy0 |
   819  
   820  #      Current issue as blocks NOT synced yet.
   821  #      When requesting "/chain" from "nvp0"
   822  #      Then I should get a JSON response with "height" = "1"
   823  
   824  
   825        # Deploy
   826        When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "nvp0"
   827                      | arg1 |  arg2 | arg3 | arg4 |
   828                      |  a   |  100  |  b   |  200 |
   829        Then I should have received a chaincode name
   830        Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   831                   | vp0  | vp1 | vp2 |
   832  
   833      Examples: Consensus Options
   834          |          ComposeFile                                                       |   WaitTime   |
   835          |   docker-compose-4-consensus-batch.yml docker-compose-4-consensus-nvp0.yml |      60      |
   836  
   837      @issue_1000
   838      Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, test crash fault
   839  
   840          Given we compose "<ComposeFile>"
   841          And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   842              | vp0  |
   843          And I use the following credentials for querying peers:
   844              | peer |   username  |    secret    |
   845              | vp0  |  test_user0 | MS9qrN8hFjlE |
   846              | vp1  |  test_user1 | jGlNl6ImkuDo |
   847              | vp2  |  test_user2 | zMflqOKezFiA |
   848              | vp3  |  test_user3 | vWdLCE00vJy0 |
   849  
   850          When requesting "/chain" from "vp0"
   851          Then I should get a JSON response with "height" = "1"
   852  
   853          # Deploy
   854          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   855              | arg1 |  arg2 | arg3 | arg4 |
   856              |  a   |  100  |  b   |  200 |
   857          Then I should have received a chaincode name
   858          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   859              | vp0  | vp1 | vp2 | vp3 |
   860  
   861          # Build up a sizable blockchain, to advance the sequence number
   862          When I invoke chaincode "example2" function name "invoke" on "vp0" "30" times
   863              |arg1|arg2|arg3|
   864              | b  | a  | 1  |
   865          Then I should have received a transactionID
   866          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   867              | vp0  | vp1 | vp2 | vp3 |
   868  
   869          When I query chaincode "example2" function name "query" with value "a" on peers:
   870              | vp0  | vp1 | vp2 | vp3 |
   871          Then I should get a JSON response from peers with "result.message" = "130"
   872              | vp0  | vp1 | vp2 | vp3 |
   873  
   874          # Stop vp1, vp2, vp3
   875          Given I stop peers:
   876              | vp1 | vp2 | vp3 |
   877  
   878          # Now start vp1, vp2 again, hopefully retaining pbft state
   879          Given I start peers:
   880              | vp1 | vp2 |
   881          And I wait "15" seconds
   882  
   883          # Invoke 1 more tx, if the crash recovery worked, it will commit, otherwise, it will not
   884          When I invoke chaincode "example2" function name "invoke" on "vp0"
   885              |arg1|arg2|arg3|
   886              | a  | b  | 10 |
   887          Then I should have received a transactionID
   888          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   889              | vp0  | vp1 | vp2 |
   890          When I query chaincode "example2" function name "query" with value "a" on peers:
   891              | vp0  | vp1 | vp2 |
   892  	    Then I should get a JSON response from peers with "result.message" = "120"
   893              | vp0  | vp1 | vp2 |
   894  
   895  
   896      Examples: Consensus Options
   897          |          ComposeFile                       |   WaitTime   |
   898          |   docker-compose-4-consensus-batch.yml     |      60      |
   899  
   900  
   901  
   902      @issue_1091
   903      Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #1019 (out of date peer)
   904  
   905          Given we compose "<ComposeFile>"
   906          And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   907              | vp0  |
   908          And I use the following credentials for querying peers:
   909              | peer |   username  |    secret    |
   910              | vp0  |  test_user0 | MS9qrN8hFjlE |
   911              | vp1  |  test_user1 | jGlNl6ImkuDo |
   912              | vp2  |  test_user2 | zMflqOKezFiA |
   913              | vp3  |  test_user3 | vWdLCE00vJy0 |
   914  
   915          When requesting "/chain" from "vp0"
   916          Then I should get a JSON response with "height" = "1"
   917  
   918          # Deploy
   919          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   920              | arg1 |  arg2 | arg3 | arg4 |
   921              |  a   |  100  |  b   |  200 |
   922          Then I should have received a chaincode name
   923          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   924              | vp0  | vp1 | vp2 |
   925  
   926          # STOPPING vp3!!!!!!!!!!!!!!!!!!!!!!!!!!
   927          Given I stop peers:
   928              | vp3  |
   929  
   930          # Execute one request to get vp3 out of sync
   931          When I invoke chaincode "example2" function name "invoke" on "vp0"
   932              |arg1|arg2|arg3|
   933              | b  | a  | 1  |
   934          Then I should have received a transactionID
   935          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   936              | vp0  | vp1 | vp2 |
   937  
   938          When I query chaincode "example2" function name "query" with value "a" on peers:
   939              | vp0  | vp1 | vp2 |
   940          Then I should get a JSON response from peers with "result.message" = "101"
   941              | vp0  | vp1 | vp2 |
   942  
   943          # Now start vp3 again
   944          Given I start peers:
   945              | vp3  |
   946          And I wait "15" seconds
   947  
   948          # Invoke 8 more txs, this will trigger a state transfer, but it cannot complete
   949          When I invoke chaincode "example2" function name "invoke" on "vp0" "8" times
   950              |arg1|arg2|arg3|
   951              | a  | b  | 10 |
   952          Then I should have received a transactionID
   953          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
   954              | vp0  | vp1 | vp2 |
   955          # wait a bit to make sure the state is invalid on vp3
   956          Then I wait "20" seconds
   957          When I query chaincode "example2" function name "query" with value "a" on peers:
   958              | vp0  | vp1 | vp2 |
   959          Then I should get a JSON response from peers with "result.message" = "21"
   960              | vp0  | vp1 | vp2 |
   961          When I unconditionally query chaincode "example2" function name "query" with value "a" on peers:
   962              | vp3  |
   963          Then I should get a JSON response from peers with "error.data" = "Error when querying chaincode: Error: state may be inconsistent, cannot query"
   964              | vp3  |
   965  
   966  
   967      Examples: Consensus Options
   968          |          ComposeFile                       |   WaitTime   |
   969          |   docker-compose-4-consensus-batch.yml     |      60      |
   970  
   971      Scenario: chaincode example02 with 4 peers, one paused, issue #1056
   972          Given we compose "docker-compose-4-consensus-batch.yml"
   973          And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
   974              | vp0  |
   975          And I use the following credentials for querying peers:
   976              | peer |   username  |    secret    |
   977              | vp0  |  test_user0 | MS9qrN8hFjlE |
   978              | vp1  |  test_user1 | jGlNl6ImkuDo |
   979              | vp2  |  test_user2 | zMflqOKezFiA |
   980              | vp3  |  test_user3 | vWdLCE00vJy0 |
   981  
   982          When requesting "/chain" from "vp0"
   983          Then I should get a JSON response with "height" = "1"
   984  
   985          Given I pause peers:
   986              | vp3  |
   987  
   988          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
   989              | arg1 |  arg2 | arg3 | arg4 |
   990              |  a   |  100  |  b   |  200 |
   991          Then I should have received a chaincode name
   992          Then I wait up to "60" seconds for transaction to be committed to peers:
   993              | vp0  | vp1 | vp2 |
   994  
   995          When I query chaincode "example2" function name "query" with value "a" on peers:
   996              | vp0  | vp1 | vp2 |
   997          Then I should get a JSON response from peers with "result.message" = "100"
   998              | vp0  | vp1 | vp2 |
   999  
  1000          When I invoke chaincode "example2" function name "invoke" on "vp0" "20" times
  1001              |arg1|arg2|arg3|
  1002              | a  | b  |  1 |
  1003          Then I should have received a transactionID
  1004          Then I wait up to "20" seconds for transaction to be committed to peers:
  1005              | vp0  | vp1 | vp2 |
  1006  
  1007          When I query chaincode "example2" function name "query" with value "a" on peers:
  1008              | vp0  | vp1 | vp2 |
  1009          Then I should get a JSON response from peers with "result.message" = "80"
  1010              | vp0  | vp1 | vp2 |
  1011  
  1012      @issue_1873
  1013      Scenario Outline: 4 peers and 1 membersrvc, consensus works if vp0 is stopped TTT3
  1014          Given we compose "<ComposeFile>"
  1015          And I use the following credentials for querying peers:
  1016              | peer |   username  |    secret    |
  1017              | vp0  |  test_user0 | MS9qrN8hFjlE |
  1018              | vp1  |  test_user1 | jGlNl6ImkuDo |
  1019              | vp2  |  test_user2 | zMflqOKezFiA |
  1020              | vp3  |  test_user3 | vWdLCE00vJy0 |
  1021          And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers:
  1022              | vp0 |
  1023  
  1024          When requesting "/chain" from "vp0"
  1025          Then I should get a JSON response with "height" = "1"
  1026  
  1027          # Deploy
  1028          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
  1029              | arg1 |  arg2 | arg3 | arg4 |
  1030              |  a   |  100  |  b   |  200 |
  1031          Then I should have received a chaincode name
  1032          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
  1033              | vp0  | vp1 | vp2 | vp3 |
  1034  
  1035          When requesting "/chain" from "vp0"
  1036          Then I should get a JSON response with "height" = "2"
  1037  
  1038          # STOP vp0
  1039          Given I stop peers:
  1040              | vp0  |
  1041  
  1042          And I register with CA supplying username "test_user1" and secret "jGlNl6ImkuDo" on peers:
  1043              | vp1 |
  1044  
  1045          When I invoke chaincode "example2" function name "invoke" on "vp1" "5" times
  1046              |arg1|arg2|arg3|
  1047              | a  | b  | 1 |
  1048          Then I should have received a transactionID
  1049          Then I wait up to "<WaitTime>" seconds for transaction to be committed to peers:
  1050              | vp1 | vp2 | vp3 |
  1051          When I query chaincode "example2" function name "query" with value "a" on peers:
  1052              | vp1 | vp2 | vp3 |
  1053          Then I should get a JSON response from peers with "result.message" = "95"
  1054              | vp1 | vp2 | vp3 |
  1055      Examples: Consensus Options
  1056          |          ComposeFile                       |   WaitTime   |
  1057          |   docker-compose-4-consensus-batch.yml     |      60      |
  1058  
  1059      @issue_1851
  1060      Scenario Outline: verify reconnect of disconnected peer, issue #1851
  1061          Given we compose "<ComposeFile>"
  1062  
  1063          When requesting "/network/peers" from "vp0"
  1064          Then I should get a JSON response with array "peers" contains "2" elements
  1065  
  1066          Given I stop peers:
  1067              | vp0  |
  1068  
  1069          When requesting "/network/peers" from "vp1"
  1070          Then I should get a JSON response with array "peers" contains "1" elements
  1071  
  1072          Given I start peers:
  1073              | vp0  |
  1074          And I wait "10" seconds
  1075  
  1076          When requesting "/network/peers" from "vp1"
  1077          Then I should get a JSON response with array "peers" contains "2" elements
  1078  
  1079      Examples: Composition options
  1080          |          ComposeFile     |
  1081          |   docker-compose-2.yml   |
  1082  
  1083  
  1084  @issue_1942
  1085  # @doNotDecompose
  1086  Scenario: chaincode example02 with 4 peers, stop and start alternates, reverse
  1087      Given we compose "docker-compose-4-consensus-batch.yml"
  1088      And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
  1089                                    | vp0  |
  1090      And I use the following credentials for querying peers:
  1091                              | peer |   username  |    secret    |
  1092                            | vp0  |  test_user0 | MS9qrN8hFjlE |
  1093                            | vp1  |  test_user1 | jGlNl6ImkuDo |
  1094                            | vp2  |  test_user2 | zMflqOKezFiA |
  1095                            | vp3  |  test_user3 | vWdLCE00vJy0 |
  1096  
  1097      When requesting "/chain" from "vp0"
  1098      Then I should get a JSON response with "height" = "1"
  1099  
  1100      When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
  1101                            | arg1 |  arg2 | arg3 | arg4 |
  1102                            |  a   |  1000 |  b   |   0  |
  1103      Then I should have received a chaincode name
  1104      Then I wait up to "60" seconds for transaction to be committed to peers:
  1105                            | vp0  | vp1 | vp2 | vp3 |
  1106  
  1107      When I query chaincode "example2" function name "query" with value "a" on peers:
  1108                            | vp0 | vp1  | vp2 | vp3 |
  1109      Then I should get a JSON response from peers with "result.message" = "1000"
  1110                            | vp0 |  vp1 | vp2 | vp3 |
  1111  
  1112      Given I stop peers:
  1113                            | vp2 |
  1114      And I register with CA supplying username "test_user3" and secret "vWdLCE00vJy0" on peers:
  1115                            | vp3  |
  1116  
  1117      When I invoke chaincode "example2" function name "invoke" on "vp3" "3" times
  1118                            |arg1|arg2|arg3|
  1119                            | a  | b  | 1  |
  1120      Then I should have received a transactionID
  1121      Then I wait up to "180" seconds for transaction to be committed to peers:
  1122                            | vp0 | vp1 | vp3 |
  1123  
  1124      When I query chaincode "example2" function name "query" with value "a" on peers:
  1125                            | vp0  | vp1 | vp3 |
  1126      Then I should get a JSON response from peers with "result.message" = "997"
  1127                            | vp0  | vp1 | vp3 |
  1128  
  1129      Given I start peers:
  1130                            | vp2  |
  1131  
  1132      And I wait "15" seconds
  1133      Given I stop peers:
  1134                            | vp1  |
  1135      When I invoke chaincode "example2" function name "invoke" on "vp3" "20" times
  1136                            |arg1|arg2|arg3|
  1137                            | a  | b  | 1  |
  1138      Then I wait up to "300" seconds for transactions to be committed to peers:
  1139                            | vp0  | vp2 | vp3 |
  1140  
  1141      When I query chaincode "example2" function name "query" with value "a" on peers:
  1142                            | vp0  | vp2 | vp3 |
  1143      Then I should get a JSON response from peers with "result.message" = "977"
  1144                            | vp0  | vp2 | vp3 |
  1145  
  1146  @issue_1874a
  1147  #@doNotDecompose
  1148  Scenario: chaincode example02 with 4 peers, two stopped
  1149      Given we compose "docker-compose-4-consensus-batch.yml"
  1150      And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
  1151          | vp0  |
  1152      And I use the following credentials for querying peers:
  1153          | peer |   username  |    secret    |
  1154          | vp0  |  test_user0 | MS9qrN8hFjlE |
  1155          | vp1  |  test_user1 | jGlNl6ImkuDo |
  1156          | vp2  |  test_user2 | zMflqOKezFiA |
  1157          | vp3  |  test_user3 | vWdLCE00vJy0 |
  1158  
  1159      When requesting "/chain" from "vp0"
  1160      Then I should get a JSON response with "height" = "1"
  1161  
  1162      When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
  1163          | arg1 |  arg2 | arg3 | arg4 |
  1164          |  a   |  100  |  b   |  200 |
  1165      Then I should have received a chaincode name
  1166      Then I wait up to "60" seconds for transaction to be committed to peers:
  1167          | vp0  | vp1 | vp2 |
  1168  
  1169      When I query chaincode "example2" function name "query" with value "a" on peers:
  1170          | vp0  | vp1 | vp2 | vp3 |
  1171      Then I should get a JSON response from peers with "result.message" = "100"
  1172          | vp0  | vp1 | vp2 | vp3 |
  1173  
  1174      Given I stop peers:
  1175          | vp2 | vp3  |
  1176  
  1177      When I invoke chaincode "example2" function name "invoke" on "vp0"
  1178          |arg1|arg2|arg3|
  1179          | a  | b  | 10 |
  1180      Then I should have received a transactionID
  1181  
  1182      Given I start peers:
  1183            | vp3  |
  1184      And I wait "15" seconds
  1185  
  1186      When I invoke chaincode "example2" function name "invoke" on "vp0" "9" times
  1187          |arg1|arg2|arg3|
  1188          | a  | b  | 10 |
  1189      Then I should have received a transactionID
  1190      Then I wait up to "60" seconds for transaction to be committed to peers:
  1191          | vp0  | vp1 | vp3 |
  1192  
  1193      When I query chaincode "example2" function name "query" with value "a" on peers:
  1194          | vp0  | vp1 | vp3 |
  1195      Then I should get a JSON response from peers with "result.message" = "0"
  1196          | vp0  | vp1 | vp3 |
  1197  
  1198  @issue_1874b
  1199  #@doNotDecompose
  1200  Scenario: chaincode example02 with 4 peers, two stopped, bring back vp0
  1201      Given we compose "docker-compose-4-consensus-batch.yml"
  1202      And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
  1203          | vp0  |
  1204      And I use the following credentials for querying peers:
  1205          | peer |   username  |    secret    |
  1206          | vp0  |  test_user0 | MS9qrN8hFjlE |
  1207          | vp1  |  test_user1 | jGlNl6ImkuDo |
  1208          | vp2  |  test_user2 | zMflqOKezFiA |
  1209          | vp3  |  test_user3 | vWdLCE00vJy0 |
  1210  
  1211      When requesting "/chain" from "vp0"
  1212      Then I should get a JSON response with "height" = "1"
  1213  
  1214      When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
  1215          | arg1 |  arg2 | arg3 | arg4 |
  1216          |  a   |  100  |  b   |  200 |
  1217      Then I should have received a chaincode name
  1218      Then I wait up to "60" seconds for transaction to be committed to peers:
  1219          | vp0  | vp1 | vp2 |
  1220  
  1221      When I query chaincode "example2" function name "query" with value "a" on peers:
  1222          | vp0  | vp1 | vp2 | vp3 |
  1223      Then I should get a JSON response from peers with "result.message" = "100"
  1224          | vp0  | vp1 | vp2 | vp3 |
  1225  
  1226      Given I stop peers:
  1227          | vp0 |
  1228  
  1229      And I register with CA supplying username "test_user1" and secret "jGlNl6ImkuDo" on peers:
  1230          | vp1  |
  1231  
  1232      When I invoke chaincode "example2" function name "invoke" on "vp1"
  1233          |arg1|arg2|arg3|
  1234          | a  | b  | 10 |
  1235      Then I should have received a transactionID
  1236  
  1237      Given I stop peers:
  1238          | vp3  |
  1239  
  1240      When I invoke chaincode "example2" function name "invoke" on "vp1"
  1241          |arg1|arg2|arg3|
  1242          | a  | b  | 10 |
  1243      Then I should have received a transactionID
  1244  
  1245      Given I start peers:
  1246          | vp0  |
  1247      And I wait "15" seconds
  1248  
  1249      When I invoke chaincode "example2" function name "invoke" on "vp1" "8" times
  1250          |arg1|arg2|arg3|
  1251          | a  | b  | 10 |
  1252      Then I should have received a transactionID
  1253      Then I wait up to "60" seconds for transaction to be committed to peers:
  1254          | vp0  | vp1 | vp2 |
  1255  
  1256      When I query chaincode "example2" function name "query" with value "a" on peers:
  1257          | vp0  | vp1 | vp2 |
  1258      Then I should get a JSON response from peers with "result.message" = "0"
  1259          | vp0  | vp1 | vp2 |
  1260  
  1261  @issue_1874c
  1262  Scenario: chaincode example02 with 4 peers, two stopped, bring back both
  1263      Given we compose "docker-compose-4-consensus-batch.yml"
  1264      And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
  1265          | vp0  |
  1266      And I use the following credentials for querying peers:
  1267          | peer |   username  |    secret    |
  1268          | vp0  |  test_user0 | MS9qrN8hFjlE |
  1269          | vp1  |  test_user1 | jGlNl6ImkuDo |
  1270          | vp2  |  test_user2 | zMflqOKezFiA |
  1271          | vp3  |  test_user3 | vWdLCE00vJy0 |
  1272  
  1273      When requesting "/chain" from "vp0"
  1274      Then I should get a JSON response with "height" = "1"
  1275  
  1276      When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0"
  1277          | arg1 |  arg2 | arg3 | arg4 |
  1278          |  a   |  100  |  b   |  200 |
  1279      Then I should have received a chaincode name
  1280      Then I wait up to "60" seconds for transaction to be committed to peers:
  1281          | vp0  | vp1 | vp2 |
  1282  
  1283      When I query chaincode "example2" function name "query" with value "a" on peers:
  1284          | vp0  | vp1 | vp2 | vp3 |
  1285      Then I should get a JSON response from peers with "result.message" = "100"
  1286          | vp0  | vp1 | vp2 | vp3 |
  1287  
  1288      Given I stop peers:
  1289          | vp1 | vp2 |
  1290  
  1291      When I invoke chaincode "example2" function name "invoke" on "vp0" "1" times
  1292          |arg1|arg2|arg3|
  1293          | a  | b  | 10 |
  1294      Then I should have received a transactionID
  1295  
  1296      Given I start peers:
  1297          | vp1 | vp2 |
  1298      And I wait "15" seconds
  1299  
  1300      When I invoke chaincode "example2" function name "invoke" on "vp0" "8" times
  1301          |arg1|arg2|arg3|
  1302          | a  | b  | 10 |
  1303      Then I should have received a transactionID
  1304      Then I wait up to "60" seconds for transaction to be committed to peers:
  1305          | vp0  | vp1 | vp2 | vp3 |
  1306      Then I wait "30" seconds
  1307  
  1308      When I query chaincode "example2" function name "query" with value "a" on peers:
  1309          | vp0  | vp1 | vp2 | vp3 |
  1310      Then I should get a JSON response from peers with "result.message" = "10"
  1311          | vp0  | vp1 | vp2 | vp3 |
  1312  
  1313      @issue_2116
  1314      #@doNotDecompose
  1315      Scenario Outline: chaincode authorizable_counter with 4 peers, two stopped, bring back both
  1316          Given we compose "<ComposeFile>"
  1317          And I register with CA supplying username "diego" and secret "DRJ23pEQl16a" on peers:
  1318                  | vp0  |
  1319          And I use the following credentials for querying peers:
  1320                  | peer |   username  |    secret    |
  1321                  | vp0  |  test_user0 | MS9qrN8hFjlE |
  1322                  | vp1  |  test_user1 | jGlNl6ImkuDo |
  1323                  | vp2  |  test_user2 | zMflqOKezFiA |
  1324                  | vp3  |  test_user3 | vWdLCE00vJy0 |
  1325  
  1326          When requesting "/chain" from "vp0"
  1327          Then I should get a JSON response with "height" = "1"
  1328  
  1329          When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/authorizable_counter" with ctor "init" to "vp0"
  1330                  | arg1 |
  1331                  | 0    |
  1332          Then I should have received a chaincode name
  1333          Then I wait up to "60" seconds for transaction to be committed to peers:
  1334                  | vp0  | vp1 | vp2 |
  1335  
  1336          When I query chaincode "authorizable_counter" function name "read" on "vp0":
  1337                  |arg1|
  1338                  | a  |
  1339          Then I should get a JSON response with "result.message" = "0"
  1340  
  1341          When I invoke chaincode "authorizable_counter" function name "increment" with attributes "position" on "vp0"
  1342                  |arg1|
  1343                  | a  |
  1344          Then I should have received a transactionID
  1345  
  1346          When I invoke chaincode "authorizable_counter" function name "increment" on "vp0" "8" times
  1347                  |arg1|arg2|arg3|
  1348                  | a  | b  | 10 |
  1349          Then I should have received a transactionID
  1350          Then I wait up to "30" seconds for transaction to be committed to peers:
  1351                  | vp0  | vp1 | vp2 | vp3 |
  1352  
  1353          When I query chaincode "authorizable_counter" function name "read" with value "a" on peers:
  1354                  | vp0  | vp1 | vp2 | vp3 |
  1355  
  1356          Then I should get a JSON response from peers with "result.message" = "1"
  1357                  | vp0  | vp1 | vp2 | vp3 |
  1358  
  1359          When I invoke chaincode "authorizable_counter" function name "increment" with attributes "company" on "vp0"
  1360                  |arg1|
  1361                  | a  |
  1362  
  1363          When I invoke chaincode "authorizable_counter" function name "increment" with attributes "company, position, age" on "vp0"
  1364                  |arg1|
  1365                  | a  |
  1366  
  1367          Then I wait up to "15" seconds for transaction to be committed to peers:
  1368                  | vp0  | vp1 | vp2 | vp3 |
  1369  
  1370          When I query chaincode "authorizable_counter" function name "read" with value "a" on peers:
  1371                  | vp0  | vp1 | vp2 | vp3 |
  1372  
  1373          Then I should get a JSON response from peers with "result.message" = "2"
  1374                  | vp0  | vp1 | vp2 | vp3 |
  1375  
  1376          Examples: Consensus Options
  1377          |          ComposeFile                   |   WaitTime    |
  1378          |   docker-compose-4-consensus-batch.yml docker-membersrvc-attributes-enabled.yml |      120      |
  1379          |   docker-compose-4-consensus-batch.yml docker-membersrvc-attributes-enabled.yml docker-membersrvc-attributes-encryption-enabled.yml |      120      |
  1380  
  1381  #    noop
  1382  #    @doNotDecompose
  1383    Scenario: noop chaincode test
  1384      Given we compose "docker-compose-1.yml"
  1385        When I invoke master chaincode "noop" function name "execute" on "vp0"
  1386          |arg1|
  1387          | aa |
  1388        Then I should have received a transactionID