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.

48 lines
1.6 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.
  21. | Name | Type | Description | Field Number |
  22. |------|--------|------------------|--------------|
  23. | id | string | NodeID of a peer | 1 |
  24. | ip | string | The IP of a node | 2 |
  25. | port | port | Port of a peer | 3 |
  26. ### Message
  27. Message is a [`oneof` protobuf type](https://developers.google.com/protocol-buffers/docs/proto#oneof). The one of consists of two messages.
  28. | Name | Type | Description | Field Number |
  29. |--------------|---------------------------|------------------------------------------------------|--------------|
  30. | pex_request | [PexRequest](#pexrequest) | Empty request asking for a list of addresses to dial | 1 |
  31. | pex_response | [PexResponse] | List of addresses to dial | 2 |