-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change-set contains the protobuf messages for the next fabric architecture (v1) as decribed here: https://hyperledgerproject.slack.com/files/adc/F2JKXGXEU/protobufmessagesandflow.pdf and incoporates the feedback received from the community in a change-set previously. This change-set comes in the context of https://jira.hyperledger.org/browse/FAB-489. Change-Id: Ia602a14292696f6295fcd6b70cdafdae54d3606e Signed-off-by: Angelo De Caro <[email protected]>
- Loading branch information
Showing
8 changed files
with
411 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
message ChaincodeTransactionHeaderExtension { | ||
|
||
bytes payloadVisibility = 1; | ||
|
||
bytes chaincodeID = 2; | ||
} | ||
|
||
message ChaincodeProposalPayload { | ||
ChaincodeProposalInputs inputs = 1; | ||
ChaincodeProposalSimulation simulation = 2; | ||
} | ||
|
||
message ChaincodeProposalInputs { | ||
bytes Input = 1; | ||
|
||
bytes Transient = 2; | ||
} | ||
|
||
message ChaincodeProposalSimulation { | ||
bytes simulationResults = 1; | ||
|
||
bytes events = 2; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
message ChaincodeProposalResponsePayload { | ||
|
||
bytes simulationResults = 1; | ||
|
||
bytes events = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
import "fabric_proposal_response.proto"; | ||
|
||
message ChaincodeActionsPayload { | ||
|
||
// ChaincodeProposalPayload is present in the transaction | ||
// depending on the payloadVisibility field in the | ||
// ChaincodeTransactionHeaderExtension. | ||
// (it could be there in its entirety, it could be hashed or it | ||
// could be totally absent) | ||
bytes chaincodeProposalPayload = 1; | ||
|
||
repeated ChaincodeEndorsedAction actions = 2; | ||
|
||
} | ||
|
||
message ChaincodeEndorsedAction { | ||
|
||
ProposalResponsePayload responsePayload = 1; | ||
|
||
repeated Endorsement endorsements = 2; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
|
||
// A Message encapsulates a payload of the indicated type in this message. | ||
message Message { | ||
|
||
enum Type { | ||
|
||
// Undefined exists to prevent invalid message construction. | ||
UNDEFINED = 0; | ||
|
||
// Handshake messages. | ||
DISCOVERY = 1; | ||
|
||
// Sent to catch up with existing peers. | ||
SYNC = 2; | ||
} | ||
|
||
// Type of this message. | ||
Type type = 1; | ||
|
||
// Version indicates message protocol version. | ||
int32 version = 2; | ||
|
||
// The payload in this message. | ||
bytes payload = 3; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
import "fabric_transaction_header.proto"; | ||
|
||
// This structure is necessary to sign over the proposal which contains | ||
// the header and the payload. Without this structure, we would have to | ||
// concatenate the header and the payload to verify the signature, which | ||
// could be expensive with large payload | ||
message SignedProposal { | ||
// The bytes of Proposal | ||
// Allow ProposalResponse to easily hash over the bytes | ||
bytes proposalBytes = 1; | ||
|
||
// Signaure over proposalBytes | ||
bytes signature = 2; | ||
} | ||
|
||
// A Proposal is sent to an endorser for endorsement. | ||
// The proposal contains: | ||
// 1. A header which has fields common to all proposals and specifies | ||
// a type field for customization | ||
// 2. A payload whose type depends on the header's type field. | ||
message Proposal { | ||
|
||
// The header of the proposal | ||
TransactionHeader header = 1; | ||
|
||
// The payload of the proposal as defined by the type in the proposal | ||
// header. For chaincode, it's bytes of ChaincodeProposalPayload | ||
bytes payload = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
// A ProposalResponse is returned from an endorser to the proposal submitter | ||
message ProposalResponse { | ||
// Version indicates message protocol version | ||
int32 version = 1; | ||
|
||
// Timestamp is the time that the message | ||
// was created as defined by the sender | ||
google.protobuf.Timestamp timestamp = 2; | ||
|
||
// A response message indicating whether the | ||
// endorsement of the action was successful | ||
Response response = 4; | ||
|
||
// The payload of response, which is the bytes of ProposalResponsePayload | ||
bytes payload = 5; | ||
|
||
// The endorsement of the proposal | ||
Endorsement endorsement = 6; | ||
} | ||
|
||
// A response with a representation similar to an HTTP response that can | ||
// be used within another message. | ||
message Response { | ||
|
||
// A status code that should follow the HTTP status codes. | ||
int32 status = 1; | ||
|
||
// A message associated with the response code. | ||
string message = 2; | ||
|
||
// A payload that can be used to include metadata with this response. | ||
bytes payload = 3; | ||
|
||
} | ||
|
||
// ProposalResponsePayload is the payload of ProposalResponse. | ||
// It links the proposal and add support for replay-attack protection. | ||
// It can include also type-dependant fields by using the | ||
// 'extensions' field. The type here refers to type specified in the proposal | ||
// header. | ||
message ProposalResponsePayload { | ||
// Hash of the proposal that the endorser acts on | ||
bytes proposalHash = 1; | ||
|
||
// Epoch in which the response has been generated | ||
bytes epoch = 2; | ||
|
||
// Extension depends on type in proposal indexed by proposalHash. | ||
// For chaincode, it's bytes of ChaincodeProposalResponsePayload | ||
bytes extension = 3; | ||
|
||
} | ||
|
||
// Endorsement represents the will of an endorse to endorse a proposal. | ||
message Endorsement { | ||
// Identifier of the endorser (eg ecert) | ||
bytes endorser = 1; | ||
|
||
// Signature of the payload included in ProposalResponse concatenate with | ||
// the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) | ||
bytes signature = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
syntax = "proto3"; | ||
|
||
package protos; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "fabric_transaction_header.proto"; | ||
|
||
message SignedTransaction { | ||
|
||
// The bytes of the Transaction. NDD | ||
bytes transactionBytes = 1; | ||
|
||
// Signature of the transactionBytes | ||
// The public key of the signature is in the header field of TransactionActions | ||
// There might be multiple TransactionActions, so multiple headers, | ||
// but there should be same transactor identity (cert) in all headers | ||
bytes signature = 2; | ||
} | ||
|
||
// The transaction to be sent to the ordering service. A transaction contains | ||
// one or more TransactionActions. Each TransactionActions binds a proposal | ||
// to potentially multiple actions. | ||
// The transaction is atomic meaning that either | ||
// all actions in the transaction will be committed or none will be committed. | ||
message Transaction { | ||
// Version indicates message protocol version. | ||
int32 version = 1; | ||
|
||
// Timestamp is the local time that the | ||
// message was created by the sender | ||
google.protobuf.Timestamp timestamp = 2; | ||
|
||
// The payload is an array of TransactionActions. An array is neccessary | ||
// accommodate multiple proposals per transaction | ||
repeated TransactionActions TransactionActions = 3; | ||
} | ||
|
||
// TransactionActions binds a proposal to one of more actions. | ||
// The type field in the header dictecates the type actions | ||
// to be applied to the ledger. | ||
message TransactionActions { | ||
|
||
// The header of the proposal action, which is the proposal header | ||
TransactionHeader header = 1; | ||
|
||
// The payload of the action as defined by the type in the header | ||
// For chaincode, it's the bytes of ChaincodeActionsPayload | ||
bytes payload = 2; | ||
} |
Oops, something went wrong.