通道

Pex 有一个通道。通道标识符如下所示。
名称编号
PexChannel0

消息类型

当前的 PEX 服务有两个版本。第一个版本使用 IP/端口对,但由于 p2p 栈正朝着与传输无关的方案演进, 节点端点需要 Protocol 和 Path,因此 V2 版本改为使用 url。

PexRequest

PexRequest 是一个空消息,用于请求对等节点列表。
EmptyRequest

PexResponse

PexResponse 是提供给对等节点用于拨号连接的网络地址列表。
名称类型描述字段编号
addressesrepeated PexAddress可用于拨号连接的对等节点地址列表1

PexAddress

PexAddress 提供节点拨号连接对等节点所需的信息。
名称类型描述字段编号
idstring对等节点的 NodeID1
ipstring节点的 IP2
portport对等节点的端口3

PexRequestV2

PexRequest 是一个空消息,用于请求对等节点列表。
EmptyRequest

PexResponseV2

PexResponse 是提供给对等节点用于拨号连接的网络地址列表。
名称类型描述字段编号
addressesrepeated PexAddressV2可用于拨号连接的对等节点地址列表1

PexAddressV2

PexAddress 提供节点拨号连接对等节点所需的信息。
名称类型描述字段编号
urlstring参见 golang url1

Message

Message 是一种 oneof protobuf 类型。该 oneof 由两类消息组成。
名称类型描述字段编号
pex_requestPexRequest请求可拨号地址列表的空请求1
pex_responsePexResponse可拨号的地址列表2
pex_request_v2PexRequestV2请求可拨号地址列表的空请求3
pex_response_v2PexRespinseV2可拨号的地址列表4

Channels

Pex has one channel. The channel identifier is listed below.
NameNumber
PexChannel0

Message Types

The current PEX service has two versions. The first uses IP/port pair but since the p2p stack is moving towards a transport agnostic approach, node endpoints require a Protocol and Path hence the V2 version uses a url instead.

PexRequest

PexRequest is an empty message requesting a list of peers.
EmptyRequest

PexResponse

PexResponse is an list of net addresses provided to a peer to dial.
NameTypeDescriptionField Number
addressesrepeated PexAddressList of peer addresses available to dial1

PexAddress

PexAddress provides needed information for a node to dial a peer.
NameTypeDescriptionField Number
idstringNodeID of a peer1
ipstringThe IP of a node2
portportPort of a peer3

PexRequestV2

PexRequest is an empty message requesting a list of peers.
EmptyRequest

PexResponseV2

PexResponse is an list of net addresses provided to a peer to dial.
NameTypeDescriptionField Number
addressesrepeated PexAddressV2List of peer addresses available to dial1

PexAddressV2

PexAddress provides needed information for a node to dial a peer.
NameTypeDescriptionField Number
urlstringSee golang url1

Message

Message is a oneof protobuf type. The one of consists of two messages.
NameTypeDescriptionField Number
pex_requestPexRequestEmpty request asking for a list of addresses to dial1
pex_responsePexResponseList of addresses to dial2
pex_request_v2PexRequestV2Empty request asking for a list of addresses to dial3
pex_response_v2PexRespinseV2List of addresses to dial4