github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/protos/peer/transaction.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  option go_package = "github.com/hyperledger/fabric/protos/peer";
    20  
    21  package protos;
    22  
    23  import "google/protobuf/timestamp.proto";
    24  import "peer/proposal_response.proto";
    25  import "common/common.proto";
    26  
    27  // This message is necessary to facilitate the verification of the signature
    28  // (in the signature field) over the bytes of the transaction (in the
    29  // transactionBytes field).
    30  message SignedTransaction {
    31  
    32  	// The bytes of the Transaction. NDD
    33  	bytes transaction_bytes = 1;
    34  
    35  	// Signature of the transactionBytes The public key of the signature is in
    36  	// the header field of TransactionAction There might be multiple
    37  	// TransactionAction, so multiple headers, but there should be same
    38  	// transactor identity (cert) in all headers
    39  	bytes signature = 2;
    40  }
    41  
    42  // ProcessedTransaction wraps an Envelope that includes a transaction along with an indication
    43  // of whether the transaction was validated or invalidated by committing peer.
    44  // The use case is that GetTransactionByID API needs to retrieve the transaction Envelope
    45  // from block storage, and return it to a client, and indicate whether the transaction
    46  // was validated or invalidated by committing peer. So that the originally submitted
    47  // transaction Envelope is not modified, the ProcessedTransaction wrapper is returned.
    48  message ProcessedTransaction {
    49      // An Envelope which includes a processed transaction
    50      common.Envelope transactionEnvelope = 1;
    51  
    52      // An indication of whether the transaction was validated or invalidated by committing peer
    53      int32 validationCode = 2;
    54  }
    55  
    56  // The transaction to be sent to the ordering service. A transaction contains
    57  // one or more TransactionAction. Each TransactionAction binds a proposal to
    58  // potentially multiple actions. The transaction is atomic meaning that either
    59  // all actions in the transaction will be committed or none will.  Note that
    60  // while a Transaction might include more than one Header, the Header.creator
    61  // field must be the same in each.
    62  // A single client is free to issue a number of independent Proposal, each with
    63  // their header (Header) and request payload (ChaincodeProposalPayload).  Each
    64  // proposal is independently endorsed generating an action
    65  // (ProposalResponsePayload) with one signature per Endorser. Any number of
    66  // independent proposals (and their action) might be included in a transaction
    67  // to ensure that they are treated atomically.
    68  message Transaction {
    69  
    70  	// The payload is an array of TransactionAction. An array is necessary to
    71  	// accommodate multiple actions per transaction
    72  	repeated TransactionAction actions = 1;
    73  }
    74  
    75  // TransactionAction binds a proposal to its action.  The type field in the
    76  // header dictates the type of action to be applied to the ledger.
    77  message TransactionAction {
    78  
    79  	// The header of the proposal action, which is the proposal header
    80  	bytes header = 1;
    81  
    82  	// The payload of the action as defined by the type in the header For
    83  	// chaincode, it's the bytes of ChaincodeActionPayload
    84  	bytes payload = 2;
    85  }
    86  
    87  //---------- Chaincode Transaction ------------
    88  
    89  // ChaincodeActionPayload is the message to be used for the TransactionAction's
    90  // payload when the Header's type is set to CHAINCODE.  It carries the
    91  // chaincodeProposalPayload and an endorsed action to apply to the ledger.
    92  message ChaincodeActionPayload {
    93  
    94  	// This field contains the bytes of the ChaincodeProposalPayload message from
    95  	// the original invocation (essentially the arguments) after the application
    96  	// of the visibility function. The main visibility modes are "full" (the
    97  	// entire ChaincodeProposalPayload message is included here), "hash" (only
    98  	// the hash of the ChaincodeProposalPayload message is included) or
    99  	// "nothing".  This field will be used to check the consistency of
   100  	// ProposalResponsePayload.proposalHash.  For the CHAINCODE type,
   101  	// ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader ||
   102  	// f(ChaincodeProposalPayload)) where f is the visibility function.
   103  	bytes chaincode_proposal_payload = 1;
   104  
   105  	// The list of actions to apply to the ledger
   106  	ChaincodeEndorsedAction action = 2;
   107  }
   108  
   109  // ChaincodeEndorsedAction carries information about the endorsement of a
   110  // specific proposal
   111  message ChaincodeEndorsedAction {
   112  
   113  	// This is the bytes of the ProposalResponsePayload message signed by the
   114  	// endorsers.  Recall that for the CHAINCODE type, the
   115  	// ProposalResponsePayload's extenstion field carries a ChaincodeAction
   116  	bytes proposal_response_payload = 1;
   117  
   118  	// The endorsement of the proposal, basically the endorser's signature over
   119  	// proposalResponsePayload
   120  	repeated Endorsement endorsements = 2;
   121  }
   122  
   123  enum TxValidationCode {
   124  	VALID = 0;
   125  	NIL_ENVELOPE = 1;
   126  	BAD_PAYLOAD = 2;
   127  	BAD_COMMON_HEADER = 3;
   128  	BAD_CREATOR_SIGNATURE = 4;
   129  	INVALID_ENDORSER_TRANSACTION = 5;
   130  	INVALID_CONFIG_TRANSACTION = 6;
   131  	UNSUPPORTED_TX_PAYLOAD = 7;
   132  	BAD_PROPOSAL_TXID = 8;
   133  	DUPLICATE_TXID = 9;
   134  	ENDORSEMENT_POLICY_FAILURE = 10;
   135  	MVCC_READ_CONFLICT = 11;
   136  	PHANTOM_READ_CONFLICT = 12;
   137  	UNKNOWN_TX_TYPE = 13;
   138  	TARGET_CHAIN_NOT_FOUND = 14;
   139  	MARSHAL_TX_ERROR = 15;
   140  	NIL_TXACTION = 16;
   141  	INVALID_OTHER_REASON = 255;
   142  }