11/*
2- Copyright IBM Corp. 2016 All Rights Reserved.
2+ Copyright IBM Corp. All Rights Reserved.
33
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.
4+ SPDX-License-Identifier: Apache-2.0
155*/
166
177syntax = "proto3" ;
@@ -27,6 +17,60 @@ option go_package = "github.com/hyperledger/fabric/protos/peer";
2717
2818package protos ;
2919
20+ // FilteredBlock is a minimal set of information about a block
21+ message FilteredBlock {
22+ string channel_id = 1 ;
23+ uint64 number = 2 ; // The position in the blockchain
24+ repeated FilteredTransaction filtered_transactions = 4 ;
25+ }
26+
27+ // FilteredTransaction is a minimal set of information about a transaction
28+ // within a block
29+ message FilteredTransaction {
30+ string txid = 1 ;
31+ common.HeaderType type = 2 ;
32+ TxValidationCode tx_validation_code = 3 ;
33+ oneof Data {
34+ FilteredTransactionActions transaction_actions = 4 ;
35+ }
36+ }
37+
38+ // FilteredTransactionActions is a wrapper for array of TransactionAction
39+ // message from regular block
40+ message FilteredTransactionActions {
41+ repeated FilteredChaincodeAction chaincode_actions = 1 ;
42+ }
43+
44+ // FilteredChaincodeAction is a minimal set of information about an action
45+ // within a transaction
46+ message FilteredChaincodeAction {
47+ ChaincodeEvent chaincode_event = 1 ;
48+ }
49+
50+ // DeliverResponse
51+ message DeliverResponse {
52+ oneof Type {
53+ common.Status status = 1 ;
54+ common.Block block = 2 ;
55+ FilteredBlock filtered_block = 3 ;
56+ }
57+ }
58+
59+ service Deliver {
60+ // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with
61+ // Payload data as a marshaled orderer.SeekInfo message,
62+ // then a stream of block replies is received
63+ rpc Deliver (stream common.Envelope ) returns (stream DeliverResponse ) {
64+ }
65+ // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with
66+ // Payload data as a marshaled orderer.SeekInfo message,
67+ // then a stream of **filtered** block replies is received
68+ rpc DeliverFiltered (stream common.Envelope ) returns (stream DeliverResponse ) {
69+ }
70+ }
71+
72+ //---------- producer events ---------
73+
3074//----Event objects----
3175
3276enum EventType {
@@ -75,37 +119,6 @@ message Unregister {
75119 repeated Interest events = 1 ;
76120}
77121
78- //FilteredBlock is sent by producers and contains minimal information
79- //about the block.
80- message FilteredBlock {
81- string channel_id = 1 ;
82- uint64 number = 2 ; // The position in the blockchain
83- repeated FilteredTransaction filtered_transactions = 4 ;
84- }
85-
86- //FilteredTransaction is a minimal set of information about a transaction
87- //within a block.
88- message FilteredTransaction {
89- string txid = 1 ;
90- common.HeaderType type = 2 ;
91- TxValidationCode tx_validation_code = 3 ;
92- oneof Data {
93- FilteredTransactionActions transaction_actions = 4 ;
94- }
95- }
96-
97- // FilteredTransactionActions is a wrapper for array of TransactionAction
98- // message from regular block
99- message FilteredTransactionActions {
100- repeated FilteredChaincodeAction chaincode_actions = 1 ;
101- }
102-
103- //FilteredChaincodeAction is a minimal set of information about an action within a
104- //transaction.
105- message FilteredChaincodeAction {
106- ChaincodeEvent chaincode_event = 1 ;
107- }
108-
109122// SignedEvent is used for any communication between consumer and producer
110123message SignedEvent {
111124 // Signature over the event bytes
@@ -147,24 +160,4 @@ service Events {
147160 // event chatting using Event
148161 rpc Chat (stream SignedEvent ) returns (stream Event ) {
149162 }
150- }
151-
152- // DeliverResponse
153- message DeliverResponse {
154- oneof Type {
155- common.Status status = 1 ;
156- common.Block block = 2 ;
157- FilteredBlock filtered_block = 3 ;
158- }
159- }
160-
161- service Deliver {
162- // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message,
163- // then a stream of block replies is received.
164- rpc Deliver (stream common.Envelope ) returns (stream DeliverResponse ) {
165- }
166- // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message,
167- // then a stream of **filtered** block replies is received.
168- rpc DeliverFiltered (stream common.Envelope ) returns (stream DeliverResponse ) {
169- }
170163}
0 commit comments