github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/protos/peer/proposal_response.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  
    25  // A ProposalResponse is returned from an endorser to the proposal submitter.
    26  // The idea is that this message contains the endorser's response to the
    27  // request of a client to perform an action over a chaincode (or more
    28  // generically on the ledger); the response might be success/error (conveyed in
    29  // the Response field) together with a description of the action and a
    30  // signature over it by that endorser.  If a sufficient number of distinct
    31  // endorsers agree on the same action and produce signature to that effect, a
    32  // transaction can be generated and sent for ordering.
    33  message ProposalResponse {
    34  
    35  	// Version indicates message protocol version
    36  	int32 version = 1;
    37  
    38  	// Timestamp is the time that the message
    39  	// was created as  defined by the sender
    40  	google.protobuf.Timestamp timestamp = 2;
    41  
    42  	// A response message indicating whether the
    43  	// endorsement of the action was successful
    44  	Response response = 4;
    45  
    46  	// The payload of response. It is the bytes of ProposalResponsePayload
    47  	bytes payload = 5;
    48  
    49  	// The endorsement of the proposal, basically
    50  	// the endorser's signature over the payload
    51  	Endorsement endorsement = 6;
    52  }
    53  
    54  // A response with a representation similar to an HTTP response that can
    55  // be used within another message.
    56  message Response {
    57  
    58  	// A status code that should follow the HTTP status codes.
    59  	int32 status = 1;
    60  
    61  	// A message associated with the response code.
    62  	string message = 2;
    63  
    64  	// A payload that can be used to include metadata with this response.
    65  	bytes payload = 3;
    66  }
    67  
    68  // ProposalResponsePayload is the payload of a proposal response.  This message
    69  // is the "bridge" between the client's request and the endorser's action in
    70  // response to that request. Concretely, for chaincodes, it contains a hashed
    71  // representation of the proposal (proposalHash) and a representation of the
    72  // chaincode state changes and events inside the extension field.
    73  message ProposalResponsePayload {
    74  
    75  	// Hash of the proposal that triggered this response. The hash is used to
    76  	// link a response with its proposal, both for bookeeping purposes on an
    77  	// asynchronous system and for security reasons (accountability,
    78  	// non-repudiation). The hash usually covers the entire Proposal message
    79  	// (byte-by-byte). However this implies that the hash can only be verified
    80  	// if the entire proposal message is available when ProposalResponsePayload is
    81  	// included in a transaction or stored in the ledger. For confidentiality
    82  	// reasons, with chaincodes it might be undesirable to store the proposal
    83  	// payload in the ledger.  If the type is CHAINCODE, this is handled by
    84  	// separating the proposal's header and
    85  	// the payload: the header is always hashed in its entirety whereas the
    86  	// payload can either be hashed fully, or only its hash may be hashed, or
    87  	// nothing from the payload can be hashed. The PayloadVisibility field in the
    88  	// Header's extension controls to which extent the proposal payload is
    89  	// "visible" in the sense that was just explained.
    90  	bytes proposal_hash = 1;
    91  
    92  	// Extension should be unmarshaled to a type-specific message. The type of
    93  	// the extension in any proposal response depends on the type of the proposal
    94  	// that the client selected when the proposal was initially sent out.  In
    95  	// particular, this information is stored in the type field of a Header.  For
    96  	// chaincode, it's a ChaincodeAction message
    97  	bytes extension = 2;
    98  }
    99  
   100  // An endorsement is a signature of an endorser over a proposal response.  By
   101  // producing an endorsement message, an endorser implicitly "approves" that
   102  // proposal response and the actions contained therein. When enough
   103  // endorsements have been collected, a transaction can be generated out of a
   104  // set of proposal responses.  Note that this message only contains an identity
   105  // and a signature but no signed payload. This is intentional because
   106  // endorsements are supposed to be collected in a transaction, and they are all
   107  // expected to endorse a single proposal response/action (many endorsements
   108  // over a single proposal response)
   109  message Endorsement {
   110  
   111  	// Identity of the endorser (e.g. its certificate)
   112  	bytes endorser = 1;
   113  
   114  	// Signature of the payload included in ProposalResponse concatenated with
   115  	// the endorser's certificate; ie, sign(ProposalResponse.payload + endorser)
   116  	bytes signature = 2;
   117  }