diff --git a/llarp/contact/client_contact.hpp b/llarp/contact/client_contact.hpp index 17d7143932..81c496443a 100644 --- a/llarp/contact/client_contact.hpp +++ b/llarp/contact/client_contact.hpp @@ -46,12 +46,8 @@ namespace llarp TCP2QUIC = 1 << 5, }; - /** TODO: - - LocalCC - - holds the derived Ed25519PrivateData - - RemoteCC: - - */ + // TESTNET: + inline static constexpr auto CC_PUBLISH_INTERVAL{5min}; /** ClientContact On the wire we encode the data as a dict containing: diff --git a/llarp/dht/node.hpp b/llarp/dht/node.hpp index 2326d15cff..4c9804c8b0 100644 --- a/llarp/dht/node.hpp +++ b/llarp/dht/node.hpp @@ -32,7 +32,7 @@ namespace llarp::dht CCNode(EncryptedClientContact other) : client_contact{std::move(other)}, ID{client_contact.blinded_pubkey} {} - nlohmann::json ExtractStatus() const { return nlohmann::json{{"key", client_contact.key()}}; } + nlohmann::json ExtractStatus() const { return nlohmann::json{{"key", client_contact.key().to_string()}}; } bool operator<(const CCNode& other) const { return client_contact.signed_at < other.client_contact.signed_at; } }; diff --git a/llarp/handlers/session.cpp b/llarp/handlers/session.cpp index d8a153e5cb..48bac59103 100644 --- a/llarp/handlers/session.cpp +++ b/llarp/handlers/session.cpp @@ -138,11 +138,11 @@ namespace llarp::handlers { if (should_publish_cc) { - log::debug(logcat, "Starting ClientContact publish ticker..."); + log::critical(logcat, "Starting ClientContact publish ticker..."); _cc_publisher = _router.loop()->call_every( - path::DEFAULT_LIFETIME, + CC_PUBLISH_INTERVAL, [this]() { - log::info(logcat, "Updating and publishing ClientContact..."); + log::critical(logcat, "Updating and publishing ClientContact..."); update_and_publish_localcc(get_current_client_intros()); }, true); diff --git a/llarp/link/link_manager.cpp b/llarp/link/link_manager.cpp index a70eb5fc1b..5c4316ea1a 100644 --- a/llarp/link/link_manager.cpp +++ b/llarp/link/link_manager.cpp @@ -1086,6 +1086,8 @@ namespace llarp void LinkManager::handle_publish_cc(std::string_view body, std::function respond) { + log::critical(logcat, "Received request to publish client contact!"); + EncryptedClientContact enc; bool is_relayed; uint64_t relay_order; diff --git a/llarp/link/link_manager.hpp b/llarp/link/link_manager.hpp index cb6c8be5d6..f48248b2d9 100644 --- a/llarp/link/link_manager.hpp +++ b/llarp/link/link_manager.hpp @@ -285,8 +285,8 @@ namespace llarp void (LinkManager::*)(std::string_view body, std::function respond)> path_requests = { {"resolve_ons"sv, &LinkManager::handle_resolve_ons}, - {"publish_intro"sv, &LinkManager::handle_publish_cc}, - {"find_intro"sv, &LinkManager::handle_find_cc}}; + {"publish_cc"sv, &LinkManager::handle_publish_cc}, + {"find_cc"sv, &LinkManager::handle_find_cc}}; // Path relaying void handle_path_control(oxen::quic::message, const RouterID& from);