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