github.com/s7techlab/cckit@v0.10.5/third_party/hyperledger/fabric/peer/proposal_response.proto (about) 1 // Copyright the Hyperledger Fabric contributors. All rights reserved. 2 // 3 // SPDX-License-Identifier: Apache-2.0 4 5 syntax = "proto3"; 6 7 option go_package = "github.com/hyperledger/fabric-protos-go/peer"; 8 option java_package = "org.hyperledger.fabric.protos.peer"; 9 option java_outer_classname = "ProposalResponsePackage"; 10 11 package protos; 12 13 import "google/protobuf/timestamp.proto"; 14 15 // A ProposalResponse is returned from an endorser to the proposal submitter. 16 // The idea is that this message contains the endorser's response to the 17 // request of a client to perform an action over a chaincode (or more 18 // generically on the ledger); the response might be success/error (conveyed in 19 // the Response field) together with a description of the action and a 20 // signature over it by that endorser. If a sufficient number of distinct 21 // endorsers agree on the same action and produce signature to that effect, a 22 // transaction can be generated and sent for ordering. 23 message ProposalResponse { 24 // Version indicates message protocol version 25 int32 version = 1; 26 27 // Timestamp is the time that the message 28 // was created as defined by the sender 29 google.protobuf.Timestamp timestamp = 2; 30 31 // A response message indicating whether the 32 // endorsement of the action was successful 33 Response response = 4; 34 35 // The payload of response. It is the bytes of ProposalResponsePayload 36 bytes payload = 5; 37 38 // The endorsement of the proposal, basically 39 // the endorser's signature over the payload 40 Endorsement endorsement = 6; 41 } 42 43 // A response with a representation similar to an HTTP response that can 44 // be used within another message. 45 message Response { 46 // A status code that should follow the HTTP status codes. 47 int32 status = 1; 48 49 // A message associated with the response code. 50 string message = 2; 51 52 // A payload that can be used to include metadata with this response. 53 bytes payload = 3; 54 } 55 56 // ProposalResponsePayload is the payload of a proposal response. This message 57 // is the "bridge" between the client's request and the endorser's action in 58 // response to that request. Concretely, for chaincodes, it contains a hashed 59 // representation of the proposal (proposalHash) and a representation of the 60 // chaincode state changes and events inside the extension field. 61 message ProposalResponsePayload { 62 // Hash of the proposal that triggered this response. The hash is used to 63 // link a response with its proposal, both for bookeeping purposes on an 64 // asynchronous system and for security reasons (accountability, 65 // non-repudiation). The hash usually covers the entire Proposal message 66 // (byte-by-byte). 67 bytes proposal_hash = 1; 68 69 // Extension should be unmarshaled to a type-specific message. The type of 70 // the extension in any proposal response depends on the type of the proposal 71 // that the client selected when the proposal was initially sent out. In 72 // particular, this information is stored in the type field of a Header. For 73 // chaincode, it's a ChaincodeAction message 74 bytes extension = 2; 75 } 76 77 // An endorsement is a signature of an endorser over a proposal response. By 78 // producing an endorsement message, an endorser implicitly "approves" that 79 // proposal response and the actions contained therein. When enough 80 // endorsements have been collected, a transaction can be generated out of a 81 // set of proposal responses. Note that this message only contains an identity 82 // and a signature but no signed payload. This is intentional because 83 // endorsements are supposed to be collected in a transaction, and they are all 84 // expected to endorse a single proposal response/action (many endorsements 85 // over a single proposal response) 86 message Endorsement { 87 // Identity of the endorser (e.g. its certificate) 88 bytes endorser = 1; 89 90 // Signature of the payload included in ProposalResponse concatenated with 91 // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) 92 bytes signature = 2; 93 }