github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/protos/orderer/ab.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 import "common/common.proto"; 20 21 option go_package = "github.com/hyperledger/fabric/protos/orderer"; 22 23 package orderer; 24 25 message BroadcastResponse { 26 common.Status status = 1; 27 } 28 29 message SeekNewest { } 30 31 message SeekOldest { } 32 33 message SeekSpecified { 34 uint64 number = 1; 35 } 36 37 message SeekPosition { 38 oneof Type { 39 SeekNewest newest = 1; 40 SeekOldest oldest = 2; 41 SeekSpecified specified = 3; 42 } 43 } 44 45 // SeekInfo specifies the range of requested blocks to return 46 // If the start position is not found, an error is immediately returned 47 // Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated 48 // by the SeekBehavior specified. If BLOCK_UNTIL_READY is specified, the reply will block until 49 // the requested blocks are available, if FAIL_IF_NOT_READY is specified, the reply will return an 50 // error indicating that the block is not found. To request that all blocks be returned indefinitely 51 // as they are created, behavior should be set to BLOCK_UNTIL_READY and the stop should be set to 52 // specified with a number of MAX_UINT64 53 message SeekInfo { 54 enum SeekBehavior { 55 BLOCK_UNTIL_READY = 0; 56 FAIL_IF_NOT_READY = 1; 57 } 58 SeekPosition start = 1; // The position to start the deliver from 59 SeekPosition stop = 2; // The position to stop the deliver 60 SeekBehavior behavior = 3; // The behavior when a missing block is encountered 61 } 62 63 message DeliverResponse { 64 oneof Type { 65 common.Status status = 1; 66 common.Block block = 2; 67 } 68 } 69 70 service AtomicBroadcast { 71 // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure 72 rpc Broadcast(stream common.Envelope) returns (stream BroadcastResponse) {} 73 74 // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. 75 rpc Deliver(stream common.Envelope) returns (stream DeliverResponse) {} 76 }