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

     1  // Copyright 2016, 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  option java_multiple_files = true;
    18  option java_package = "sawtooth.sdk.protobuf";
    19  option go_package = "network_pb2";
    20  
    21  // The disconnect message from a client to the server
    22  message DisconnectMessage {
    23  }
    24  
    25  // The registration request from a peer to the validator
    26  message PeerRegisterRequest {
    27      string endpoint = 1;
    28      // The current version of the network protocol that is being used by the
    29      // sender.  This version is an increasing value.
    30      uint32 protocol_version = 2;
    31  }
    32  
    33  // The unregistration request from a peer to the validator
    34  message PeerUnregisterRequest {
    35  }
    36  
    37  message GetPeersRequest {
    38  }
    39  
    40  message GetPeersResponse {
    41      repeated string peer_endpoints = 1;
    42  }
    43  
    44  message PingRequest {
    45  }
    46  
    47  message PingResponse{
    48  }
    49  
    50  message GossipMessage {
    51      enum ContentType{
    52          CONTENT_TYPE_UNSET = 0;
    53          BLOCK = 1;
    54          BATCH = 2;
    55      }
    56      bytes content = 1;
    57      ContentType content_type = 2;
    58      uint32 time_to_live = 3;
    59  }
    60  
    61  // A response sent from the validator to the peer acknowledging message
    62  // receipt
    63  message NetworkAcknowledgement {
    64      enum Status {
    65          STATUS_UNSET = 0;
    66          OK = 1;
    67          ERROR = 2;
    68      }
    69  
    70      Status status = 1;
    71  }
    72  
    73  message GossipBlockRequest {
    74      // The id of the block that is being requested
    75      string block_id = 1;
    76  
    77      // A random string that provides uniqueness for requests with
    78      // otherwise identical fields.
    79      string nonce = 2;
    80      uint32 time_to_live = 3;
    81  
    82  }
    83  
    84  message GossipBlockResponse {
    85      // The block
    86      bytes content = 1;
    87  }
    88  
    89  message GossipBatchResponse {
    90      //The batch
    91      bytes content = 1;
    92  }
    93  
    94  message GossipBatchByBatchIdRequest {
    95      // The id of the batch that is being requested
    96      string id = 1;
    97  
    98      // A random string that provides uniqueness for requests with
    99      // otherwise identical fields.
   100      string nonce = 2;
   101      uint32 time_to_live = 3;
   102  
   103  }
   104  
   105  message GossipBatchByTransactionIdRequest {
   106      // The id's of the transaction that are in the batches requested
   107      repeated string ids = 1;
   108  
   109      // A random string that provides uniqueness for requests with
   110      // otherwise identical fields.
   111      string nonce = 2;
   112      uint32 time_to_live = 3;
   113  
   114  }
   115  
   116  message GossipConsensusMessage {
   117      bytes message = 1;
   118      bytes sender_id = 2;
   119      uint32 time_to_live = 3;
   120  }