github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/protos/client_block.proto (about)

     1  // Copyright 2017 Intel Corporation
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  // -----------------------------------------------------------------------------
    15  
    16  syntax = "proto3";
    17  
    18  option java_multiple_files = true;
    19  option java_package = "sawtooth.sdk.protobuf";
    20  option go_package = "client_block_pb2";
    21  
    22  import "block.proto";
    23  import "client_list_control.proto";
    24  
    25  
    26  // A request to return a list of blocks from the validator. May include the id
    27  // of a particular block to be the `head` of the chain being requested. In that
    28  // case the list will include that block (if found), and all blocks previous
    29  // to it on the chain. Can be filtered using specific `block_ids`.
    30  message ClientBlockListRequest {
    31      string head_id = 1;
    32      repeated string block_ids = 2;
    33      ClientPagingControls paging = 3;
    34      repeated ClientSortControls sorting = 4;
    35  }
    36  
    37  // A response that lists a chain of blocks with the newest at the beginning,
    38  // and the oldest (genesis) block at the end.
    39  //
    40  // Statuses:
    41  //   * OK - everything worked as expected
    42  //   * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
    43  //   * NOT_READY - the validator does not yet have a genesis block
    44  //   * NO_ROOT - the head block specified was not found
    45  //   * NO_RESOURCE - no blocks were found with the parameters specified
    46  //   * INVALID_PAGING - the paging controls were malformed or out of range
    47  //   * INVALID_SORT - the sorting controls were malformed or invalid
    48  message ClientBlockListResponse {
    49      enum Status {
    50          STATUS_UNSET = 0;
    51          OK = 1;
    52          INTERNAL_ERROR = 2;
    53          NOT_READY = 3;
    54          NO_ROOT = 4;
    55          NO_RESOURCE = 5;
    56          INVALID_PAGING = 6;
    57          INVALID_SORT = 7;
    58          INVALID_ID = 8;
    59      }
    60      Status status = 1;
    61      repeated Block blocks = 2;
    62      string head_id = 3;
    63      ClientPagingResponse paging = 4;
    64  }
    65  
    66  // A request to return a specific block from the validator. The block must be
    67  // specified by its unique id, in this case the block's header signature
    68  message ClientBlockGetByIdRequest {
    69      string block_id = 1;
    70  }
    71  
    72  // A request to return a specific block from the validator. The block must be
    73  // specified by its block number
    74  message ClientBlockGetByNumRequest {
    75      uint64 block_num = 1;
    76  }
    77  
    78  // A request to return a specific block from the validator. The block
    79  // containing the given transaction is returned. If no block on the current
    80  // chain contains the transaction, NO_RESOURCE is returned.
    81  message ClientBlockGetByTransactionIdRequest {
    82      string transaction_id = 1;
    83  }
    84  
    85  // A request to return a specific block from the validator. The block
    86  // containing the given batch is returned. If no block on the current chain
    87  // contains the batch, NO_RESOURCE is returned.
    88  message ClientBlockGetByBatchIdRequest {
    89      string batch_id = 1;
    90  }
    91  
    92  // A response that returns the block specified by a ClientBlockGetByIdRequest
    93  // or  ClientBlockGetByNumRequest.
    94  //
    95  // Statuses:
    96  //   * OK - everything worked as expected
    97  //   * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
    98  //   * NO_RESOURCE - no block with the specified id exists
    99  message ClientBlockGetResponse {
   100      enum Status {
   101          STATUS_UNSET = 0;
   102          OK = 1;
   103          INTERNAL_ERROR = 2;
   104          NO_RESOURCE = 5;
   105          INVALID_ID = 8;
   106      }
   107      Status status = 1;
   108      Block block = 2;
   109  }