syntax = "proto3";
package cometbft.p2p.v1;

option go_package = "github.com/cometbft/cometbft/api/cometbft/p2p/v1";

import "gogoproto/gogo.proto";

// NetAddress represents a peer's network address.
message NetAddress {
  string id   = 1 [(gogoproto.customname) = "ID"];
  string ip   = 2 [(gogoproto.customname) = "IP"];
  uint32 port = 3;
}

// ProtocolVersion represents the current p2p protocol version.
message ProtocolVersion {
  uint64 p2p   = 1 [(gogoproto.customname) = "P2P"];
  uint64 block = 2;
  uint64 app   = 3;
}

// DefaultNodeInfo is a basic node's information sent to other peers during the
// p2p handshake.
message DefaultNodeInfo {
  ProtocolVersion      protocol_version = 1 [(gogoproto.nullable) = false];
  string               default_node_id  = 2 [(gogoproto.customname) = "DefaultNodeID"];
  string               listen_addr      = 3;
  string               network          = 4;
  string               version          = 5;
  bytes                channels         = 6;
  string               moniker          = 7;
  DefaultNodeInfoOther other            = 8 [(gogoproto.nullable) = false];
}

// DefaultNodeInfoOther is the misc. application specific data.
message DefaultNodeInfoOther {
  string tx_index    = 1;
  string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"];
}
