github.com/tenywen/fabric@v1.0.0-beta.0.20170620030522-a5b1ed380643/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.hyperledger.fabric.protos.peer"; 21 option go_package = "github.com/hyperledger/fabric/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 // Specify the deployment of a chaincode. 77 // TODO: Define `codePackage`. 78 message ChaincodeDeploymentSpec { 79 80 enum ExecutionEnvironment { 81 DOCKER = 0; 82 SYSTEM = 1; 83 } 84 85 ChaincodeSpec chaincode_spec = 1; 86 // Controls when the chaincode becomes executable. 87 google.protobuf.Timestamp effective_date = 2; 88 bytes code_package = 3; 89 ExecutionEnvironment exec_env= 4; 90 91 } 92 93 // Carries the chaincode function and its arguments. 94 message ChaincodeInvocationSpec { 95 96 ChaincodeSpec chaincode_spec = 1; 97 // This field can contain a user-specified ID generation algorithm 98 // If supplied, this will be used to generate a ID 99 // If not supplied (left empty), sha256base64 will be used 100 // The algorithm consists of two parts: 101 // 1, a hash function 102 // 2, a decoding used to decode user (string) input to bytes 103 // Currently, SHA256 with BASE64 is supported (e.g. idGenerationAlg='sha256base64') 104 string id_generation_alg = 2; 105 }