Remove [netdb] conf and place it under data-dir

This does three things:

1) Remove the [netdb] conf section,
2) Rename the subdir 'netdb' -> 'nodedb'
3) Place 'nodedb' under 'data-dir'
pull/1186/head
Stephen Shelton 4 years ago
parent 3c6a127dce
commit a66f502ed6
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C

@ -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<std::string>("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",

@ -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;

@ -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()

@ -54,7 +54,7 @@ namespace llarp
jobQueueSize = 1024;
logic = std::make_shared<Logic>(jobQueueSize);
nodedb_dir = config->netdb.m_nodedbDir;
nodedb_dir = config->router.m_dataDir / nodedb_dirname;
return true;
}

Loading…
Cancel
Save