diff --git a/llarp/config/config.cpp b/llarp/config/config.cpp index 2de73e636..3584c870d 100644 --- a/llarp/config/config.cpp +++ b/llarp/config/config.cpp @@ -161,16 +161,6 @@ namespace llarp }); } - void - NetdbConfig::defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params) - { - (void)params; - - // TODO: all of NetdbConfig can probably go away in favor of deriving from [router]:data-dir - conf.defineOption("netdb", "dir", false, m_nodedbDir, - AssignmentAcceptor(m_nodedbDir)); - } - void DnsConfig::defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params) { @@ -478,7 +468,6 @@ namespace llarp router.defineConfigOptions(conf, params); network.defineConfigOptions(conf, params); connect.defineConfigOptions(conf, params); - netdb.defineConfigOptions(conf, params); dns.defineConfigOptions(conf, params); links.defineConfigOptions(conf, params); services.defineConfigOptions(conf, params); @@ -620,15 +609,6 @@ namespace llarp "Multiple values accepted.", }); - // netdb - def.addSectionComments("netdb", { - "Configuration for lokinet's database of service nodes", - }); - - def.addOptionComments("netdb", "dir", { - "Root directory of netdb.", - }); - // bootstrap def.addSectionComments("bootstrap", { "Configure nodes that will bootstrap us onto the network", diff --git a/llarp/config/config.hpp b/llarp/config/config.hpp index 808e1b0f3..da9b4241f 100644 --- a/llarp/config/config.hpp +++ b/llarp/config/config.hpp @@ -68,14 +68,6 @@ namespace llarp defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params); }; - struct NetdbConfig - { - std::string m_nodedbDir; - - void - defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params); - }; - struct DnsConfig { FreehandOptions m_options; @@ -179,7 +171,6 @@ namespace llarp RouterConfig router; NetworkConfig network; ConnectConfig connect; - NetdbConfig netdb; DnsConfig dns; LinksConfig links; ServicesConfig services; diff --git a/llarp/constants/files.hpp b/llarp/constants/files.hpp index 9a686d21b..3a5803c5a 100644 --- a/llarp/constants/files.hpp +++ b/llarp/constants/files.hpp @@ -11,6 +11,8 @@ namespace llarp constexpr auto our_enc_key_filename = "encryption.key"; constexpr auto our_transport_key_filename = "transport.key"; + constexpr auto nodedb_dirname = "nodedb"; + inline fs::path GetDefaultDataDir() diff --git a/llarp/context.cpp b/llarp/context.cpp index abaa0b71b..2722a6d3d 100644 --- a/llarp/context.cpp +++ b/llarp/context.cpp @@ -54,7 +54,7 @@ namespace llarp jobQueueSize = 1024; logic = std::make_shared(jobQueueSize); - nodedb_dir = config->netdb.m_nodedbDir; + nodedb_dir = config->router.m_dataDir / nodedb_dirname; return true; }