github.com/inklabsfoundation/inkchain@v0.17.1-0.20181025012015-c3cef8062f19/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.inklabsfoundation.inkchain.protos.peer";
    21  option go_package = "github.com/inklabsfoundation/inkchain/protos/peer";
    22  import "peer/chaincode_event.proto";
    23  import "peer/proposal.proto";
    24  import "google/protobuf/timestamp.proto";
    25  
    26  message ChaincodeMessage {
    27  
    28      enum Type {
    29          UNDEFINED = 0;
    30          REGISTER = 1;
    31          REGISTERED = 2;
    32          INIT = 3;
    33          READY = 4;
    34          TRANSACTION = 5;
    35          COMPLETED = 6;
    36          ERROR = 7;
    37          GET_STATE = 8;
    38          PUT_STATE = 9;
    39          DEL_STATE = 10;
    40          INVOKE_CHAINCODE = 11;
    41          RESPONSE = 13;
    42          GET_STATE_BY_RANGE = 14;
    43          GET_QUERY_RESULT = 15;
    44          QUERY_STATE_NEXT = 16;
    45          QUERY_STATE_CLOSE = 17;
    46          KEEPALIVE = 18;
    47          GET_HISTORY_FOR_KEY = 19;
    48          TRANSFER = 820;
    49          ISSUE_TOKEN = 821;
    50          GET_ACCOUNT = 823;
    51          GET_FEE =825;
    52          SIGN = 826;
    53          VERIFY = 827;
    54      }
    55  
    56      Type type = 1;
    57      google.protobuf.Timestamp timestamp = 2;
    58      bytes payload = 3;
    59      string txid = 4;
    60  
    61      SignedProposal proposal = 5;
    62  
    63      //event emmited by chaincode. Used only with Init or Invoke.
    64      // This event is then stored (currently)
    65      //with Block.NonHashData.TransactionResult
    66      ChaincodeEvent chaincode_event = 6;
    67  }
    68  
    69  message PutStateInfo {
    70      string key = 1;
    71      bytes value = 2;
    72  }
    73  
    74  message GetStateByRange {
    75      string startKey = 1;
    76      string endKey = 2;
    77  }
    78  
    79  message GetQueryResult {
    80      string query = 1;
    81  }
    82  
    83  message GetHistoryForKey {
    84      string key = 1;
    85  }
    86  
    87  message QueryStateNext {
    88      string id = 1;
    89  }
    90  
    91  message QueryStateClose {
    92      string id = 1;
    93  }
    94  
    95  message QueryResultBytes {
    96      bytes resultBytes = 1;
    97  }
    98  
    99  message QueryResponse {
   100      repeated QueryResultBytes results = 1;
   101      bool has_more = 2;
   102      string id = 3;
   103  }
   104  
   105  message Transfer {
   106      bytes to=1;
   107      bytes balanceType = 2;
   108      bytes amount = 3;
   109  }
   110  
   111  message TransferInfo {
   112      repeated Transfer tranSet = 1;
   113  }
   114  
   115  message IssueTokenInfo {
   116      bytes address = 1;
   117      bytes balanceType = 2;
   118      bytes amount = 3;
   119  }
   120  
   121  message Verify {
   122      string signature = 1;
   123      bytes data = 2;
   124      string address = 3;
   125  }
   126  // Interface that provides support to chaincode execution. ChaincodeContext
   127  // provides the context necessary for the server to respond appropriately.
   128  service ChaincodeSupport {
   129  
   130      rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage) {}
   131  
   132  
   133  }