github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/protos/peer/chaincodeshim.proto (about)

     1  /*
     2  Copyright IBM Corp. 2016 All Rights Reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8  		 http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  syntax = "proto3";
    18  
    19  package protos;
    20  option java_package = "org.hyperledger.protos";
    21  option go_package = "github.com/hyperledger/fabric/protos/peer";
    22  import "peer/chaincodeevent.proto";
    23  import "peer/proposal.proto";
    24  import "google/protobuf/timestamp.proto";
    25  
    26  
    27  message ChaincodeMessage {
    28  
    29      enum Type {
    30          UNDEFINED = 0;
    31          REGISTER = 1;
    32          REGISTERED = 2;
    33          INIT = 3;
    34          READY = 4;
    35          TRANSACTION = 5;
    36          COMPLETED = 6;
    37          ERROR = 7;
    38          GET_STATE = 8;
    39          PUT_STATE = 9;
    40          DEL_STATE = 10;
    41          INVOKE_CHAINCODE = 11;
    42          RESPONSE = 13;
    43          GET_STATE_BY_RANGE = 14;
    44          GET_QUERY_RESULT = 15;
    45          QUERY_STATE_NEXT = 16;
    46          QUERY_STATE_CLOSE = 17;
    47          KEEPALIVE = 18;
    48          GET_HISTORY_FOR_KEY = 19;
    49      }
    50  
    51      Type type = 1;
    52      google.protobuf.Timestamp timestamp = 2;
    53      bytes payload = 3;
    54      string txid = 4;
    55  
    56      Proposal proposal = 5;
    57  
    58      //event emmited by chaincode. Used only with Init or Invoke.
    59      // This event is then stored (currently)
    60      //with Block.NonHashData.TransactionResult
    61      ChaincodeEvent chaincode_event = 6;
    62  }
    63  
    64  message PutStateInfo {
    65      string key = 1;
    66      bytes value = 2;
    67  }
    68  
    69  message GetStateByRange {
    70      string startKey = 1;
    71      string endKey = 2;
    72  }
    73  
    74  message GetQueryResult {
    75      string query = 1;
    76  }
    77  
    78  message GetHistoryForKey {
    79      string key = 1;
    80  }
    81  
    82  message QueryStateNext {
    83      string id = 1;
    84  }
    85  
    86  message QueryStateClose {
    87      string id = 1;
    88  }
    89  
    90  message QueryStateKeyValue {
    91      string key = 1;
    92      bytes value = 2;
    93  }
    94  
    95  message QueryStateResponse {
    96      repeated QueryStateKeyValue keys_and_values = 1;
    97      bool has_more = 2;
    98      string id = 3;
    99  }
   100  
   101  // Interface that provides support to chaincode execution. ChaincodeContext
   102  // provides the context necessary for the server to respond appropriately.
   103  service ChaincodeSupport {
   104  
   105      rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage) {}
   106  
   107  
   108  }