mirror of https://github.com/oxen-io/lokinet
bake in bootstrap fallbacks at build time
also change the defailt/fallback bootstrap file for testnet to be a list of RCs (albeit of size 1) rather than just an RC dict.pull/1996/head
parent
82c95a2486
commit
82e2e6fb10
@ -0,0 +1,25 @@
|
|||||||
|
#include <initializer_list>
|
||||||
|
#include "llarp/bootstrap.hpp"
|
||||||
|
|
||||||
|
namespace llarp
|
||||||
|
{
|
||||||
|
using namespace std::literals;
|
||||||
|
|
||||||
|
std::unordered_map<std::string, BootstrapList>
|
||||||
|
load_bootstrap_fallbacks()
|
||||||
|
{
|
||||||
|
std::unordered_map<std::string, BootstrapList> fallbacks;
|
||||||
|
using init_list = std::initializer_list<std::pair<std::string, std::string_view>>;
|
||||||
|
// clang-format off
|
||||||
|
for (const auto& [network, bootstrap] : init_list{
|
||||||
|
@BOOTSTRAP_FALLBACKS@
|
||||||
|
})
|
||||||
|
// clang-format on
|
||||||
|
{
|
||||||
|
llarp_buffer_t buf{bootstrap.data(), bootstrap.size()};
|
||||||
|
auto& bsl = fallbacks[network];
|
||||||
|
bsl.BDecode(&buf);
|
||||||
|
}
|
||||||
|
return fallbacks;
|
||||||
|
}
|
||||||
|
} // namespace llarp
|
Loading…
Reference in New Issue