mirror of https://github.com/oxen-io/lokinet
Implement fetch RouterIDs method and usage
Periodically clients will fetch the set of RouterIDs for all relays on the network. It will request this list from a number (12, currently) of relays, but as we are likely to be requesting from more relays than we want to have edge connections, this request will itself be relayed to the target source via one of our edges. As we can't trust our edge to do this honestly, the responses are signed by the source relay. TODO: the responses from all (12) relays are collected, then processed together. The reconciliation of their responses is not yet implemented. TODO: the source selection for this method obviously requires sources to begin with, but this is the method by which we learn of those...bootstrapping is still a bit in-progress, and will need to be finished for this. TODO: make Router call this periodically, as with RC fetching.pull/2232/head
parent
e37ef7808d
commit
a42d1c1d9f
@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "common.hpp"
|
||||||
|
|
||||||
|
namespace llarp::RouterIDFetch
|
||||||
|
{
|
||||||
|
inline constexpr auto INVALID_REQUEST = "Invalid relay ID requested to relay response from."sv;
|
||||||
|
|
||||||
|
inline static std::string
|
||||||
|
serialize(const RouterID& source)
|
||||||
|
{
|
||||||
|
// serialize_response is a bit weird here, and perhaps could have a sister function
|
||||||
|
// with the same purpose but as a request, but...it works.
|
||||||
|
return messages::serialize_response({{"source", source.ToView()}});
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace llarp::RouterIDFetch
|
Loading…
Reference in New Issue