You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
unclear what the 'time' field represents in "cleos net status"Β #8239
structhandshake_message {
uint16_t network_version = 0; ///< incremental value above a computed base
chain_id_type chain_id; ///< used to identify chain
fc::sha256 node_id; ///< used to identify peers and prevent self-connect
chain::public_key_type key; ///< authentication key; may be a producer or peer key, or empty
tstamp time;
fc::sha256 token; ///< digest of time to prove we own the private key of the key above
chain::signature_type sig; ///< signature for the digest
string p2p_address;
uint32_t last_irreversible_block_num = 0;
block_id_type last_irreversible_block_id;
uint32_t head_num = 0;
block_id_type head_id;
string os;
string agent;
int16_t generation;
};
In the same file, we can also see that the field time is of type tstamp which is a typedef to:
auto status = net->add_subcommand("status", localized("Status of existing connection"), false);
status->add_option("host", new_host, localized("The hostname:port to query status of connection"))->required();
status->set_callback([&] {
constauto& v = call(url, net_status, new_host);
std::cout << fc::json::to_pretty_string(v) << std::endl;
});
thank you all, for reporting this and for contributing to the solution @lparisc and @johndebord .
in the light of the new documentation that explains the time field of the handshake message can we close this issue @matthewdarwin ?
Activity
johndebord commentedon Nov 26, 2019
We can find the underlying data structure of
last_handshakein file eos/plugins/net_plugin/include/eosio/net_plugin/protocol.hpp#L24-L40:In the same file, we can also see that the field
timeis of typetstampwhich is a typedef to:typedef std::chrono::system_clock::duration::rep tstamp;But what is it a timestamp of?
Well, let's follow the logic in the code originating from file eos/programs/cleos/main.cpp#L3114-L3119:
We end up calling the function
connection::get_status()in file eos/plugins/net_plugin/net_plugin.cpp#L508-L515:Lastly, the type
connection_statusholds a field that is of typehandshake_message; which can be found in file eos/plugins/net_plugin/include/eosio/net_plugin/net_plugin.hpp#L13-L18:We can now see that the field
timecorresponds to the last timestamp of the last handshake received;last_handshake_recv.lparisc commentedon Feb 26, 2020
@matthewdarwin See also a description of the handshake message in the EOSIO network protocol document.
iamveritas commentedon Feb 27, 2020
thank you all, for reporting this and for contributing to the solution @lparisc and @johndebord .
in the light of the new documentation that explains the
timefield of thehandshake messagecan we close this issue @matthewdarwin ?matthewdarwin commentedon Feb 27, 2020
Can the page at https://developers.eos.io/manuals/eos/latest/cleos/command-reference/net/status point to the web page with the handshake details?
iamveritas commentedon Feb 28, 2020
#8718
we have in plan to improve the whole cleos reference documentation for now this is the best I can do.
lparisc commentedon Feb 28, 2020
docs/02_cleos/03_command-reference/net/status.md
network_peer_protocol#421-handshake-message