|
| 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 | +package protos; |
| 20 | + |
| 21 | +import "google/protobuf/timestamp.proto"; |
| 22 | + |
| 23 | +// A ProposalResponse is returned from an endorser to the proposal submitter |
| 24 | +message ProposalResponse { |
| 25 | + // Version indicates message protocol version |
| 26 | + int32 version = 1; |
| 27 | + |
| 28 | + // Timestamp is the time that the message |
| 29 | + // was created as defined by the sender |
| 30 | + google.protobuf.Timestamp timestamp = 2; |
| 31 | + |
| 32 | + // A response message indicating whether the |
| 33 | + // endorsement of the action was successful |
| 34 | + Response response = 4; |
| 35 | + |
| 36 | + // The payload of response, which is the bytes of ProposalResponsePayload |
| 37 | + bytes payload = 5; |
| 38 | + |
| 39 | + // The endorsement of the proposal |
| 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 | + |
| 47 | + // A status code that should follow the HTTP status codes. |
| 48 | + int32 status = 1; |
| 49 | + |
| 50 | + // A message associated with the response code. |
| 51 | + string message = 2; |
| 52 | + |
| 53 | + // A payload that can be used to include metadata with this response. |
| 54 | + bytes payload = 3; |
| 55 | + |
| 56 | +} |
| 57 | + |
| 58 | +// ProposalResponsePayload is the payload of ProposalResponse. |
| 59 | +// It links the proposal and add support for replay-attack protection. |
| 60 | +// It can include also type-dependant fields by using the |
| 61 | +// 'extensions' field. The type here refers to type specified in the proposal |
| 62 | +// header. |
| 63 | +message ProposalResponsePayload { |
| 64 | + // Hash of the proposal that the endorser acts on |
| 65 | + bytes proposalHash = 1; |
| 66 | + |
| 67 | + // Epoch in which the response has been generated |
| 68 | + bytes epoch = 2; |
| 69 | + |
| 70 | + // Extension depends on type in proposal indexed by proposalHash. |
| 71 | + // For chaincode, it's bytes of ChaincodeProposalResponsePayload |
| 72 | + bytes extension = 3; |
| 73 | + |
| 74 | +} |
| 75 | + |
| 76 | +// Endorsement represents the will of an endorse to endorse a proposal. |
| 77 | +message Endorsement { |
| 78 | + // Identifier of the endorser (eg ecert) |
| 79 | + bytes endorser = 1; |
| 80 | + |
| 81 | + // Signature of the payload included in ProposalResponse concatenate with |
| 82 | + // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) |
| 83 | + bytes signature = 2; |
| 84 | +} |
0 commit comments