Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document client version field in DHT messages #61

Merged
merged 2 commits into from
May 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions beps/bep_0005.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,20 @@ single packet is sent in response. There is no retry. There are three
message types: query, response, and error. For the DHT protocol, there
are four queries: ping, find_node, get_peers, and announce_peer.

A KRPC message is a single dictionary with two keys common to
A KRPC message is a single dictionary with three keys common to
every message and additional keys depending on the type of message.
Every message has a key "t" with a string value representing a transaction
ID. This transaction ID is generated by the querying node and is echoed
in the response, so responses may be correlated with multiple queries
to the same node. The transaction ID should be encoded as a short string
of binary numbers, typically 2 characters are enough as they cover 2^16
outstanding queries. The other key contained in every KRPC message is "y"
with a single character value describing the type of message. The value
outstanding queries. Every message also has a key "y" with a single
character value describing the type of message. The value
of the "y" key is one of "q" for query, "r" for response, or "e" for
error.
error. A key "v" should be included in every message with a client version
string. The string should be a two character client identifier registered
in BEP 20 [#BEP-20]_ followed by a two character version identifier. Not all
implementations include a "v" key so clients should not assume its presence.

Contact Encoding
----------------
Expand Down Expand Up @@ -418,6 +421,9 @@ References

.. [#entropy] Use SHA1 and plenty of entropy to ensure a unique ID.

.. [#BEP-20] BEP_0020. Peer ID Conventions.
(http://www.bittorrent.org/beps/bep_0020.html)

Copyright
=========

Expand Down