github.com/aergoio/aergo@v1.3.1/p2p/p2pcommon/subprotocols.go (about)

     1  /*
     2   * @file
     3   * @copyright defined in aergo/LICENSE.txt
     4   */
     5  
     6  package p2pcommon
     7  
     8  // NOTE: change const of protocols_test.go
     9  const (
    10  	_ SubProtocol = 0x00 + iota
    11  	StatusRequest
    12  	PingRequest
    13  	PingResponse
    14  	GoAway
    15  	AddressesRequest
    16  	AddressesResponse
    17  )
    18  const (
    19  	GetBlocksRequest SubProtocol = 0x010 + iota
    20  	GetBlocksResponse
    21  	GetBlockHeadersRequest
    22  	GetBlockHeadersResponse
    23  	_ // placeholder for deprecated GetMissingRequest
    24  	_ // placeholder for deprecated GetMissingResponse
    25  	NewBlockNotice
    26  	GetAncestorRequest
    27  	GetAncestorResponse
    28  	GetHashesRequest
    29  	GetHashesResponse
    30  	GetHashByNoRequest
    31  	GetHashByNoResponse
    32  )
    33  const (
    34  	GetTXsRequest SubProtocol = 0x020 + iota
    35  	GetTXsResponse
    36  	NewTxNotice
    37  )
    38  
    39  // subprotocols for block producers and their own trusted nodes
    40  const (
    41  	// BlockProducedNotice from block producer to trusted nodes and other bp nodes
    42  	BlockProducedNotice SubProtocol = 0x030 + iota
    43  )
    44  
    45  const (
    46  	_ SubProtocol = 0x3100 + iota
    47  	GetClusterRequest
    48  	GetClusterResponse
    49  	RaftWrapperMessage  //
    50  )
    51  
    52  //go:generate stringer -type=SubProtocol