github.com/tenywen/fabric@v1.0.0-beta.0.20170620030522-a5b1ed380643/protos/peer/chaincode_shim.proto (about)

     1  /*
     2  Copyright IBM Corp. 2017 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.fabric.protos.peer";
    21  option go_package = "github.com/hyperledger/fabric/protos/peer";
    22  import "peer/chaincode_event.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      SignedProposal 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 QueryResultBytes {
    91      bytes resultBytes = 1;
    92  }
    93  
    94  message QueryResponse {
    95      repeated QueryResultBytes results = 1;
    96      bool has_more = 2;
    97      string id = 3;
    98  }
    99  
   100  // Interface that provides support to chaincode execution. ChaincodeContext
   101  // provides the context necessary for the server to respond appropriately.
   102  service ChaincodeSupport {
   103  
   104      rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage) {}
   105  
   106  
   107  }