You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.8 KiB

  1. ---
  2. order: 6
  3. ---
  4. # Peer Exchange
  5. ## Channels
  6. Pex has one channel. The channel identifier is listed below.
  7. | Name | Number |
  8. |------------|--------|
  9. | PexChannel | 0 |
  10. ## Message Types
  11. ### PexRequest
  12. PexRequest is an empty message requesting a list of peers.
  13. > EmptyRequest
  14. ### PexResponse
  15. PexResponse is an list of net addresses provided to a peer to dial.
  16. | Name | Type | Description | Field Number |
  17. |-------|------------------------------------|------------------------------------------|--------------|
  18. | addresses | repeated [PexAddress](#PexAddress) | List of peer addresses available to dial | 1 |
  19. ### PexAddress
  20. PexAddress provides needed information for a node to dial a peer. This is in the form of a `URL` that gets parsed
  21. into a `NodeAddress`. See [ParseNodeAddress](https://github.com/tendermint/tendermint/blob/f2a8f5e054cf99ebe246818bb6d71f41f9a30faa/internal/p2p/address.go#L43) for more details.
  22. | Name | Type | Description | Field Number |
  23. |------|--------|------------------|--------------|
  24. | url | string | See [golang url](https://golang.org/pkg/net/url/#URL) | 1 |
  25. ### Message
  26. Message is a [`oneof` protobuf type](https://developers.google.com/protocol-buffers/docs/proto#oneof). The one of consists of two messages.
  27. | Name | Type | Description | Field Number |
  28. |--------------|---------------------------|------------------------------------------------------|--------------|
  29. | pex_request | [PexRequest](#PexRequest) | Empty request asking for a list of addresses to dial | 3 |
  30. | pex_response | [PexResponse](#PexResponse) | List of addresses to dial | 4 |