syntax = "proto3";
package tendermint.p2p;

option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";

message ProtocolVersion {
  uint64 p2p   = 1 [(gogoproto.customname) = "P2P"];
  uint64 block = 2;
  uint64 app   = 3;
}

message NodeInfo {
  ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false];
  string          node_id          = 2 [(gogoproto.customname) = "NodeID"];
  string          listen_addr      = 3;
  string          network          = 4;
  string          version          = 5;
  bytes           channels         = 6;
  string          moniker          = 7;
  NodeInfoOther   other            = 8 [(gogoproto.nullable) = false];
}

message NodeInfoOther {
  string tx_index    = 1;
  string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"];
}

message PeerInfo {
  string                    id             = 1 [(gogoproto.customname) = "ID"];
  repeated PeerAddressInfo  address_info   = 2;
  google.protobuf.Timestamp last_connected = 3 [(gogoproto.stdtime) = true];
}

message PeerAddressInfo {
  string                    address           = 1;
  google.protobuf.Timestamp last_dial_success = 2 [(gogoproto.stdtime) = true];
  google.protobuf.Timestamp last_dial_failure = 3 [(gogoproto.stdtime) = true];
  uint32                    dial_failures     = 4;
}
