github.com/inklabsfoundation/inkchain@v0.17.1-0.20181025012015-c3cef8062f19/protos/peer/chaincode.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 "google/protobuf/timestamp.proto";
    23  
    24  
    25  // Confidentiality Levels
    26  enum ConfidentialityLevel {
    27      PUBLIC = 0;
    28      CONFIDENTIAL = 1;
    29  }
    30  
    31  
    32  //ChaincodeID contains the path as specified by the deploy transaction
    33  //that created it as well as the hashCode that is generated by the
    34  //system for the path. From the user level (ie, CLI, REST API and so on)
    35  //deploy transaction is expected to provide the path and other requests
    36  //are expected to provide the hashCode. The other value will be ignored.
    37  //Internally, the structure could contain both values. For instance, the
    38  //hashCode will be set when first generated using the path
    39  message ChaincodeID {
    40      //deploy transaction will use the path
    41      string path = 1;
    42  
    43      //all other requests will use the name (really a hashcode) generated by
    44      //the deploy transaction
    45      string name = 2;
    46  
    47      //user friendly version name for the chaincode
    48      string version = 3;
    49  }
    50  
    51  // Carries the chaincode function and its arguments.
    52  // UnmarshalJSON in transaction.go converts the string-based REST/JSON input to
    53  // the []byte-based current ChaincodeInput structure.
    54  message ChaincodeInput {
    55      repeated bytes args  = 1;
    56  }
    57  
    58  // Carries the chaincode specification. This is the actual metadata required for
    59  // defining a chaincode.
    60  message ChaincodeSpec {
    61  
    62      enum Type {
    63          UNDEFINED = 0;
    64          GOLANG = 1;
    65          NODE = 2;
    66          CAR = 3;
    67          JAVA = 4;
    68      }
    69  
    70      Type type = 1;
    71      ChaincodeID chaincode_id = 2;
    72      ChaincodeInput input = 3;
    73      int32 timeout = 4;
    74  }
    75  
    76  message SenderSpec {
    77      bytes sender = 1;
    78      uint64 counter = 2;
    79      bytes fee_limit = 3;
    80      bytes msg = 4;
    81  }
    82  
    83  message SignContent {
    84      ChaincodeSpec chaincode_spec = 1;
    85      string id_generation_alg = 2;
    86      SenderSpec sender_spec = 3;
    87  }
    88  
    89  // Specify the deployment of a chaincode.
    90  // TODO: Define `codePackage`.
    91  message ChaincodeDeploymentSpec {
    92  
    93      enum ExecutionEnvironment {
    94          DOCKER = 0;
    95          SYSTEM = 1;
    96      }
    97  
    98      ChaincodeSpec chaincode_spec = 1;
    99      // Controls when the chaincode becomes executable.
   100      google.protobuf.Timestamp effective_date = 2;
   101      bytes code_package = 3;
   102      ExecutionEnvironment exec_env = 4;
   103  }
   104  
   105  // Carries the chaincode function and its arguments.
   106  message ChaincodeInvocationSpec {
   107  
   108      ChaincodeSpec chaincode_spec = 1;
   109      // This field can contain a user-specified ID generation algorithm
   110      // If supplied, this will be used to generate a ID
   111      // If not supplied (left empty), sha256base64 will be used
   112      // The algorithm consists of two parts:
   113      //  1, a hash function
   114      //  2, a decoding used to decode user (string) input to bytes
   115      // Currently, SHA256 with BASE64 is supported (e.g. idGenerationAlg='sha256base64')
   116      string id_generation_alg = 2;
   117  
   118      SenderSpec sender_spec = 3;
   119  
   120      bytes sig = 4;
   121  }