From b9ef07fc10ff9ab5d7eebb9ef057e335fa5786a7 Mon Sep 17 00:00:00 2001 From: bthomee Date: Mon, 5 Jan 2026 06:58:21 -0800 Subject: [PATCH] deploy: 3d1b3a49b3601a0a7037fa0b19d5df7b5e0e2fc1 --- AccountTxPaging_8cpp_source.html | 2 +- AccountTx_8cpp_source.html | 2 +- Application_8cpp_source.html | 10 +- Config_8cpp_source.html | 1932 +++++----- Config_8h_source.html | 704 ++-- Config__test_8cpp_source.html | 3253 ++++++++-------- ConnectAttempt_8cpp_source.html | 8 +- Connect_8cpp_source.html | 2 +- DatabaseCon_8cpp_source.html | 6 +- DatabaseCon_8h_source.html | 4 +- Env_8cpp_source.html | 4 +- Env__test_8cpp_source.html | 2 +- FeeVoteImpl_8cpp_source.html | 2 +- FeeVote__test_8cpp_source.html | 2 +- GetCounts_8cpp_source.html | 2 +- Handshake_8cpp_source.html | 10 +- LedgerAccept_8cpp_source.html | 2 +- LedgerLoad__test_8cpp_source.html | 8 +- LedgerMaster_8cpp_source.html | 4 +- LedgerReplay__test_8cpp_source.html | 4 +- Ledger_8cpp_source.html | 4 +- LoadFeeTrack__test_8cpp_source.html | 2 +- Main_8cpp_source.html | 10 +- ManagerImp_8cpp_source.html | 4 +- NetworkID__test_8cpp_source.html | 2 +- NetworkOPs_8cpp_source.html | 12 +- Node_8cpp_source.html | 12 +- OrderBookDB_8cpp_source.html | 4 +- OverlayImpl_8cpp_source.html | 16 +- PathFind_8cpp_source.html | 2 +- PathRequest_8cpp_source.html | 6 +- PayChanClaim_8cpp_source.html | 2 +- PeerFinder__test_8cpp_source.html | 8 +- PeerImp_8cpp_source.html | 10 +- PeerImp_8h_source.html | 2 +- PeerfinderConfig_8cpp_source.html | 10 +- PerfLogImp_8cpp_source.html | 2 +- PerfLogImp_8h_source.html | 2 +- PerfLog_8h_source.html | 2 +- PerfLog__test_8cpp_source.html | 2 +- RPCCall_8cpp_source.html | 4 +- RPCLedgerHelpers_8cpp_source.html | 2 +- RipplePathFind_8cpp_source.html | 4 +- SHAMapStoreImp_8cpp_source.html | 4 +- SHAMapStore__test_8cpp_source.html | 2 +- ServerHandler_8cpp_source.html | 4 +- ServerStatus__test_8cpp_source.html | 2 +- SignFor_8cpp_source.html | 2 +- SignHandler_8cpp_source.html | 2 +- Simulate_8cpp_source.html | 2 +- Submit_8cpp_source.html | 2 +- Subscribe_8cpp_source.html | 2 +- Subscribe__test_8cpp_source.html | 2 +- TransactionSign_8cpp_source.html | 10 +- Transactor_8cpp_source.html | 2 +- TxHistory_8cpp_source.html | 2 +- TxQ_8cpp_source.html | 2 +- Tx_8cpp_source.html | 4 +- Version__test_8cpp_source.html | 4 +- XChain__test_8cpp_source.html | 2 +- annotated.html | 58 +- classes.html | 4 +- classxrpl_1_1Config-members.html | 181 +- classxrpl_1_1Config.html | 192 +- classxrpl_1_1Config__test-members.html | 35 +- classxrpl_1_1Config__test.html | 55 +- classxrpl_1_1SHAMapStoreImp.html | 2 +- classxrpl_1_1detail_1_1DirGuard.html | 14 +- ..._1_1detail_1_1DirGuard__inherit__graph.map | 14 +- ..._1_1detail_1_1DirGuard__inherit__graph.md5 | 2 +- ..._1_1detail_1_1DirGuard__inherit__graph.png | Bin 12769 -> 13304 bytes ...rpl_1_1detail_1_1FileCfgGuard-members.html | 32 +- ...> classxrpl_1_1detail_1_1FileCfgGuard.html | 158 +- ...1_1detail_1_1FileCfgGuard__coll__graph.map | 8 +- ...1_1detail_1_1FileCfgGuard__coll__graph.md5 | 1 + ...1_1detail_1_1FileCfgGuard__coll__graph.png | Bin 0 -> 383505 bytes ...detail_1_1FileCfgGuard__inherit__graph.map | 12 +- ...detail_1_1FileCfgGuard__inherit__graph.md5 | 1 + ...detail_1_1FileCfgGuard__inherit__graph.png | Bin 0 -> 7757 bytes classxrpl_1_1detail_1_1FileDirGuard.html | 14 +- ...detail_1_1FileDirGuard__inherit__graph.map | 14 +- ...detail_1_1FileDirGuard__inherit__graph.md5 | 2 +- ...detail_1_1FileDirGuard__inherit__graph.png | Bin 12770 -> 13341 bytes ...detail_1_1RippledCfgGuard__coll__graph.md5 | 1 - ...detail_1_1RippledCfgGuard__coll__graph.png | Bin 382292 -> 0 bytes ...ail_1_1RippledCfgGuard__inherit__graph.md5 | 1 - ...ail_1_1RippledCfgGuard__inherit__graph.png | Bin 8432 -> 0 bytes ...sxrpl_1_1detail_1_1ValidatorsTxtGuard.html | 10 +- classxrpl_1_1perf_1_1PerfLog.html | 2 +- compression__test_8cpp_source.html | 6 +- envconfig_8cpp_source.html | 8 +- functions_c.html | 27 +- functions_d.html | 6 +- functions_e.html | 8 +- functions_f.html | 9 +- functions_func_c.html | 6 +- functions_func_d.html | 4 +- functions_func_f.html | 13 +- functions_func_h.html | 2 +- functions_func_i.html | 2 +- functions_func_j.html | 8 +- functions_func_k.html | 2 +- functions_func_l.html | 4 +- functions_func_m.html | 4 +- functions_func_r.html | 21 +- functions_func_s.html | 16 +- functions_func_t.html | 3 +- functions_func_~.html | 2 +- functions_g.html | 3 +- functions_h.html | 4 +- functions_i.html | 28 +- functions_j.html | 6 +- functions_k.html | 4 +- functions_l.html | 6 +- functions_m.html | 10 +- functions_o.html | 2 +- functions_p.html | 13 +- functions_q.html | 3 +- functions_r.html | 15 +- functions_s.html | 38 +- functions_t.html | 25 +- functions_vars_c.html | 3 +- functions_vars_d.html | 2 +- functions_vars_r.html | 2 +- functions_w.html | 2 +- functions_~.html | 2 +- hierarchy.html | 4 +- inherit_graph_312.map | 14 +- inherit_graph_312.md5 | 2 +- inherit_graph_312.png | Bin 12679 -> 12071 bytes inherit_graph_553.map | 2 +- inherit_graph_553.md5 | 2 +- inherits.html | 16 +- ...led_2include_2xrpl_2nodestore_2README.html | 2 +- md_xrpld_2overlay_2README.html | 2 +- namespaces.html | 58 +- namespacexrpl.html | 6 +- namespacexrpl_1_1detail.html | 10 +- reduce__relay__test_8cpp_source.html | 8 +- search/all_10.js | 14 +- search/all_11.js | 4 +- search/all_12.js | 2 +- search/all_13.js | 10 +- search/all_14.js | 14 +- search/all_15.js | 4 +- search/all_16.js | 8 +- search/all_17.js | 16 +- search/all_18.js | 2 +- search/all_19.js | 613 ++- search/all_1a.js | 26 +- search/all_1b.js | 3433 +++++++++-------- search/all_1e.js | 6 +- search/all_1f.js | 2 +- search/all_21.js | 2 +- search/all_22.js | 280 +- search/all_8.js | 10 +- search/all_9.js | 2 +- search/all_a.js | 885 ++--- search/all_b.js | 12 +- search/all_c.js | 8 +- search/all_d.js | 707 ++-- search/all_e.js | 4 +- search/all_f.js | 8 +- search/classes_11.js | 37 +- search/classes_5.js | 117 +- search/enumvalues_13.js | 2 +- search/enumvalues_18.js | 2 +- search/functions_1.js | 6 +- search/functions_10.js | 6 +- search/functions_12.js | 131 +- search/functions_13.js | 20 +- search/functions_14.js | 2513 ++++++------ search/functions_17.js | 2 +- search/functions_1a.js | 2 +- search/functions_1b.js | 280 +- search/functions_3.js | 10 +- search/functions_4.js | 6 +- search/functions_5.js | 6 +- search/functions_6.js | 383 +- search/functions_7.js | 2 +- search/functions_8.js | 2 +- search/functions_9.js | 10 +- search/functions_a.js | 4 +- search/functions_b.js | 2 +- search/functions_c.js | 2 +- search/functions_d.js | 8 +- search/functions_e.js | 2 +- search/functions_f.js | 4 +- search/typedefs_8.js | 2 +- search/typedefs_c.js | 2 +- search/variables_11.js | 2 +- search/variables_13.js | 4 +- search/variables_16.js | 2 +- search/variables_2.js | 203 +- search/variables_3.js | 4 +- search/variables_c.js | 2 +- search/variables_f.js | 2 +- structxrpl_1_1perf_1_1PerfLog_1_1Setup.html | 6 +- ...1perf_1_1PerfLog_1_1Setup__coll__graph.map | 2 +- ...1perf_1_1PerfLog_1_1Setup__coll__graph.md5 | 2 +- tx__reduce__relay__test_8cpp_source.html | 10 +- 201 files changed, 8752 insertions(+), 8517 deletions(-) rename classxrpl_1_1detail_1_1RippledCfgGuard-members.html => classxrpl_1_1detail_1_1FileCfgGuard-members.html (65%) rename classxrpl_1_1detail_1_1RippledCfgGuard.html => classxrpl_1_1detail_1_1FileCfgGuard.html (82%) rename classxrpl_1_1detail_1_1RippledCfgGuard__coll__graph.map => classxrpl_1_1detail_1_1FileCfgGuard__coll__graph.map (98%) create mode 100644 classxrpl_1_1detail_1_1FileCfgGuard__coll__graph.md5 create mode 100644 classxrpl_1_1detail_1_1FileCfgGuard__coll__graph.png rename classxrpl_1_1detail_1_1RippledCfgGuard__inherit__graph.map => classxrpl_1_1detail_1_1FileCfgGuard__inherit__graph.map (50%) create mode 100644 classxrpl_1_1detail_1_1FileCfgGuard__inherit__graph.md5 create mode 100644 classxrpl_1_1detail_1_1FileCfgGuard__inherit__graph.png delete mode 100644 classxrpl_1_1detail_1_1RippledCfgGuard__coll__graph.md5 delete mode 100644 classxrpl_1_1detail_1_1RippledCfgGuard__coll__graph.png delete mode 100644 classxrpl_1_1detail_1_1RippledCfgGuard__inherit__graph.md5 delete mode 100644 classxrpl_1_1detail_1_1RippledCfgGuard__inherit__graph.png diff --git a/AccountTxPaging_8cpp_source.html b/AccountTxPaging_8cpp_source.html index 6caec1c4a8..5cccb8ea44 100644 --- a/AccountTxPaging_8cpp_source.html +++ b/AccountTxPaging_8cpp_source.html @@ -136,7 +136,7 @@ $(document).ready(function() { init_codefold(0); });
Definition Application.h:95
virtual Config & config()=0
virtual LedgerMaster & getLedgerMaster()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
std::shared_ptr< Ledger const > getLedgerBySeq(std::uint32_t index)
Definition Serializer.h:326
static TransStatus sqlTransactionStatus(boost::optional< std::string > const &status)
diff --git a/AccountTx_8cpp_source.html b/AccountTx_8cpp_source.html index fd7d6b2ddc..2328dec90d 100644 --- a/AccountTx_8cpp_source.html +++ b/AccountTx_8cpp_source.html @@ -569,7 +569,7 @@ $(document).ready(function() { init_codefold(0); });
Stream debug() const
Definition Journal.h:309
virtual Config & config()=0
virtual RelationalDatabase & getRelationalDatabase()=0
-
bool useTxTables() const
Definition Config.h:323
+
bool useTxTables() const
Definition Config.h:324
bool getValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
uint256 getHashBySeq(std::uint32_t index)
Get a ledger's hash by sequence number using the cache.
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
diff --git a/Application_8cpp_source.html b/Application_8cpp_source.html index dea98f7623..1e70de1e33 100644 --- a/Application_8cpp_source.html +++ b/Application_8cpp_source.html @@ -2628,11 +2628,11 @@ $(document).ready(function() { init_codefold(0); });
Definition Cluster.h:18
Provides the beast::insight::Collector service.
Definition Config.h:67
-
bool standalone() const
Definition Config.h:317
-
bool FORCE_MULTI_THREAD
Definition Config.h:220
-
std::size_t NODE_SIZE
Definition Config.h:194
-
int IO_WORKERS
Definition Config.h:216
-
int WORKERS
Definition Config.h:215
+
bool standalone() const
Definition Config.h:318
+
bool FORCE_MULTI_THREAD
Definition Config.h:221
+
std::size_t NODE_SIZE
Definition Config.h:195
+
int IO_WORKERS
Definition Config.h:217
+
int WORKERS
Definition Config.h:216
Definition DatabaseCon.h:68
Definition Family.h:14
Routing table for objects identified by hash.
Definition HashRouter.h:78
diff --git a/Config_8cpp_source.html b/Config_8cpp_source.html index 5e4d1b3601..04498faa97 100644 --- a/Config_8cpp_source.html +++ b/Config_8cpp_source.html @@ -312,927 +312,928 @@ $(document).ready(function() { init_codefold(0); });
221
222//------------------------------------------------------------------------------
223//
-
224// Config (DEPRECATED)
+
224// Config
225//
226//------------------------------------------------------------------------------
227
-
228char const* const Config::configFileName = "rippled.cfg";
-
229char const* const Config::databaseDirName = "db";
-
230char const* const Config::validatorsFileName = "validators.txt";
-
231
-
232[[nodiscard]] static std::string
-
-
233getEnvVar(char const* name)
-
234{
-
235 std::string value;
-
236
-
237 if (auto const v = std::getenv(name); v != nullptr)
-
238 value = v;
-
239
-
240 return value;
-
241}
+
228char const* const Config::configFileName = "xrpld.cfg";
+
229char const* const Config::configLegacyName = "rippled.cfg";
+
230char const* const Config::databaseDirName = "db";
+
231char const* const Config::validatorsFileName = "validators.txt";
+
232
+
233[[nodiscard]] static std::string
+
+
234getEnvVar(char const* name)
+
235{
+
236 std::string value;
+
237
+
238 if (auto const v = std::getenv(name); v != nullptr)
+
239 value = v;
+
240
+
241 return value;
+
242}
-
242
-
-
243Config::Config()
-
244 : j_(beast::Journal::getNullSink())
-
245 , ramSize_(detail::getMemorySize() / (1024 * 1024 * 1024))
-
246{
-
247}
+
243
+
+
244Config::Config()
+
245 : j_(beast::Journal::getNullSink())
+
246 , ramSize_(detail::getMemorySize() / (1024 * 1024 * 1024))
+
247{
+
248}
-
248
-
249void
-
-
250Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone)
-
251{
-
252 XRPL_ASSERT(
-
253 NODE_SIZE == 0, "xrpl::Config::setupControl : node size not set");
-
254
-
255 QUIET = bQuiet || bSilent;
-
256 SILENT = bSilent;
-
257 RUN_STANDALONE = bStandalone;
-
258
-
259 // We try to autodetect the appropriate node size by checking available
-
260 // RAM and CPU resources. We default to "tiny" for standalone mode.
-
261 if (!bStandalone)
-
262 {
-
263 // First, check against 'minimum' RAM requirements per node size:
-
264 auto const& threshold =
- -
266
-
267 auto ns = std::find_if(
-
268 threshold.second.begin(),
-
269 threshold.second.end(),
-
270 [this](std::size_t limit) {
-
271 return (limit == 0) || (ramSize_ < limit);
-
272 });
-
273
-
274 XRPL_ASSERT(
-
275 ns != threshold.second.end(),
-
276 "xrpl::Config::setupControl : valid node size");
-
277
-
278 if (ns != threshold.second.end())
-
279 NODE_SIZE = std::distance(threshold.second.begin(), ns);
-
280
-
281 // Adjust the size based on the number of hardware threads of
-
282 // execution available to us:
-
283 if (auto const hc = std::thread::hardware_concurrency(); hc != 0)
- -
285 }
-
286
-
287 XRPL_ASSERT(
-
288 NODE_SIZE <= 4, "xrpl::Config::setupControl : node size is set");
-
289}
+
249
+
250void
+
+
251Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone)
+
252{
+
253 XRPL_ASSERT(
+
254 NODE_SIZE == 0, "xrpl::Config::setupControl : node size not set");
+
255
+
256 QUIET = bQuiet || bSilent;
+
257 SILENT = bSilent;
+
258 RUN_STANDALONE = bStandalone;
+
259
+
260 // We try to autodetect the appropriate node size by checking available
+
261 // RAM and CPU resources. We default to "tiny" for standalone mode.
+
262 if (!bStandalone)
+
263 {
+
264 // First, check against 'minimum' RAM requirements per node size:
+
265 auto const& threshold =
+ +
267
+
268 auto ns = std::find_if(
+
269 threshold.second.begin(),
+
270 threshold.second.end(),
+
271 [this](std::size_t limit) {
+
272 return (limit == 0) || (ramSize_ < limit);
+
273 });
+
274
+
275 XRPL_ASSERT(
+
276 ns != threshold.second.end(),
+
277 "xrpl::Config::setupControl : valid node size");
+
278
+
279 if (ns != threshold.second.end())
+
280 NODE_SIZE = std::distance(threshold.second.begin(), ns);
+
281
+
282 // Adjust the size based on the number of hardware threads of
+
283 // execution available to us:
+
284 if (auto const hc = std::thread::hardware_concurrency(); hc != 0)
+ +
286 }
+
287
+
288 XRPL_ASSERT(
+
289 NODE_SIZE <= 4, "xrpl::Config::setupControl : node size is set");
+
290}
-
290
-
291void
-
- -
293 std::string const& strConf,
-
294 bool bQuiet,
-
295 bool bSilent,
-
296 bool bStandalone)
-
297{
-
298 boost::filesystem::path dataDir;
-
299 std::string strDbPath, strConfFile;
+
291
+
292void
+
+ +
294 std::string const& strConf,
+
295 bool bQuiet,
+
296 bool bSilent,
+
297 bool bStandalone)
+
298{
+
299 setupControl(bQuiet, bSilent, bStandalone);
300
301 // Determine the config and data directories.
302 // If the config file is found in the current working
303 // directory, use the current working directory as the
304 // config directory and that with "db" as the data
305 // directory.
-
306
-
307 setupControl(bQuiet, bSilent, bStandalone);
-
308
-
309 strDbPath = databaseDirName;
-
310
-
311 if (!strConf.empty())
-
312 strConfFile = strConf;
-
313 else
-
314 strConfFile = configFileName;
-
315
-
316 if (!strConf.empty())
+
306 boost::filesystem::path dataDir;
+
307
+
308 if (!strConf.empty())
+
309 {
+
310 // --conf=<path> : everything is relative that file.
+
311 CONFIG_FILE = strConf;
+
312 CONFIG_DIR = boost::filesystem::absolute(CONFIG_FILE);
+
313 CONFIG_DIR.remove_filename();
+
314 dataDir = CONFIG_DIR / databaseDirName;
+
315 }
+
316 else
317 {
-
318 // --conf=<path> : everything is relative that file.
-
319 CONFIG_FILE = strConfFile;
-
320 CONFIG_DIR = boost::filesystem::absolute(CONFIG_FILE);
-
321 CONFIG_DIR.remove_filename();
-
322 dataDir = CONFIG_DIR / strDbPath;
-
323 }
-
324 else
-
325 {
-
326 CONFIG_DIR = boost::filesystem::current_path();
-
327 CONFIG_FILE = CONFIG_DIR / strConfFile;
-
328 dataDir = CONFIG_DIR / strDbPath;
-
329
-
330 // Construct XDG config and data home.
-
331 // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
-
332 auto const strHome = getEnvVar("HOME");
-
333 auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
-
334 auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
-
335
-
336 if (boost::filesystem::exists(CONFIG_FILE)
-
337 // Can we figure out XDG dirs?
-
338 || (strHome.empty() &&
-
339 (strXdgConfigHome.empty() || strXdgDataHome.empty())))
-
340 {
-
341 // Current working directory is fine, put dbs in a subdir.
-
342 }
-
343 else
-
344 {
-
345 if (strXdgConfigHome.empty())
-
346 {
-
347 // $XDG_CONFIG_HOME was not set, use default based on $HOME.
-
348 strXdgConfigHome = strHome + "/.config";
-
349 }
+
318 do
+
319 {
+
320 // Check if either of the config files exist in the current working
+
321 // directory, in which case the databases will be stored in a
+
322 // subdirectory.
+
323 CONFIG_DIR = boost::filesystem::current_path();
+
324 dataDir = CONFIG_DIR / databaseDirName;
+ +
326 if (boost::filesystem::exists(CONFIG_FILE))
+
327 break;
+ +
329 if (boost::filesystem::exists(CONFIG_FILE))
+
330 break;
+
331
+
332 // Check if the home directory is set, and optionally the XDG config
+
333 // and/or data directories, as the config may be there. See
+
334 // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html.
+
335 auto const strHome = getEnvVar("HOME");
+
336 if (!strHome.empty())
+
337 {
+
338 auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
+
339 auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
+
340 if (strXdgConfigHome.empty())
+
341 {
+
342 // $XDG_CONFIG_HOME was not set, use default based on $HOME.
+
343 strXdgConfigHome = strHome + "/.config";
+
344 }
+
345 if (strXdgDataHome.empty())
+
346 {
+
347 // $XDG_DATA_HOME was not set, use default based on $HOME.
+
348 strXdgDataHome = strHome + "/.local/share";
+
349 }
350
-
351 if (strXdgDataHome.empty())
-
352 {
-
353 // $XDG_DATA_HOME was not set, use default based on $HOME.
-
354 strXdgDataHome = strHome + "/.local/share";
-
355 }
-
356
-
357 CONFIG_DIR = strXdgConfigHome + "/" + systemName();
-
358 CONFIG_FILE = CONFIG_DIR / strConfFile;
-
359 dataDir = strXdgDataHome + "/" + systemName();
-
360
-
361 if (!boost::filesystem::exists(CONFIG_FILE))
-
362 {
-
363 CONFIG_DIR = "/etc/opt/" + systemName();
-
364 CONFIG_FILE = CONFIG_DIR / strConfFile;
-
365 dataDir = "/var/opt/" + systemName();
-
366 }
-
367 }
-
368 }
-
369
-
370 // Update default values
-
371 load();
-
372 {
-
373 // load() may have set a new value for the dataDir
-
374 std::string const dbPath(legacy("database_path"));
-
375 if (!dbPath.empty())
-
376 dataDir = boost::filesystem::path(dbPath);
-
377 else if (RUN_STANDALONE)
-
378 dataDir.clear();
-
379 }
-
380
-
381 if (!dataDir.empty())
-
382 {
-
383 boost::system::error_code ec;
-
384 boost::filesystem::create_directories(dataDir, ec);
-
385
-
386 if (ec)
-
387 Throw<std::runtime_error>(
-
388 boost::str(boost::format("Can not create %s") % dataDir));
-
389
-
390 legacy("database_path", boost::filesystem::absolute(dataDir).string());
-
391 }
-
392
- -
394 this->SSL_VERIFY_DIR, this->SSL_VERIFY_FILE, this->SSL_VERIFY, j_);
-
395
-
396 if (RUN_STANDALONE)
-
397 LEDGER_HISTORY = 0;
-
398
-
399 std::string ledgerTxDbType;
-
400 Section ledgerTxTablesSection = section("ledger_tx_tables");
-
401 get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
-
402
- -
404 get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
-
405}
+
351 // Check if either of the config files exist in the XDG config
+
352 // dir.
+
353 dataDir = strXdgDataHome + "/" + systemName();
+
354 CONFIG_DIR = strXdgConfigHome + "/" + systemName();
+ +
356 if (boost::filesystem::exists(CONFIG_FILE))
+
357 break;
+ +
359 if (boost::filesystem::exists(CONFIG_FILE))
+
360 break;
+
361 }
+
362
+
363 // As a last resort, check the system config directory.
+
364 dataDir = "/var/opt/" + systemName();
+
365 CONFIG_DIR = "/etc/opt/" + systemName();
+ +
367 if (boost::filesystem::exists(CONFIG_FILE))
+
368 break;
+ +
370 } while (false);
+
371 }
+
372
+
373 // Update default values
+
374 load();
+
375 {
+
376 // load() may have set a new value for the dataDir
+
377 std::string const dbPath(legacy("database_path"));
+
378 if (!dbPath.empty())
+
379 dataDir = boost::filesystem::path(dbPath);
+
380 }
+
381
+
382 if (!RUN_STANDALONE)
+
383 {
+
384 boost::system::error_code ec;
+
385 boost::filesystem::create_directories(dataDir, ec);
+
386
+
387 if (ec)
+
388 Throw<std::runtime_error>(
+
389 boost::str(boost::format("Can not create %s") % dataDir));
+
390
+
391 legacy("database_path", boost::filesystem::absolute(dataDir).string());
+
392 }
+
393
+ +
395 this->SSL_VERIFY_DIR, this->SSL_VERIFY_FILE, this->SSL_VERIFY, j_);
+
396
+
397 if (RUN_STANDALONE)
+
398 LEDGER_HISTORY = 0;
+
399
+
400 std::string ledgerTxDbType;
+
401 Section ledgerTxTablesSection = section("ledger_tx_tables");
+
402 get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
+
403
+ +
405 get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
+
406}
-
406
-
407// 0 ports are allowed for unit tests, but still not allowed to be present in
-
408// config file
-
409static void
-
-
410checkZeroPorts(Config const& config)
-
411{
-
412 if (!config.exists("server"))
-
413 return;
-
414
-
415 for (auto const& name : config.section("server").values())
-
416 {
-
417 if (!config.exists(name))
-
418 return;
-
419
-
420 auto const& section = config[name];
-
421 auto const optResult = section.get("port");
-
422 if (optResult)
-
423 {
-
424 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
-
425 if (!port)
-
426 {
- -
428 ss << "Invalid value '" << *optResult << "' for key 'port' in ["
-
429 << name << "]";
-
430 Throw<std::runtime_error>(ss.str());
-
431 }
-
432 }
-
433 }
-
434}
+
407
+
408// 0 ports are allowed for unit tests, but still not allowed to be present in
+
409// config file
+
410static void
+
+
411checkZeroPorts(Config const& config)
+
412{
+
413 if (!config.exists("server"))
+
414 return;
+
415
+
416 for (auto const& name : config.section("server").values())
+
417 {
+
418 if (!config.exists(name))
+
419 return;
+
420
+
421 auto const& section = config[name];
+
422 auto const optResult = section.get("port");
+
423 if (optResult)
+
424 {
+
425 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
+
426 if (!port)
+
427 {
+ +
429 ss << "Invalid value '" << *optResult << "' for key 'port' in ["
+
430 << name << "]";
+
431 Throw<std::runtime_error>(ss.str());
+
432 }
+
433 }
+
434 }
+
435}
-
435
-
436void
-
- -
438{
-
439 // NOTE: this writes to cerr because we want cout to be reserved
-
440 // for the writing of the json response (so that stdout can be part of a
-
441 // pipeline, for instance)
-
442 if (!QUIET)
-
443 std::cerr << "Loading: " << CONFIG_FILE << "\n";
-
444
-
445 boost::system::error_code ec;
-
446 auto const fileContents = getFileContents(ec, CONFIG_FILE);
-
447
-
448 if (ec)
-
449 {
-
450 std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value()
-
451 << ": " << ec.message() << std::endl;
-
452 return;
-
453 }
-
454
-
455 loadFromString(fileContents);
-
456 checkZeroPorts(*this);
-
457}
+
436
+
437void
+
+ +
439{
+
440 // NOTE: this writes to cerr because we want cout to be reserved
+
441 // for the writing of the json response (so that stdout can be part of a
+
442 // pipeline, for instance)
+
443 if (!QUIET)
+
444 std::cerr << "Loading: " << CONFIG_FILE << "\n";
+
445
+
446 boost::system::error_code ec;
+
447 auto const fileContents = getFileContents(ec, CONFIG_FILE);
+
448
+
449 if (ec)
+
450 {
+
451 std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value()
+
452 << ": " << ec.message() << std::endl;
+
453 return;
+
454 }
+
455
+
456 loadFromString(fileContents);
+
457 checkZeroPorts(*this);
+
458}
-
458
-
459void
-
- -
461{
-
462 IniFileSections secConfig = parseIniFile(fileContents, true);
-
463
-
464 build(secConfig);
-
465
-
466 if (auto s = getIniFileSection(secConfig, SECTION_IPS))
-
467 IPS = *s;
-
468
-
469 if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
-
470 IPS_FIXED = *s;
-
471
-
472 // if the user has specified ip:port then replace : with a space.
-
473 {
-
474 auto replaceColons = [](std::vector<std::string>& strVec) {
-
475 static std::regex const e(":([0-9]+)$");
-
476 for (auto& line : strVec)
-
477 {
-
478 // skip anything that might be an ipv6 address
-
479 if (std::count(line.begin(), line.end(), ':') != 1)
-
480 continue;
-
481
-
482 std::string result = std::regex_replace(line, e, " $1");
-
483 // sanity check the result of the replace, should be same length
-
484 // as input
-
485 if (result.size() == line.size())
-
486 line = result;
-
487 }
-
488 };
-
489
-
490 replaceColons(IPS_FIXED);
-
491 replaceColons(IPS);
-
492 }
-
493
-
494 {
-
495 std::string dbPath;
-
496 if (getSingleSection(secConfig, "database_path", dbPath, j_))
-
497 {
-
498 boost::filesystem::path p(dbPath);
-
499 legacy("database_path", boost::filesystem::absolute(p).string());
-
500 }
-
501 }
-
502
-
503 std::string strTemp;
-
504
-
505 if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
-
506 {
-
507 if (strTemp == "main")
-
508 NETWORK_ID = 0;
-
509 else if (strTemp == "testnet")
-
510 NETWORK_ID = 1;
-
511 else if (strTemp == "devnet")
-
512 NETWORK_ID = 2;
-
513 else
-
514 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
-
515 }
-
516
-
517 if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
-
518 PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
-
519
-
520 if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
-
521 {
-
522 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
-
523 }
-
524 else
-
525 {
-
526 std::optional<std::size_t> peers_in_max{};
-
527 if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
-
528 {
-
529 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
530 if (*peers_in_max > 1000)
-
531 Throw<std::runtime_error>(
-
532 "Invalid value specified in [" SECTION_PEERS_IN_MAX
-
533 "] section; the value must be less or equal than 1000");
-
534 }
-
535
-
536 std::optional<std::size_t> peers_out_max{};
-
537 if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
-
538 {
-
539 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
540 if (*peers_out_max < 10 || *peers_out_max > 1000)
-
541 Throw<std::runtime_error>(
-
542 "Invalid value specified in [" SECTION_PEERS_OUT_MAX
-
543 "] section; the value must be in range 10-1000");
-
544 }
-
545
-
546 // if one section is configured then the other must be configured too
-
547 if ((peers_in_max && !peers_out_max) ||
-
548 (peers_out_max && !peers_in_max))
-
549 Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
-
550 "]"
-
551 "and [" SECTION_PEERS_OUT_MAX
-
552 "] must be configured");
-
553
-
554 if (peers_in_max && peers_out_max)
-
555 {
-
556 PEERS_IN_MAX = *peers_in_max;
-
557 PEERS_OUT_MAX = *peers_out_max;
-
558 }
-
559 }
-
560
-
561 if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
-
562 {
-
563 if (boost::iequals(strTemp, "tiny"))
-
564 NODE_SIZE = 0;
-
565 else if (boost::iequals(strTemp, "small"))
-
566 NODE_SIZE = 1;
-
567 else if (boost::iequals(strTemp, "medium"))
-
568 NODE_SIZE = 2;
-
569 else if (boost::iequals(strTemp, "large"))
-
570 NODE_SIZE = 3;
-
571 else if (boost::iequals(strTemp, "huge"))
-
572 NODE_SIZE = 4;
-
573 else
- -
575 4, beast::lexicalCastThrow<std::size_t>(strTemp));
-
576 }
-
577
-
578 if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
-
579 signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
-
580
-
581 if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
-
582 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
-
583
-
584 getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
-
585 getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
-
586
-
587 if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
-
588 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
-
589
-
590 if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
-
591 {
-
592 if (boost::iequals(strTemp, "all"))
- -
594 else if (boost::iequals(strTemp, "trusted"))
- -
596 else if (boost::iequals(strTemp, "drop_untrusted"))
- -
598 else
-
599 Throw<std::runtime_error>(
-
600 "Invalid value specified in [" SECTION_RELAY_VALIDATIONS
-
601 "] section");
-
602 }
-
603
-
604 if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
-
605 {
-
606 if (boost::iequals(strTemp, "all"))
- -
608 else if (boost::iequals(strTemp, "trusted"))
- -
610 else if (boost::iequals(strTemp, "drop_untrusted"))
- -
612 else
-
613 Throw<std::runtime_error>(
-
614 "Invalid value specified in [" SECTION_RELAY_PROPOSALS
-
615 "] section");
-
616 }
-
617
-
618 if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
-
619 Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
-
620 "] and [" SECTION_VALIDATOR_TOKEN
-
621 "] config sections");
-
622
-
623 if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
-
624 NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
-
625
-
626 FEES = setup_FeeVote(section("voting"));
-
627 /* [fee_default] is documented in the example config files as useful for
-
628 * things like offline transaction signing. Until that's completely
-
629 * deprecated, allow it to override the [voting] section. */
-
630 if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
-
631 FEES.reference_fee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
-
632
-
633 if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
-
634 {
-
635 if (boost::iequals(strTemp, "full"))
- -
637 std::numeric_limits<decltype(LEDGER_HISTORY)>::max();
-
638 else if (boost::iequals(strTemp, "none"))
-
639 LEDGER_HISTORY = 0;
-
640 else
-
641 LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
642 }
-
643
-
644 if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
-
645 {
-
646 if (boost::iequals(strTemp, "none"))
-
647 FETCH_DEPTH = 0;
-
648 else if (boost::iequals(strTemp, "full"))
-
649 FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
-
650 else
-
651 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
652
-
653 if (FETCH_DEPTH < 10)
-
654 FETCH_DEPTH = 10;
-
655 }
-
656
-
657 // By default, validators don't have pathfinding enabled, unless it is
-
658 // explicitly requested by the server's admin.
-
659 if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
-
660 PATH_SEARCH_MAX = 0;
-
661
-
662 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
-
663 PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
-
664 if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
-
665 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
-
666 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
-
667 PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
-
668 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
-
669 PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
-
670
-
671 if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
-
672 DEBUG_LOGFILE = strTemp;
-
673
-
674 if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
-
675 {
-
676 SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
-
677
-
678 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
-
679 Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL
-
680 ": must be between 10 and 600 inclusive");
-
681 }
-
682
-
683 if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
-
684 {
-
685 WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
686
-
687 if (WORKERS < 1 || WORKERS > 1024)
-
688 Throw<std::runtime_error>(
-
689 "Invalid " SECTION_WORKERS
-
690 ": must be between 1 and 1024 inclusive.");
-
691 }
-
692
-
693 if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
-
694 {
-
695 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
696
-
697 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
-
698 Throw<std::runtime_error>(
-
699 "Invalid " SECTION_IO_WORKERS
-
700 ": must be between 1 and 1024 inclusive.");
-
701 }
-
702
-
703 if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
-
704 {
-
705 PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
706
-
707 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
-
708 Throw<std::runtime_error>(
-
709 "Invalid " SECTION_PREFETCH_WORKERS
-
710 ": must be between 1 and 1024 inclusive.");
-
711 }
-
712
-
713 if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
-
714 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
-
715
-
716 if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
-
717 LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
-
718
-
719 if (exists(SECTION_REDUCE_RELAY))
-
720 {
-
721 auto sec = section(SECTION_REDUCE_RELAY);
-
722
-
724 // vp_enable config option is deprecated by vp_base_squelch_enable //
-
725 // This option is kept for backwards compatibility. When squelching //
-
726 // is the default algorithm, it must be replaced with: //
-
727 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
-
728 // sec.value_or("vp_base_squelch_enable", true); //
-
729 if (sec.exists("vp_base_squelch_enable") && sec.exists("vp_enable"))
-
730 Throw<std::runtime_error>(
-
731 "Invalid " SECTION_REDUCE_RELAY
-
732 " cannot specify both vp_base_squelch_enable and vp_enable "
-
733 "options. "
-
734 "vp_enable was deprecated and replaced by "
-
735 "vp_base_squelch_enable");
-
736
-
737 if (sec.exists("vp_base_squelch_enable"))
- -
739 sec.value_or("vp_base_squelch_enable", false);
-
740 else if (sec.exists("vp_enable"))
- -
742 sec.value_or("vp_enable", false);
-
743 else
- -
746
-
748 // Temporary squelching config for the peers selected as a source of //
-
749 // validator messages. The config must be removed once squelching is //
-
750 // made the default routing algorithm. //
- -
752 sec.value_or("vp_base_squelch_max_selected_peers", 5);
- -
754 Throw<std::runtime_error>(
-
755 "Invalid " SECTION_REDUCE_RELAY
-
756 " vp_base_squelch_max_selected_peers must be "
-
757 "greater than or equal to 3");
-
759
-
760 TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
-
761 TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
-
762 TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
-
763 TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
-
764 if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 ||
- -
766 Throw<std::runtime_error>(
-
767 "Invalid " SECTION_REDUCE_RELAY
-
768 ", tx_min_peers must be greater than or equal to 10"
-
769 ", tx_relay_percentage must be greater than or equal to 10 "
-
770 "and less than or equal to 100");
-
771 }
-
772
-
773 if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
-
774 {
- -
776 beast::lexicalCastThrow<int>(strTemp),
- - -
779 }
-
780
-
781 if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
-
782 {
-
783 if (!isProperlyFormedTomlDomain(strTemp))
-
784 {
-
785 Throw<std::runtime_error>(
-
786 "Invalid " SECTION_SERVER_DOMAIN
-
787 ": the domain name does not appear to meet the requirements.");
-
788 }
-
789
-
790 SERVER_DOMAIN = strTemp;
-
791 }
-
792
-
793 if (exists(SECTION_OVERLAY))
-
794 {
-
795 auto const sec = section(SECTION_OVERLAY);
-
796
-
797 using namespace std::chrono;
-
798
-
799 try
-
800 {
-
801 if (auto val = sec.get("max_unknown_time"))
- -
803 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
804 }
-
805 catch (...)
-
806 {
-
807 Throw<std::runtime_error>(
-
808 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
809 ": must be of the form '<number>' representing seconds.");
-
810 }
-
811
-
812 if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
-
813 Throw<std::runtime_error>(
-
814 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
815 ": the time must be between 300 and 1800 seconds, inclusive.");
-
816
-
817 try
-
818 {
-
819 if (auto val = sec.get("max_diverged_time"))
- -
821 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
822 }
-
823 catch (...)
-
824 {
-
825 Throw<std::runtime_error>(
-
826 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
827 ": must be of the form '<number>' representing seconds.");
-
828 }
-
829
- -
831 {
-
832 Throw<std::runtime_error>(
-
833 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
834 ": the time must be between 60 and 900 seconds, inclusive.");
-
835 }
-
836 }
-
837
- -
839 secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
-
840 {
-
841 using namespace std::chrono;
-
842 boost::regex const re(
-
843 "^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
-
844 boost::smatch match;
-
845 if (!boost::regex_match(strTemp, match, re))
-
846 Throw<std::runtime_error>(
-
847 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
848 ", must be: [0-9]+ [minutes|hours|days|weeks]");
-
849
- -
851 beast::lexicalCastThrow<std::uint32_t>(match[1].str());
-
852
-
853 if (boost::iequals(match[2], "minutes"))
- -
855 else if (boost::iequals(match[2], "hours"))
- -
857 else if (boost::iequals(match[2], "days"))
- -
859 else if (boost::iequals(match[2], "weeks"))
- -
861
- -
863 Throw<std::runtime_error>(
-
864 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
865 ", the minimum amount of time an amendment must hold a "
-
866 "majority is 15 minutes");
-
867 }
-
868
-
869 if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
-
870 BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
-
871
-
872 // Do not load trusted validator configuration for standalone mode
-
873 if (!RUN_STANDALONE)
-
874 {
-
875 // If a file was explicitly specified, then throw if the
-
876 // path is malformed or if the file does not exist or is
-
877 // not a file.
-
878 // If the specified file is not an absolute path, then look
-
879 // for it in the same directory as the config file.
-
880 // If no path was specified, then look for validators.txt
-
881 // in the same directory as the config file, but don't complain
-
882 // if we can't find it.
-
883 boost::filesystem::path validatorsFile;
-
884
-
885 if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
-
886 {
-
887 validatorsFile = strTemp;
-
888
-
889 if (validatorsFile.empty())
-
890 Throw<std::runtime_error>(
-
891 "Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
-
892
-
893 if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
-
894 validatorsFile = CONFIG_DIR / validatorsFile;
-
895
-
896 if (!boost::filesystem::exists(validatorsFile))
-
897 Throw<std::runtime_error>(
-
898 "The file specified in [" SECTION_VALIDATORS_FILE
-
899 "] "
-
900 "does not exist: " +
-
901 validatorsFile.string());
-
902
-
903 else if (
-
904 !boost::filesystem::is_regular_file(validatorsFile) &&
-
905 !boost::filesystem::is_symlink(validatorsFile))
-
906 Throw<std::runtime_error>(
-
907 "Invalid file specified in [" SECTION_VALIDATORS_FILE
-
908 "]: " +
-
909 validatorsFile.string());
-
910 }
-
911 else if (!CONFIG_DIR.empty())
-
912 {
-
913 validatorsFile = CONFIG_DIR / validatorsFileName;
-
914
-
915 if (!validatorsFile.empty())
-
916 {
-
917 if (!boost::filesystem::exists(validatorsFile))
-
918 validatorsFile.clear();
-
919 else if (
-
920 !boost::filesystem::is_regular_file(validatorsFile) &&
-
921 !boost::filesystem::is_symlink(validatorsFile))
-
922 validatorsFile.clear();
-
923 }
-
924 }
-
925
-
926 if (!validatorsFile.empty() &&
-
927 boost::filesystem::exists(validatorsFile) &&
-
928 (boost::filesystem::is_regular_file(validatorsFile) ||
-
929 boost::filesystem::is_symlink(validatorsFile)))
-
930 {
-
931 boost::system::error_code ec;
-
932 auto const data = getFileContents(ec, validatorsFile);
-
933 if (ec)
-
934 {
-
935 Throw<std::runtime_error>(
-
936 "Failed to read '" + validatorsFile.string() + "'." +
-
937 std::to_string(ec.value()) + ": " + ec.message());
-
938 }
-
939
-
940 auto iniFile = parseIniFile(data, true);
-
941
-
942 auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
-
943
-
944 if (entries)
-
945 section(SECTION_VALIDATORS).append(*entries);
-
946
-
947 auto valKeyEntries =
-
948 getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
-
949
-
950 if (valKeyEntries)
-
951 section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
-
952
-
953 auto valSiteEntries =
-
954 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
-
955
-
956 if (valSiteEntries)
-
957 section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
-
958
-
959 auto valListKeys =
-
960 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
-
961
-
962 if (valListKeys)
-
963 section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
-
964
-
965 auto valListThreshold =
-
966 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
-
967
-
968 if (valListThreshold)
-
969 section(SECTION_VALIDATOR_LIST_THRESHOLD)
-
970 .append(*valListThreshold);
-
971
-
972 if (!entries && !valKeyEntries && !valListKeys)
-
973 Throw<std::runtime_error>(
-
974 "The file specified in [" SECTION_VALIDATORS_FILE
-
975 "] "
-
976 "does not contain a [" SECTION_VALIDATORS
-
977 "], "
-
978 "[" SECTION_VALIDATOR_KEYS
-
979 "] or "
-
980 "[" SECTION_VALIDATOR_LIST_KEYS
-
981 "]"
-
982 " section: " +
-
983 validatorsFile.string());
-
984 }
-
985
- -
987 auto const& listThreshold =
-
988 section(SECTION_VALIDATOR_LIST_THRESHOLD);
-
989 if (listThreshold.lines().empty())
-
990 return std::nullopt;
-
991 else if (listThreshold.values().size() == 1)
-
992 {
-
993 auto strTemp = listThreshold.values()[0];
-
994 auto const listThreshold =
-
995 beast::lexicalCastThrow<std::size_t>(strTemp);
-
996 if (listThreshold == 0)
-
997 return std::nullopt; // NOTE: Explicitly ask for computed
-
998 else if (
-
999 listThreshold >
-
1000 section(SECTION_VALIDATOR_LIST_KEYS).values().size())
-
1001 {
-
1002 Throw<std::runtime_error>(
-
1003 "Value in config section "
-
1004 "[" SECTION_VALIDATOR_LIST_THRESHOLD
-
1005 "] exceeds the number of configured list keys");
-
1006 }
-
1007 return listThreshold;
-
1008 }
-
1009 else
-
1010 {
-
1011 Throw<std::runtime_error>(
-
1012 "Config section "
-
1013 "[" SECTION_VALIDATOR_LIST_THRESHOLD
-
1014 "] should contain single value only");
-
1015 }
-
1016 }();
-
1017
-
1018 // Consolidate [validator_keys] and [validators]
-
1019 section(SECTION_VALIDATORS)
-
1020 .append(section(SECTION_VALIDATOR_KEYS).lines());
-
1021
-
1022 if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
-
1023 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
-
1024 {
-
1025 Throw<std::runtime_error>(
-
1026 "[" + std::string(SECTION_VALIDATOR_LIST_KEYS) +
-
1027 "] config section is missing");
-
1028 }
-
1029 }
-
1030
-
1031 {
-
1032 auto const part = section("features");
-
1033 for (auto const& s : part.values())
-
1034 {
-
1035 if (auto const f = getRegisteredFeature(s))
-
1036 features.insert(*f);
-
1037 else
-
1038 Throw<std::runtime_error>(
-
1039 "Unknown feature: " + s + " in config file.");
-
1040 }
-
1041 }
-
1042
-
1043 // This doesn't properly belong here, but check to make sure that the
-
1044 // value specified for network_quorum is achievable:
-
1045 {
-
1046 auto pm = PEERS_MAX;
-
1047
-
1048 // FIXME this apparently magic value is actually defined as a constant
-
1049 // elsewhere (see defaultMaxPeers) but we handle this check here.
-
1050 if (pm == 0)
-
1051 pm = 21;
-
1052
-
1053 if (NETWORK_QUORUM > pm)
-
1054 {
-
1055 Throw<std::runtime_error>(
-
1056 "The minimum number of required peers (network_quorum) exceeds "
-
1057 "the maximum number of allowed peers (peers_max)");
-
1058 }
-
1059 }
-
1060}
+
459
+
460void
+
+ +
462{
+
463 IniFileSections secConfig = parseIniFile(fileContents, true);
+
464
+
465 build(secConfig);
+
466
+
467 if (auto s = getIniFileSection(secConfig, SECTION_IPS))
+
468 IPS = *s;
+
469
+
470 if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
+
471 IPS_FIXED = *s;
+
472
+
473 // if the user has specified ip:port then replace : with a space.
+
474 {
+
475 auto replaceColons = [](std::vector<std::string>& strVec) {
+
476 static std::regex const e(":([0-9]+)$");
+
477 for (auto& line : strVec)
+
478 {
+
479 // skip anything that might be an ipv6 address
+
480 if (std::count(line.begin(), line.end(), ':') != 1)
+
481 continue;
+
482
+
483 std::string result = std::regex_replace(line, e, " $1");
+
484 // sanity check the result of the replace, should be same length
+
485 // as input
+
486 if (result.size() == line.size())
+
487 line = result;
+
488 }
+
489 };
+
490
+
491 replaceColons(IPS_FIXED);
+
492 replaceColons(IPS);
+
493 }
+
494
+
495 {
+
496 std::string dbPath;
+
497 if (getSingleSection(secConfig, "database_path", dbPath, j_))
+
498 {
+
499 boost::filesystem::path p(dbPath);
+
500 legacy("database_path", boost::filesystem::absolute(p).string());
+
501 }
+
502 }
+
503
+
504 std::string strTemp;
+
505
+
506 if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
+
507 {
+
508 if (strTemp == "main")
+
509 NETWORK_ID = 0;
+
510 else if (strTemp == "testnet")
+
511 NETWORK_ID = 1;
+
512 else if (strTemp == "devnet")
+
513 NETWORK_ID = 2;
+
514 else
+
515 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
+
516 }
+
517
+
518 if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
+
519 PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
+
520
+
521 if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
+
522 {
+
523 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
+
524 }
+
525 else
+
526 {
+
527 std::optional<std::size_t> peers_in_max{};
+
528 if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
+
529 {
+
530 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
531 if (*peers_in_max > 1000)
+
532 Throw<std::runtime_error>(
+
533 "Invalid value specified in [" SECTION_PEERS_IN_MAX
+
534 "] section; the value must be less or equal than 1000");
+
535 }
+
536
+
537 std::optional<std::size_t> peers_out_max{};
+
538 if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
+
539 {
+
540 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
541 if (*peers_out_max < 10 || *peers_out_max > 1000)
+
542 Throw<std::runtime_error>(
+
543 "Invalid value specified in [" SECTION_PEERS_OUT_MAX
+
544 "] section; the value must be in range 10-1000");
+
545 }
+
546
+
547 // if one section is configured then the other must be configured too
+
548 if ((peers_in_max && !peers_out_max) ||
+
549 (peers_out_max && !peers_in_max))
+
550 Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
+
551 "]"
+
552 "and [" SECTION_PEERS_OUT_MAX
+
553 "] must be configured");
+
554
+
555 if (peers_in_max && peers_out_max)
+
556 {
+
557 PEERS_IN_MAX = *peers_in_max;
+
558 PEERS_OUT_MAX = *peers_out_max;
+
559 }
+
560 }
+
561
+
562 if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
+
563 {
+
564 if (boost::iequals(strTemp, "tiny"))
+
565 NODE_SIZE = 0;
+
566 else if (boost::iequals(strTemp, "small"))
+
567 NODE_SIZE = 1;
+
568 else if (boost::iequals(strTemp, "medium"))
+
569 NODE_SIZE = 2;
+
570 else if (boost::iequals(strTemp, "large"))
+
571 NODE_SIZE = 3;
+
572 else if (boost::iequals(strTemp, "huge"))
+
573 NODE_SIZE = 4;
+
574 else
+ +
576 4, beast::lexicalCastThrow<std::size_t>(strTemp));
+
577 }
+
578
+
579 if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
+
580 signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
+
581
+
582 if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
+
583 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
+
584
+
585 getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
+
586 getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
+
587
+
588 if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
+
589 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
+
590
+
591 if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
+
592 {
+
593 if (boost::iequals(strTemp, "all"))
+ +
595 else if (boost::iequals(strTemp, "trusted"))
+ +
597 else if (boost::iequals(strTemp, "drop_untrusted"))
+ +
599 else
+
600 Throw<std::runtime_error>(
+
601 "Invalid value specified in [" SECTION_RELAY_VALIDATIONS
+
602 "] section");
+
603 }
+
604
+
605 if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
+
606 {
+
607 if (boost::iequals(strTemp, "all"))
+ +
609 else if (boost::iequals(strTemp, "trusted"))
+ +
611 else if (boost::iequals(strTemp, "drop_untrusted"))
+ +
613 else
+
614 Throw<std::runtime_error>(
+
615 "Invalid value specified in [" SECTION_RELAY_PROPOSALS
+
616 "] section");
+
617 }
+
618
+
619 if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
+
620 Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
+
621 "] and [" SECTION_VALIDATOR_TOKEN
+
622 "] config sections");
+
623
+
624 if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
+
625 NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
+
626
+
627 FEES = setup_FeeVote(section("voting"));
+
628 /* [fee_default] is documented in the example config files as useful for
+
629 * things like offline transaction signing. Until that's completely
+
630 * deprecated, allow it to override the [voting] section. */
+
631 if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
+
632 FEES.reference_fee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
+
633
+
634 if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
+
635 {
+
636 if (boost::iequals(strTemp, "full"))
+ +
638 std::numeric_limits<decltype(LEDGER_HISTORY)>::max();
+
639 else if (boost::iequals(strTemp, "none"))
+
640 LEDGER_HISTORY = 0;
+
641 else
+
642 LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
643 }
+
644
+
645 if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
+
646 {
+
647 if (boost::iequals(strTemp, "none"))
+
648 FETCH_DEPTH = 0;
+
649 else if (boost::iequals(strTemp, "full"))
+
650 FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
+
651 else
+
652 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
653
+
654 if (FETCH_DEPTH < 10)
+
655 FETCH_DEPTH = 10;
+
656 }
+
657
+
658 // By default, validators don't have pathfinding enabled, unless it is
+
659 // explicitly requested by the server's admin.
+
660 if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
+
661 PATH_SEARCH_MAX = 0;
+
662
+
663 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
+
664 PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
+
665 if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
+
666 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
+
667 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
+
668 PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
+
669 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
+
670 PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
+
671
+
672 if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
+
673 DEBUG_LOGFILE = strTemp;
+
674
+
675 if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
+
676 {
+
677 SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
+
678
+
679 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
+
680 Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL
+
681 ": must be between 10 and 600 inclusive");
+
682 }
+
683
+
684 if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
+
685 {
+
686 WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
687
+
688 if (WORKERS < 1 || WORKERS > 1024)
+
689 Throw<std::runtime_error>(
+
690 "Invalid " SECTION_WORKERS
+
691 ": must be between 1 and 1024 inclusive.");
+
692 }
+
693
+
694 if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
+
695 {
+
696 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
697
+
698 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
+
699 Throw<std::runtime_error>(
+
700 "Invalid " SECTION_IO_WORKERS
+
701 ": must be between 1 and 1024 inclusive.");
+
702 }
+
703
+
704 if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
+
705 {
+
706 PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
707
+
708 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
+
709 Throw<std::runtime_error>(
+
710 "Invalid " SECTION_PREFETCH_WORKERS
+
711 ": must be between 1 and 1024 inclusive.");
+
712 }
+
713
+
714 if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
+
715 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
+
716
+
717 if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
+
718 LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
+
719
+
720 if (exists(SECTION_REDUCE_RELAY))
+
721 {
+
722 auto sec = section(SECTION_REDUCE_RELAY);
+
723
+
725 // vp_enable config option is deprecated by vp_base_squelch_enable //
+
726 // This option is kept for backwards compatibility. When squelching //
+
727 // is the default algorithm, it must be replaced with: //
+
728 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
+
729 // sec.value_or("vp_base_squelch_enable", true); //
+
730 if (sec.exists("vp_base_squelch_enable") && sec.exists("vp_enable"))
+
731 Throw<std::runtime_error>(
+
732 "Invalid " SECTION_REDUCE_RELAY
+
733 " cannot specify both vp_base_squelch_enable and vp_enable "
+
734 "options. "
+
735 "vp_enable was deprecated and replaced by "
+
736 "vp_base_squelch_enable");
+
737
+
738 if (sec.exists("vp_base_squelch_enable"))
+ +
740 sec.value_or("vp_base_squelch_enable", false);
+
741 else if (sec.exists("vp_enable"))
+ +
743 sec.value_or("vp_enable", false);
+
744 else
+ +
747
+
749 // Temporary squelching config for the peers selected as a source of //
+
750 // validator messages. The config must be removed once squelching is //
+
751 // made the default routing algorithm. //
+ +
753 sec.value_or("vp_base_squelch_max_selected_peers", 5);
+ +
755 Throw<std::runtime_error>(
+
756 "Invalid " SECTION_REDUCE_RELAY
+
757 " vp_base_squelch_max_selected_peers must be "
+
758 "greater than or equal to 3");
+
760
+
761 TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
+
762 TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
+
763 TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
+
764 TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
+
765 if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 ||
+ +
767 Throw<std::runtime_error>(
+
768 "Invalid " SECTION_REDUCE_RELAY
+
769 ", tx_min_peers must be greater than or equal to 10"
+
770 ", tx_relay_percentage must be greater than or equal to 10 "
+
771 "and less than or equal to 100");
+
772 }
+
773
+
774 if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
+
775 {
+ +
777 beast::lexicalCastThrow<int>(strTemp),
+ + +
780 }
+
781
+
782 if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
+
783 {
+
784 if (!isProperlyFormedTomlDomain(strTemp))
+
785 {
+
786 Throw<std::runtime_error>(
+
787 "Invalid " SECTION_SERVER_DOMAIN
+
788 ": the domain name does not appear to meet the requirements.");
+
789 }
+
790
+
791 SERVER_DOMAIN = strTemp;
+
792 }
+
793
+
794 if (exists(SECTION_OVERLAY))
+
795 {
+
796 auto const sec = section(SECTION_OVERLAY);
+
797
+
798 using namespace std::chrono;
+
799
+
800 try
+
801 {
+
802 if (auto val = sec.get("max_unknown_time"))
+ +
804 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
805 }
+
806 catch (...)
+
807 {
+
808 Throw<std::runtime_error>(
+
809 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
810 ": must be of the form '<number>' representing seconds.");
+
811 }
+
812
+
813 if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
+
814 Throw<std::runtime_error>(
+
815 "Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
816 ": the time must be between 300 and 1800 seconds, inclusive.");
+
817
+
818 try
+
819 {
+
820 if (auto val = sec.get("max_diverged_time"))
+ +
822 seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
823 }
+
824 catch (...)
+
825 {
+
826 Throw<std::runtime_error>(
+
827 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
828 ": must be of the form '<number>' representing seconds.");
+
829 }
+
830
+ +
832 {
+
833 Throw<std::runtime_error>(
+
834 "Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
835 ": the time must be between 60 and 900 seconds, inclusive.");
+
836 }
+
837 }
+
838
+ +
840 secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
+
841 {
+
842 using namespace std::chrono;
+
843 boost::regex const re(
+
844 "^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
+
845 boost::smatch match;
+
846 if (!boost::regex_match(strTemp, match, re))
+
847 Throw<std::runtime_error>(
+
848 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
849 ", must be: [0-9]+ [minutes|hours|days|weeks]");
+
850
+ +
852 beast::lexicalCastThrow<std::uint32_t>(match[1].str());
+
853
+
854 if (boost::iequals(match[2], "minutes"))
+ +
856 else if (boost::iequals(match[2], "hours"))
+ +
858 else if (boost::iequals(match[2], "days"))
+ +
860 else if (boost::iequals(match[2], "weeks"))
+ +
862
+ +
864 Throw<std::runtime_error>(
+
865 "Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
866 ", the minimum amount of time an amendment must hold a "
+
867 "majority is 15 minutes");
+
868 }
+
869
+
870 if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
+
871 BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
+
872
+
873 // Do not load trusted validator configuration for standalone mode
+
874 if (!RUN_STANDALONE)
+
875 {
+
876 // If a file was explicitly specified, then throw if the
+
877 // path is malformed or if the file does not exist or is
+
878 // not a file.
+
879 // If the specified file is not an absolute path, then look
+
880 // for it in the same directory as the config file.
+
881 // If no path was specified, then look for validators.txt
+
882 // in the same directory as the config file, but don't complain
+
883 // if we can't find it.
+
884 boost::filesystem::path validatorsFile;
+
885
+
886 if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
+
887 {
+
888 validatorsFile = strTemp;
+
889
+
890 if (validatorsFile.empty())
+
891 Throw<std::runtime_error>(
+
892 "Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
+
893
+
894 if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
+
895 validatorsFile = CONFIG_DIR / validatorsFile;
+
896
+
897 if (!boost::filesystem::exists(validatorsFile))
+
898 Throw<std::runtime_error>(
+
899 "The file specified in [" SECTION_VALIDATORS_FILE
+
900 "] "
+
901 "does not exist: " +
+
902 validatorsFile.string());
+
903
+
904 else if (
+
905 !boost::filesystem::is_regular_file(validatorsFile) &&
+
906 !boost::filesystem::is_symlink(validatorsFile))
+
907 Throw<std::runtime_error>(
+
908 "Invalid file specified in [" SECTION_VALIDATORS_FILE
+
909 "]: " +
+
910 validatorsFile.string());
+
911 }
+
912 else if (!CONFIG_DIR.empty())
+
913 {
+
914 validatorsFile = CONFIG_DIR / validatorsFileName;
+
915
+
916 if (!validatorsFile.empty())
+
917 {
+
918 if (!boost::filesystem::exists(validatorsFile))
+
919 validatorsFile.clear();
+
920 else if (
+
921 !boost::filesystem::is_regular_file(validatorsFile) &&
+
922 !boost::filesystem::is_symlink(validatorsFile))
+
923 validatorsFile.clear();
+
924 }
+
925 }
+
926
+
927 if (!validatorsFile.empty() &&
+
928 boost::filesystem::exists(validatorsFile) &&
+
929 (boost::filesystem::is_regular_file(validatorsFile) ||
+
930 boost::filesystem::is_symlink(validatorsFile)))
+
931 {
+
932 boost::system::error_code ec;
+
933 auto const data = getFileContents(ec, validatorsFile);
+
934 if (ec)
+
935 {
+
936 Throw<std::runtime_error>(
+
937 "Failed to read '" + validatorsFile.string() + "'." +
+
938 std::to_string(ec.value()) + ": " + ec.message());
+
939 }
+
940
+
941 auto iniFile = parseIniFile(data, true);
+
942
+
943 auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
+
944
+
945 if (entries)
+
946 section(SECTION_VALIDATORS).append(*entries);
+
947
+
948 auto valKeyEntries =
+
949 getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
+
950
+
951 if (valKeyEntries)
+
952 section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
+
953
+
954 auto valSiteEntries =
+
955 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
+
956
+
957 if (valSiteEntries)
+
958 section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
+
959
+
960 auto valListKeys =
+
961 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
+
962
+
963 if (valListKeys)
+
964 section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
+
965
+
966 auto valListThreshold =
+
967 getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
+
968
+
969 if (valListThreshold)
+
970 section(SECTION_VALIDATOR_LIST_THRESHOLD)
+
971 .append(*valListThreshold);
+
972
+
973 if (!entries && !valKeyEntries && !valListKeys)
+
974 Throw<std::runtime_error>(
+
975 "The file specified in [" SECTION_VALIDATORS_FILE
+
976 "] "
+
977 "does not contain a [" SECTION_VALIDATORS
+
978 "], "
+
979 "[" SECTION_VALIDATOR_KEYS
+
980 "] or "
+
981 "[" SECTION_VALIDATOR_LIST_KEYS
+
982 "]"
+
983 " section: " +
+
984 validatorsFile.string());
+
985 }
+
986
+ +
988 auto const& listThreshold =
+
989 section(SECTION_VALIDATOR_LIST_THRESHOLD);
+
990 if (listThreshold.lines().empty())
+
991 return std::nullopt;
+
992 else if (listThreshold.values().size() == 1)
+
993 {
+
994 auto strTemp = listThreshold.values()[0];
+
995 auto const listThreshold =
+
996 beast::lexicalCastThrow<std::size_t>(strTemp);
+
997 if (listThreshold == 0)
+
998 return std::nullopt; // NOTE: Explicitly ask for computed
+
999 else if (
+
1000 listThreshold >
+
1001 section(SECTION_VALIDATOR_LIST_KEYS).values().size())
+
1002 {
+
1003 Throw<std::runtime_error>(
+
1004 "Value in config section "
+
1005 "[" SECTION_VALIDATOR_LIST_THRESHOLD
+
1006 "] exceeds the number of configured list keys");
+
1007 }
+
1008 return listThreshold;
+
1009 }
+
1010 else
+
1011 {
+
1012 Throw<std::runtime_error>(
+
1013 "Config section "
+
1014 "[" SECTION_VALIDATOR_LIST_THRESHOLD
+
1015 "] should contain single value only");
+
1016 }
+
1017 }();
+
1018
+
1019 // Consolidate [validator_keys] and [validators]
+
1020 section(SECTION_VALIDATORS)
+
1021 .append(section(SECTION_VALIDATOR_KEYS).lines());
+
1022
+
1023 if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
+
1024 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
+
1025 {
+
1026 Throw<std::runtime_error>(
+
1027 "[" + std::string(SECTION_VALIDATOR_LIST_KEYS) +
+
1028 "] config section is missing");
+
1029 }
+
1030 }
+
1031
+
1032 {
+
1033 auto const part = section("features");
+
1034 for (auto const& s : part.values())
+
1035 {
+
1036 if (auto const f = getRegisteredFeature(s))
+
1037 features.insert(*f);
+
1038 else
+
1039 Throw<std::runtime_error>(
+
1040 "Unknown feature: " + s + " in config file.");
+
1041 }
+
1042 }
+
1043
+
1044 // This doesn't properly belong here, but check to make sure that the
+
1045 // value specified for network_quorum is achievable:
+
1046 {
+
1047 auto pm = PEERS_MAX;
+
1048
+
1049 // FIXME this apparently magic value is actually defined as a constant
+
1050 // elsewhere (see defaultMaxPeers) but we handle this check here.
+
1051 if (pm == 0)
+
1052 pm = 21;
+
1053
+
1054 if (NETWORK_QUORUM > pm)
+
1055 {
+
1056 Throw<std::runtime_error>(
+
1057 "The minimum number of required peers (network_quorum) exceeds "
+
1058 "the maximum number of allowed peers (peers_max)");
+
1059 }
+
1060 }
+
1061}
-
1061
-
1062boost::filesystem::path
-
- -
1064{
-
1065 auto log_file = DEBUG_LOGFILE;
-
1066
-
1067 if (!log_file.empty() && !log_file.is_absolute())
-
1068 {
-
1069 // Unless an absolute path for the log file is specified, the
-
1070 // path is relative to the config file directory.
-
1071 log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
-
1072 }
-
1073
-
1074 if (!log_file.empty())
-
1075 {
-
1076 auto log_dir = log_file.parent_path();
-
1077
-
1078 if (!boost::filesystem::is_directory(log_dir))
-
1079 {
-
1080 boost::system::error_code ec;
-
1081 boost::filesystem::create_directories(log_dir, ec);
-
1082
-
1083 // If we fail, we warn but continue so that the calling code can
-
1084 // decide how to handle this situation.
-
1085 if (ec)
-
1086 {
-
1087 std::cerr << "Unable to create log file path " << log_dir
-
1088 << ": " << ec.message() << '\n';
-
1089 }
-
1090 }
-
1091 }
-
1092
-
1093 return log_file;
-
1094}
+
1062
+
1063boost::filesystem::path
+
+ +
1065{
+
1066 auto log_file = DEBUG_LOGFILE;
+
1067
+
1068 if (!log_file.empty() && !log_file.is_absolute())
+
1069 {
+
1070 // Unless an absolute path for the log file is specified, the
+
1071 // path is relative to the config file directory.
+
1072 log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
+
1073 }
+
1074
+
1075 if (!log_file.empty())
+
1076 {
+
1077 auto log_dir = log_file.parent_path();
+
1078
+
1079 if (!boost::filesystem::is_directory(log_dir))
+
1080 {
+
1081 boost::system::error_code ec;
+
1082 boost::filesystem::create_directories(log_dir, ec);
+
1083
+
1084 // If we fail, we warn but continue so that the calling code can
+
1085 // decide how to handle this situation.
+
1086 if (ec)
+
1087 {
+
1088 std::cerr << "Unable to create log file path " << log_dir
+
1089 << ": " << ec.message() << '\n';
+
1090 }
+
1091 }
+
1092 }
+
1093
+
1094 return log_file;
+
1095}
-
1095
-
1096int
-
- -
1098{
-
1099 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
-
1100 XRPL_ASSERT(
-
1101 index < sizedItems.size(),
-
1102 "xrpl::Config::getValueFor : valid index input");
-
1103 XRPL_ASSERT(
-
1104 !node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node");
-
1105 return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
-
1106}
+
1096
+
1097int
+
+ +
1099{
+
1100 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
+
1101 XRPL_ASSERT(
+
1102 index < sizedItems.size(),
+
1103 "xrpl::Config::getValueFor : valid index input");
+
1104 XRPL_ASSERT(
+
1105 !node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node");
+
1106 return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
+
1107}
-
1107
- -
-
1109setup_FeeVote(Section const& section)
-
1110{
-
1111 FeeSetup setup;
-
1112 {
-
1113 std::uint64_t temp;
-
1114 if (set(temp, "reference_fee", section) &&
- -
1116 setup.reference_fee = temp;
-
1117 }
-
1118 {
-
1119 std::uint32_t temp;
-
1120 if (set(temp, "account_reserve", section))
-
1121 setup.account_reserve = temp;
-
1122 if (set(temp, "owner_reserve", section))
-
1123 setup.owner_reserve = temp;
-
1124 }
-
1125 return setup;
-
1126}
+
1108
+ +
+
1110setup_FeeVote(Section const& section)
+
1111{
+
1112 FeeSetup setup;
+
1113 {
+
1114 std::uint64_t temp;
+
1115 if (set(temp, "reference_fee", section) &&
+ +
1117 setup.reference_fee = temp;
+
1118 }
+
1119 {
+
1120 std::uint32_t temp;
+
1121 if (set(temp, "account_reserve", section))
+
1122 setup.account_reserve = temp;
+
1123 if (set(temp, "owner_reserve", section))
+
1124 setup.owner_reserve = temp;
+
1125 }
+
1126 return setup;
+
1127}
-
1127
-
1128} // namespace xrpl
+
1128
+
1129} // namespace xrpl
@@ -1247,69 +1248,70 @@ $(document).ready(function() { init_codefold(0); });
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
-
bool ELB_SUPPORT
Definition Config.h:119
-
bool COMPRESSION
Definition Config.h:201
-
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:85
-
void load()
Definition Config.cpp:437
-
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:281
-
boost::filesystem::path CONFIG_FILE
Definition Config.h:79
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
uint32_t NETWORK_ID
Definition Config.h:138
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:258
+
bool ELB_SUPPORT
Definition Config.h:120
+
bool COMPRESSION
Definition Config.h:202
+
static char const *const configLegacyName
Definition Config.h:71
+
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:86
+
void load()
Definition Config.cpp:438
+
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:282
+
boost::filesystem::path CONFIG_FILE
Definition Config.h:80
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:240
static char const *const configFileName
Definition Config.h:70
-
int MAX_TRANSACTIONS
Definition Config.h:207
-
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
int PATH_SEARCH_OLD
Definition Config.h:176
-
bool BETA_RPC_API
Definition Config.h:268
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
-
beast::Journal const j_
Definition Config.h:89
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:102
-
int PATH_SEARCH_FAST
Definition Config.h:178
-
std::string SSL_VERIFY_FILE
Definition Config.h:197
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
std::string SERVER_DOMAIN
Definition Config.h:259
-
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:150
-
bool SILENT
Definition Config.h:92
-
std::string SSL_VERIFY_DIR
Definition Config.h:198
-
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:292
-
bool USE_TX_TABLES
Definition Config.h:104
-
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:208
-
int PREFETCH_WORKERS
Definition Config.h:217
-
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:460
-
bool SSL_VERIFY
Definition Config.h:196
-
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:1063
-
bool QUIET
Definition Config.h:91
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
-
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
-
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:209
-
bool PEER_PRIVATE
Definition Config.h:154
-
static char const *const validatorsFileName
Definition Config.h:72
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
-
std::size_t NODE_SIZE
Definition Config.h:194
-
bool FAST_LOAD
Definition Config.h:271
-
std::size_t PEERS_MAX
Definition Config.h:160
-
std::uint32_t FETCH_DEPTH
Definition Config.h:189
-
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:112
-
int PATH_SEARCH
Definition Config.h:177
-
std::optional< int > SWEEP_INTERVAL
Definition Config.h:224
-
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:250
-
std::size_t NETWORK_QUORUM
Definition Config.h:145
-
FeeSetup FEES
Definition Config.h:185
-
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1097
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
-
int IO_WORKERS
Definition Config.h:216
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:212
-
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:151
-
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:235
-
int WORKERS
Definition Config.h:215
-
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
-
boost::filesystem::path CONFIG_DIR
Definition Config.h:82
-
bool LEDGER_REPLAY
Definition Config.h:204
-
static char const *const databaseDirName
Definition Config.h:71
+
int MAX_TRANSACTIONS
Definition Config.h:208
+
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
int PATH_SEARCH_OLD
Definition Config.h:177
+
bool BETA_RPC_API
Definition Config.h:269
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:266
+
beast::Journal const j_
Definition Config.h:90
+
std::vector< std::string > IPS
Definition Config.h:123
+
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:103
+
int PATH_SEARCH_FAST
Definition Config.h:179
+
std::string SSL_VERIFY_FILE
Definition Config.h:198
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
std::string SERVER_DOMAIN
Definition Config.h:260
+
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:151
+
bool SILENT
Definition Config.h:93
+
std::string SSL_VERIFY_DIR
Definition Config.h:199
+
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:293
+
bool USE_TX_TABLES
Definition Config.h:105
+
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:209
+
int PREFETCH_WORKERS
Definition Config.h:218
+
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:253
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:461
+
bool SSL_VERIFY
Definition Config.h:197
+
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:1064
+
bool QUIET
Definition Config.h:92
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:247
+
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:263
+
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:210
+
bool PEER_PRIVATE
Definition Config.h:155
+
static char const *const validatorsFileName
Definition Config.h:73
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:189
+
std::size_t NODE_SIZE
Definition Config.h:195
+
bool FAST_LOAD
Definition Config.h:272
+
std::size_t PEERS_MAX
Definition Config.h:161
+
std::uint32_t FETCH_DEPTH
Definition Config.h:190
+
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:113
+
int PATH_SEARCH
Definition Config.h:178
+
std::optional< int > SWEEP_INTERVAL
Definition Config.h:225
+
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:251
+
std::size_t NETWORK_QUORUM
Definition Config.h:146
+
FeeSetup FEES
Definition Config.h:186
+
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1098
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:230
+
int IO_WORKERS
Definition Config.h:217
+
std::vector< std::string > IPS_FIXED
Definition Config.h:126
+
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:213
+
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:152
+
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:236
+
int WORKERS
Definition Config.h:216
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:250
+
boost::filesystem::path CONFIG_DIR
Definition Config.h:83
+
bool LEDGER_REPLAY
Definition Config.h:205
+
static char const *const databaseDirName
Definition Config.h:72
static void initializeSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j)
Holds a collection of configuration values.
Definition BasicConfig.h:26
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:60
@@ -1336,11 +1338,11 @@ $(document).ready(function() { init_codefold(0); });
std::string getFileContents(boost::system::error_code &ec, boost::filesystem::path const &sourcePath, std::optional< std::size_t > maxSize=std::nullopt)
bool isProperlyFormedTomlDomain(std::string_view domain)
Determines if the given string looks like a TOML-file hosting domain.
-
static std::string getEnvVar(char const *name)
Definition Config.cpp:233
+
static std::string getEnvVar(char const *name)
Definition Config.cpp:234
bool getSingleSection(IniFileSections &secSource, std::string const &strSection, std::string &strValue, beast::Journal j)
Definition Config.cpp:199
IniFileSections::mapped_type * getIniFileSection(IniFileSections &secSource, std::string const &strSection)
Definition Config.cpp:190
IniFileSections parseIniFile(std::string const &strInput, bool const bTrim)
Definition Config.cpp:142
-
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1109
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1110
SizedItem
Definition Config.h:25
@@ -1359,7 +1361,7 @@ $(document).ready(function() { init_codefold(0); });
std::unordered_map< std::string, std::vector< std::string > > IniFileSections
Definition BasicConfig.h:18
static std::string const & systemName()
bool get_if_exists(Section const &section, std::string const &name, T &v)
-
static void checkZeroPorts(Config const &config)
Definition Config.cpp:410
+
static void checkZeroPorts(Config const &config)
Definition Config.cpp:411
std::chrono::duration< int, std::ratio_multiply< std::chrono::hours::period, std::ratio< 24 > > > days
Definition chrono.h:21
std::optional< uint256 > getRegisteredFeature(std::string const &name)
Definition Feature.cpp:363
diff --git a/Config_8h_source.html b/Config_8h_source.html index 3690e9ff24..9f8018548b 100644 --- a/Config_8h_source.html +++ b/Config_8h_source.html @@ -148,368 +148,370 @@ $(document).ready(function() { init_codefold(0); });
68public:
69 // Settings related to the configuration file location and directories
70 static char const* const configFileName;
-
71 static char const* const databaseDirName;
-
72 static char const* const validatorsFileName;
-
73
-
75 boost::filesystem::path
-
76 getDebugLogFile() const;
-
77
-
78private:
-
79 boost::filesystem::path CONFIG_FILE;
-
80
-
81public:
-
82 boost::filesystem::path CONFIG_DIR;
-
83
-
84private:
-
85 boost::filesystem::path DEBUG_LOGFILE;
-
86
-
87 void
-
88 load();
- -
90
-
91 bool QUIET = false; // Minimize logging verbosity.
-
92 bool SILENT = false; // No output to console after startup.
-
102 bool RUN_STANDALONE = false;
-
103
-
104 bool USE_TX_TABLES = true;
-
105
-
112 bool signingEnabled_ = false;
-
113
-
114 // The amount of RAM, in bytes, that we detected on this system.
- -
116
-
117public:
-
118 bool doImport = false;
-
119 bool ELB_SUPPORT = false;
-
120
-
121 // Entries from [ips] config stanza
- -
123
-
124 // Entries from [ips_fixed] config stanza
- -
126
- - -
129
-
130 bool START_VALID = false;
-
131
- -
133
- -
135
-
136 // Network parameters
-
137 uint32_t NETWORK_ID = 0;
-
138
-
139 // DEPRECATED - Fee units for a reference transction.
-
140 // Only provided for backwards compatibility in a couple of places
-
141 static constexpr std::uint32_t FEE_UNITS_DEPRECATED = 10;
-
142
-
143 // Note: The following parameters do not relate to the UNL or trust at all
-
144 // Minimum number of nodes to consider the network present
- -
146
-
147 // Peer networking parameters
-
148 // 1 = relay, 0 = do not relay (but process), -1 = drop completely (do NOT
-
149 // process)
- - -
152
-
153 // True to ask peers not to relay current IP.
-
154 bool PEER_PRIVATE = false;
-
155 // peers_max is a legacy configuration, which is going to be replaced
-
156 // with individual inbound peers peers_in_max and outbound peers
-
157 // peers_out_max configuration. for now we support both the legacy and
-
158 // the new configuration. if peers_max is configured then peers_in_max and
-
159 // peers_out_max are ignored.
- - - -
163
-
164 // Path searching: these were reasonable default values at some point but
-
165 // further research is needed to decide if they still are
-
166 // and whether all of them are needed.
-
167 //
-
168 // The performance and resource consumption of a server can
-
169 // be dramatically impacted by changing these configuration
-
170 // options; higher values result in exponentially higher
-
171 // resource usage.
-
172 //
-
173 // Servers operating as validators disable path finding by
-
174 // default by setting the `PATH_SEARCH_MAX` option to 0
-
175 // unless it is explicitly set in the configuration file.
- -
177 int PATH_SEARCH = 2;
- - -
180
-
181 // Validation
- -
183 VALIDATION_QUORUM; // validations to consider ledger authoritative
-
184
- -
186
-
187 // Node storage configuration
- - -
190
-
191 // Tunable that adjusts various parameters, typically associated
-
192 // with hardware parameters (RAM size and CPU cores). The default
-
193 // is 'tiny'.
- -
195
-
196 bool SSL_VERIFY = true;
- - -
199
-
200 // Compression
-
201 bool COMPRESSION = false;
-
202
-
203 // Enable the experimental Ledger Replay functionality
-
204 bool LEDGER_REPLAY = false;
-
205
-
206 // Work queue limits
- -
208 static constexpr int MAX_JOB_QUEUE_TX = 1000;
-
209 static constexpr int MIN_JOB_QUEUE_TX = 100;
-
210
-
211 // Amendment majority time
- -
213
-
214 // Thread pool configuration (0 = choose for me)
-
215 int WORKERS = 0; // jobqueue thread count. default: upto 6
-
216 int IO_WORKERS = 0; // io svc thread count. default: 2
-
217 int PREFETCH_WORKERS = 0; // prefetch thread count. default: 4
-
218
-
219 // Can only be set in code, specifically unit tests
-
220 bool FORCE_MULTI_THREAD = false;
-
221
-
222 // Normally the sweep timer is automatically deduced based on the node
-
223 // size, but we allow admins to explicitly set it in the config.
- -
225
-
226 // Reduce-relay - Experimental parameters to control p2p routing algorithms
-
227
-
228 // Enable base squelching of duplicate validation/proposal messages
- -
230
-
232 // Temporary squelching config for the peers selected as a source of //
-
233 // validator messages. The config must be removed once squelching is //
-
234 // made the default routing algorithm //
- -
237
-
238 // Transaction reduce-relay feature
- -
240 // If tx reduce-relay feature is disabled
-
241 // and this flag is enabled then some
-
242 // tx-related metrics is collected. It
-
243 // is ignored if tx reduce-relay feature is
-
244 // enabled. It is used in debugging to compare
-
245 // metrics with the feature disabled/enabled.
- -
247 // Minimum peers a server should have before
-
248 // selecting random peers
- -
250 // Percentage of peers with the tx reduce-relay feature enabled
-
251 // to relay to out of total active peers
- -
253
-
254 // These override the command line client settings
- -
256
- -
258
- -
260
-
261 // How long can a peer remain in the "unknown" state
- -
263
-
264 // How long can a peer remain in the "diverged" state
- -
266
-
267 // Enable the beta API version
-
268 bool BETA_RPC_API = false;
-
269
-
270 // First, attempt to load the latest ledger directly from disk.
-
271 bool FAST_LOAD = false;
-
272 // When starting rippled with existing database it do not know it has those
-
273 // ledgers locally until the server naturally tries to backfill. This makes
-
274 // is difficult to test some functionality (in particular performance
-
275 // testing sidechains). With this variable the user is able to force rippled
-
276 // to consider the ledger range to be present. It should be used for testing
-
277 // only.
- - -
280
- -
282
-
283public:
-
284 Config();
-
285
-
286 /* Be very careful to make sure these bool params
-
287 are in the right order. */
-
288 void
-
289 setup(
-
290 std::string const& strConf,
-
291 bool bQuiet,
-
292 bool bSilent,
-
293 bool bStandalone);
-
294
-
295 void
-
296 setupControl(bool bQuiet, bool bSilent, bool bStandalone);
-
297
-
303 void
-
304 loadFromString(std::string const& fileContents);
-
305
-
306 bool
-
-
307 quiet() const
-
308 {
-
309 return QUIET;
-
310 }
+
71 static char const* const configLegacyName;
+
72 static char const* const databaseDirName;
+
73 static char const* const validatorsFileName;
+
74
+
76 boost::filesystem::path
+
77 getDebugLogFile() const;
+
78
+
79private:
+
80 boost::filesystem::path CONFIG_FILE;
+
81
+
82public:
+
83 boost::filesystem::path CONFIG_DIR;
+
84
+
85private:
+
86 boost::filesystem::path DEBUG_LOGFILE;
+
87
+
88 void
+
89 load();
+ +
91
+
92 bool QUIET = false; // Minimize logging verbosity.
+
93 bool SILENT = false; // No output to console after startup.
+
103 bool RUN_STANDALONE = false;
+
104
+
105 bool USE_TX_TABLES = true;
+
106
+
113 bool signingEnabled_ = false;
+
114
+
115 // The amount of RAM, in bytes, that we detected on this system.
+ +
117
+
118public:
+
119 bool doImport = false;
+
120 bool ELB_SUPPORT = false;
+
121
+
122 // Entries from [ips] config stanza
+ +
124
+
125 // Entries from [ips_fixed] config stanza
+ +
127
+ + +
130
+
131 bool START_VALID = false;
+
132
+ +
134
+ +
136
+
137 // Network parameters
+
138 uint32_t NETWORK_ID = 0;
+
139
+
140 // DEPRECATED - Fee units for a reference transction.
+
141 // Only provided for backwards compatibility in a couple of places
+
142 static constexpr std::uint32_t FEE_UNITS_DEPRECATED = 10;
+
143
+
144 // Note: The following parameters do not relate to the UNL or trust at all
+
145 // Minimum number of nodes to consider the network present
+ +
147
+
148 // Peer networking parameters
+
149 // 1 = relay, 0 = do not relay (but process), -1 = drop completely (do NOT
+
150 // process)
+ + +
153
+
154 // True to ask peers not to relay current IP.
+
155 bool PEER_PRIVATE = false;
+
156 // peers_max is a legacy configuration, which is going to be replaced
+
157 // with individual inbound peers peers_in_max and outbound peers
+
158 // peers_out_max configuration. for now we support both the legacy and
+
159 // the new configuration. if peers_max is configured then peers_in_max and
+
160 // peers_out_max are ignored.
+ + + +
164
+
165 // Path searching: these were reasonable default values at some point but
+
166 // further research is needed to decide if they still are
+
167 // and whether all of them are needed.
+
168 //
+
169 // The performance and resource consumption of a server can
+
170 // be dramatically impacted by changing these configuration
+
171 // options; higher values result in exponentially higher
+
172 // resource usage.
+
173 //
+
174 // Servers operating as validators disable path finding by
+
175 // default by setting the `PATH_SEARCH_MAX` option to 0
+
176 // unless it is explicitly set in the configuration file.
+ +
178 int PATH_SEARCH = 2;
+ + +
181
+
182 // Validation
+ +
184 VALIDATION_QUORUM; // validations to consider ledger authoritative
+
185
+ +
187
+
188 // Node storage configuration
+ + +
191
+
192 // Tunable that adjusts various parameters, typically associated
+
193 // with hardware parameters (RAM size and CPU cores). The default
+
194 // is 'tiny'.
+ +
196
+
197 bool SSL_VERIFY = true;
+ + +
200
+
201 // Compression
+
202 bool COMPRESSION = false;
+
203
+
204 // Enable the experimental Ledger Replay functionality
+
205 bool LEDGER_REPLAY = false;
+
206
+
207 // Work queue limits
+ +
209 static constexpr int MAX_JOB_QUEUE_TX = 1000;
+
210 static constexpr int MIN_JOB_QUEUE_TX = 100;
+
211
+
212 // Amendment majority time
+ +
214
+
215 // Thread pool configuration (0 = choose for me)
+
216 int WORKERS = 0; // jobqueue thread count. default: upto 6
+
217 int IO_WORKERS = 0; // io svc thread count. default: 2
+
218 int PREFETCH_WORKERS = 0; // prefetch thread count. default: 4
+
219
+
220 // Can only be set in code, specifically unit tests
+
221 bool FORCE_MULTI_THREAD = false;
+
222
+
223 // Normally the sweep timer is automatically deduced based on the node
+
224 // size, but we allow admins to explicitly set it in the config.
+ +
226
+
227 // Reduce-relay - Experimental parameters to control p2p routing algorithms
+
228
+
229 // Enable base squelching of duplicate validation/proposal messages
+ +
231
+
233 // Temporary squelching config for the peers selected as a source of //
+
234 // validator messages. The config must be removed once squelching is //
+
235 // made the default routing algorithm //
+ +
238
+
239 // Transaction reduce-relay feature
+ +
241 // If tx reduce-relay feature is disabled
+
242 // and this flag is enabled then some
+
243 // tx-related metrics is collected. It
+
244 // is ignored if tx reduce-relay feature is
+
245 // enabled. It is used in debugging to compare
+
246 // metrics with the feature disabled/enabled.
+ +
248 // Minimum peers a server should have before
+
249 // selecting random peers
+ +
251 // Percentage of peers with the tx reduce-relay feature enabled
+
252 // to relay to out of total active peers
+ +
254
+
255 // These override the command line client settings
+ +
257
+ +
259
+ +
261
+
262 // How long can a peer remain in the "unknown" state
+ +
264
+
265 // How long can a peer remain in the "diverged" state
+ +
267
+
268 // Enable the beta API version
+
269 bool BETA_RPC_API = false;
+
270
+
271 // First, attempt to load the latest ledger directly from disk.
+
272 bool FAST_LOAD = false;
+
273 // When starting rippled with existing database it do not know it has those
+
274 // ledgers locally until the server naturally tries to backfill. This makes
+
275 // is difficult to test some functionality (in particular performance
+
276 // testing sidechains). With this variable the user is able to force rippled
+
277 // to consider the ledger range to be present. It should be used for testing
+
278 // only.
+ + +
281
+ +
283
+
284public:
+
285 Config();
+
286
+
287 /* Be very careful to make sure these bool params
+
288 are in the right order. */
+
289 void
+
290 setup(
+
291 std::string const& strConf,
+
292 bool bQuiet,
+
293 bool bSilent,
+
294 bool bStandalone);
+
295
+
296 void
+
297 setupControl(bool bQuiet, bool bSilent, bool bStandalone);
+
298
+
304 void
+
305 loadFromString(std::string const& fileContents);
+
306
+
307 bool
+
+
308 quiet() const
+
309 {
+
310 return QUIET;
+
311 }
-
311 bool
-
-
312 silent() const
-
313 {
-
314 return SILENT;
-
315 }
+
312 bool
+
+
313 silent() const
+
314 {
+
315 return SILENT;
+
316 }
-
316 bool
-
- -
318 {
-
319 return RUN_STANDALONE;
-
320 }
+
317 bool
+
+ +
319 {
+
320 return RUN_STANDALONE;
+
321 }
-
321
-
322 bool
-
- -
324 {
-
325 return USE_TX_TABLES;
-
326 }
+
322
+
323 bool
+
+ +
325 {
+
326 return USE_TX_TABLES;
+
327 }
-
327
-
328 bool
-
-
329 canSign() const
-
330 {
-
331 return signingEnabled_;
-
332 }
+
328
+
329 bool
+
+
330 canSign() const
+
331 {
+
332 return signingEnabled_;
+
333 }
-
333
-
351 int
- -
353 const;
-
354
- -
-
356 journal() const
-
357 {
-
358 return j_;
-
359 }
+
334
+
352 int
+ +
354 const;
+
355
+ +
+
357 journal() const
+
358 {
+
359 return j_;
+
360 }
-
360};
+
361};
-
361
-
362FeeSetup
-
363setup_FeeVote(Section const& section);
-
364
-
365} // namespace xrpl
-
366
-
367#endif
+
362
+
363FeeSetup
+
364setup_FeeVote(Section const& section);
+
365
+
366} // namespace xrpl
+
367
+
368#endif
A generic endpoint for log messages.
Definition Journal.h:41
Holds unparsed configuration information.
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
-
bool ELB_SUPPORT
Definition Config.h:119
-
bool COMPRESSION
Definition Config.h:201
-
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:85
-
void load()
Definition Config.cpp:437
-
bool doImport
Definition Config.h:118
-
StartUpType START_UP
Definition Config.h:128
-
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:281
-
boost::filesystem::path CONFIG_FILE
Definition Config.h:79
-
bool silent() const
Definition Config.h:312
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
+
uint32_t NETWORK_ID
Definition Config.h:138
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:258
+
bool ELB_SUPPORT
Definition Config.h:120
+
bool COMPRESSION
Definition Config.h:202
+
static char const *const configLegacyName
Definition Config.h:71
+
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:86
+
void load()
Definition Config.cpp:438
+
bool doImport
Definition Config.h:119
+
StartUpType START_UP
Definition Config.h:129
+
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:282
+
boost::filesystem::path CONFIG_FILE
Definition Config.h:80
+
bool silent() const
Definition Config.h:313
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:240
static char const *const configFileName
Definition Config.h:70
-
int MAX_TRANSACTIONS
Definition Config.h:207
-
bool quiet() const
Definition Config.h:307
-
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
int PATH_SEARCH_OLD
Definition Config.h:176
-
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:255
-
bool BETA_RPC_API
Definition Config.h:268
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
-
beast::Journal const j_
Definition Config.h:89
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool standalone() const
Definition Config.h:317
-
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:102
-
int PATH_SEARCH_FAST
Definition Config.h:178
-
std::string SSL_VERIFY_FILE
Definition Config.h:197
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
std::string SERVER_DOMAIN
Definition Config.h:259
-
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:150
-
bool SILENT
Definition Config.h:92
-
std::string SSL_VERIFY_DIR
Definition Config.h:198
-
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:292
-
std::string START_LEDGER
Definition Config.h:132
-
bool USE_TX_TABLES
Definition Config.h:104
-
beast::Journal journal() const
Definition Config.h:356
-
std::optional< std::size_t > VALIDATION_QUORUM
Definition Config.h:183
-
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:208
-
std::uint64_t const ramSize_
Definition Config.h:115
-
int PREFETCH_WORKERS
Definition Config.h:217
-
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:460
-
std::optional< std::pair< std::uint32_t, std::uint32_t > > FORCED_LEDGER_RANGE_PRESENT
Definition Config.h:279
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
-
bool FORCE_MULTI_THREAD
Definition Config.h:220
-
bool SSL_VERIFY
Definition Config.h:196
-
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:1063
-
bool QUIET
Definition Config.h:91
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
-
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
-
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:209
-
bool PEER_PRIVATE
Definition Config.h:154
-
static char const *const validatorsFileName
Definition Config.h:72
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
- -
std::size_t NODE_SIZE
Definition Config.h:194
-
bool useTxTables() const
Definition Config.h:323
-
bool FAST_LOAD
Definition Config.h:271
- - - - - - - -
std::size_t PEERS_MAX
Definition Config.h:160
-
std::uint32_t FETCH_DEPTH
Definition Config.h:189
-
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:112
-
int PATH_SEARCH
Definition Config.h:177
-
std::optional< int > SWEEP_INTERVAL
Definition Config.h:224
-
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:250
-
std::size_t NETWORK_QUORUM
Definition Config.h:145
-
FeeSetup FEES
Definition Config.h:185
-
std::optional< uint256 > TRAP_TX_HASH
Definition Config.h:134
-
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1097
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
-
int IO_WORKERS
Definition Config.h:216
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:212
-
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:151
-
bool canSign() const
Definition Config.h:329
-
bool START_VALID
Definition Config.h:130
-
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:235
-
int WORKERS
Definition Config.h:215
-
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
-
boost::filesystem::path CONFIG_DIR
Definition Config.h:82
-
bool LEDGER_REPLAY
Definition Config.h:204
-
static char const *const databaseDirName
Definition Config.h:71
+
int MAX_TRANSACTIONS
Definition Config.h:208
+
bool quiet() const
Definition Config.h:308
+
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
int PATH_SEARCH_OLD
Definition Config.h:177
+
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:256
+
bool BETA_RPC_API
Definition Config.h:269
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:266
+
beast::Journal const j_
Definition Config.h:90
+
std::vector< std::string > IPS
Definition Config.h:123
+
bool standalone() const
Definition Config.h:318
+
bool RUN_STANDALONE
Operate in stand-alone mode.
Definition Config.h:103
+
int PATH_SEARCH_FAST
Definition Config.h:179
+
std::string SSL_VERIFY_FILE
Definition Config.h:198
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
std::string SERVER_DOMAIN
Definition Config.h:260
+
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:151
+
bool SILENT
Definition Config.h:93
+
std::string SSL_VERIFY_DIR
Definition Config.h:199
+
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:293
+
std::string START_LEDGER
Definition Config.h:133
+
bool USE_TX_TABLES
Definition Config.h:105
+
beast::Journal journal() const
Definition Config.h:357
+
std::optional< std::size_t > VALIDATION_QUORUM
Definition Config.h:184
+
static constexpr int MAX_JOB_QUEUE_TX
Definition Config.h:209
+
std::uint64_t const ramSize_
Definition Config.h:116
+
int PREFETCH_WORKERS
Definition Config.h:218
+
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:253
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:461
+
std::optional< std::pair< std::uint32_t, std::uint32_t > > FORCED_LEDGER_RANGE_PRESENT
Definition Config.h:280
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
+
bool FORCE_MULTI_THREAD
Definition Config.h:221
+
bool SSL_VERIFY
Definition Config.h:197
+
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:1064
+
bool QUIET
Definition Config.h:92
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:247
+
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:263
+
static constexpr int MIN_JOB_QUEUE_TX
Definition Config.h:210
+
bool PEER_PRIVATE
Definition Config.h:155
+
static char const *const validatorsFileName
Definition Config.h:73
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:189
+ +
std::size_t NODE_SIZE
Definition Config.h:195
+
bool useTxTables() const
Definition Config.h:324
+
bool FAST_LOAD
Definition Config.h:272
+ + + + + + + +
std::size_t PEERS_MAX
Definition Config.h:161
+
std::uint32_t FETCH_DEPTH
Definition Config.h:190
+
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
Definition Config.h:113
+
int PATH_SEARCH
Definition Config.h:178
+
std::optional< int > SWEEP_INTERVAL
Definition Config.h:225
+
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:251
+
std::size_t NETWORK_QUORUM
Definition Config.h:146
+
FeeSetup FEES
Definition Config.h:186
+
std::optional< uint256 > TRAP_TX_HASH
Definition Config.h:135
+
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1098
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:230
+
int IO_WORKERS
Definition Config.h:217
+
std::vector< std::string > IPS_FIXED
Definition Config.h:126
+
std::chrono::seconds AMENDMENT_MAJORITY_TIME
Definition Config.h:213
+
int RELAY_UNTRUSTED_PROPOSALS
Definition Config.h:152
+
bool canSign() const
Definition Config.h:330
+
bool START_VALID
Definition Config.h:131
+
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:236
+
int WORKERS
Definition Config.h:216
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:250
+
boost::filesystem::path CONFIG_DIR
Definition Config.h:83
+
bool LEDGER_REPLAY
Definition Config.h:205
+
static char const *const databaseDirName
Definition Config.h:72
@@ -517,7 +519,7 @@ $(document).ready(function() { init_codefold(0); });
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::chrono::seconds const defaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
-
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1109
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1110
SizedItem
Definition Config.h:25
diff --git a/Config__test_8cpp_source.html b/Config__test_8cpp_source.html index 2f3f9f126f..8e66e9ee26 100644 --- a/Config__test_8cpp_source.html +++ b/Config__test_8cpp_source.html @@ -88,1561 +88,1723 @@ $(document).ready(function() { init_codefold(0); });
5#include <xrpld/core/ConfigSections.h>
6
7#include <xrpl/beast/unit_test/suite.h>
-
8#include <xrpl/server/Port.h>
-
9
-
10#include <boost/filesystem.hpp>
-
11#include <boost/format.hpp>
-
12
-
13#include <fstream>
-
14#include <regex>
-
15
-
16namespace xrpl {
-
17namespace detail {
- -
-
19configContents(std::string const& dbPath, std::string const& validatorsFile)
-
20{
-
21 static boost::format configContentsTemplate(R"rippleConfig(
-
22[server]
-
23port_rpc
-
24port_peer
-
25port_wss_admin
-
26
-
27[port_rpc]
-
28port = 5005
-
29ip = 127.0.0.1
-
30admin = 127.0.0.1, ::1
-
31protocol = https
-
32
-
33[port_peer]
-
34port = 51235
-
35ip = 0.0.0.0
-
36protocol = peer
-
37
-
38[port_wss_admin]
-
39port = 6006
-
40ip = 127.0.0.1
-
41admin = 127.0.0.1
-
42protocol = wss
-
43
-
44#[port_ws_public]
-
45#port = 5005
-
46#ip = 127.0.0.1
-
47#protocol = wss
-
48
-
49#-------------------------------------------------------------------------------
-
50
-
51[node_size]
-
52medium
-
53
-
54# This is primary persistent datastore for rippled. This includes transaction
-
55# metadata, account states, and ledger headers. Helpful information can be
-
56# found on https://xrpl.org/capacity-planning.html#node-db-type
-
57# delete old ledgers while maintaining at least 2000. Do not require an
-
58# external administrative command to initiate deletion.
-
59[node_db]
-
60type=memory
-
61path=/Users/dummy/ripple/config/db/rocksdb
-
62open_files=2000
-
63filter_bits=12
-
64cache_mb=256
-
65file_size_mb=8
-
66file_size_mult=2
-
67
-
68%1%
-
69
-
70%2%
-
71
-
72# This needs to be an absolute directory reference, not a relative one.
-
73# Modify this value as required.
-
74[debug_logfile]
-
75/Users/dummy/ripple/config/log/debug.log
-
76
-
77[sntp_servers]
-
78time.windows.com
-
79time.apple.com
-
80time.nist.gov
-
81pool.ntp.org
-
82
-
83# Where to find some other servers speaking the Ripple protocol.
-
84#
-
85[ips]
-
86r.ripple.com 51235
-
87
-
88# Turn down default logging to save disk space in the long run.
-
89# Valid values here are trace, debug, info, warning, error, and fatal
-
90[rpc_startup]
-
91{ "command": "log_level", "severity": "warning" }
-
92
-
93# Defaults to 1 ("yes") so that certificates will be validated. To allow the use
-
94# of self-signed certificates for development or internal use, set to 0 ("no").
-
95[ssl_verify]
-
960
-
97
-
98[sqdb]
-
99backend=sqlite
-
100)rippleConfig");
-
101
-
102 std::string dbPathSection =
-
103 dbPath.empty() ? "" : "[database_path]\n" + dbPath;
-
104 std::string valFileSection =
-
105 validatorsFile.empty() ? "" : "[validators_file]\n" + validatorsFile;
-
106 return boost::str(configContentsTemplate % dbPathSection % valFileSection);
-
107}
+
8#include <xrpl/beast/utility/temp_dir.h>
+
9#include <xrpl/server/Port.h>
+
10
+
11#include <boost/filesystem.hpp>
+
12#include <boost/format.hpp>
+
13
+
14#include <fstream>
+
15#include <regex>
+
16
+
17namespace xrpl {
+
18namespace detail {
+ +
+
20configContents(std::string const& dbPath, std::string const& validatorsFile)
+
21{
+
22 static boost::format configContentsTemplate(R"xrpldConfig(
+
23[server]
+
24port_rpc
+
25port_peer
+
26port_wss_admin
+
27
+
28[port_rpc]
+
29port = 5005
+
30ip = 127.0.0.1
+
31admin = 127.0.0.1, ::1
+
32protocol = https
+
33
+
34[port_peer]
+
35port = 51235
+
36ip = 0.0.0.0
+
37protocol = peer
+
38
+
39[port_wss_admin]
+
40port = 6006
+
41ip = 127.0.0.1
+
42admin = 127.0.0.1
+
43protocol = wss
+
44
+
45#[port_ws_public]
+
46#port = 5005
+
47#ip = 127.0.0.1
+
48#protocol = wss
+
49
+
50#-------------------------------------------------------------------------------
+
51
+
52[node_size]
+
53medium
+
54
+
55# This is primary persistent datastore for xrpld. This includes transaction
+
56# metadata, account states, and ledger headers. Helpful information can be
+
57# found on https://xrpl.org/capacity-planning.html#node-db-type
+
58# delete old ledgers while maintaining at least 2000. Do not require an
+
59# external administrative command to initiate deletion.
+
60[node_db]
+
61type=memory
+
62path=/Users/dummy/xrpld/config/db/rocksdb
+
63open_files=2000
+
64filter_bits=12
+
65cache_mb=256
+
66file_size_mb=8
+
67file_size_mult=2
+
68
+
69%1%
+
70
+
71%2%
+
72
+
73# This needs to be an absolute directory reference, not a relative one.
+
74# Modify this value as required.
+
75[debug_logfile]
+
76/Users/dummy/xrpld/config/log/debug.log
+
77
+
78[sntp_servers]
+
79time.windows.com
+
80time.apple.com
+
81time.nist.gov
+
82pool.ntp.org
+
83
+
84# Where to find some other servers speaking the Ripple protocol.
+
85#
+
86[ips]
+
87r.ripple.com 51235
+
88
+
89# Turn down default logging to save disk space in the long run.
+
90# Valid values here are trace, debug, info, warning, error, and fatal
+
91[rpc_startup]
+
92{ "command": "log_level", "severity": "warning" }
+
93
+
94# Defaults to 1 ("yes") so that certificates will be validated. To allow the use
+
95# of self-signed certificates for development or internal use, set to 0 ("no").
+
96[ssl_verify]
+
970
+
98
+
99[sqdb]
+
100backend=sqlite
+
101)xrpldConfig");
+
102
+
103 std::string dbPathSection =
+
104 dbPath.empty() ? "" : "[database_path]\n" + dbPath;
+
105 std::string valFileSection =
+
106 validatorsFile.empty() ? "" : "[validators_file]\n" + validatorsFile;
+
107 return boost::str(configContentsTemplate % dbPathSection % valFileSection);
+
108}
-
108
-
- -
113{
-
114private:
- -
116
-
117 bool rmDataDir_{false};
-
118
- -
120
-
121public:
-
- - -
124 path subDir,
-
125 path const& dbPath,
-
126 path const& validatorsFile,
-
127 bool useCounter = true,
-
128 std::string confContents = "")
-
129 : FileDirGuard(
-
130 test,
-
131 std::move(subDir),
-
132 path(Config::configFileName),
-
133 confContents.empty()
-
134 ? configContents(dbPath.string(), validatorsFile.string())
-
135 : confContents,
-
136 useCounter)
-
137 , dataDir_(dbPath)
-
138 {
-
139 if (dbPath.empty())
- -
141
-
142 rmDataDir_ = !exists(dataDir_);
- -
144 file_.string(),
-
145 /* bQuiet */ true,
-
146 /* bSilent */ false,
-
147 /* bStandalone */ false);
-
148 }
+
109
+
+ +
114{
+
115private:
+ +
117
+
118 bool rmDataDir_{false};
+
119
+ +
121
+
122public:
+
+ + +
125 path subDir,
+
126 path const& dbPath,
+
127 path const& configFile,
+
128 path const& validatorsFile,
+
129 bool useCounter = true,
+
130 std::string confContents = "")
+
131 : FileDirGuard(
+
132 test,
+
133 std::move(subDir),
+ +
135 confContents.empty()
+
136 ? configContents(dbPath.string(), validatorsFile.string())
+
137 : confContents,
+
138 useCounter)
+
139 , dataDir_(dbPath)
+
140 {
+
141 if (dbPath.empty())
+ +
143
+
144 rmDataDir_ = !exists(dataDir_);
+ +
146 file_.string(),
+
147 /* bQuiet */ true,
+
148 /* bSilent */ false,
+
149 /* bStandalone */ false);
+
150 }
-
149
-
150 Config const&
-
-
151 config() const
-
152 {
-
153 return config_;
-
154 }
+
151
+
152 Config const&
+
+
153 config() const
+
154 {
+
155 return config_;
+
156 }
-
155
- -
- -
158 {
-
159 return file().string();
-
160 }
+
157
+ +
+ +
160 {
+
161 return file().string();
+
162 }
-
161
-
162 bool
-
- -
164 {
-
165 return boost::filesystem::is_directory(dataDir_);
-
166 }
+
163
+
164 bool
+
+ +
166 {
+
167 return boost::filesystem::is_directory(dataDir_);
+
168 }
-
167
-
168 bool
-
- -
170 {
-
171 return fileExists();
-
172 }
+
169
+
170 bool
+
+ +
172 {
+
173 return fileExists();
+
174 }
-
173
-
- -
175 {
-
176 try
-
177 {
-
178 using namespace boost::filesystem;
-
179 if (rmDataDir_)
- -
181 }
-
182 catch (std::exception& e)
-
183 {
-
184 // if we throw here, just let it die.
-
185 test_.log << "Error in ~RippledCfgGuard: " << e.what() << std::endl;
-
186 };
-
187 }
+
175
+
+ +
177 {
+
178 try
+
179 {
+
180 using namespace boost::filesystem;
+
181 if (rmDataDir_)
+ +
183 }
+
184 catch (std::exception& e)
+
185 {
+
186 // if we throw here, just let it die.
+
187 test_.log << "Error in ~FileCfgGuard: " << e.what() << std::endl;
+
188 };
+
189 }
-
188};
+
190};
-
189
- -
- -
192{
-
193 std::string configContents(R"rippleConfig(
-
194[validators]
-
195n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
-
196n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
-
197n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
-
198n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
-
199n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
-
200
-
201[validator_keys]
-
202nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
-
203nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
-
204nHUPDdcdb2Y5DZAJne4c2iabFuAP3F34xZUgYQT2NH7qfkdapgnz
-
205
-
206[validator_list_sites]
-
207recommendedripplevalidators.com
-
208moreripplevalidators.net
-
209
-
210[validator_list_keys]
-
21103E74EE14CB525AFBB9F1B7D86CD58ECC4B91452294B42AB4E78F260BD905C091D
-
212030775A669685BD6ABCEBD80385921C7851783D991A8055FD21D2F3966C96F1B56
-
213
-
214[validator_list_threshold]
-
2152
-
216)rippleConfig");
-
217 return configContents;
-
218}
+
191
+ +
+ +
194{
+
195 std::string configContents(R"xrpldConfig(
+
196[validators]
+
197n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
+
198n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
+
199n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
+
200n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
+
201n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
+
202
+
203[validator_keys]
+
204nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
+
205nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
+
206nHUPDdcdb2Y5DZAJne4c2iabFuAP3F34xZUgYQT2NH7qfkdapgnz
+
207
+
208[validator_list_sites]
+
209recommendedxrplvalidators.com
+
210morexrplvalidators.net
+
211
+
212[validator_list_keys]
+
21303E74EE14CB525AFBB9F1B7D86CD58ECC4B91452294B42AB4E78F260BD905C091D
+
214030775A669685BD6ABCEBD80385921C7851783D991A8055FD21D2F3966C96F1B56
+
215
+
216[validator_list_threshold]
+
2172
+
218)xrpldConfig");
+
219 return configContents;
+
220}
-
219
-
- -
224{
-
225public:
-
- - -
228 path subDir,
-
229 path const& validatorsFileName,
-
230 bool useCounter = true)
-
231 : FileDirGuard(
-
232 test,
-
233 std::move(subDir),
-
234 path(
-
235 validatorsFileName.empty() ? Config::validatorsFileName
-
236 : validatorsFileName),
- -
238 useCounter)
-
239 {
-
240 }
+
221
+
+ +
226{
+
227public:
+
+ + +
230 path subDir,
+
231 path const& validatorsFileName,
+
232 bool useCounter = true)
+
233 : FileDirGuard(
+
234 test,
+
235 std::move(subDir),
+
236 path(
+
237 validatorsFileName.empty() ? Config::validatorsFileName
+
238 : validatorsFileName),
+ +
240 useCounter)
+
241 {
+
242 }
-
241
-
242 bool
-
- -
244 {
-
245 return fileExists();
-
246 }
+
243
+
244 bool
+
+ +
246 {
+
247 return fileExists();
+
248 }
-
247
- -
- -
250 {
-
251 return absolute(file()).string();
-
252 }
+
249
+ +
+ +
252 {
+
253 return absolute(file()).string();
+
254 }
-
253
-
- -
255 {
-
256 }
+
255
+
+ +
257 {
+
258 }
-
257};
+
259};
-
258} // namespace detail
-
259
-
-
260class Config_test final : public TestSuite
-
261{
-
262private:
-
263 using path = boost::filesystem::path;
-
264
-
265public:
-
266 void
-
- -
268 {
-
269 testcase("legacy");
-
270
-
271 Config c;
+
260} // namespace detail
+
261
+
+
262class Config_test final : public TestSuite
+
263{
+
264private:
+
265 using path = boost::filesystem::path;
+
266
+
267public:
+
268 void
+
+ +
270 {
+
271 testcase("legacy");
272
-
273 std::string toLoad(R"rippleConfig(
-
274[server]
-
275port_rpc
-
276port_peer
-
277port_wss_admin
-
278
-
279[ssl_verify]
-
2800
-
281)rippleConfig");
-
282
-
283 c.loadFromString(toLoad);
+
273 Config c;
+
274
+
275 std::string toLoad(R"xrpldConfig(
+
276[server]
+
277port_rpc
+
278port_peer
+
279port_wss_admin
+
280
+
281[ssl_verify]
+
2820
+
283)xrpldConfig");
284
-
285 BEAST_EXPECT(c.legacy("ssl_verify") == "0");
-
286 expectException([&c] { c.legacy("server"); }); // not a single line
-
287
-
288 // set a legacy value
-
289 BEAST_EXPECT(c.legacy("not_in_file") == "");
-
290 c.legacy("not_in_file", "new_value");
-
291 BEAST_EXPECT(c.legacy("not_in_file") == "new_value");
-
292 }
+
285 c.loadFromString(toLoad);
+
286
+
287 BEAST_EXPECT(c.legacy("ssl_verify") == "0");
+
288 expectException([&c] { c.legacy("server"); }); // not a single line
+
289
+
290 // set a legacy value
+
291 BEAST_EXPECT(c.legacy("not_in_file") == "");
+
292 c.legacy("not_in_file", "new_value");
+
293 BEAST_EXPECT(c.legacy("not_in_file") == "new_value");
+
294 }
-
293 void
-
- -
295 {
-
296 testcase("database_path");
-
297
-
298 using namespace boost::filesystem;
-
299 {
-
300 boost::format cc("[database_path]\n%1%\n");
-
301
-
302 auto const cwd = current_path();
-
303 path const dataDirRel("test_data_dir");
-
304 path const dataDirAbs(cwd / dataDirRel);
-
305 {
-
306 // Dummy test - do we get back what we put in
-
307 Config c;
-
308 c.loadFromString(boost::str(cc % dataDirAbs.string()));
-
309 BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
-
310 }
-
311 {
-
312 // Rel paths should convert to abs paths
-
313 Config c;
-
314 c.loadFromString(boost::str(cc % dataDirRel.string()));
-
315 BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
-
316 }
-
317 {
-
318 // No db section.
-
319 // N.B. Config::setup will give database_path a default,
-
320 // load will not.
-
321 Config c;
-
322 c.loadFromString("");
-
323 BEAST_EXPECT(c.legacy("database_path") == "");
-
324 }
+
295 void
+
+ +
297 {
+
298 testcase("config_file");
+
299
+
300 using namespace boost::filesystem;
+
301 auto const cwd = current_path();
+
302
+
303 // Test both config file names.
+
304 char const* configFiles[] = {
+ +
306
+
307 // Config file in current directory.
+
308 for (auto const& configFile : configFiles)
+
309 {
+
310 // Use a temporary directory for testing.
+ +
312 current_path(td.path());
+
313 path const f = td.file(configFile);
+
314 std::ofstream o(f.string());
+
315 o << detail::configContents("", "");
+
316 o.close();
+
317
+
318 // Load the config file from the current directory and verify it.
+
319 Config c;
+
320 c.setup("", true, false, true);
+
321 BEAST_EXPECT(c.section(SECTION_DEBUG_LOGFILE).values().size() == 1);
+
322 BEAST_EXPECT(
+
323 c.section(SECTION_DEBUG_LOGFILE).values()[0] ==
+
324 "/Users/dummy/xrpld/config/log/debug.log");
325 }
-
326 {
-
327 // read from file absolute path
-
328 auto const cwd = current_path();
-
329 xrpl::detail::DirGuard const g0(*this, "test_db");
-
330 path const dataDirRel("test_data_dir");
-
331 path const dataDirAbs(cwd / g0.subdir() / dataDirRel);
- -
333 *this, g0.subdir(), dataDirAbs, "", false);
-
334 auto const& c(g.config());
-
335 BEAST_EXPECT(g.dataDirExists());
-
336 BEAST_EXPECT(g.configFileExists());
-
337 BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
-
338 }
-
339 {
-
340 // read from file relative path
-
341 std::string const dbPath("my_db");
-
342 detail::RippledCfgGuard const g(*this, "test_db", dbPath, "");
-
343 auto const& c(g.config());
-
344 std::string const nativeDbPath = absolute(path(dbPath)).string();
-
345 BEAST_EXPECT(g.dataDirExists());
-
346 BEAST_EXPECT(g.configFileExists());
-
347 BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
-
348 }
-
349 {
-
350 // read from file no path
-
351 detail::RippledCfgGuard const g(*this, "test_db", "", "");
-
352 auto const& c(g.config());
-
353 std::string const nativeDbPath =
-
354 absolute(g.subdir() / path(Config::databaseDirName)).string();
-
355 BEAST_EXPECT(g.dataDirExists());
-
356 BEAST_EXPECT(g.configFileExists());
-
357 BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
-
358 }
-
359 }
-
-
360
-
361 void
-
- -
363 {
-
364 testcase("validator keys");
+
326
+
327 // Config file in HOME or XDG_CONFIG_HOME directory.
+
328#if BOOST_OS_LINUX || BOOST_OS_MACOS
+
329 for (auto const& configFile : configFiles)
+
330 {
+
331 // Point the current working directory to a temporary directory, so
+
332 // we don't pick up an actual config file from the repository root.
+ +
334 current_path(td.path());
+
335
+
336 // The XDG config directory is set: the config file must be in a
+
337 // subdirectory named after the system.
+
338 {
+ +
340
+
341 // Set the HOME and XDG_CONFIG_HOME environment variables. The
+
342 // HOME variable is not used when XDG_CONFIG_HOME is set, but
+
343 // must be set.
+
344 char const* h = getenv("HOME");
+
345 setenv("HOME", tc.path().c_str(), 1);
+
346 char const* x = getenv("XDG_CONFIG_HOME");
+
347 setenv("XDG_CONFIG_HOME", tc.path().c_str(), 1);
+
348
+
349 // Create the config file in '${XDG_CONFIG_HOME}/[systemName]'.
+
350 path p = tc.file(systemName());
+
351 create_directory(p);
+
352 p = tc.file(systemName() + "/" + configFile);
+
353 std::ofstream o(p.string());
+
354 o << detail::configContents("", "");
+
355 o.close();
+
356
+
357 // Load the config file from the config directory and verify it.
+
358 Config c;
+
359 c.setup("", true, false, true);
+
360 BEAST_EXPECT(
+
361 c.section(SECTION_DEBUG_LOGFILE).values().size() == 1);
+
362 BEAST_EXPECT(
+
363 c.section(SECTION_DEBUG_LOGFILE).values()[0] ==
+
364 "/Users/dummy/xrpld/config/log/debug.log");
365
-
366 std::string const validationSeed = "spA4sh1qTvwq92X715tYyGQKmAKfa";
-
367
-
368 auto const token =
-
369 "eyJ2YWxpZGF0aW9uX3ByaXZhdGVfa2V5IjoiOWVkNDVmODY2MjQxY2MxOGEyNzQ3Yj"
-
370 "U0Mzg3YzA2MjU5MDc5NzJmNGU3MTkwMjMxZmFhOTM3NDU3ZmE5ZGFmNiIsIm1hbmlm"
-
371 "ZXN0IjoiSkFBQUFBRnhJZTFGdHdtaW12R3RIMmlDY01KcUM5Z1ZGS2lsR2Z3MS92Q3"
-
372 "hIWFhMcGxjMkduTWhBa0UxYWdxWHhCd0R3RGJJRDZPTVNZdU0wRkRBbHBBZ05rOFNL"
-
373 "Rm43TU8yZmRrY3dSUUloQU9uZ3U5c0FLcVhZb3VKK2wyVjBXK3NBT2tWQitaUlM2UF"
-
374 "NobEpBZlVzWGZBaUJzVkpHZXNhYWRPSmMvYUFab2tTMXZ5bUdtVnJsSFBLV1gzWXl3"
-
375 "dTZpbjhIQVNRS1B1Z0JENjdrTWFSRkd2bXBBVEhsR0tKZHZERmxXUFl5NUFxRGVkRn"
-
376 "Y1VEphMncwaTIxZXEzTVl5d0xWSlpuRk9yN0Mwa3cyQWlUelNDakl6ZGl0UTg9In0"
-
377 "=";
-
378
-
379 {
-
380 Config c;
-
381 static boost::format configTemplate(R"rippleConfig(
-
382[validation_seed]
-
383%1%
-
384
-
385[validator_token]
-
386%2%
-
387)rippleConfig");
-
388 std::string error;
-
389 auto const expectedError =
-
390 "Cannot have both [validation_seed] "
-
391 "and [validator_token] config sections";
-
392 try
-
393 {
- -
395 boost::str(configTemplate % validationSeed % token));
-
396 }
-
397 catch (std::runtime_error& e)
-
398 {
-
399 error = e.what();
-
400 }
-
401 BEAST_EXPECT(error == expectedError);
-
402 }
-
403 }
+
366 // Restore the environment variables.
+
367 h ? setenv("HOME", h, 1) : unsetenv("HOME");
+
368 x ? setenv("XDG_CONFIG_HOME", x, 1)
+
369 : unsetenv("XDG_CONFIG_HOME");
+
370 }
+
371
+
372 // The XDG config directory is not set: the config file must be in a
+
373 // subdirectory named .config followed by the system name.
+
374 {
+ +
376
+
377 // Set only the HOME environment variable.
+
378 char const* h = getenv("HOME");
+
379 setenv("HOME", tc.path().c_str(), 1);
+
380 char const* x = getenv("XDG_CONFIG_HOME");
+
381 unsetenv("XDG_CONFIG_HOME");
+
382
+
383 // Create the config file in '${HOME}/.config/[systemName]'.
+
384 std::string s = ".config";
+
385 path p = tc.file(s);
+
386 create_directory(p);
+
387 s += "/" + systemName();
+
388 p = tc.file(s);
+
389 create_directory(p);
+
390 p = tc.file(s + "/" + configFile);
+
391 std::ofstream o(p.string());
+
392 o << detail::configContents("", "");
+
393 o.close();
+
394
+
395 // Load the config file from the config directory and verify it.
+
396 Config c;
+
397 c.setup("", true, false, true);
+
398 BEAST_EXPECT(
+
399 c.section(SECTION_DEBUG_LOGFILE).values().size() == 1);
+
400 BEAST_EXPECT(
+
401 c.section(SECTION_DEBUG_LOGFILE).values()[0] ==
+
402 "/Users/dummy/xrpld/config/log/debug.log");
+
403
+
404 // Restore the environment variables.
+
405 h ? setenv("HOME", h, 1) : unsetenv("HOME");
+
406 if (x)
+
407 setenv("XDG_CONFIG_HOME", x, 1);
+
408 }
+
409 }
+
410#endif
+
411
+
412 // Restore the current working directory.
+
413 current_path(cwd);
+
414 }
-
404
-
405 void
-
- -
407 {
-
408 testcase("network id");
-
409 std::string error;
-
410 Config c;
-
411 try
-
412 {
-
413 c.loadFromString(R"rippleConfig(
-
414[network_id]
-
415main
-
416)rippleConfig");
-
417 }
-
418 catch (std::runtime_error& e)
-
419 {
-
420 error = e.what();
-
421 }
-
422
-
423 BEAST_EXPECT(error == "");
-
424 BEAST_EXPECT(c.NETWORK_ID == 0);
-
425
-
426 try
-
427 {
-
428 c.loadFromString(R"rippleConfig(
-
429)rippleConfig");
-
430 }
-
431 catch (std::runtime_error& e)
-
432 {
-
433 error = e.what();
-
434 }
-
435
-
436 BEAST_EXPECT(error == "");
-
437 BEAST_EXPECT(c.NETWORK_ID == 0);
-
438
-
439 try
-
440 {
-
441 c.loadFromString(R"rippleConfig(
-
442[network_id]
-
443255
-
444)rippleConfig");
-
445 }
-
446 catch (std::runtime_error& e)
-
447 {
-
448 error = e.what();
-
449 }
-
450
-
451 BEAST_EXPECT(error == "");
-
452 BEAST_EXPECT(c.NETWORK_ID == 255);
-
453
-
454 try
-
455 {
-
456 c.loadFromString(R"rippleConfig(
-
457[network_id]
-
45810000
-
459)rippleConfig");
-
460 }
-
461 catch (std::runtime_error& e)
-
462 {
-
463 error = e.what();
-
464 }
-
465
-
466 BEAST_EXPECT(error == "");
-
467 BEAST_EXPECT(c.NETWORK_ID == 10000);
-
468 }
+
415 void
+
+ +
417 {
+
418 testcase("database_path");
+
419
+
420 using namespace boost::filesystem;
+
421 {
+
422 boost::format cc("[database_path]\n%1%\n");
+
423
+
424 auto const cwd = current_path();
+
425 path const dataDirRel("test_data_dir");
+
426 path const dataDirAbs(cwd / dataDirRel);
+
427 {
+
428 // Dummy test - do we get back what we put in
+
429 Config c;
+
430 c.loadFromString(boost::str(cc % dataDirAbs.string()));
+
431 BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
+
432 }
+
433 {
+
434 // Rel paths should convert to abs paths
+
435 Config c;
+
436 c.loadFromString(boost::str(cc % dataDirRel.string()));
+
437 BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
+
438 }
+
439 {
+
440 // No db section.
+
441 // N.B. Config::setup will give database_path a default,
+
442 // load will not.
+
443 Config c;
+
444 c.loadFromString("");
+
445 BEAST_EXPECT(c.legacy("database_path") == "");
+
446 }
+
447 }
+
448 {
+
449 // read from file absolute path
+
450 auto const cwd = current_path();
+
451 detail::DirGuard const g0(*this, "test_db");
+
452 path const dataDirRel("test_data_dir");
+
453 path const dataDirAbs(cwd / g0.subdir() / dataDirRel);
+
454 detail::FileCfgGuard const g(
+
455 *this,
+
456 g0.subdir(),
+
457 dataDirAbs,
+ +
459 "",
+
460 false);
+
461 auto const& c(g.config());
+
462 BEAST_EXPECT(g.dataDirExists());
+
463 BEAST_EXPECT(g.configFileExists());
+
464 BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
+
465 }
+
466 {
+
467 // read from file relative path
+
468 std::string const dbPath("my_db");
+
469 detail::FileCfgGuard const g(
+
470 *this, "test_db", dbPath, Config::configFileName, "");
+
471 auto const& c(g.config());
+
472 std::string const nativeDbPath = absolute(path(dbPath)).string();
+
473 BEAST_EXPECT(g.dataDirExists());
+
474 BEAST_EXPECT(g.configFileExists());
+
475 BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
+
476 }
+
477 {
+
478 // read from file no path
+
479 detail::FileCfgGuard const g(
+
480 *this, "test_db", "", Config::configFileName, "");
+
481 auto const& c(g.config());
+
482 std::string const nativeDbPath =
+
483 absolute(g.subdir() / path(Config::databaseDirName)).string();
+
484 BEAST_EXPECT(g.dataDirExists());
+
485 BEAST_EXPECT(g.configFileExists());
+
486 BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
+
487 }
+
488 }
-
469
-
470 void
-
- -
472 {
-
473 testcase("validators_file");
-
474
-
475 using namespace boost::filesystem;
-
476 {
-
477 // load should throw for missing specified validators file
-
478 boost::format cc("[validators_file]\n%1%\n");
-
479 std::string error;
-
480 std::string const missingPath = "/no/way/this/path/exists";
-
481 auto const expectedError =
-
482 "The file specified in [validators_file] does not exist: " +
-
483 missingPath;
-
484 try
-
485 {
-
486 Config c;
-
487 c.loadFromString(boost::str(cc % missingPath));
-
488 }
-
489 catch (std::runtime_error& e)
-
490 {
-
491 error = e.what();
-
492 }
-
493 BEAST_EXPECT(error == expectedError);
-
494 }
-
495 {
-
496 // load should throw for invalid [validators_file]
- -
498 *this, "test_cfg", "validators.cfg");
-
499 path const invalidFile = current_path() / vtg.subdir();
-
500 boost::format cc("[validators_file]\n%1%\n");
-
501 std::string error;
-
502 auto const expectedError =
-
503 "Invalid file specified in [validators_file]: " +
-
504 invalidFile.string();
-
505 try
-
506 {
-
507 Config c;
-
508 c.loadFromString(boost::str(cc % invalidFile.string()));
-
509 }
-
510 catch (std::runtime_error& e)
-
511 {
-
512 error = e.what();
-
513 }
-
514 BEAST_EXPECT(error == expectedError);
-
515 }
-
516 {
-
517 // load validators from config into single section
-
518 Config c;
-
519 std::string toLoad(R"rippleConfig(
-
520[validators]
-
521n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
-
522n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
-
523n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
-
524
-
525[validator_keys]
-
526nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
-
527nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
-
528)rippleConfig");
-
529 c.loadFromString(toLoad);
-
530 BEAST_EXPECT(c.legacy("validators_file").empty());
-
531 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 5);
-
532 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == std::nullopt);
-
533 }
-
534 {
-
535 // load validator list sites and keys from config
-
536 Config c;
-
537 std::string toLoad(R"rippleConfig(
-
538[validator_list_sites]
-
539ripplevalidators.com
-
540trustthesevalidators.gov
-
541
-
542[validator_list_keys]
-
543021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
544
-
545[validator_list_threshold]
-
5461
-
547)rippleConfig");
-
548 c.loadFromString(toLoad);
-
549 BEAST_EXPECT(
-
550 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
551 BEAST_EXPECT(
-
552 c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] ==
-
553 "ripplevalidators.com");
-
554 BEAST_EXPECT(
-
555 c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] ==
-
556 "trustthesevalidators.gov");
-
557 BEAST_EXPECT(
-
558 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 1);
-
559 BEAST_EXPECT(
-
560 c.section(SECTION_VALIDATOR_LIST_KEYS).values()[0] ==
-
561 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
-
562 "E566");
-
563 BEAST_EXPECT(
-
564 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
-
565 1);
-
566 BEAST_EXPECT(
-
567 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values()[0] == "1");
-
568 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == std::size_t(1));
-
569 }
-
570 {
-
571 // load validator list sites and keys from config
-
572 Config c;
-
573 std::string toLoad(R"rippleConfig(
-
574[validator_list_sites]
-
575ripplevalidators.com
-
576trustthesevalidators.gov
-
577
-
578[validator_list_keys]
-
579021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
580
-
581[validator_list_threshold]
-
5820
-
583)rippleConfig");
-
584 c.loadFromString(toLoad);
-
585 BEAST_EXPECT(
-
586 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
587 BEAST_EXPECT(
-
588 c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] ==
-
589 "ripplevalidators.com");
-
590 BEAST_EXPECT(
-
591 c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] ==
-
592 "trustthesevalidators.gov");
-
593 BEAST_EXPECT(
-
594 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 1);
-
595 BEAST_EXPECT(
-
596 c.section(SECTION_VALIDATOR_LIST_KEYS).values()[0] ==
-
597 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
-
598 "E566");
-
599 BEAST_EXPECT(
-
600 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
-
601 1);
-
602 BEAST_EXPECT(
-
603 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values()[0] == "0");
-
604 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == std::nullopt);
-
605 }
-
606 {
-
607 // load should throw if [validator_list_threshold] is greater than
-
608 // the number of [validator_list_keys]
-
609 Config c;
-
610 std::string toLoad(R"rippleConfig(
-
611[validator_list_sites]
-
612ripplevalidators.com
-
613trustthesevalidators.gov
-
614
-
615[validator_list_keys]
-
616021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
617
-
618[validator_list_threshold]
-
6192
-
620)rippleConfig");
-
621 std::string error;
-
622 auto const expectedError =
-
623 "Value in config section [validator_list_threshold] exceeds "
-
624 "the number of configured list keys";
-
625 try
-
626 {
-
627 c.loadFromString(toLoad);
-
628 fail();
-
629 }
-
630 catch (std::runtime_error& e)
-
631 {
-
632 error = e.what();
-
633 }
-
634 BEAST_EXPECT(error == expectedError);
-
635 }
-
636 {
-
637 // load should throw if [validator_list_threshold] is malformed
-
638 Config c;
-
639 std::string toLoad(R"rippleConfig(
-
640[validator_list_sites]
-
641ripplevalidators.com
-
642trustthesevalidators.gov
-
643
-
644[validator_list_keys]
-
645021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
646
-
647[validator_list_threshold]
-
648value = 2
-
649)rippleConfig");
-
650 std::string error;
-
651 auto const expectedError =
-
652 "Config section [validator_list_threshold] should contain "
-
653 "single value only";
-
654 try
-
655 {
-
656 c.loadFromString(toLoad);
-
657 fail();
-
658 }
-
659 catch (std::runtime_error& e)
-
660 {
-
661 error = e.what();
-
662 }
-
663 BEAST_EXPECT(error == expectedError);
-
664 }
-
665 {
-
666 // load should throw if [validator_list_threshold] is negative
-
667 Config c;
-
668 std::string toLoad(R"rippleConfig(
-
669[validator_list_sites]
-
670ripplevalidators.com
-
671trustthesevalidators.gov
-
672
-
673[validator_list_keys]
-
674021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
675
-
676[validator_list_threshold]
-
677-1
-
678)rippleConfig");
-
679 bool error = false;
-
680 try
-
681 {
-
682 c.loadFromString(toLoad);
-
683 fail();
-
684 }
-
685 catch (std::bad_cast& e)
-
686 {
-
687 error = true;
-
688 }
-
689 BEAST_EXPECT(error);
-
690 }
-
691 {
-
692 // load should throw if [validator_list_sites] is configured but
-
693 // [validator_list_keys] is not
-
694 Config c;
-
695 std::string toLoad(R"rippleConfig(
-
696[validator_list_sites]
-
697ripplevalidators.com
-
698trustthesevalidators.gov
-
699)rippleConfig");
-
700 std::string error;
-
701 auto const expectedError =
-
702 "[validator_list_keys] config section is missing";
-
703 try
-
704 {
-
705 c.loadFromString(toLoad);
-
706 fail();
-
707 }
-
708 catch (std::runtime_error& e)
-
709 {
-
710 error = e.what();
-
711 }
-
712 BEAST_EXPECT(error == expectedError);
-
713 }
-
714 {
-
715 // load from specified [validators_file] absolute path
- -
717 *this, "test_cfg", "validators.cfg");
-
718 BEAST_EXPECT(vtg.validatorsFileExists());
-
719 Config c;
-
720 boost::format cc("[validators_file]\n%1%\n");
-
721 c.loadFromString(boost::str(cc % vtg.validatorsFile()));
-
722 BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile());
-
723 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
489
+
490 void
+
+ +
492 {
+
493 testcase("validator keys");
+
494
+
495 std::string const validationSeed = "spA4sh1qTvwq92X715tYyGQKmAKfa";
+
496
+
497 auto const token =
+
498 "eyJ2YWxpZGF0aW9uX3ByaXZhdGVfa2V5IjoiOWVkNDVmODY2MjQxY2MxOGEyNzQ3Yj"
+
499 "U0Mzg3YzA2MjU5MDc5NzJmNGU3MTkwMjMxZmFhOTM3NDU3ZmE5ZGFmNiIsIm1hbmlm"
+
500 "ZXN0IjoiSkFBQUFBRnhJZTFGdHdtaW12R3RIMmlDY01KcUM5Z1ZGS2lsR2Z3MS92Q3"
+
501 "hIWFhMcGxjMkduTWhBa0UxYWdxWHhCd0R3RGJJRDZPTVNZdU0wRkRBbHBBZ05rOFNL"
+
502 "Rm43TU8yZmRrY3dSUUloQU9uZ3U5c0FLcVhZb3VKK2wyVjBXK3NBT2tWQitaUlM2UF"
+
503 "NobEpBZlVzWGZBaUJzVkpHZXNhYWRPSmMvYUFab2tTMXZ5bUdtVnJsSFBLV1gzWXl3"
+
504 "dTZpbjhIQVNRS1B1Z0JENjdrTWFSRkd2bXBBVEhsR0tKZHZERmxXUFl5NUFxRGVkRn"
+
505 "Y1VEphMncwaTIxZXEzTVl5d0xWSlpuRk9yN0Mwa3cyQWlUelNDakl6ZGl0UTg9In0"
+
506 "=";
+
507
+
508 {
+
509 Config c;
+
510 static boost::format configTemplate(R"xrpldConfig(
+
511[validation_seed]
+
512%1%
+
513
+
514[validator_token]
+
515%2%
+
516)xrpldConfig");
+
517 std::string error;
+
518 auto const expectedError =
+
519 "Cannot have both [validation_seed] "
+
520 "and [validator_token] config sections";
+
521 try
+
522 {
+ +
524 boost::str(configTemplate % validationSeed % token));
+
525 }
+
526 catch (std::runtime_error& e)
+
527 {
+
528 error = e.what();
+
529 }
+
530 BEAST_EXPECT(error == expectedError);
+
531 }
+
532 }
+
+
533
+
534 void
+
+ +
536 {
+
537 testcase("network id");
+
538 std::string error;
+
539 Config c;
+
540 try
+
541 {
+
542 c.loadFromString(R"xrpldConfig(
+
543[network_id]
+
544main
+
545)xrpldConfig");
+
546 }
+
547 catch (std::runtime_error& e)
+
548 {
+
549 error = e.what();
+
550 }
+
551
+
552 BEAST_EXPECT(error == "");
+
553 BEAST_EXPECT(c.NETWORK_ID == 0);
+
554
+
555 try
+
556 {
+
557 c.loadFromString(R"xrpldConfig(
+
558)xrpldConfig");
+
559 }
+
560 catch (std::runtime_error& e)
+
561 {
+
562 error = e.what();
+
563 }
+
564
+
565 BEAST_EXPECT(error == "");
+
566 BEAST_EXPECT(c.NETWORK_ID == 0);
+
567
+
568 try
+
569 {
+
570 c.loadFromString(R"xrpldConfig(
+
571[network_id]
+
572255
+
573)xrpldConfig");
+
574 }
+
575 catch (std::runtime_error& e)
+
576 {
+
577 error = e.what();
+
578 }
+
579
+
580 BEAST_EXPECT(error == "");
+
581 BEAST_EXPECT(c.NETWORK_ID == 255);
+
582
+
583 try
+
584 {
+
585 c.loadFromString(R"xrpldConfig(
+
586[network_id]
+
58710000
+
588)xrpldConfig");
+
589 }
+
590 catch (std::runtime_error& e)
+
591 {
+
592 error = e.what();
+
593 }
+
594
+
595 BEAST_EXPECT(error == "");
+
596 BEAST_EXPECT(c.NETWORK_ID == 10000);
+
597 }
+
+
598
+
599 void
+
+ +
601 {
+
602 testcase("validators_file");
+
603
+
604 using namespace boost::filesystem;
+
605 {
+
606 // load should throw for missing specified validators file
+
607 boost::format cc("[validators_file]\n%1%\n");
+
608 std::string error;
+
609 std::string const missingPath = "/no/way/this/path/exists";
+
610 auto const expectedError =
+
611 "The file specified in [validators_file] does not exist: " +
+
612 missingPath;
+
613 try
+
614 {
+
615 Config c;
+
616 c.loadFromString(boost::str(cc % missingPath));
+
617 }
+
618 catch (std::runtime_error& e)
+
619 {
+
620 error = e.what();
+
621 }
+
622 BEAST_EXPECT(error == expectedError);
+
623 }
+
624 {
+
625 // load should throw for invalid [validators_file]
+ +
627 *this, "test_cfg", "validators.cfg");
+
628 path const invalidFile = current_path() / vtg.subdir();
+
629 boost::format cc("[validators_file]\n%1%\n");
+
630 std::string error;
+
631 auto const expectedError =
+
632 "Invalid file specified in [validators_file]: " +
+
633 invalidFile.string();
+
634 try
+
635 {
+
636 Config c;
+
637 c.loadFromString(boost::str(cc % invalidFile.string()));
+
638 }
+
639 catch (std::runtime_error& e)
+
640 {
+
641 error = e.what();
+
642 }
+
643 BEAST_EXPECT(error == expectedError);
+
644 }
+
645 {
+
646 // load validators from config into single section
+
647 Config c;
+
648 std::string toLoad(R"xrpldConfig(
+
649[validators]
+
650n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
+
651n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
+
652n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
+
653
+
654[validator_keys]
+
655nHUhG1PgAG8H8myUENypM35JgfqXAKNQvRVVAFDRzJrny5eZN8d5
+
656nHBu9PTL9dn2GuZtdW4U2WzBwffyX9qsQCd9CNU4Z5YG3PQfViM8
+
657)xrpldConfig");
+
658 c.loadFromString(toLoad);
+
659 BEAST_EXPECT(c.legacy("validators_file").empty());
+
660 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 5);
+
661 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == std::nullopt);
+
662 }
+
663 {
+
664 // load validator list sites and keys from config
+
665 Config c;
+
666 std::string toLoad(R"xrpldConfig(
+
667[validator_list_sites]
+
668xrplvalidators.com
+
669trustthesevalidators.gov
+
670
+
671[validator_list_keys]
+
672021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
673
+
674[validator_list_threshold]
+
6751
+
676)xrpldConfig");
+
677 c.loadFromString(toLoad);
+
678 BEAST_EXPECT(
+
679 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
680 BEAST_EXPECT(
+
681 c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] ==
+
682 "xrplvalidators.com");
+
683 BEAST_EXPECT(
+
684 c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] ==
+
685 "trustthesevalidators.gov");
+
686 BEAST_EXPECT(
+
687 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 1);
+
688 BEAST_EXPECT(
+
689 c.section(SECTION_VALIDATOR_LIST_KEYS).values()[0] ==
+
690 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
+
691 "E566");
+
692 BEAST_EXPECT(
+
693 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
694 1);
+
695 BEAST_EXPECT(
+
696 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values()[0] == "1");
+
697 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == std::size_t(1));
+
698 }
+
699 {
+
700 // load validator list sites and keys from config
+
701 Config c;
+
702 std::string toLoad(R"xrpldConfig(
+
703[validator_list_sites]
+
704xrplvalidators.com
+
705trustthesevalidators.gov
+
706
+
707[validator_list_keys]
+
708021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
709
+
710[validator_list_threshold]
+
7110
+
712)xrpldConfig");
+
713 c.loadFromString(toLoad);
+
714 BEAST_EXPECT(
+
715 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
716 BEAST_EXPECT(
+
717 c.section(SECTION_VALIDATOR_LIST_SITES).values()[0] ==
+
718 "xrplvalidators.com");
+
719 BEAST_EXPECT(
+
720 c.section(SECTION_VALIDATOR_LIST_SITES).values()[1] ==
+
721 "trustthesevalidators.gov");
+
722 BEAST_EXPECT(
+
723 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 1);
724 BEAST_EXPECT(
-
725 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
726 BEAST_EXPECT(
-
727 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
725 c.section(SECTION_VALIDATOR_LIST_KEYS).values()[0] ==
+
726 "021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801"
+
727 "E566");
728 BEAST_EXPECT(
729 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
730 1);
-
731 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
-
732 }
-
733 {
-
734 // load from specified [validators_file] file name
-
735 // in config directory
-
736 std::string const valFileName = "validators.txt";
- -
738 *this, "test_cfg", valFileName);
-
739 detail::RippledCfgGuard const rcg(
-
740 *this, vtg.subdir(), "", valFileName, false);
-
741 BEAST_EXPECT(vtg.validatorsFileExists());
-
742 BEAST_EXPECT(rcg.configFileExists());
-
743 auto const& c(rcg.config());
-
744 BEAST_EXPECT(c.legacy("validators_file") == valFileName);
-
745 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
746 BEAST_EXPECT(
-
747 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
748 BEAST_EXPECT(
-
749 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
750 BEAST_EXPECT(
-
751 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
-
752 1);
-
753 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
-
754 }
-
755 {
-
756 // load from specified [validators_file] relative path
-
757 // to config directory
- -
759 *this, "test_cfg", "validators.txt");
-
760 auto const valFilePath = ".." / vtg.subdir() / "validators.txt";
-
761 detail::RippledCfgGuard const rcg(
-
762 *this, vtg.subdir(), "", valFilePath, false);
-
763 BEAST_EXPECT(vtg.validatorsFileExists());
-
764 BEAST_EXPECT(rcg.configFileExists());
-
765 auto const& c(rcg.config());
-
766 BEAST_EXPECT(c.legacy("validators_file") == valFilePath);
-
767 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
768 BEAST_EXPECT(
-
769 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
770 BEAST_EXPECT(
-
771 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
772 BEAST_EXPECT(
-
773 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
-
774 1);
-
775 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
-
776 }
-
777 {
-
778 // load from validators file in default location
- -
780 *this, "test_cfg", "validators.txt");
-
781 detail::RippledCfgGuard const rcg(
-
782 *this, vtg.subdir(), "", "", false);
-
783 BEAST_EXPECT(vtg.validatorsFileExists());
-
784 BEAST_EXPECT(rcg.configFileExists());
-
785 auto const& c(rcg.config());
-
786 BEAST_EXPECT(c.legacy("validators_file").empty());
-
787 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
788 BEAST_EXPECT(
-
789 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
790 BEAST_EXPECT(
-
791 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
792 BEAST_EXPECT(
-
793 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
-
794 1);
-
795 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
-
796 }
-
797 {
-
798 // load from specified [validators_file] instead
-
799 // of default location
- -
801 *this, "test_cfg", "validators.cfg");
-
802 BEAST_EXPECT(vtg.validatorsFileExists());
-
803 detail::ValidatorsTxtGuard const vtgDefault(
-
804 *this, vtg.subdir(), "validators.txt", false);
-
805 BEAST_EXPECT(vtgDefault.validatorsFileExists());
-
806 detail::RippledCfgGuard const rcg(
-
807 *this, vtg.subdir(), "", vtg.validatorsFile(), false);
-
808 BEAST_EXPECT(rcg.configFileExists());
-
809 auto const& c(rcg.config());
-
810 BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile());
-
811 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
-
812 BEAST_EXPECT(
-
813 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
-
814 BEAST_EXPECT(
-
815 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
-
816 BEAST_EXPECT(
-
817 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
-
818 1);
-
819 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
-
820 }
-
821
-
822 {
-
823 // load validators from both config and validators file
-
824 boost::format cc(R"rippleConfig(
-
825[validators_file]
-
826%1%
-
827
-
828[validators]
-
829n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
-
830n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
-
831n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
-
832n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
-
833n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
-
834
-
835[validator_keys]
-
836nHB1X37qrniVugfQcuBTAjswphC1drx7QjFFojJPZwKHHnt8kU7v
-
837nHUkAWDR4cB8AgPg7VXMX6et8xRTQb2KJfgv1aBEXozwrawRKgMB
-
838
-
839[validator_list_sites]
-
840ripplevalidators.com
-
841trustthesevalidators.gov
-
842
-
843[validator_list_keys]
-
844021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
-
845)rippleConfig");
- -
847 *this, "test_cfg", "validators.cfg");
-
848 BEAST_EXPECT(vtg.validatorsFileExists());
-
849 Config c;
+
731 BEAST_EXPECT(
+
732 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values()[0] == "0");
+
733 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == std::nullopt);
+
734 }
+
735 {
+
736 // load should throw if [validator_list_threshold] is greater than
+
737 // the number of [validator_list_keys]
+
738 Config c;
+
739 std::string toLoad(R"xrpldConfig(
+
740[validator_list_sites]
+
741xrplvalidators.com
+
742trustthesevalidators.gov
+
743
+
744[validator_list_keys]
+
745021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
746
+
747[validator_list_threshold]
+
7482
+
749)xrpldConfig");
+
750 std::string error;
+
751 auto const expectedError =
+
752 "Value in config section [validator_list_threshold] exceeds "
+
753 "the number of configured list keys";
+
754 try
+
755 {
+
756 c.loadFromString(toLoad);
+
757 fail();
+
758 }
+
759 catch (std::runtime_error& e)
+
760 {
+
761 error = e.what();
+
762 }
+
763 BEAST_EXPECT(error == expectedError);
+
764 }
+
765 {
+
766 // load should throw if [validator_list_threshold] is malformed
+
767 Config c;
+
768 std::string toLoad(R"xrpldConfig(
+
769[validator_list_sites]
+
770xrplvalidators.com
+
771trustthesevalidators.gov
+
772
+
773[validator_list_keys]
+
774021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
775
+
776[validator_list_threshold]
+
777value = 2
+
778)xrpldConfig");
+
779 std::string error;
+
780 auto const expectedError =
+
781 "Config section [validator_list_threshold] should contain "
+
782 "single value only";
+
783 try
+
784 {
+
785 c.loadFromString(toLoad);
+
786 fail();
+
787 }
+
788 catch (std::runtime_error& e)
+
789 {
+
790 error = e.what();
+
791 }
+
792 BEAST_EXPECT(error == expectedError);
+
793 }
+
794 {
+
795 // load should throw if [validator_list_threshold] is negative
+
796 Config c;
+
797 std::string toLoad(R"xrpldConfig(
+
798[validator_list_sites]
+
799xrplvalidators.com
+
800trustthesevalidators.gov
+
801
+
802[validator_list_keys]
+
803021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
804
+
805[validator_list_threshold]
+
806-1
+
807)xrpldConfig");
+
808 bool error = false;
+
809 try
+
810 {
+
811 c.loadFromString(toLoad);
+
812 fail();
+
813 }
+
814 catch (std::bad_cast& e)
+
815 {
+
816 error = true;
+
817 }
+
818 BEAST_EXPECT(error);
+
819 }
+
820 {
+
821 // load should throw if [validator_list_sites] is configured but
+
822 // [validator_list_keys] is not
+
823 Config c;
+
824 std::string toLoad(R"xrpldConfig(
+
825[validator_list_sites]
+
826xrplvalidators.com
+
827trustthesevalidators.gov
+
828)xrpldConfig");
+
829 std::string error;
+
830 auto const expectedError =
+
831 "[validator_list_keys] config section is missing";
+
832 try
+
833 {
+
834 c.loadFromString(toLoad);
+
835 fail();
+
836 }
+
837 catch (std::runtime_error& e)
+
838 {
+
839 error = e.what();
+
840 }
+
841 BEAST_EXPECT(error == expectedError);
+
842 }
+
843 {
+
844 // load from specified [validators_file] absolute path
+ +
846 *this, "test_cfg", "validators.cfg");
+
847 BEAST_EXPECT(vtg.validatorsFileExists());
+
848 Config c;
+
849 boost::format cc("[validators_file]\n%1%\n");
850 c.loadFromString(boost::str(cc % vtg.validatorsFile()));
851 BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile());
-
852 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 15);
+
852 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
853 BEAST_EXPECT(
-
854 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 4);
+
854 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
855 BEAST_EXPECT(
-
856 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 3);
+
856 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
857 BEAST_EXPECT(
858 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
859 1);
860 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
861 }
862 {
-
863 // load should throw if [validator_list_threshold] is present both
-
864 // in rippled cfg and validators file
-
865 boost::format cc(R"rippleConfig(
-
866[validators_file]
-
867%1%
-
868
-
869[validator_list_threshold]
-
8701
-
871)rippleConfig");
-
872 std::string error;
- -
874 *this, "test_cfg", "validators.cfg");
+
863 // load from specified [validators_file] file name
+
864 // in config directory
+
865 std::string const valFileName = "validators.txt";
+ +
867 *this, "test_cfg", valFileName);
+
868 detail::FileCfgGuard const rcg(
+
869 *this,
+
870 vtg.subdir(),
+
871 "",
+ +
873 valFileName,
+
874 false);
875 BEAST_EXPECT(vtg.validatorsFileExists());
-
876 auto const expectedError =
-
877 "Config section [validator_list_threshold] should contain "
-
878 "single value only";
-
879 try
-
880 {
-
881 Config c;
-
882 c.loadFromString(boost::str(cc % vtg.validatorsFile()));
-
883 fail();
-
884 }
-
885 catch (std::runtime_error& e)
-
886 {
-
887 error = e.what();
-
888 }
-
889 BEAST_EXPECT(error == expectedError);
-
890 }
-
891 {
-
892 // load should throw if [validators], [validator_keys] and
-
893 // [validator_list_keys] are missing from rippled cfg and
-
894 // validators file
-
895 Config c;
-
896 boost::format cc("[validators_file]\n%1%\n");
-
897 std::string error;
- -
899 *this, "test_cfg", "validators.cfg");
-
900 BEAST_EXPECT(vtg.validatorsFileExists());
-
901 auto const expectedError =
-
902 "The file specified in [validators_file] does not contain a "
-
903 "[validators], [validator_keys] or [validator_list_keys] "
-
904 "section: " +
-
905 vtg.validatorsFile();
- -
907 try
-
908 {
-
909 Config c2;
-
910 c2.loadFromString(boost::str(cc % vtg.validatorsFile()));
-
911 }
-
912 catch (std::runtime_error& e)
-
913 {
-
914 error = e.what();
-
915 }
-
916 BEAST_EXPECT(error == expectedError);
-
917 }
-
918 }
+
876 BEAST_EXPECT(rcg.configFileExists());
+
877 auto const& c(rcg.config());
+
878 BEAST_EXPECT(c.legacy("validators_file") == valFileName);
+
879 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
880 BEAST_EXPECT(
+
881 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
882 BEAST_EXPECT(
+
883 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
884 BEAST_EXPECT(
+
885 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
886 1);
+
887 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
888 }
+
889 {
+
890 // load from specified [validators_file] relative path
+
891 // to config directory
+ +
893 *this, "test_cfg", "validators.txt");
+
894 auto const valFilePath = ".." / vtg.subdir() / "validators.txt";
+
895 detail::FileCfgGuard const rcg(
+
896 *this,
+
897 vtg.subdir(),
+
898 "",
+ +
900 valFilePath,
+
901 false);
+
902 BEAST_EXPECT(vtg.validatorsFileExists());
+
903 BEAST_EXPECT(rcg.configFileExists());
+
904 auto const& c(rcg.config());
+
905 BEAST_EXPECT(c.legacy("validators_file") == valFilePath);
+
906 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
907 BEAST_EXPECT(
+
908 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
909 BEAST_EXPECT(
+
910 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
911 BEAST_EXPECT(
+
912 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
913 1);
+
914 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
915 }
+
916 {
+
917 // load from validators file in default location
+ +
919 *this, "test_cfg", "validators.txt");
+
920 detail::FileCfgGuard const rcg(
+
921 *this, vtg.subdir(), "", Config::configFileName, "", false);
+
922 BEAST_EXPECT(vtg.validatorsFileExists());
+
923 BEAST_EXPECT(rcg.configFileExists());
+
924 auto const& c(rcg.config());
+
925 BEAST_EXPECT(c.legacy("validators_file").empty());
+
926 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
927 BEAST_EXPECT(
+
928 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
929 BEAST_EXPECT(
+
930 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
931 BEAST_EXPECT(
+
932 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
933 1);
+
934 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
935 }
+
936 {
+
937 // load from specified [validators_file] instead
+
938 // of default location
+ +
940 *this, "test_cfg", "validators.cfg");
+
941 BEAST_EXPECT(vtg.validatorsFileExists());
+
942 detail::ValidatorsTxtGuard const vtgDefault(
+
943 *this, vtg.subdir(), "validators.txt", false);
+
944 BEAST_EXPECT(vtgDefault.validatorsFileExists());
+
945 detail::FileCfgGuard const rcg(
+
946 *this,
+
947 vtg.subdir(),
+
948 "",
+ +
950 vtg.validatorsFile(),
+
951 false);
+
952 BEAST_EXPECT(rcg.configFileExists());
+
953 auto const& c(rcg.config());
+
954 BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile());
+
955 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 8);
+
956 BEAST_EXPECT(
+
957 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 2);
+
958 BEAST_EXPECT(
+
959 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 2);
+
960 BEAST_EXPECT(
+
961 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
962 1);
+
963 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
964 }
+
965
+
966 {
+
967 // load validators from both config and validators file
+
968 boost::format cc(R"xrpldConfig(
+
969[validators_file]
+
970%1%
+
971
+
972[validators]
+
973n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7
+
974n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj
+
975n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C
+
976n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS
+
977n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA
+
978
+
979[validator_keys]
+
980nHB1X37qrniVugfQcuBTAjswphC1drx7QjFFojJPZwKHHnt8kU7v
+
981nHUkAWDR4cB8AgPg7VXMX6et8xRTQb2KJfgv1aBEXozwrawRKgMB
+
982
+
983[validator_list_sites]
+
984xrplvalidators.com
+
985trustthesevalidators.gov
+
986
+
987[validator_list_keys]
+
988021A99A537FDEBC34E4FCA03B39BEADD04299BB19E85097EC92B15A3518801E566
+
989)xrpldConfig");
+ +
991 *this, "test_cfg", "validators.cfg");
+
992 BEAST_EXPECT(vtg.validatorsFileExists());
+
993 Config c;
+
994 c.loadFromString(boost::str(cc % vtg.validatorsFile()));
+
995 BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile());
+
996 BEAST_EXPECT(c.section(SECTION_VALIDATORS).values().size() == 15);
+
997 BEAST_EXPECT(
+
998 c.section(SECTION_VALIDATOR_LIST_SITES).values().size() == 4);
+
999 BEAST_EXPECT(
+
1000 c.section(SECTION_VALIDATOR_LIST_KEYS).values().size() == 3);
+
1001 BEAST_EXPECT(
+
1002 c.section(SECTION_VALIDATOR_LIST_THRESHOLD).values().size() ==
+
1003 1);
+
1004 BEAST_EXPECT(c.VALIDATOR_LIST_THRESHOLD == 2);
+
1005 }
+
1006 {
+
1007 // load should throw if [validator_list_threshold] is present both
+
1008 // in xrpld.cfg and validators file
+
1009 boost::format cc(R"xrpldConfig(
+
1010[validators_file]
+
1011%1%
+
1012
+
1013[validator_list_threshold]
+
10141
+
1015)xrpldConfig");
+
1016 std::string error;
+ +
1018 *this, "test_cfg", "validators.cfg");
+
1019 BEAST_EXPECT(vtg.validatorsFileExists());
+
1020 auto const expectedError =
+
1021 "Config section [validator_list_threshold] should contain "
+
1022 "single value only";
+
1023 try
+
1024 {
+
1025 Config c;
+
1026 c.loadFromString(boost::str(cc % vtg.validatorsFile()));
+
1027 fail();
+
1028 }
+
1029 catch (std::runtime_error& e)
+
1030 {
+
1031 error = e.what();
+
1032 }
+
1033 BEAST_EXPECT(error == expectedError);
+
1034 }
+
1035 {
+
1036 // load should throw if [validators], [validator_keys] and
+
1037 // [validator_list_keys] are missing from xrpld.cfg and
+
1038 // validators file
+
1039 Config c;
+
1040 boost::format cc("[validators_file]\n%1%\n");
+
1041 std::string error;
+ +
1043 *this, "test_cfg", "validators.cfg");
+
1044 BEAST_EXPECT(vtg.validatorsFileExists());
+
1045 auto const expectedError =
+
1046 "The file specified in [validators_file] does not contain a "
+
1047 "[validators], [validator_keys] or [validator_list_keys] "
+
1048 "section: " +
+
1049 vtg.validatorsFile();
+ +
1051 try
+
1052 {
+
1053 Config c2;
+
1054 c2.loadFromString(boost::str(cc % vtg.validatorsFile()));
+
1055 }
+
1056 catch (std::runtime_error& e)
+
1057 {
+
1058 error = e.what();
+
1059 }
+
1060 BEAST_EXPECT(error == expectedError);
+
1061 }
+
1062 }
-
919
-
920 void
-
-
921 testSetup(bool explicitPath)
-
922 {
-
923 detail::RippledCfgGuard const cfg(
-
924 *this, "testSetup", explicitPath ? "test_db" : "", "");
-
925 /* RippledCfgGuard has a Config object that gets loaded on
-
926 construction, but Config::setup is not reentrant, so we
-
927 need a fresh config for every test case, so ignore it.
-
928 */
-
929 {
-
930 Config config;
-
931 config.setup(
-
932 cfg.configFile(),
-
933 /*bQuiet*/ false,
-
934 /* bSilent */ false,
-
935 /* bStandalone */ false);
-
936 BEAST_EXPECT(!config.quiet());
-
937 BEAST_EXPECT(!config.silent());
-
938 BEAST_EXPECT(!config.standalone());
-
939 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
-
940 BEAST_EXPECT(!config.legacy("database_path").empty());
-
941 }
-
942 {
-
943 Config config;
-
944 config.setup(
-
945 cfg.configFile(),
-
946 /*bQuiet*/ true,
-
947 /* bSilent */ false,
-
948 /* bStandalone */ false);
-
949 BEAST_EXPECT(config.quiet());
-
950 BEAST_EXPECT(!config.silent());
-
951 BEAST_EXPECT(!config.standalone());
-
952 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
-
953 BEAST_EXPECT(!config.legacy("database_path").empty());
-
954 }
-
955 {
-
956 Config config;
-
957 config.setup(
-
958 cfg.configFile(),
-
959 /*bQuiet*/ false,
-
960 /* bSilent */ true,
-
961 /* bStandalone */ false);
-
962 BEAST_EXPECT(config.quiet());
-
963 BEAST_EXPECT(config.silent());
-
964 BEAST_EXPECT(!config.standalone());
-
965 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
-
966 BEAST_EXPECT(!config.legacy("database_path").empty());
-
967 }
-
968 {
-
969 Config config;
-
970 config.setup(
-
971 cfg.configFile(),
-
972 /*bQuiet*/ true,
-
973 /* bSilent */ true,
-
974 /* bStandalone */ false);
-
975 BEAST_EXPECT(config.quiet());
-
976 BEAST_EXPECT(config.silent());
-
977 BEAST_EXPECT(!config.standalone());
-
978 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
-
979 BEAST_EXPECT(!config.legacy("database_path").empty());
-
980 }
-
981 {
-
982 Config config;
-
983 config.setup(
-
984 cfg.configFile(),
-
985 /*bQuiet*/ false,
-
986 /* bSilent */ false,
-
987 /* bStandalone */ true);
-
988 BEAST_EXPECT(!config.quiet());
-
989 BEAST_EXPECT(!config.silent());
-
990 BEAST_EXPECT(config.standalone());
-
991 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
-
992 BEAST_EXPECT(
-
993 config.legacy("database_path").empty() == !explicitPath);
-
994 }
-
995 {
-
996 Config config;
-
997 config.setup(
-
998 cfg.configFile(),
-
999 /*bQuiet*/ true,
-
1000 /* bSilent */ false,
-
1001 /* bStandalone */ true);
-
1002 BEAST_EXPECT(config.quiet());
-
1003 BEAST_EXPECT(!config.silent());
-
1004 BEAST_EXPECT(config.standalone());
-
1005 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
-
1006 BEAST_EXPECT(
-
1007 config.legacy("database_path").empty() == !explicitPath);
-
1008 }
-
1009 {
-
1010 Config config;
-
1011 config.setup(
-
1012 cfg.configFile(),
-
1013 /*bQuiet*/ false,
-
1014 /* bSilent */ true,
-
1015 /* bStandalone */ true);
-
1016 BEAST_EXPECT(config.quiet());
-
1017 BEAST_EXPECT(config.silent());
-
1018 BEAST_EXPECT(config.standalone());
-
1019 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
-
1020 BEAST_EXPECT(
-
1021 config.legacy("database_path").empty() == !explicitPath);
-
1022 }
-
1023 {
-
1024 Config config;
-
1025 config.setup(
-
1026 cfg.configFile(),
-
1027 /*bQuiet*/ true,
-
1028 /* bSilent */ true,
-
1029 /* bStandalone */ true);
-
1030 BEAST_EXPECT(config.quiet());
-
1031 BEAST_EXPECT(config.silent());
-
1032 BEAST_EXPECT(config.standalone());
-
1033 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
-
1034 BEAST_EXPECT(
-
1035 config.legacy("database_path").empty() == !explicitPath);
-
1036 }
-
1037 }
+
1063
+
1064 void
+
+
1065 testSetup(bool explicitPath)
+
1066 {
+
1067 detail::FileCfgGuard const cfg(
+
1068 *this,
+
1069 "testSetup",
+
1070 explicitPath ? "test_db" : "",
+ +
1072 "");
+
1073 /* FileCfgGuard has a Config object that gets loaded on
+
1074 construction, but Config::setup is not reentrant, so we
+
1075 need a fresh config for every test case, so ignore it.
+
1076 */
+
1077 {
+
1078 Config config;
+
1079 config.setup(
+
1080 cfg.configFile(),
+
1081 /*bQuiet*/ false,
+
1082 /* bSilent */ false,
+
1083 /* bStandalone */ false);
+
1084 BEAST_EXPECT(!config.quiet());
+
1085 BEAST_EXPECT(!config.silent());
+
1086 BEAST_EXPECT(!config.standalone());
+
1087 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
+
1088 BEAST_EXPECT(!config.legacy("database_path").empty());
+
1089 }
+
1090 {
+
1091 Config config;
+
1092 config.setup(
+
1093 cfg.configFile(),
+
1094 /*bQuiet*/ true,
+
1095 /* bSilent */ false,
+
1096 /* bStandalone */ false);
+
1097 BEAST_EXPECT(config.quiet());
+
1098 BEAST_EXPECT(!config.silent());
+
1099 BEAST_EXPECT(!config.standalone());
+
1100 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
+
1101 BEAST_EXPECT(!config.legacy("database_path").empty());
+
1102 }
+
1103 {
+
1104 Config config;
+
1105 config.setup(
+
1106 cfg.configFile(),
+
1107 /*bQuiet*/ false,
+
1108 /* bSilent */ true,
+
1109 /* bStandalone */ false);
+
1110 BEAST_EXPECT(config.quiet());
+
1111 BEAST_EXPECT(config.silent());
+
1112 BEAST_EXPECT(!config.standalone());
+
1113 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
+
1114 BEAST_EXPECT(!config.legacy("database_path").empty());
+
1115 }
+
1116 {
+
1117 Config config;
+
1118 config.setup(
+
1119 cfg.configFile(),
+
1120 /*bQuiet*/ true,
+
1121 /* bSilent */ true,
+
1122 /* bStandalone */ false);
+
1123 BEAST_EXPECT(config.quiet());
+
1124 BEAST_EXPECT(config.silent());
+
1125 BEAST_EXPECT(!config.standalone());
+
1126 BEAST_EXPECT(config.LEDGER_HISTORY == 256);
+
1127 BEAST_EXPECT(!config.legacy("database_path").empty());
+
1128 }
+
1129 {
+
1130 Config config;
+
1131 config.setup(
+
1132 cfg.configFile(),
+
1133 /*bQuiet*/ false,
+
1134 /* bSilent */ false,
+
1135 /* bStandalone */ true);
+
1136 BEAST_EXPECT(!config.quiet());
+
1137 BEAST_EXPECT(!config.silent());
+
1138 BEAST_EXPECT(config.standalone());
+
1139 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
+
1140 BEAST_EXPECT(
+
1141 config.legacy("database_path").empty() == !explicitPath);
+
1142 }
+
1143 {
+
1144 Config config;
+
1145 config.setup(
+
1146 cfg.configFile(),
+
1147 /*bQuiet*/ true,
+
1148 /* bSilent */ false,
+
1149 /* bStandalone */ true);
+
1150 BEAST_EXPECT(config.quiet());
+
1151 BEAST_EXPECT(!config.silent());
+
1152 BEAST_EXPECT(config.standalone());
+
1153 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
+
1154 BEAST_EXPECT(
+
1155 config.legacy("database_path").empty() == !explicitPath);
+
1156 }
+
1157 {
+
1158 Config config;
+
1159 config.setup(
+
1160 cfg.configFile(),
+
1161 /*bQuiet*/ false,
+
1162 /* bSilent */ true,
+
1163 /* bStandalone */ true);
+
1164 BEAST_EXPECT(config.quiet());
+
1165 BEAST_EXPECT(config.silent());
+
1166 BEAST_EXPECT(config.standalone());
+
1167 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
+
1168 BEAST_EXPECT(
+
1169 config.legacy("database_path").empty() == !explicitPath);
+
1170 }
+
1171 {
+
1172 Config config;
+
1173 config.setup(
+
1174 cfg.configFile(),
+
1175 /*bQuiet*/ true,
+
1176 /* bSilent */ true,
+
1177 /* bStandalone */ true);
+
1178 BEAST_EXPECT(config.quiet());
+
1179 BEAST_EXPECT(config.silent());
+
1180 BEAST_EXPECT(config.standalone());
+
1181 BEAST_EXPECT(config.LEDGER_HISTORY == 0);
+
1182 BEAST_EXPECT(
+
1183 config.legacy("database_path").empty() == !explicitPath);
+
1184 }
+
1185 }
-
1038
-
1039 void
-
- -
1041 {
-
1042 detail::RippledCfgGuard const cfg(*this, "testPort", "", "");
-
1043 auto const& conf = cfg.config();
-
1044 if (!BEAST_EXPECT(conf.exists("port_rpc")))
-
1045 return;
-
1046 if (!BEAST_EXPECT(conf.exists("port_wss_admin")))
-
1047 return;
-
1048 ParsedPort rpc;
-
1049 if (!unexcept([&]() { parse_Port(rpc, conf["port_rpc"], log); }))
-
1050 return;
-
1051 BEAST_EXPECT(rpc.admin_nets_v4.size() + rpc.admin_nets_v6.size() == 2);
-
1052 ParsedPort wss;
-
1053 if (!unexcept([&]() { parse_Port(wss, conf["port_wss_admin"], log); }))
-
1054 return;
-
1055 BEAST_EXPECT(wss.admin_nets_v4.size() + wss.admin_nets_v6.size() == 1);
-
1056 }
+
1186
+
1187 void
+
+ +
1189 {
+
1190 detail::FileCfgGuard const cfg(
+
1191 *this, "testPort", "", Config::configFileName, "");
+
1192 auto const& conf = cfg.config();
+
1193 if (!BEAST_EXPECT(conf.exists("port_rpc")))
+
1194 return;
+
1195 if (!BEAST_EXPECT(conf.exists("port_wss_admin")))
+
1196 return;
+
1197 ParsedPort rpc;
+
1198 if (!unexcept([&]() { parse_Port(rpc, conf["port_rpc"], log); }))
+
1199 return;
+
1200 BEAST_EXPECT(rpc.admin_nets_v4.size() + rpc.admin_nets_v6.size() == 2);
+
1201 ParsedPort wss;
+
1202 if (!unexcept([&]() { parse_Port(wss, conf["port_wss_admin"], log); }))
+
1203 return;
+
1204 BEAST_EXPECT(wss.admin_nets_v4.size() + wss.admin_nets_v6.size() == 1);
+
1205 }
-
1057
-
1058 void
-
- -
1060 {
-
1061 auto const contents = std::regex_replace(
-
1062 detail::configContents("", ""),
-
1063 std::regex("port\\s*=\\s*\\d+"),
-
1064 "port = 0");
-
1065
-
1066 try
-
1067 {
-
1068 detail::RippledCfgGuard const cfg(
-
1069 *this, "testPort", "", "", true, contents);
-
1070 BEAST_EXPECT(false);
-
1071 }
-
1072 catch (std::exception const& ex)
-
1073 {
-
1074 BEAST_EXPECT(std::string_view(ex.what()).starts_with(
-
1075 "Invalid value '0' for key 'port'"));
-
1076 }
-
1077 }
+
1206
+
1207 void
+
+ +
1209 {
+
1210 auto const contents = std::regex_replace(
+
1211 detail::configContents("", ""),
+
1212 std::regex("port\\s*=\\s*\\d+"),
+
1213 "port = 0");
+
1214
+
1215 try
+
1216 {
+
1217 detail::FileCfgGuard const cfg(
+
1218 *this,
+
1219 "testPort",
+
1220 "",
+ +
1222 "",
+
1223 true,
+
1224 contents);
+
1225 BEAST_EXPECT(false);
+
1226 }
+
1227 catch (std::exception const& ex)
+
1228 {
+
1229 BEAST_EXPECT(std::string_view(ex.what()).starts_with(
+
1230 "Invalid value '0' for key 'port'"));
+
1231 }
+
1232 }
-
1078
-
1079 void
-
- -
1081 {
-
1082 Config cfg;
-
1083 /* NOTE: this string includes some explicit
-
1084 * space chars in order to verify proper trimming */
-
1085 std::string toLoad(R"(
-
1086[port_rpc])"
-
1087 "\x20"
-
1088 R"(
-
1089# comment
-
1090 # indented comment
-
1091)"
-
1092 "\x20\x20"
-
1093 R"(
-
1094[ips])"
-
1095 "\x20"
-
1096 R"(
-
1097r.ripple.com 51235
-
1098
-
1099 [ips_fixed])"
-
1100 "\x20\x20"
-
1101 R"(
-
1102 # COMMENT
-
1103 s1.ripple.com 51235
-
1104 s2.ripple.com 51235
-
1105
-
1106)");
-
1107 cfg.loadFromString(toLoad);
+
1233
+
1234 void
+
+ +
1236 {
+
1237 Config cfg;
+
1238 /* NOTE: this string includes some explicit
+
1239 * space chars in order to verify proper trimming */
+
1240 std::string toLoad(R"(
+
1241[port_rpc])"
+
1242 "\x20"
+
1243 R"(
+
1244# comment
+
1245 # indented comment
+
1246)"
+
1247 "\x20\x20"
+
1248 R"(
+
1249[ips])"
+
1250 "\x20"
+
1251 R"(
+
1252r.ripple.com 51235
+
1253
+
1254 [ips_fixed])"
+
1255 "\x20\x20"
+
1256 R"(
+
1257 # COMMENT
+
1258 s1.ripple.com 51235
+
1259 s2.ripple.com 51235
+
1260
+
1261)");
+
1262 cfg.loadFromString(toLoad);
-
1108 BEAST_EXPECT(
-
1109 cfg.exists("port_rpc") && cfg.section("port_rpc").lines().empty() &&
-
-
1110 cfg.section("port_rpc").values().empty());
-
1111 BEAST_EXPECT(
-
1112 cfg.exists(SECTION_IPS) &&
-
1113 cfg.section(SECTION_IPS).lines().size() == 1 &&
-
1114 cfg.section(SECTION_IPS).values().size() == 1);
-
1115 BEAST_EXPECT(
-
1116 cfg.exists(SECTION_IPS_FIXED) &&
-
1117 cfg.section(SECTION_IPS_FIXED).lines().size() == 2 &&
-
1118 cfg.section(SECTION_IPS_FIXED).values().size() == 2);
-
1119 }
-
1120
-
1121 void
-
1122 testColons()
-
1123 {
-
1124 Config cfg;
-
1125 /* NOTE: this string includes some explicit
-
1126 * space chars in order to verify proper trimming */
-
1127 std::string toLoad(R"(
-
1128[port_rpc])"
-
1129 "\x20"
-
1130 R"(
-
1131# comment
-
1132 # indented comment
-
1133)"
-
1134 "\x20\x20"
-
1135 R"(
-
1136[ips])"
-
1137 "\x20"
-
1138 R"(
-
1139r.ripple.com:51235
-
1140
-
1141 [ips_fixed])"
-
1142 "\x20\x20"
-
1143 R"(
-
1144 # COMMENT
-
1145 s1.ripple.com:51235
-
1146 s2.ripple.com 51235
-
1147 anotherserversansport
-
1148 anotherserverwithport:12
-
1149 1.1.1.1:1
-
1150 1.1.1.1 1
-
1151 12.34.12.123:12345
-
1152 12.34.12.123 12345
-
1153 ::
-
1154 2001:db8::
-
1155 ::1
-
1156 ::1:12345
-
1157 [::1]:12345
-
1158 2001:db8:3333:4444:5555:6666:7777:8888:12345
-
1159 [2001:db8:3333:4444:5555:6666:7777:8888]:1
+
1263 BEAST_EXPECT(
+
1264 cfg.exists("port_rpc") && cfg.section("port_rpc").lines().empty() &&
+
+
1265 cfg.section("port_rpc").values().empty());
+
1266 BEAST_EXPECT(
+
1267 cfg.exists(SECTION_IPS) &&
+
1268 cfg.section(SECTION_IPS).lines().size() == 1 &&
+
1269 cfg.section(SECTION_IPS).values().size() == 1);
+
1270 BEAST_EXPECT(
+
1271 cfg.exists(SECTION_IPS_FIXED) &&
+
1272 cfg.section(SECTION_IPS_FIXED).lines().size() == 2 &&
+
1273 cfg.section(SECTION_IPS_FIXED).values().size() == 2);
+
1274 }
+
1275
+
1276 void
+
1277 testColons()
+
1278 {
+
1279 Config cfg;
+
1280 /* NOTE: this string includes some explicit
+
1281 * space chars in order to verify proper trimming */
+
1282 std::string toLoad(R"(
+
1283[port_rpc])"
+
1284 "\x20"
+
1285 R"(
+
1286# comment
+
1287 # indented comment
+
1288)"
+
1289 "\x20\x20"
+
1290 R"(
+
1291[ips])"
+
1292 "\x20"
+
1293 R"(
+
1294r.ripple.com:51235
+
1295
+
1296 [ips_fixed])"
+
1297 "\x20\x20"
+
1298 R"(
+
1299 # COMMENT
+
1300 s1.ripple.com:51235
+
1301 s2.ripple.com 51235
+
1302 anotherserversansport
+
1303 anotherserverwithport:12
+
1304 1.1.1.1:1
+
1305 1.1.1.1 1
+
1306 12.34.12.123:12345
+
1307 12.34.12.123 12345
+
1308 ::
+
1309 2001:db8::
+
1310 ::1
+
1311 ::1:12345
+
1312 [::1]:12345
+
1313 2001:db8:3333:4444:5555:6666:7777:8888:12345
+
1314 [2001:db8:3333:4444:5555:6666:7777:8888]:1
-
1160
-
1161
-
-
1162)");
-
1163 cfg.loadFromString(toLoad);
-
1164 BEAST_EXPECT(
-
1165 cfg.exists("port_rpc") && cfg.section("port_rpc").lines().empty() &&
-
1166 cfg.section("port_rpc").values().empty());
-
1167 BEAST_EXPECT(
-
1168 cfg.exists(SECTION_IPS) &&
-
1169 cfg.section(SECTION_IPS).lines().size() == 1 &&
-
1170 cfg.section(SECTION_IPS).values().size() == 1);
-
1171 BEAST_EXPECT(
-
1172 cfg.exists(SECTION_IPS_FIXED) &&
-
1173 cfg.section(SECTION_IPS_FIXED).lines().size() == 15 &&
-
1174 cfg.section(SECTION_IPS_FIXED).values().size() == 15);
-
1175 BEAST_EXPECT(cfg.IPS[0] == "r.ripple.com 51235");
-
1176
-
1177 BEAST_EXPECT(cfg.IPS_FIXED[0] == "s1.ripple.com 51235");
-
1178 BEAST_EXPECT(cfg.IPS_FIXED[1] == "s2.ripple.com 51235");
-
1179 BEAST_EXPECT(cfg.IPS_FIXED[2] == "anotherserversansport");
-
1180 BEAST_EXPECT(cfg.IPS_FIXED[3] == "anotherserverwithport 12");
-
1181 BEAST_EXPECT(cfg.IPS_FIXED[4] == "1.1.1.1 1");
-
1182 BEAST_EXPECT(cfg.IPS_FIXED[5] == "1.1.1.1 1");
-
1183 BEAST_EXPECT(cfg.IPS_FIXED[6] == "12.34.12.123 12345");
-
1184 BEAST_EXPECT(cfg.IPS_FIXED[7] == "12.34.12.123 12345");
-
1185
-
1186 // all ipv6 should be ignored by colon replacer, howsoever formatted
-
1187 BEAST_EXPECT(cfg.IPS_FIXED[8] == "::");
-
1188 BEAST_EXPECT(cfg.IPS_FIXED[9] == "2001:db8::");
-
1189 BEAST_EXPECT(cfg.IPS_FIXED[10] == "::1");
-
1190 BEAST_EXPECT(cfg.IPS_FIXED[11] == "::1:12345");
-
1191 BEAST_EXPECT(cfg.IPS_FIXED[12] == "[::1]:12345");
-
1192 BEAST_EXPECT(
-
1193 cfg.IPS_FIXED[13] ==
-
1194 "2001:db8:3333:4444:5555:6666:7777:8888:12345");
-
1195 BEAST_EXPECT(
-
1196 cfg.IPS_FIXED[14] == "[2001:db8:3333:4444:5555:6666:7777:8888]:1");
-
1197 }
-
1198
-
1199 void
-
1200 testComments()
-
1201 {
-
1202 struct TestCommentData
-
1203 {
-
1204 std::string_view line;
-
1205 std::string_view field;
-
1206 std::string_view expect;
-
1207 bool had_comment;
-
1208 };
-
1209
- -
1211 {{"password = aaaa\\#bbbb", "password", "aaaa#bbbb", false},
-
1212 {"password = aaaa#bbbb", "password", "aaaa", true},
-
1213 {"password = aaaa #bbbb", "password", "aaaa", true},
-
1214 // since the value is all comment, this doesn't parse as k=v :
-
1215 {"password = #aaaa #bbbb", "", "password =", true},
-
1216 {"password = aaaa\\# #bbbb", "password", "aaaa#", true},
-
1217 {"password = aaaa\\##bbbb", "password", "aaaa#", true},
-
1218 {"aaaa#bbbb", "", "aaaa", true},
-
1219 {"aaaa\\#bbbb", "", "aaaa#bbbb", false},
-
1220 {"aaaa\\##bbbb", "", "aaaa#", true},
-
-
1221 {"aaaa #bbbb", "", "aaaa", true},
-
1222 {"1 #comment", "", "1", true},
-
-
1223 {"#whole thing is comment", "", "", false},
-
1224 {" #whole comment with space", "", "", false}}};
-
1225
-
1226 for (auto const& t : tests)
-
1227 {
-
1228 Section s;
-
1229 s.append(t.line.data());
-
1230 BEAST_EXPECT(s.had_trailing_comments() == t.had_comment);
-
1231 if (t.field.empty())
-
1232 {
-
1233 BEAST_EXPECTS(s.legacy() == t.expect, s.legacy());
-
1234 }
-
1235 else
-
1236 {
- -
1238 BEAST_EXPECTS(set(field, t.field.data(), s), t.line);
-
1239 BEAST_EXPECTS(field == t.expect, t.line);
-
1240 }
-
1241 }
-
1242
-
1243 {
-
1244 Section s;
-
1245 s.append("online_delete = 3000");
-
1246 std::uint32_t od = 0;
-
1247 BEAST_EXPECT(set(od, "online_delete", s));
-
1248 BEAST_EXPECTS(od == 3000, *(s.get<std::string>("online_delete")));
-
1249 }
-
1250
-
1251 {
-
1252 Section s;
-
1253 s.append("online_delete = 2000 #my comment on this");
-
1254 std::uint32_t od = 0;
-
1255 BEAST_EXPECT(set(od, "online_delete", s));
-
1256 BEAST_EXPECTS(od == 2000, *(s.get<std::string>("online_delete")));
-
1257 }
-
1258 }
-
1259
-
1260 void
-
1261 testGetters()
-
1262 {
-
1263 using namespace std::string_literals;
-
1264 Section s{"MySection"};
-
1265 s.append("a_string = mystring");
-
1266 s.append("positive_int = 2");
-
1267 s.append("negative_int = -3");
-
1268 s.append("bool_ish = 1");
-
1269
-
1270 {
-
1271 auto val_1 = "value 1"s;
-
1272 BEAST_EXPECT(set(val_1, "a_string", s));
-
1273 BEAST_EXPECT(val_1 == "mystring");
-
1274
-
1275 auto val_2 = "value 2"s;
-
1276 BEAST_EXPECT(!set(val_2, "not_a_key", s));
-
1277 BEAST_EXPECT(val_2 == "value 2");
-
1278 BEAST_EXPECT(!set(val_2, "default"s, "not_a_key", s));
-
1279 BEAST_EXPECT(val_2 == "default");
-
1280
-
1281 auto val_3 = get<std::string>(s, "a_string");
-
1282 BEAST_EXPECT(val_3 == "mystring");
-
1283 auto val_4 = get<std::string>(s, "not_a_key");
-
1284 BEAST_EXPECT(val_4 == "");
-
1285 auto val_5 = get<std::string>(s, "not_a_key", "default");
-
1286 BEAST_EXPECT(val_5 == "default");
-
1287
-
1288 auto val_6 = "value 6"s;
-
1289 BEAST_EXPECT(get_if_exists(s, "a_string", val_6));
-
1290 BEAST_EXPECT(val_6 == "mystring");
-
1291
-
1292 auto val_7 = "value 7"s;
-
1293 BEAST_EXPECT(!get_if_exists(s, "not_a_key", val_7));
-
1294 BEAST_EXPECT(val_7 == "value 7");
-
1295 }
-
1296
-
1297 {
-
1298 int val_1 = 1;
-
1299 BEAST_EXPECT(set(val_1, "positive_int", s));
-
1300 BEAST_EXPECT(val_1 == 2);
-
1301
-
1302 int val_2 = 2;
-
1303 BEAST_EXPECT(set(val_2, "negative_int", s));
-
1304 BEAST_EXPECT(val_2 == -3);
-
1305
-
1306 int val_3 = 3;
-
1307 BEAST_EXPECT(!set(val_3, "a_string", s));
-
1308 BEAST_EXPECT(val_3 == 3);
-
1309
-
1310 auto val_4 = get<int>(s, "positive_int");
-
1311 BEAST_EXPECT(val_4 == 2);
-
1312 auto val_5 = get<int>(s, "not_a_key");
-
1313 BEAST_EXPECT(val_5 == 0);
-
1314 auto val_6 = get<int>(s, "not_a_key", 5);
-
-
1315 BEAST_EXPECT(val_6 == 5);
-
1316 auto val_7 = get<int>(s, "a_string", 6);
+
1315
+
1316
-
1317 BEAST_EXPECT(val_7 == 6);
-
1318
-
1319 int val_8 = 8;
-
1320 BEAST_EXPECT(get_if_exists(s, "positive_int", val_8));
-
1321 BEAST_EXPECT(val_8 == 2);
-
1322
-
1323 auto val_9 = 9;
-
1324 BEAST_EXPECT(!get_if_exists(s, "not_a_key", val_9));
-
1325 BEAST_EXPECT(val_9 == 9);
-
1326
-
1327 auto val_10 = 10;
-
1328 BEAST_EXPECT(!get_if_exists(s, "a_string", val_10));
-
1329 BEAST_EXPECT(val_10 == 10);
-
1330
-
1331 BEAST_EXPECT(s.get<int>("not_a_key") == std::nullopt);
-
1332 try
-
1333 {
-
1334 s.get<int>("a_string");
-
1335 fail();
-
1336 }
-
1337 catch (boost::bad_lexical_cast&)
-
1338 {
-
1339 pass();
-
1340 }
-
1341 }
-
1342
-
1343 {
-
1344 bool flag_1 = false;
-
1345 BEAST_EXPECT(get_if_exists(s, "bool_ish", flag_1));
-
1346 BEAST_EXPECT(flag_1 == true);
-
1347
-
1348 bool flag_2 = false;
-
1349 BEAST_EXPECT(!get_if_exists(s, "not_a_key", flag_2));
-
1350 BEAST_EXPECT(flag_2 == false);
-
1351 }
+
1317)");
+
1318 cfg.loadFromString(toLoad);
+
1319 BEAST_EXPECT(
+
1320 cfg.exists("port_rpc") && cfg.section("port_rpc").lines().empty() &&
+
1321 cfg.section("port_rpc").values().empty());
+
1322 BEAST_EXPECT(
+
1323 cfg.exists(SECTION_IPS) &&
+
1324 cfg.section(SECTION_IPS).lines().size() == 1 &&
+
1325 cfg.section(SECTION_IPS).values().size() == 1);
+
1326 BEAST_EXPECT(
+
1327 cfg.exists(SECTION_IPS_FIXED) &&
+
1328 cfg.section(SECTION_IPS_FIXED).lines().size() == 15 &&
+
1329 cfg.section(SECTION_IPS_FIXED).values().size() == 15);
+
1330 BEAST_EXPECT(cfg.IPS[0] == "r.ripple.com 51235");
+
1331
+
1332 BEAST_EXPECT(cfg.IPS_FIXED[0] == "s1.ripple.com 51235");
+
1333 BEAST_EXPECT(cfg.IPS_FIXED[1] == "s2.ripple.com 51235");
+
1334 BEAST_EXPECT(cfg.IPS_FIXED[2] == "anotherserversansport");
+
1335 BEAST_EXPECT(cfg.IPS_FIXED[3] == "anotherserverwithport 12");
+
1336 BEAST_EXPECT(cfg.IPS_FIXED[4] == "1.1.1.1 1");
+
1337 BEAST_EXPECT(cfg.IPS_FIXED[5] == "1.1.1.1 1");
+
1338 BEAST_EXPECT(cfg.IPS_FIXED[6] == "12.34.12.123 12345");
+
1339 BEAST_EXPECT(cfg.IPS_FIXED[7] == "12.34.12.123 12345");
+
1340
+
1341 // all ipv6 should be ignored by colon replacer, howsoever formatted
+
1342 BEAST_EXPECT(cfg.IPS_FIXED[8] == "::");
+
1343 BEAST_EXPECT(cfg.IPS_FIXED[9] == "2001:db8::");
+
1344 BEAST_EXPECT(cfg.IPS_FIXED[10] == "::1");
+
1345 BEAST_EXPECT(cfg.IPS_FIXED[11] == "::1:12345");
+
1346 BEAST_EXPECT(cfg.IPS_FIXED[12] == "[::1]:12345");
+
1347 BEAST_EXPECT(
+
1348 cfg.IPS_FIXED[13] ==
+
1349 "2001:db8:3333:4444:5555:6666:7777:8888:12345");
+
1350 BEAST_EXPECT(
+
1351 cfg.IPS_FIXED[14] == "[2001:db8:3333:4444:5555:6666:7777:8888]:1");
1352 }
1353
1354 void
- +
1355 testComments()
1356 {
-
1357 testcase("amendment");
-
1358 struct ConfigUnit
-
1359 {
-
1360 std::string unit;
-
1361 std::uint32_t numSeconds;
-
1362 std::uint32_t configVal;
-
1363 bool shouldPass;
-
1364 };
-
1365
+
1357 struct TestCommentData
+
1358 {
+
1359 std::string_view line;
+
1360 std::string_view field;
+
1361 std::string_view expect;
+
1362 bool had_comment;
+
1363 };
+
1364
+ +
1366 {{"password = aaaa\\#bbbb", "password", "aaaa#bbbb", false},
+
1367 {"password = aaaa#bbbb", "password", "aaaa", true},
+
1368 {"password = aaaa #bbbb", "password", "aaaa", true},
+
1369 // since the value is all comment, this doesn't parse as k=v :
+
1370 {"password = #aaaa #bbbb", "", "password =", true},
+
1371 {"password = aaaa\\# #bbbb", "password", "aaaa#", true},
+
1372 {"password = aaaa\\##bbbb", "password", "aaaa#", true},
+
1373 {"aaaa#bbbb", "", "aaaa", true},
+
1374 {"aaaa\\#bbbb", "", "aaaa#bbbb", false},
+
1375 {"aaaa\\##bbbb", "", "aaaa#", true},
-
1366 std::vector<ConfigUnit> units = {
-
1367 {"seconds", 1, 15 * 60, false},
-
-
1368 {"minutes", 60, 14, false},
-
1369 {"minutes", 60, 15, true},
-
1370 {"hours", 3600, 10, true},
-
1371 {"days", 86400, 10, true},
-
1372 {"weeks", 604800, 2, true},
-
1373 {"months", 2592000, 1, false},
-
1374 {"years", 31536000, 1, false}};
-
1375
-
1376 std::string space = "";
-
1377 for (auto& [unit, sec, val, shouldPass] : units)
-
1378 {
-
1379 Config c;
-
1380 std::string toLoad(R"rippleConfig(
-
1381[amendment_majority_time]
-
1382)rippleConfig");
-
1383 toLoad += std::to_string(val) + space + unit;
-
1384 space = space == "" ? " " : "";
-
1385
-
1386 try
+
1376 {"aaaa #bbbb", "", "aaaa", true},
+
1377 {"1 #comment", "", "1", true},
+
+
1378 {"#whole thing is comment", "", "", false},
+
1379 {" #whole comment with space", "", "", false}}};
+
1380
+
1381 for (auto const& t : tests)
+
1382 {
+
1383 Section s;
+
1384 s.append(t.line.data());
+
1385 BEAST_EXPECT(s.had_trailing_comments() == t.had_comment);
+
1386 if (t.field.empty())
1387 {
-
1388 c.loadFromString(toLoad);
-
1389 if (shouldPass)
-
1390 BEAST_EXPECT(
-
1391 c.AMENDMENT_MAJORITY_TIME.count() == val * sec);
-
1392 else
-
1393 fail();
-
1394 }
-
1395 catch (std::runtime_error&)
-
1396 {
-
1397 if (!shouldPass)
-
1398 pass();
-
1399 else
-
1400 fail();
-
1401 }
-
1402 }
-
1403 }
-
1404
-
1405 void
-
1406 testOverlay()
-
1407 {
-
1408 testcase("overlay: unknown time");
-
1409
-
1410 auto testUnknown =
- -
1412 try
-
1413 {
-
1414 Config c;
-
1415 c.loadFromString("[overlay]\nmax_unknown_time=" + value);
-
1416 return c.MAX_UNKNOWN_TIME;
-
1417 }
-
1418 catch (std::runtime_error&)
-
1419 {
-
1420 return {};
-
1421 }
-
1422 };
-
1423
-
1424 // Failures
-
1425 BEAST_EXPECT(!testUnknown("none"));
-
1426 BEAST_EXPECT(!testUnknown("0.5"));
-
1427 BEAST_EXPECT(!testUnknown("180 seconds"));
-
1428 BEAST_EXPECT(!testUnknown("9 minutes"));
+
1388 BEAST_EXPECTS(s.legacy() == t.expect, s.legacy());
+
1389 }
+
1390 else
+
1391 {
+ +
1393 BEAST_EXPECTS(set(field, t.field.data(), s), t.line);
+
1394 BEAST_EXPECTS(field == t.expect, t.line);
+
1395 }
+
1396 }
+
1397
+
1398 {
+
1399 Section s;
+
1400 s.append("online_delete = 3000");
+
1401 std::uint32_t od = 0;
+
1402 BEAST_EXPECT(set(od, "online_delete", s));
+
1403 BEAST_EXPECTS(od == 3000, *(s.get<std::string>("online_delete")));
+
1404 }
+
1405
+
1406 {
+
1407 Section s;
+
1408 s.append("online_delete = 2000 #my comment on this");
+
1409 std::uint32_t od = 0;
+
1410 BEAST_EXPECT(set(od, "online_delete", s));
+
1411 BEAST_EXPECTS(od == 2000, *(s.get<std::string>("online_delete")));
+
1412 }
+
1413 }
+
1414
+
1415 void
+
1416 testGetters()
+
1417 {
+
1418 using namespace std::string_literals;
+
1419 Section s{"MySection"};
+
1420 s.append("a_string = mystring");
+
1421 s.append("positive_int = 2");
+
1422 s.append("negative_int = -3");
+
1423 s.append("bool_ish = 1");
+
1424
+
1425 {
+
1426 auto val_1 = "value 1"s;
+
1427 BEAST_EXPECT(set(val_1, "a_string", s));
+
1428 BEAST_EXPECT(val_1 == "mystring");
1429
-
1430 // Below lower bound
-
1431 BEAST_EXPECT(!testUnknown("299"));
-
1432
-
1433 // In bounds
-
1434 BEAST_EXPECT(testUnknown("300") == std::chrono::seconds{300});
-
1435 BEAST_EXPECT(testUnknown("301") == std::chrono::seconds{301});
-
1436 BEAST_EXPECT(testUnknown("1799") == std::chrono::seconds{1799});
-
1437 BEAST_EXPECT(testUnknown("1800") == std::chrono::seconds{1800});
-
1438
-
1439 // Above upper bound
-
-
1440 BEAST_EXPECT(!testUnknown("1801"));
-
1441
-
-
1442 testcase("overlay: diverged time");
-
1443
-
1444 // In bounds:
-
1445 auto testDiverged =
- -
1447 try
-
1448 {
-
1449 Config c;
-
1450 c.loadFromString("[overlay]\nmax_diverged_time=" + value);
-
1451 return c.MAX_DIVERGED_TIME;
-
1452 }
-
1453 catch (std::runtime_error&)
-
1454 {
-
1455 return {};
-
1456 }
-
1457 };
-
1458
-
1459 // Failures
-
-
1460 BEAST_EXPECT(!testDiverged("none"));
-
1461 BEAST_EXPECT(!testDiverged("0.5"));
-
1462 BEAST_EXPECT(!testDiverged("180 seconds"));
-
1463 BEAST_EXPECT(!testDiverged("9 minutes"));
+
1430 auto val_2 = "value 2"s;
+
1431 BEAST_EXPECT(!set(val_2, "not_a_key", s));
+
1432 BEAST_EXPECT(val_2 == "value 2");
+
1433 BEAST_EXPECT(!set(val_2, "default"s, "not_a_key", s));
+
1434 BEAST_EXPECT(val_2 == "default");
+
1435
+
1436 auto val_3 = get<std::string>(s, "a_string");
+
1437 BEAST_EXPECT(val_3 == "mystring");
+
1438 auto val_4 = get<std::string>(s, "not_a_key");
+
1439 BEAST_EXPECT(val_4 == "");
+
1440 auto val_5 = get<std::string>(s, "not_a_key", "default");
+
1441 BEAST_EXPECT(val_5 == "default");
+
1442
+
1443 auto val_6 = "value 6"s;
+
1444 BEAST_EXPECT(get_if_exists(s, "a_string", val_6));
+
1445 BEAST_EXPECT(val_6 == "mystring");
+
1446
+
1447 auto val_7 = "value 7"s;
+
1448 BEAST_EXPECT(!get_if_exists(s, "not_a_key", val_7));
+
1449 BEAST_EXPECT(val_7 == "value 7");
+
1450 }
+
1451
+
1452 {
+
1453 int val_1 = 1;
+
1454 BEAST_EXPECT(set(val_1, "positive_int", s));
+
1455 BEAST_EXPECT(val_1 == 2);
+
1456
+
1457 int val_2 = 2;
+
1458 BEAST_EXPECT(set(val_2, "negative_int", s));
+
1459 BEAST_EXPECT(val_2 == -3);
+
1460
+
1461 int val_3 = 3;
+
1462 BEAST_EXPECT(!set(val_3, "a_string", s));
+
1463 BEAST_EXPECT(val_3 == 3);
1464
-
1465 // Below lower bound
-
1466 BEAST_EXPECT(!testDiverged("0"));
-
1467 BEAST_EXPECT(!testDiverged("59"));
-
1468
-
1469 // In bounds
-
1470 BEAST_EXPECT(testDiverged("60") == std::chrono::seconds{60});
-
1471 BEAST_EXPECT(testDiverged("61") == std::chrono::seconds{61});
-
1472 BEAST_EXPECT(testDiverged("899") == std::chrono::seconds{899});
-
1473 BEAST_EXPECT(testDiverged("900") == std::chrono::seconds{900});
-
1474
-
1475 // Above upper bound
-
1476 BEAST_EXPECT(!testDiverged("901"));
-
1477 }
-
1478
-
1479 void
-
1480 run() override
-
1481 {
-
1482 testLegacy();
-
1483 testDbPath();
- - -
1486 testSetup(false);
-
1487 testSetup(true);
-
1488 testPort();
-
1489 testZeroPort();
- -
1491 testColons();
-
1492 testComments();
-
1493 testGetters();
-
1494 testAmendment();
+
1465 auto val_4 = get<int>(s, "positive_int");
+
1466 BEAST_EXPECT(val_4 == 2);
+
1467 auto val_5 = get<int>(s, "not_a_key");
+
1468 BEAST_EXPECT(val_5 == 0);
+
1469 auto val_6 = get<int>(s, "not_a_key", 5);
-
1495 testOverlay();
- -
1497 }
-
1498};
-
1499
-
1500BEAST_DEFINE_TESTSUITE(Config, core, xrpl);
-
1501
-
1502} // namespace xrpl
+
1470 BEAST_EXPECT(val_6 == 5);
+
1471 auto val_7 = get<int>(s, "a_string", 6);
+
+
1472 BEAST_EXPECT(val_7 == 6);
+
1473
+
1474 int val_8 = 8;
+
1475 BEAST_EXPECT(get_if_exists(s, "positive_int", val_8));
+
1476 BEAST_EXPECT(val_8 == 2);
+
1477
+
1478 auto val_9 = 9;
+
1479 BEAST_EXPECT(!get_if_exists(s, "not_a_key", val_9));
+
1480 BEAST_EXPECT(val_9 == 9);
+
1481
+
1482 auto val_10 = 10;
+
1483 BEAST_EXPECT(!get_if_exists(s, "a_string", val_10));
+
1484 BEAST_EXPECT(val_10 == 10);
+
1485
+
1486 BEAST_EXPECT(s.get<int>("not_a_key") == std::nullopt);
+
1487 try
+
1488 {
+
1489 s.get<int>("a_string");
+
1490 fail();
+
1491 }
+
1492 catch (boost::bad_lexical_cast&)
+
1493 {
+
1494 pass();
+
1495 }
+
1496 }
+
1497
+
1498 {
+
1499 bool flag_1 = false;
+
1500 BEAST_EXPECT(get_if_exists(s, "bool_ish", flag_1));
+
1501 BEAST_EXPECT(flag_1 == true);
+
1502
+
1503 bool flag_2 = false;
+
1504 BEAST_EXPECT(!get_if_exists(s, "not_a_key", flag_2));
+
1505 BEAST_EXPECT(flag_2 == false);
+
1506 }
+
1507 }
+
1508
+
1509 void
+ +
1511 {
+
1512 testcase("amendment");
+
1513 struct ConfigUnit
+
1514 {
+
1515 std::string unit;
+
1516 std::uint32_t numSeconds;
+
1517 std::uint32_t configVal;
+
1518 bool shouldPass;
+
1519 };
+
1520
+
+
1521 std::vector<ConfigUnit> units = {
+
1522 {"seconds", 1, 15 * 60, false},
+
+
1523 {"minutes", 60, 14, false},
+
1524 {"minutes", 60, 15, true},
+
1525 {"hours", 3600, 10, true},
+
1526 {"days", 86400, 10, true},
+
1527 {"weeks", 604800, 2, true},
+
1528 {"months", 2592000, 1, false},
+
1529 {"years", 31536000, 1, false}};
+
1530
+
1531 std::string space = "";
+
1532 for (auto& [unit, sec, val, shouldPass] : units)
+
1533 {
+
1534 Config c;
+
1535 std::string toLoad(R"xrpldConfig(
+
1536[amendment_majority_time]
+
1537)xrpldConfig");
+
1538 toLoad += std::to_string(val) + space + unit;
+
1539 space = space == "" ? " " : "";
+
1540
+
1541 try
+
1542 {
+
1543 c.loadFromString(toLoad);
+
1544 if (shouldPass)
+
1545 BEAST_EXPECT(
+
1546 c.AMENDMENT_MAJORITY_TIME.count() == val * sec);
+
1547 else
+
1548 fail();
+
1549 }
+
1550 catch (std::runtime_error&)
+
1551 {
+
1552 if (!shouldPass)
+
1553 pass();
+
1554 else
+
1555 fail();
+
1556 }
+
1557 }
+
1558 }
+
1559
+
1560 void
+
1561 testOverlay()
+
1562 {
+
1563 testcase("overlay: unknown time");
+
1564
+
1565 auto testUnknown =
+ +
1567 try
+
1568 {
+
1569 Config c;
+
1570 c.loadFromString("[overlay]\nmax_unknown_time=" + value);
+
1571 return c.MAX_UNKNOWN_TIME;
+
1572 }
+
1573 catch (std::runtime_error&)
+
1574 {
+
1575 return {};
+
1576 }
+
1577 };
+
1578
+
1579 // Failures
+
1580 BEAST_EXPECT(!testUnknown("none"));
+
1581 BEAST_EXPECT(!testUnknown("0.5"));
+
1582 BEAST_EXPECT(!testUnknown("180 seconds"));
+
1583 BEAST_EXPECT(!testUnknown("9 minutes"));
+
1584
+
1585 // Below lower bound
+
1586 BEAST_EXPECT(!testUnknown("299"));
+
1587
+
1588 // In bounds
+
1589 BEAST_EXPECT(testUnknown("300") == std::chrono::seconds{300});
+
1590 BEAST_EXPECT(testUnknown("301") == std::chrono::seconds{301});
+
1591 BEAST_EXPECT(testUnknown("1799") == std::chrono::seconds{1799});
+
1592 BEAST_EXPECT(testUnknown("1800") == std::chrono::seconds{1800});
+
1593
+
1594 // Above upper bound
+
+
1595 BEAST_EXPECT(!testUnknown("1801"));
+
1596
+
+
1597 testcase("overlay: diverged time");
+
1598
+
1599 // In bounds:
+
1600 auto testDiverged =
+ +
1602 try
+
1603 {
+
1604 Config c;
+
1605 c.loadFromString("[overlay]\nmax_diverged_time=" + value);
+
1606 return c.MAX_DIVERGED_TIME;
+
1607 }
+
1608 catch (std::runtime_error&)
+
1609 {
+
1610 return {};
+
1611 }
+
1612 };
+
1613
+
1614 // Failures
+
1615 BEAST_EXPECT(!testDiverged("none"));
+
+
1616 BEAST_EXPECT(!testDiverged("0.5"));
+
1617 BEAST_EXPECT(!testDiverged("180 seconds"));
+
1618 BEAST_EXPECT(!testDiverged("9 minutes"));
+
1619
+
1620 // Below lower bound
+
1621 BEAST_EXPECT(!testDiverged("0"));
+
1622 BEAST_EXPECT(!testDiverged("59"));
+
1623
+
1624 // In bounds
+
1625 BEAST_EXPECT(testDiverged("60") == std::chrono::seconds{60});
+
1626 BEAST_EXPECT(testDiverged("61") == std::chrono::seconds{61});
+
1627 BEAST_EXPECT(testDiverged("899") == std::chrono::seconds{899});
+
1628 BEAST_EXPECT(testDiverged("900") == std::chrono::seconds{900});
+
1629
+
1630 // Above upper bound
+
1631 BEAST_EXPECT(!testDiverged("901"));
+
1632 }
+
1633
+
1634 void
+
1635 run() override
+
1636 {
+
1637 testLegacy();
+ +
1639 testDbPath();
+ + +
1642 testSetup(false);
+
1643 testSetup(true);
+
1644 testPort();
+
1645 testZeroPort();
+ +
1647 testColons();
+
1648 testComments();
+
1649 testGetters();
+
1650 testAmendment();
+
+
1651 testOverlay();
+ +
1653 }
+
1654};
+
1655
+
1656BEAST_DEFINE_TESTSUITE(Config, core, xrpl);
+
1657
+
1658} // namespace xrpl
+
T c_str(T... args)
+
RAII temporary directory.
Definition temp_dir.h:16
+
std::string path() const
Get the native path for the temporary directory.
Definition temp_dir.h:48
+
std::string file(std::string const &name) const
Get the native path for the a file.
Definition temp_dir.h:58
A testsuite class.
Definition suite.h:52
log_os< char > log
Logging output stream.
Definition suite.h:149
void pass()
Record a successful test condition.
Definition suite.h:508
@@ -1652,36 +1814,39 @@ $(document).ready(function() { init_codefold(0); });
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
- - - - - - -
void testSetup(bool explicitPath)
- -
void run() override
Runs the suite.
- - - - - - - -
boost::filesystem::path path
+ + + + + + +
void testSetup(bool explicitPath)
+ +
void run() override
Runs the suite.
+ + + + + + + + +
boost::filesystem::path path
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:281
-
bool silent() const
Definition Config.h:312
-
bool quiet() const
Definition Config.h:307
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool standalone() const
Definition Config.h:317
-
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:292
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:460
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
static char const *const databaseDirName
Definition Config.h:71
+
uint32_t NETWORK_ID
Definition Config.h:138
+
static char const *const configLegacyName
Definition Config.h:71
+
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:282
+
bool silent() const
Definition Config.h:313
+
static char const *const configFileName
Definition Config.h:70
+
bool quiet() const
Definition Config.h:308
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:266
+
std::vector< std::string > IPS
Definition Config.h:123
+
bool standalone() const
Definition Config.h:318
+
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:293
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:461
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:189
+
std::vector< std::string > IPS_FIXED
Definition Config.h:126
+
static char const *const databaseDirName
Definition Config.h:72
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:60
std::vector< std::string > const & lines() const
Returns all the lines in the section.
Definition BasicConfig.h:51
@@ -1691,25 +1856,26 @@ $(document).ready(function() { init_codefold(0); });
path const & subdir() const
auto rmDir(path const &toRm)
boost::filesystem::path path
+
Write a xrpld config file and remove when done.
+
Config const & config() const
+ + +
std::string configFile() const
+ + + +
FileCfgGuard(beast::unit_test::suite &test, path subDir, path const &dbPath, path const &configFile, path const &validatorsFile, bool useCounter=true, std::string confContents="")
+
Write a file in a directory and remove when done.
path const & file() const
-
Write a rippled config file and remove when done.
- -
RippledCfgGuard(beast::unit_test::suite &test, path subDir, path const &dbPath, path const &validatorsFile, bool useCounter=true, std::string confContents="")
- -
Config const & config() const
-
std::string configFile() const
- - - - -
Write a validators.txt file and remove when done.
-
std::string validatorsFile() const
- -
ValidatorsTxtGuard(beast::unit_test::suite &test, path subDir, path const &validatorsFileName, bool useCounter=true)
- +
Write a validators.txt file and remove when done.
+
std::string validatorsFile() const
+ +
ValidatorsTxtGuard(beast::unit_test::suite &test, path subDir, path const &validatorsFileName, bool useCounter=true)
+ +
T close(T... args)
T empty(T... args)
T endl(T... args)
@@ -1719,11 +1885,12 @@ $(document).ready(function() { init_codefold(0); });
T is_same_v
field_t< CharT, Traits, Allocator > field(std::basic_string< CharT, Traits, Allocator > const &text, int width=8, int pad=0, bool right=false)
Definition iosformat.h:143
STL namespace.
-
std::string valFileContents()
-
std::string configContents(std::string const &dbPath, std::string const &validatorsFile)
+
std::string valFileContents()
+
std::string configContents(std::string const &dbPath, std::string const &validatorsFile)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
void parse_Port(ParsedPort &port, Section const &section, std::ostream &log)
Definition Port.cpp:195
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
+
static std::string const & systemName()
bool get_if_exists(Section const &section, std::string const &name, T &v)
static std::optional< Seed > validationSeed(Json::Value const &params)
diff --git a/ConnectAttempt_8cpp_source.html b/ConnectAttempt_8cpp_source.html index 0c1665a75d..6008b4e4ca 100644 --- a/ConnectAttempt_8cpp_source.html +++ b/ConnectAttempt_8cpp_source.html @@ -760,10 +760,10 @@ $(document).ready(function() { init_codefold(0); });
virtual Cluster & cluster()=0
virtual Config & config()=0
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
Definition Cluster.cpp:19
-
bool COMPRESSION
Definition Config.h:201
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
-
bool LEDGER_REPLAY
Definition Config.h:204
+
bool COMPRESSION
Definition Config.h:202
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:240
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:230
+
bool LEDGER_REPLAY
Definition Config.h:205
boost::system::error_code error_code
boost::beast::ssl_stream< middle_type > stream_type
void fail(std::string const &reason)
diff --git a/Connect_8cpp_source.html b/Connect_8cpp_source.html index 66d79f1f3d..783a6493b4 100644 --- a/Connect_8cpp_source.html +++ b/Connect_8cpp_source.html @@ -145,7 +145,7 @@ $(document).ready(function() { init_codefold(0); });
static Endpoint from_string(std::string const &s)
virtual Config & config()=0
virtual Overlay & overlay()=0
-
bool standalone() const
Definition Config.h:317
+
bool standalone() const
Definition Config.h:318
virtual void connect(beast::IP::Endpoint const &address)=0
Establish a peer connection to the specified endpoint.
@ intValue
signed integer value
Definition json_value.h:21
Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
Definition Handler.h:47
diff --git a/DatabaseCon_8cpp_source.html b/DatabaseCon_8cpp_source.html index 3adfb8ef7d..bd4f8ba1e4 100644 --- a/DatabaseCon_8cpp_source.html +++ b/DatabaseCon_8cpp_source.html @@ -377,9 +377,9 @@ $(document).ready(function() { init_codefold(0); });
std::shared_ptr< Checkpointer > fromId(std::uintptr_t id)
std::unordered_map< std::uintptr_t, std::shared_ptr< Checkpointer > > checkpointers_
-
StartUpType START_UP
Definition Config.h:128
-
bool standalone() const
Definition Config.h:317
-
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
+
StartUpType START_UP
Definition Config.h:129
+
bool standalone() const
Definition Config.h:318
+
std::uint32_t LEDGER_HISTORY
Definition Config.h:189
std::shared_ptr< soci::session > const session_
void setupCheckpointing(JobQueue *, Logs &)
std::shared_ptr< Checkpointer > checkpointer_
diff --git a/DatabaseCon_8h_source.html b/DatabaseCon_8h_source.html index c0cf6eeeda..6965c41bfc 100644 --- a/DatabaseCon_8h_source.html +++ b/DatabaseCon_8h_source.html @@ -370,8 +370,8 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:41
- - + +
DatabaseCon(boost::filesystem::path const &dataDir, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, beast::Journal journal)
DatabaseCon(boost::filesystem::path const &dataDir, std::string const &dbName, std::array< std::string, N > const &pragma, std::array< char const *, M > const &initSQL, CheckpointerSetup const &checkpointerSetup, beast::Journal journal)
diff --git a/Env_8cpp_source.html b/Env_8cpp_source.html index 6e89ee8fde..763dfd6874 100644 --- a/Env_8cpp_source.html +++ b/Env_8cpp_source.html @@ -841,8 +841,8 @@ $(document).ready(function() { init_codefold(0); });
virtual NetworkOPs & getOPs()=0
constexpr value_type const & value() const
Definition Asset.h:157
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
+
uint32_t NETWORK_ID
Definition Config.h:138
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:258
static void initializeSSLContext(std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, beast::Journal j)
A currency issued by an account.
Definition Issue.h:14
Currency currency
Definition Issue.h:16
diff --git a/Env__test_8cpp_source.html b/Env__test_8cpp_source.html index e9d5cbe39a..67947f863d 100644 --- a/Env__test_8cpp_source.html +++ b/Env__test_8cpp_source.html @@ -1078,7 +1078,7 @@ $(document).ready(function() { init_codefold(0); });
virtual TxQ & getTxQ()=0
virtual Config & config()=0
virtual NetworkOPs & getOPs()=0
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:258
FeatureBitset & set(uint256 const &f, bool value=true)
Definition Feature.h:217
virtual std::size_t getLocalTxCount()=0
diff --git a/FeeVoteImpl_8cpp_source.html b/FeeVoteImpl_8cpp_source.html index c23bdc29d8..7f67749d47 100644 --- a/FeeVoteImpl_8cpp_source.html +++ b/FeeVoteImpl_8cpp_source.html @@ -432,7 +432,7 @@ $(document).ready(function() { init_codefold(0); });
A generic endpoint for log messages.
Definition Journal.h:41
Stream info() const
Definition Journal.h:315
Stream warn() const
Definition Journal.h:321
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
void doValidation(Fees const &lastFees, Rules const &rules, STValidation &val) override
Add local fee preference to validation.
FeeVoteImpl(FeeSetup const &setup, beast::Journal journal)
diff --git a/FeeVote__test_8cpp_source.html b/FeeVote__test_8cpp_source.html index d888460be4..bc4125ef16 100644 --- a/FeeVote__test_8cpp_source.html +++ b/FeeVote__test_8cpp_source.html @@ -957,7 +957,7 @@ $(document).ready(function() { init_codefold(0); });
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition apply.cpp:121
create_genesis_t const create_genesis
Definition Ledger.cpp:32
-
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1109
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1110
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:29
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
SecretKey randomSecretKey()
Create a secret key using secure random numbers.
diff --git a/GetCounts_8cpp_source.html b/GetCounts_8cpp_source.html index e2f2e3123b..77933590ea 100644 --- a/GetCounts_8cpp_source.html +++ b/GetCounts_8cpp_source.html @@ -230,7 +230,7 @@ $(document).ready(function() { init_codefold(0); });
virtual CachedSLEs & cachedSLEs()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual NetworkOPs & getOPs()=0
-
bool useTxTables() const
Definition Config.h:323
+
bool useTxTables() const
Definition Config.h:324
List getCounts(int minimumThreshold) const
static CountedObjects & getInstance() noexcept
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
diff --git a/Handshake_8cpp_source.html b/Handshake_8cpp_source.html index 58a6830e18..6bfe647eaf 100644 --- a/Handshake_8cpp_source.html +++ b/Handshake_8cpp_source.html @@ -508,11 +508,11 @@ $(document).ready(function() { init_codefold(0); });
virtual LedgerMaster & getLedgerMaster()=0
virtual TimeKeeper & timeKeeper()=0
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
-
bool COMPRESSION
Definition Config.h:201
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
-
std::string SERVER_DOMAIN
Definition Config.h:259
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
-
bool LEDGER_REPLAY
Definition Config.h:204
+
bool COMPRESSION
Definition Config.h:202
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:240
+
std::string SERVER_DOMAIN
Definition Config.h:260
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:230
+
bool LEDGER_REPLAY
Definition Config.h:205
std::shared_ptr< Ledger const > getClosedLedger()
A public key.
Definition PublicKey.h:43
An immutable linear range of bytes.
Definition Slice.h:27
diff --git a/LedgerAccept_8cpp_source.html b/LedgerAccept_8cpp_source.html index 13efc1405c..14fc4d3829 100644 --- a/LedgerAccept_8cpp_source.html +++ b/LedgerAccept_8cpp_source.html @@ -120,7 +120,7 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:131
virtual Config & config()=0
virtual MutexType & getMasterMutex()=0
-
bool standalone() const
Definition Config.h:317
+
bool standalone() const
Definition Config.h:318
LedgerIndex getCurrentLedgerIndex()
virtual std::uint32_t acceptLedger(std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)=0
Accepts the current transaction tree, return the new ledger's sequence.
diff --git a/LedgerLoad__test_8cpp_source.html b/LedgerLoad__test_8cpp_source.html index 230c7f410f..72e2c2ae56 100644 --- a/LedgerLoad__test_8cpp_source.html +++ b/LedgerLoad__test_8cpp_source.html @@ -492,10 +492,10 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:52
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:152
bool except(F &&f, String const &reason)
Definition suite.h:445
- - - - + + + +
void testLoadLatest(SetupData const &sd)
void testReplay(SetupData const &sd)
diff --git a/LedgerMaster_8cpp_source.html b/LedgerMaster_8cpp_source.html index af909b472b..5840cf1770 100644 --- a/LedgerMaster_8cpp_source.html +++ b/LedgerMaster_8cpp_source.html @@ -2476,8 +2476,8 @@ $(document).ready(function() { init_codefold(0); });
Holds transactions which were deferred to the next pass of consensus.
void insert(std::shared_ptr< STTx const > const &txn)
std::shared_ptr< STTx const > popAcctTransaction(std::shared_ptr< STTx const > const &tx)
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
-
bool LEDGER_REPLAY
Definition Config.h:204
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:258
+
bool LEDGER_REPLAY
Definition Config.h:205
diff --git a/LedgerReplay__test_8cpp_source.html b/LedgerReplay__test_8cpp_source.html index 85aad49a93..640e76b88d 100644 --- a/LedgerReplay__test_8cpp_source.html +++ b/LedgerReplay__test_8cpp_source.html @@ -1841,8 +1841,8 @@ $(document).ready(function() { init_codefold(0); });
virtual LedgerMaster & getLedgerMaster()=0
virtual Logs & logs()=0
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:460
-
bool LEDGER_REPLAY
Definition Config.h:204
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:461
+
bool LEDGER_REPLAY
Definition Config.h:205
diff --git a/Ledger_8cpp_source.html b/Ledger_8cpp_source.html index 7fea0064a2..cfb7e89f34 100644 --- a/Ledger_8cpp_source.html +++ b/Ledger_8cpp_source.html @@ -1352,8 +1352,8 @@ $(document).ready(function() { init_codefold(0); });
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
-
FeeSetup FEES
Definition Config.h:185
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
+
FeeSetup FEES
Definition Config.h:186
virtual void missingNodeAcquireByHash(uint256 const &refHash, std::uint32_t refNum)=0
Acquire ledger that has a missing node by ledger hash.
bool setFlags(uint256 const &key, HashRouterFlags flags)
Set the flags on a hash.
diff --git a/LoadFeeTrack__test_8cpp_source.html b/LoadFeeTrack__test_8cpp_source.html index 14233ee51f..99659c3ffc 100644 --- a/LoadFeeTrack__test_8cpp_source.html +++ b/LoadFeeTrack__test_8cpp_source.html @@ -160,7 +160,7 @@ $(document).ready(function() { init_codefold(0); });
73} // namespace xrpl
A testsuite class.
Definition suite.h:52
-
FeeSetup FEES
Definition Config.h:185
+
FeeSetup FEES
Definition Config.h:186
void run() override
Runs the suite.
Manages the current fee schedule.
diff --git a/Main_8cpp_source.html b/Main_8cpp_source.html index b8de5d43a8..58a15ef58a 100644 --- a/Main_8cpp_source.html +++ b/Main_8cpp_source.html @@ -957,11 +957,11 @@ $(document).ready(function() { init_codefold(0); });
Unit test runner interface.
Definition runner.h:24
void arg(std::string const &s)
Set the argument string.
Definition runner.h:46
Associates a unit test type with metadata.
Definition suite_info.h:20
- - - - - + + + + +
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition base_uint.h:484
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition rpc.h:16
diff --git a/ManagerImp_8cpp_source.html b/ManagerImp_8cpp_source.html index 04d1192120..30ee62e124 100644 --- a/ManagerImp_8cpp_source.html +++ b/ManagerImp_8cpp_source.html @@ -104,8 +104,8 @@ $(document).ready(function() { init_codefold(0); });
19{
20 Throw<std::runtime_error>(
-
21 "Your rippled.cfg is missing a [node_db] entry, "
-
22 "please see the rippled-example.cfg file!");
+
21 "Your xrpld.cfg is missing a [node_db] entry, "
+
22 "please see the xrpld-example.cfg file!");
23}
24
diff --git a/NetworkID__test_8cpp_source.html b/NetworkID__test_8cpp_source.html index 919c9df6d7..d6c71aa2d5 100644 --- a/NetworkID__test_8cpp_source.html +++ b/NetworkID__test_8cpp_source.html @@ -241,7 +241,7 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:52
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:152
virtual Config & config()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
Slice slice() const noexcept
Definition Serializer.h:47
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index f69c215b4f..55a2d530a1 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -5233,11 +5233,11 @@ $(document).ready(function() { init_codefold(0); });
PublicKey const & identity() const
Definition ClusterNode.h:45
std::string const & name() const
Definition ClusterNode.h:27
std::size_t size() const
The number of nodes in the cluster list.
Definition Cluster.cpp:30
-
uint32_t NETWORK_ID
Definition Config.h:137
-
std::string SERVER_DOMAIN
Definition Config.h:259
-
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:150
-
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:141
-
std::size_t NODE_SIZE
Definition Config.h:194
+
uint32_t NETWORK_ID
Definition Config.h:138
+
std::string SERVER_DOMAIN
Definition Config.h:260
+
int RELAY_UNTRUSTED_VALIDATIONS
Definition Config.h:151
+
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
+
std::size_t NODE_SIZE
Definition Config.h:195
virtual Json::Value getInfo()=0
virtual void clearFailures()=0
std::shared_ptr< InfoSub > pointer
Definition InfoSub.h:35
@@ -5570,7 +5570,7 @@ $(document).ready(function() { init_codefold(0); });
@ tefPAST_SEQ
Definition TER.h:156
std::uint64_t getQuality(uint256 const &uBase)
Definition Indexes.cpp:131
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:95
-
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1109
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1110
Number root(Number f, unsigned d)
Definition Number.cpp:644
std::unique_ptr< NetworkOPs > make_NetworkOPs(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startvalid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_context &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
bool transResultInfo(TER code, std::string &token, std::string &text)
Definition TER.cpp:230
diff --git a/Node_8cpp_source.html b/Node_8cpp_source.html index c6c4b1ed48..55eb6feb38 100644 --- a/Node_8cpp_source.html +++ b/Node_8cpp_source.html @@ -1419,12 +1419,12 @@ $(document).ready(function() { init_codefold(0); });
virtual NodeStore::Database & getNodeStore()=0
virtual TransactionMaster & getMasterTransaction()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
-
bool useTxTables() const
Definition Config.h:323
- - - -
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1097
+
uint32_t NETWORK_ID
Definition Config.h:138
+
bool useTxTables() const
Definition Config.h:324
+ + + +
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1098
LockedSociSession checkoutDb()
diff --git a/OrderBookDB_8cpp_source.html b/OrderBookDB_8cpp_source.html index 13535c8aa6..85bc42b3f1 100644 --- a/OrderBookDB_8cpp_source.html +++ b/OrderBookDB_8cpp_source.html @@ -444,8 +444,8 @@ $(document).ready(function() { init_codefold(0); });
Issue in
Definition Book.h:19
std::optional< uint256 > domain
Definition Book.h:21
Issue out
Definition Book.h:20
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
bool standalone() const
Definition Config.h:317
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
bool standalone() const
Definition Config.h:318
A currency issued by an account.
Definition Issue.h:14
Currency currency
Definition Issue.h:16
AccountID account
Definition Issue.h:17
diff --git a/OverlayImpl_8cpp_source.html b/OverlayImpl_8cpp_source.html index dc77354872..24a851b094 100644 --- a/OverlayImpl_8cpp_source.html +++ b/OverlayImpl_8cpp_source.html @@ -630,7 +630,7 @@ $(document).ready(function() { init_codefold(0); });
514 m_peerFinder->addFallbackStrings(base + name, ips);
515 });
516
-
517 // Add the ips_fixed from the rippled.cfg file
+
517 // Add the ips_fixed from the xrpld.cfg file
519 {
@@ -1834,13 +1834,13 @@ $(document).ready(function() { init_codefold(0); });
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
Definition Cluster.cpp:19
-
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
-
std::vector< std::string > IPS
Definition Config.h:122
-
bool standalone() const
Definition Config.h:317
-
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
-
std::vector< std::string > IPS_FIXED
Definition Config.h:125
-
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
+
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:240
+
std::vector< std::string > IPS
Definition Config.h:123
+
bool standalone() const
Definition Config.h:318
+
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:253
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:247
+
std::vector< std::string > IPS_FIXED
Definition Config.h:126
+
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:250
LockedSociSession checkoutDb()
std::optional< std::set< PeerShortID > > shouldRelay(uint256 const &key)
Determines whether the hashed item should be relayed.
virtual void pubManifest(Manifest const &)=0
diff --git a/PathFind_8cpp_source.html b/PathFind_8cpp_source.html index 36c83e7ef5..7a7d6397f4 100644 --- a/PathFind_8cpp_source.html +++ b/PathFind_8cpp_source.html @@ -155,7 +155,7 @@ $(document).ready(function() { init_codefold(0); });
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
virtual PathRequests & getPathRequests()=0
-
int PATH_SEARCH_MAX
Definition Config.h:179
+
int PATH_SEARCH_MAX
Definition Config.h:180
void clearRequest()
Definition InfoSub.cpp:102
void setApiVersion(unsigned int apiVersion)
Definition InfoSub.cpp:120
std::shared_ptr< InfoSubRequest > const & getRequest()
Definition InfoSub.cpp:114
diff --git a/PathRequest_8cpp_source.html b/PathRequest_8cpp_source.html index d351811780..de0a61af4c 100644 --- a/PathRequest_8cpp_source.html +++ b/PathRequest_8cpp_source.html @@ -895,9 +895,9 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual Logs & logs()=0
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
int PATH_SEARCH_FAST
Definition Config.h:178
-
int PATH_SEARCH
Definition Config.h:177
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
int PATH_SEARCH_FAST
Definition Config.h:179
+
int PATH_SEARCH
Definition Config.h:178
A currency issued by an account.
Definition Issue.h:14
Currency currency
Definition Issue.h:16
bool isLoadedLocal() const
diff --git a/PayChanClaim_8cpp_source.html b/PayChanClaim_8cpp_source.html index f2e1409561..6dc8ded611 100644 --- a/PayChanClaim_8cpp_source.html +++ b/PayChanClaim_8cpp_source.html @@ -232,7 +232,7 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:131
virtual Config & config()=0
-
bool canSign() const
Definition Config.h:329
+
bool canSign() const
Definition Config.h:330
A public key.
Definition PublicKey.h:43
A secret key.
Definition SecretKey.h:19
diff --git a/PeerFinder__test_8cpp_source.html b/PeerFinder__test_8cpp_source.html index 8900a5513e..0f729d59d3 100644 --- a/PeerFinder__test_8cpp_source.html +++ b/PeerFinder__test_8cpp_source.html @@ -662,10 +662,10 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:152
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:530
-
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:460
-
std::size_t PEERS_MAX
Definition Config.h:160
+
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:461
+
std::size_t PEERS_MAX
Definition Config.h:161
Manages the count of available connections for the various slots.
Definition Counts.h:15
int out_max() const
Returns the total number of outbound slots.
Definition Counts.h:85
int in_max() const
Returns the total number of inbound slots.
Definition Counts.h:147
diff --git a/PeerImp_8cpp_source.html b/PeerImp_8cpp_source.html index 35b8df1a89..994d746d38 100644 --- a/PeerImp_8cpp_source.html +++ b/PeerImp_8cpp_source.html @@ -3936,11 +3936,11 @@ $(document).ready(function() { init_codefold(0); });
void for_each(std::function< void(ClusterNode const &)> func) const
Invokes the callback once for every cluster node.
Definition Cluster.cpp:64
std::optional< std::string > member(PublicKey const &node) const
Determines whether a node belongs in the cluster.
Definition Cluster.cpp:19
std::size_t size() const
The number of nodes in the cluster list.
Definition Cluster.cpp:30
-
int MAX_TRANSACTIONS
Definition Config.h:207
-
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:265
-
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
-
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
+
int MAX_TRANSACTIONS
Definition Config.h:208
+
std::chrono::seconds MAX_DIVERGED_TIME
Definition Config.h:266
+
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:247
+
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:263
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:230
bool addSuppressionPeer(uint256 const &key, PeerShortID peer)
bool shouldProcess(uint256 const &key, PeerShortID peer, HashRouterFlags &flags, std::chrono::seconds tx_interval)
diff --git a/PeerImp_8h_source.html b/PeerImp_8h_source.html index 619dd6ef70..b971014a1d 100644 --- a/PeerImp_8h_source.html +++ b/PeerImp_8h_source.html @@ -844,7 +844,7 @@ $(document).ready(function() { init_codefold(0); });
Wraps a Journal::Sink to prefix its output with a string.
Definition WrappedSink.h:15
virtual Config & config()=0
-
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
+
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:230
diff --git a/PeerfinderConfig_8cpp_source.html b/PeerfinderConfig_8cpp_source.html index 661b05b0bf..fe31e62367 100644 --- a/PeerfinderConfig_8cpp_source.html +++ b/PeerfinderConfig_8cpp_source.html @@ -227,11 +227,11 @@ $(document).ready(function() { init_codefold(0); });
132} // namespace xrpl
-
std::size_t PEERS_IN_MAX
Definition Config.h:162
-
bool standalone() const
Definition Config.h:317
-
std::size_t PEERS_OUT_MAX
Definition Config.h:161
-
bool PEER_PRIVATE
Definition Config.h:154
-
std::size_t PEERS_MAX
Definition Config.h:160
+
std::size_t PEERS_IN_MAX
Definition Config.h:163
+
bool standalone() const
Definition Config.h:318
+
std::size_t PEERS_OUT_MAX
Definition Config.h:162
+
bool PEER_PRIVATE
Definition Config.h:155
+
std::size_t PEERS_MAX
Definition Config.h:161
T max(T... args)
T min(T... args)
diff --git a/PerfLogImp_8cpp_source.html b/PerfLogImp_8cpp_source.html index 4bfcb6357f..c27da2625d 100644 --- a/PerfLogImp_8cpp_source.html +++ b/PerfLogImp_8cpp_source.html @@ -734,7 +734,7 @@ $(document).ready(function() { init_codefold(0); });
Json::Value countersJson() const
Counters(std::set< char const * > const &labels, JobTypes const &jobTypes)
-
Configuration from [perf] section of rippled.cfg.
Definition PerfLog.h:46
+
Configuration from [perf] section of xrpld.cfg.
Definition PerfLog.h:46
boost::filesystem::path perfLog
Definition PerfLog.h:47
milliseconds logInterval
Definition PerfLog.h:49
diff --git a/PerfLogImp_8h_source.html b/PerfLogImp_8h_source.html index e34e7cf188..41cad6d763 100644 --- a/PerfLogImp_8h_source.html +++ b/PerfLogImp_8h_source.html @@ -368,7 +368,7 @@ $(document).ready(function() { init_codefold(0); });
std::unordered_map< std::string, Locked< Rpc > > rpc_
Definition PerfLogImp.h:88
Json::Value countersJson() const
-
Configuration from [perf] section of rippled.cfg.
Definition PerfLog.h:46
+
Configuration from [perf] section of xrpld.cfg.
Definition PerfLog.h:46
diff --git a/PerfLog_8h_source.html b/PerfLog_8h_source.html index 4b98b3611e..1ae3de6708 100644 --- a/PerfLog_8h_source.html +++ b/PerfLog_8h_source.html @@ -254,7 +254,7 @@ $(document).ready(function() { init_codefold(0); }); -
Configuration from [perf] section of rippled.cfg.
Definition PerfLog.h:46
+
Configuration from [perf] section of xrpld.cfg.
Definition PerfLog.h:46
boost::filesystem::path perfLog
Definition PerfLog.h:47
milliseconds logInterval
Definition PerfLog.h:49
diff --git a/PerfLog__test_8cpp_source.html b/PerfLog__test_8cpp_source.html index 22e81369c4..c9ec3338c2 100644 --- a/PerfLog__test_8cpp_source.html +++ b/PerfLog__test_8cpp_source.html @@ -1257,7 +1257,7 @@ $(document).ready(function() { init_codefold(0); });
Fixture(Application &app, beast::Journal j)
-
Configuration from [perf] section of rippled.cfg.
Definition PerfLog.h:46
+
Configuration from [perf] section of xrpld.cfg.
Definition PerfLog.h:46
diff --git a/RPCCall_8cpp_source.html b/RPCCall_8cpp_source.html index 0e43377291..54f9f69321 100644 --- a/RPCCall_8cpp_source.html +++ b/RPCCall_8cpp_source.html @@ -1950,8 +1950,8 @@ $(document).ready(function() { init_codefold(0); });
Stream trace() const
Severity stream access functions.
Definition Journal.h:303
-
bool quiet() const
Definition Config.h:307
-
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:255
+
bool quiet() const
Definition Config.h:308
+
std::optional< beast::IP::Endpoint > rpc_ip
Definition Config.h:256
static void request(bool bSSL, boost::asio::io_context &io_context, std::string strSite, unsigned short const port, std::function< void(boost::asio::streambuf &sb, std::string const &strHost)> build, std::size_t responseMax, std::chrono::seconds timeout, std::function< bool(boost::system::error_code const &ecResult, int iStatus, std::string const &strData)> complete, beast::Journal &j)
Manages partitions for logging.
Definition Log.h:33
beast::Journal journal(std::string const &name)
Definition Log.cpp:141
diff --git a/RPCLedgerHelpers_8cpp_source.html b/RPCLedgerHelpers_8cpp_source.html index f623ec32b6..8e85a18b08 100644 --- a/RPCLedgerHelpers_8cpp_source.html +++ b/RPCLedgerHelpers_8cpp_source.html @@ -617,7 +617,7 @@ $(document).ready(function() { init_codefold(0); });
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual beast::Journal journal(std::string const &name)=0
-
bool standalone() const
Definition Config.h:317
+
bool standalone() const
Definition Config.h:318
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
diff --git a/RipplePathFind_8cpp_source.html b/RipplePathFind_8cpp_source.html index 39f74e3ccf..ba1db01e6f 100644 --- a/RipplePathFind_8cpp_source.html +++ b/RipplePathFind_8cpp_source.html @@ -247,8 +247,8 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual PathRequests & getPathRequests()=0
-
int PATH_SEARCH_MAX
Definition Config.h:179
-
bool standalone() const
Definition Config.h:317
+
int PATH_SEARCH_MAX
Definition Config.h:180
+
bool standalone() const
Definition Config.h:318
std::chrono::seconds getValidatedLedgerAge()
std::shared_ptr< Ledger const > getClosedLedger()
Json::Value makeLegacyPathRequest(PathRequest::pointer &req, std::function< void(void)> completion, Resource::Consumer &consumer, std::shared_ptr< ReadView const > const &inLedger, Json::Value const &request)
diff --git a/SHAMapStoreImp_8cpp_source.html b/SHAMapStoreImp_8cpp_source.html index ddb90ab3be..ce48ab0f9a 100644 --- a/SHAMapStoreImp_8cpp_source.html +++ b/SHAMapStoreImp_8cpp_source.html @@ -818,8 +818,8 @@ $(document).ready(function() { init_codefold(0); });
void legacy(std::string const &section, std::string value)
Set a value that is not a key/value pair.
Section & section(std::string const &name)
Returns the section with the given name.
-
bool useTxTables() const
Definition Config.h:323
-
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1097
+
bool useTxTables() const
Definition Config.h:324
+
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1098
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
virtual std::shared_ptr< FullBelowCache > getFullBelowCache()=0
Return a pointer to the Family Full Below Cache.
std::optional< LedgerIndex > minSqlSeq()
diff --git a/SHAMapStore__test_8cpp_source.html b/SHAMapStore__test_8cpp_source.html index 848d4d8215..ce0e6ff170 100644 --- a/SHAMapStore__test_8cpp_source.html +++ b/SHAMapStore__test_8cpp_source.html @@ -764,7 +764,7 @@ $(document).ready(function() { init_codefold(0); });
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
Section & section(std::string const &name)
Returns the section with the given name.
-
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1097
+
int getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) const
Retrieve the default value for the item at the specified node size.
Definition Config.cpp:1098
beast::Journal journal(std::string const &name)
Definition Log.cpp:141
A NodeStore::Scheduler which uses the JobQueue.
static Manager & instance()
Returns the instance of the manager singleton.
diff --git a/ServerHandler_8cpp_source.html b/ServerHandler_8cpp_source.html index 29d1f87883..e17b20337d 100644 --- a/ServerHandler_8cpp_source.html +++ b/ServerHandler_8cpp_source.html @@ -1454,8 +1454,8 @@ $(document).ready(function() { init_codefold(0); });
Provides the beast::insight::Collector service.
virtual beast::insight::Group::ptr const & group(std::string const &name)=0
-
bool BETA_RPC_API
Definition Config.h:268
-
bool standalone() const
Definition Config.h:317
+
bool BETA_RPC_API
Definition Config.h:269
+
bool standalone() const
Definition Config.h:318
A pool of threads to perform work.
Definition JobQueue.h:38
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
Definition JobQueue.h:393
Provides server functionality for clients.
Definition NetworkOPs.h:70
diff --git a/ServerStatus__test_8cpp_source.html b/ServerStatus__test_8cpp_source.html index c34c48ccb7..180010a113 100644 --- a/ServerStatus__test_8cpp_source.html +++ b/ServerStatus__test_8cpp_source.html @@ -1381,7 +1381,7 @@ $(document).ready(function() { init_codefold(0); });
virtual LedgerMaster & getLedgerMaster()=0
virtual NetworkOPs & getOPs()=0
Section & section(std::string const &name)
Returns the section with the given name.
-
bool ELB_SUPPORT
Definition Config.h:119
+
bool ELB_SUPPORT
Definition Config.h:120
virtual void setAmendmentBlocked()=0
diff --git a/SignFor_8cpp_source.html b/SignFor_8cpp_source.html index 3bf5a6d041..14ef1f5765 100644 --- a/SignFor_8cpp_source.html +++ b/SignFor_8cpp_source.html @@ -129,7 +129,7 @@ $(document).ready(function() { init_codefold(0); });
Represents a JSON value.
Definition json_value.h:131
bool asBool() const
virtual Config & config()=0
-
bool canSign() const
Definition Config.h:329
+
bool canSign() const
Definition Config.h:330
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:76
Json::Value transactionSignFor(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
diff --git a/SignHandler_8cpp_source.html b/SignHandler_8cpp_source.html index ee7f2ea0d2..f457654eba 100644 --- a/SignHandler_8cpp_source.html +++ b/SignHandler_8cpp_source.html @@ -131,7 +131,7 @@ $(document).ready(function() { init_codefold(0); });
bool asBool() const
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
-
bool canSign() const
Definition Config.h:329
+
bool canSign() const
Definition Config.h:330
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:76
diff --git a/Simulate_8cpp_source.html b/Simulate_8cpp_source.html index 83e9df4f1a..1c61d3229b 100644 --- a/Simulate_8cpp_source.html +++ b/Simulate_8cpp_source.html @@ -479,7 +479,7 @@ $(document).ready(function() { init_codefold(0); });
virtual LoadFeeTrack & getFeeTrack()=0
virtual beast::Journal journal(std::string const &name)=0
virtual OpenLedger & openLedger()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
std::shared_ptr< OpenView const > current() const
Returns a view to the current open ledger.
Writable ledger view that accumulates state and tx changes.
Definition OpenView.h:46
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition ReadView.h:99
diff --git a/Submit_8cpp_source.html b/Submit_8cpp_source.html index 590a0f331e..eaed264278 100644 --- a/Submit_8cpp_source.html +++ b/Submit_8cpp_source.html @@ -269,7 +269,7 @@ $(document).ready(function() { init_codefold(0); });
virtual HashRouter & getHashRouter()=0
virtual Config & config()=0
virtual bool checkSigs() const =0
-
bool canSign() const
Definition Config.h:329
+
bool canSign() const
Definition Config.h:330
std::chrono::seconds getValidatedLedgerAge()
std::shared_ptr< ReadView const > getCurrentLedger()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:76
diff --git a/Subscribe_8cpp_source.html b/Subscribe_8cpp_source.html index 4d32f24409..a047c4d562 100644 --- a/Subscribe_8cpp_source.html +++ b/Subscribe_8cpp_source.html @@ -475,7 +475,7 @@ $(document).ready(function() { init_codefold(0); });
Issue in
Definition Book.h:19
std::optional< uint256 > domain
Definition Book.h:21
Issue out
Definition Book.h:20
-
bool useTxTables() const
Definition Config.h:323
+
bool useTxTables() const
Definition Config.h:324
virtual bool subTransactions(ref ispListener)=0
virtual error_code_i subAccountHistory(ref ispListener, AccountID const &account)=0
subscribe an account's new transactions and retrieve the account's historical transactions
virtual bool subPeerStatus(ref ispListener)=0
diff --git a/Subscribe__test_8cpp_source.html b/Subscribe__test_8cpp_source.html index 9ff8875f13..f62bc92d4f 100644 --- a/Subscribe__test_8cpp_source.html +++ b/Subscribe__test_8cpp_source.html @@ -1712,7 +1712,7 @@ $(document).ready(function() { init_codefold(0); });
virtual LoadFeeTrack & getFeeTrack()=0
virtual LoadManager & getLoadManager()=0
virtual NetworkOPs & getOPs()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
diff --git a/TransactionSign_8cpp_source.html b/TransactionSign_8cpp_source.html index c617d312f6..202a17d617 100644 --- a/TransactionSign_8cpp_source.html +++ b/TransactionSign_8cpp_source.html @@ -1620,11 +1620,11 @@ $(document).ready(function() { init_codefold(0); });
Like std::vector<char> but better.
Definition Buffer.h:17
std::size_t size() const noexcept
Returns the number of bytes in the buffer.
Definition Buffer.h:108
-
uint32_t NETWORK_ID
Definition Config.h:137
-
int PATH_SEARCH_OLD
Definition Config.h:176
-
bool BETA_RPC_API
Definition Config.h:268
-
bool standalone() const
Definition Config.h:317
-
FeeSetup FEES
Definition Config.h:185
+
uint32_t NETWORK_ID
Definition Config.h:138
+
int PATH_SEARCH_OLD
Definition Config.h:177
+
bool BETA_RPC_API
Definition Config.h:269
+
bool standalone() const
Definition Config.h:318
+
FeeSetup FEES
Definition Config.h:186
SOTemplate const * findSOTemplateBySField(SField const &sField) const
static InnerObjectFormats const & getInstance()
Currency currency
Definition Issue.h:16
diff --git a/Transactor_8cpp_source.html b/Transactor_8cpp_source.html index 519e0b80cf..fefe02ab0a 100644 --- a/Transactor_8cpp_source.html +++ b/Transactor_8cpp_source.html @@ -1513,7 +1513,7 @@ $(document).ready(function() { init_codefold(0); });
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
virtual void erase(std::shared_ptr< SLE > const &sle)=0
Remove a peeked SLE.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
-
uint32_t NETWORK_ID
Definition Config.h:137
+
uint32_t NETWORK_ID
Definition Config.h:138
RAII class to set and restore the current transaction rules.
Definition Rules.h:92
RAII class to set and restore the Number switchover.
Definition IOUAmount.h:192
A public key.
Definition PublicKey.h:43
diff --git a/TxHistory_8cpp_source.html b/TxHistory_8cpp_source.html index aa56b50cbd..42e56863a5 100644 --- a/TxHistory_8cpp_source.html +++ b/TxHistory_8cpp_source.html @@ -141,7 +141,7 @@ $(document).ready(function() { init_codefold(0); });
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
virtual RelationalDatabase & getRelationalDatabase()=0
-
bool useTxTables() const
Definition Config.h:323
+
bool useTxTables() const
Definition Config.h:324
virtual std::vector< std::shared_ptr< Transaction > > getTxHistory(LedgerIndex startIndex)=0
getTxHistory Returns the 20 most recent transactions starting from the given number.
void insertDeliverMax(Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
Definition DeliverMax.cpp:9
Charge const feeMediumBurdenRPC
diff --git a/TxQ_8cpp_source.html b/TxQ_8cpp_source.html index 6b1619658e..5c9474a6af 100644 --- a/TxQ_8cpp_source.html +++ b/TxQ_8cpp_source.html @@ -2121,7 +2121,7 @@ $(document).ready(function() { init_codefold(0); });
Editable, discardable view that can build metadata for one tx.
Section & section(std::string const &name)
Returns the section with the given name.
-
bool standalone() const
Definition Config.h:317
+
bool standalone() const
Definition Config.h:318
RAII class to set and restore the Number switchover.
Definition IOUAmount.h:192
std::shared_ptr< OpenView const > current() const
Returns a view to the current open ledger.
Writable ledger view that accumulates state and tx changes.
Definition OpenView.h:46
diff --git a/Tx_8cpp_source.html b/Tx_8cpp_source.html index e6cadaf54d..813e159688 100644 --- a/Tx_8cpp_source.html +++ b/Tx_8cpp_source.html @@ -432,8 +432,8 @@ $(document).ready(function() { init_codefold(0); });
virtual Config & config()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual TransactionMaster & getMasterTransaction()=0
-
uint32_t NETWORK_ID
Definition Config.h:137
-
bool useTxTables() const
Definition Config.h:323
+
uint32_t NETWORK_ID
Definition Config.h:138
+
bool useTxTables() const
Definition Config.h:324
std::shared_ptr< Ledger const > getLedgerBySeq(std::uint32_t index)
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
diff --git a/Version__test_8cpp_source.html b/Version__test_8cpp_source.html index bd1d5640b3..4338773a2f 100644 --- a/Version__test_8cpp_source.html +++ b/Version__test_8cpp_source.html @@ -386,8 +386,8 @@ $(document).ready(function() { init_codefold(0); });
A testsuite class.
Definition suite.h:52
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:152
-
bool BETA_RPC_API
Definition Config.h:268
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:460
+
bool BETA_RPC_API
Definition Config.h:269
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:461
diff --git a/XChain__test_8cpp_source.html b/XChain__test_8cpp_source.html index b0f7a56a85..9f8c8ab394 100644 --- a/XChain__test_8cpp_source.html +++ b/XChain__test_8cpp_source.html @@ -5411,7 +5411,7 @@ $(document).ready(function() { init_codefold(0); });
void pass()
Record a successful test condition.
Definition suite.h:508
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:152
virtual Config & config()=0
-
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:257
+
std::unordered_set< uint256, beast::uhash<> > features
Definition Config.h:258
A currency issued by an account.
Definition Issue.h:14
diff --git a/annotated.html b/annotated.html index 8d86baae73..cba3dc6ee3 100644 --- a/annotated.html +++ b/annotated.html @@ -354,34 +354,34 @@ $(function() {  CDirGuardCreate a directory and remove it when it's done  Cepsilon_multiple  CExtendedPaymentComponents - CFileDirGuardWrite a file in a directory and remove when done - Cflags_helper - CGeneratorProduces a sequence of secp256k1 key pairs - Cis_contiguous_container - Cis_contiguous_container< Container, std::void_t< decltype(std::declval< Container const >().size()), decltype(std::declval< Container const >().data()), typename Container::value_type > > - Cis_contiguous_container< Slice > - CLoanStateDeltas - CLocalValues - CBasicValue - CValue - CMessageHeader - Cmulti_runner_base - Cinner - CMultiApiJson - Cvisitor_t - CNodeIDTag - CNoEdgeData - CnonPresentObject_t - CPaymentComponents - CPeerDataCounts - CRawStateTable - CsleAction - Csles_iter_impl - CReadViewFwdIter - CReadViewFwdRange - Citerator - Cresults - CRippledCfgGuardWrite a rippled config file and remove when done + CFileCfgGuardWrite a xrpld config file and remove when done + CFileDirGuardWrite a file in a directory and remove when done + Cflags_helper + CGeneratorProduces a sequence of secp256k1 key pairs + Cis_contiguous_container + Cis_contiguous_container< Container, std::void_t< decltype(std::declval< Container const >().size()), decltype(std::declval< Container const >().data()), typename Container::value_type > > + Cis_contiguous_container< Slice > + CLoanStateDeltas + CLocalValues + CBasicValue + CValue + CMessageHeader + Cmulti_runner_base + Cinner + CMultiApiJson + Cvisitor_t + CNodeIDTag + CNoEdgeData + CnonPresentObject_t + CPaymentComponents + CPeerDataCounts + CRawStateTable + CsleAction + Csles_iter_impl + CReadViewFwdIter + CReadViewFwdRange + Citerator + Cresults  Csave_stream_state  CServerDefinitions  CSTVar @@ -503,7 +503,7 @@ $(function() {  NperfDummy class for unit tests  CLockedA box coupling data with a mutex for locking access to it  CPerfLogSingleton class that maintains performance counters and optionally writes Json-formatted data to a distinct log - CSetupConfiguration from [perf] section of rippled.cfg + CSetupConfiguration from [perf] section of xrpld.cfg  CPerfLogImpImplementation class for PerfLog  CCountersTrack performance counters and currently executing tasks  CJqJob Queue task performance counters diff --git a/classes.html b/classes.html index 3c32ca5ecb..aefa6a35b5 100644 --- a/classes.html +++ b/classes.html @@ -91,7 +91,7 @@ $(function() {
Digraph::Edge (xrpl::test::csf)
EitherAmount (xrpl)
aged_unordered_container::element (beast::detail)
LivecacheBase::Element (xrpl::PeerFinder::detail)
aged_ordered_container::element (beast::detail)
ElementComboIter (xrpl::test)
empty_base_optimization (beast::detail)
empty_base_optimization< T, UniqueID, false > (beast::detail)
enable_yield_to (beast::test)
EncodedBlob (xrpl::NodeStore)
Endpoint (beast::IP)
Endpoint (xrpl::PeerFinder)
HashRouter::Entry (xrpl)
Entry (xrpl::Resource)
Store::Entry (xrpl::PeerFinder)
Bootcache::Entry (xrpl::PeerFinder)
Env (xrpl::test::jtx)
Env_ss (xrpl::test::jtx)
Env_test (xrpl::test)
epsilon_multiple (xrpl::detail)
epsilon_t (xrpl::test::jtx)
equal_to (xrpl)
aged_associative_container_test_base::equal_value (beast)
aged_associative_container_test_base::EqualT (beast)
error (Json)
Reader::ErrorInfo (Json)
ErrorInfo (xrpl::RPC)
Escrow_test (xrpl::test)
EscrowCancel (xrpl)
EscrowCreate (xrpl)
EscrowFinish (xrpl)
EscrowToken_test (xrpl::test)
Scheduler::event (xrpl::test::csf)
reduce_relay_test::Event (xrpl::test)
Event (beast::insight)
Scheduler::event_impl (xrpl::test::csf)
EventImpl (beast::insight)
ExistingElementPool (xrpl::test)
Expected (xrpl)
Expected< void, E > (xrpl)
Expected_test (xrpl::test)
expiration (xrpl::test::jtx)
expiration (xrpl::test::jtx::token)
ExtendedPaymentComponents (xrpl::detail)
F
-
Factory (xrpl::NodeStore)
Family (xrpl)
FastWriter (Json)
Door::FDStats (xrpl)
Feature_test (xrpl)
FeatureBitset (xrpl)
AmendmentTable::FeatureInfo (xrpl)
fee (xrpl::test::jtx)
TxQ::FeeAndSeq (xrpl)
TxQ::FeeMetrics (xrpl)
Fees (xrpl)
FeeSettingsFields (xrpl::test)
FeeSetup (xrpl)
FeeVote (xrpl)
FeeVote_test (xrpl::test)
FeeVoteImpl (xrpl)
ValidatorSite_test::FetchListConfig (xrpl::test)
FetchPack_test (xrpl::tests)
FetchReport (xrpl::NodeStore)
field_t (beast)
STObject::FieldErr (xrpl)
Logs::File (xrpl)
FileDirGuard (xrpl::detail)
FileUtilities_test (xrpl)
fillJson_test (xrpl::RPC)
FindOversizeCross_test (xrpl::test)
Fixed (xrpl::PeerFinder)
FixNFTokenPageLinks_test (xrpl)
PerfLog_test::Fixture (xrpl)
flags (xrpl::test::jtx)
flags_helper (xrpl::detail)
Flow_manual_test (xrpl::test)
Flow_test (xrpl::test)
FlowDebugInfo (xrpl::path::detail)
FlowOfferStream (xrpl)
TrustGraph::ForkInfo (xrpl::test::csf)
fpad (beast)
Freeze_test (xrpl)
Fulfillment (xrpl::cryptoconditions)
FullyValidateLedger (xrpl::test::csf)
+
Factory (xrpl::NodeStore)
Family (xrpl)
FastWriter (Json)
Door::FDStats (xrpl)
Feature_test (xrpl)
FeatureBitset (xrpl)
AmendmentTable::FeatureInfo (xrpl)
fee (xrpl::test::jtx)
TxQ::FeeAndSeq (xrpl)
TxQ::FeeMetrics (xrpl)
Fees (xrpl)
FeeSettingsFields (xrpl::test)
FeeSetup (xrpl)
FeeVote (xrpl)
FeeVote_test (xrpl::test)
FeeVoteImpl (xrpl)
ValidatorSite_test::FetchListConfig (xrpl::test)
FetchPack_test (xrpl::tests)
FetchReport (xrpl::NodeStore)
field_t (beast)
STObject::FieldErr (xrpl)
Logs::File (xrpl)
FileCfgGuard (xrpl::detail)
FileDirGuard (xrpl::detail)
FileUtilities_test (xrpl)
fillJson_test (xrpl::RPC)
FindOversizeCross_test (xrpl::test)
Fixed (xrpl::PeerFinder)
FixNFTokenPageLinks_test (xrpl)
PerfLog_test::Fixture (xrpl)
flags (xrpl::test::jtx)
flags_helper (xrpl::detail)
Flow_manual_test (xrpl::test)
Flow_test (xrpl::test)
FlowDebugInfo (xrpl::path::detail)
FlowOfferStream (xrpl)
TrustGraph::ForkInfo (xrpl::test::csf)
fpad (beast)
Freeze_test (xrpl)
Fulfillment (xrpl::cryptoconditions)
FullyValidateLedger (xrpl::test::csf)
G
AMMTest::gate (xrpl::test::jtx)
Path_test::gate (xrpl::test)
Coroutine_test::gate (xrpl::test)
GatewayBalances_test (xrpl::test)
Gauge (beast::insight)
GaugeImpl (beast::insight)
Generator (xrpl::detail)
GetAggregatePrice_test (xrpl::test::jtx::oracle)
GetAmendments_test (xrpl::test)
GetCounts_test (xrpl)
Gossip (xrpl::Resource)
Group (beast::insight)
GroupImp (beast::insight::detail)
Groups (beast::insight)
GroupsImp (beast::insight::detail)
GRPCContext (xrpl::RPC)
GRPCServer (xrpl)
GRPCServerImpl (xrpl)
GRPCTestClientBase (xrpl::test)
Number::Guard (xrpl)
@@ -127,7 +127,7 @@ $(function() {
Quality_test (xrpl)
QualityFunction (xrpl)
qualityIn (xrpl::test::jtx)
qualityInPercent (xrpl::test::jtx)
qualityOut (xrpl::test::jtx)
qualityOutPercent (xrpl::test::jtx)
HTTPClientImp::Query (xrpl)
Scheduler::queue_type (xrpl::test::csf)
TimeoutCounter::QueueJobParameter (xrpl)
R
-
RandomAccountParams (xrpl::test)
Rate (xrpl)
Rate (xrpl::test::csf)
TaggedPointer::RawAllocateTag (xrpl)
RawStateTable (xrpl::detail)
RawView (xrpl)
RCLCensorshipDetector (xrpl)
RCLCensorshipDetector_test (xrpl::test)
RCLConsensus (xrpl)
RclConsensusLogger (xrpl)
RCLCxLedger (xrpl)
RCLCxPeerPos (xrpl)
RCLCxTx (xrpl)
RCLTxSet (xrpl)
RCLValidatedLedger (xrpl)
RCLValidation (xrpl)
RCLValidations_test (xrpl::test)
RCLValidationsAdaptor (xrpl)
json_body::reader (xrpl)
Reader (Json)
ReadView (xrpl)
ReadViewFwdIter (xrpl::detail)
ReadViewFwdRange (xrpl::detail)
aged_associative_container_test_base::AllocT::rebind (beast)
Receive (xrpl::test::csf)
SlotImp::recent_t (xrpl::PeerFinder)
recorder (beast::unit_test)
RedirectHandouts (xrpl::PeerFinder)
reduce_relay_simulate_test (xrpl::test)
reduce_relay_test (xrpl::test)
ReducedOffer_test (xrpl::test)
IntrusiveRefCounts::RefCountPair (xrpl)
Reg (xrpl::test::jtx)
Regression_test (xrpl::test)
RelationalDatabase (xrpl)
Relay (xrpl::test::csf)
RemoveArg (xrpl::test::jtx::oracle)
reporter (beast::unit_test::detail)
Request (xrpl::RPC)
require (xrpl::test::jtx)
requireAny (xrpl::test::jtx)
Resolver (xrpl)
ResolverAsio (xrpl)
ResolverAsioImpl (xrpl)
ValidatorSite::Site::Resource (xrpl)
ResourceManager_test (xrpl::Resource)
results (beast::unit_test)
Source::Results (xrpl::PeerFinder)
results (xrpl::detail)
reporter::results (beast::unit_test::detail)
RFC1751 (xrpl)
ripesha_hasher (xrpl)
RippleCalc (xrpl::path)
RippleCalcTestParams (xrpl::test)
RippledCfgGuard (xrpl::detail)
RippleLineCache (xrpl)
RobustTransaction_test (xrpl::test)
Roles_test (xrpl::test)
rootIndex (xrpl::test::jtx::token)
Peer::Router (xrpl::test::csf)
PerfLogImp::Counters::Rpc (xrpl::perf)
rpc (xrpl::test::jtx)
RPCCall_test (xrpl::test)
RPCCallImp (xrpl)
RPCCallTestData (xrpl::test)
RPCHelpers_test (xrpl::test)
RPCOverload_test (xrpl::test)
RPCParser (xrpl)
RPCSub (xrpl)
RPCSubImp (xrpl)
RPCTrustLine (xrpl)
Rules (xrpl)
runner (beast::unit_test)
+
RandomAccountParams (xrpl::test)
Rate (xrpl)
Rate (xrpl::test::csf)
TaggedPointer::RawAllocateTag (xrpl)
RawStateTable (xrpl::detail)
RawView (xrpl)
RCLCensorshipDetector (xrpl)
RCLCensorshipDetector_test (xrpl::test)
RCLConsensus (xrpl)
RclConsensusLogger (xrpl)
RCLCxLedger (xrpl)
RCLCxPeerPos (xrpl)
RCLCxTx (xrpl)
RCLTxSet (xrpl)
RCLValidatedLedger (xrpl)
RCLValidation (xrpl)
RCLValidations_test (xrpl::test)
RCLValidationsAdaptor (xrpl)
json_body::reader (xrpl)
Reader (Json)
ReadView (xrpl)
ReadViewFwdIter (xrpl::detail)
ReadViewFwdRange (xrpl::detail)
aged_associative_container_test_base::AllocT::rebind (beast)
Receive (xrpl::test::csf)
SlotImp::recent_t (xrpl::PeerFinder)
recorder (beast::unit_test)
RedirectHandouts (xrpl::PeerFinder)
reduce_relay_simulate_test (xrpl::test)
reduce_relay_test (xrpl::test)
ReducedOffer_test (xrpl::test)
IntrusiveRefCounts::RefCountPair (xrpl)
Reg (xrpl::test::jtx)
Regression_test (xrpl::test)
RelationalDatabase (xrpl)
Relay (xrpl::test::csf)
RemoveArg (xrpl::test::jtx::oracle)
reporter (beast::unit_test::detail)
Request (xrpl::RPC)
require (xrpl::test::jtx)
requireAny (xrpl::test::jtx)
Resolver (xrpl)
ResolverAsio (xrpl)
ResolverAsioImpl (xrpl)
ValidatorSite::Site::Resource (xrpl)
ResourceManager_test (xrpl::Resource)
reporter::results (beast::unit_test::detail)
results (beast::unit_test)
results (xrpl::detail)
Source::Results (xrpl::PeerFinder)
RFC1751 (xrpl)
ripesha_hasher (xrpl)
RippleCalc (xrpl::path)
RippleCalcTestParams (xrpl::test)
RippleLineCache (xrpl)
RobustTransaction_test (xrpl::test)
Roles_test (xrpl::test)
rootIndex (xrpl::test::jtx::token)
Peer::Router (xrpl::test::csf)
PerfLogImp::Counters::Rpc (xrpl::perf)
rpc (xrpl::test::jtx)
RPCCall_test (xrpl::test)
RPCCallImp (xrpl)
RPCCallTestData (xrpl::test)
RPCHelpers_test (xrpl::test)
RPCOverload_test (xrpl::test)
RPCParser (xrpl)
RPCSub (xrpl)
RPCSubImp (xrpl)
RPCTrustLine (xrpl)
Rules (xrpl)
runner (beast::unit_test)
S
io_latency_probe::sample_op (beast)
Sandbox (xrpl)
save_stream_state (xrpl::detail)
SavedState (xrpl)
SHAMapStoreImp::SavedStateDB (xrpl)
saveNumberRoundMode (xrpl)
ScaleFreeSim_test (xrpl::test)
Scheduler (xrpl::NodeStore)
Scheduler (xrpl::test::csf)
Scheduler_test (xrpl::test)
scope_exit (xrpl)
scope_fail (xrpl)
scope_success (xrpl)
scope_unlock (xrpl)
suite::scoped_testcase (beast::unit_test)
Journal::ScopedStream (beast)
SecretKey (xrpl)
SecretKey_test (xrpl)
Section (xrpl)
Seed (xrpl)
Seed_test (xrpl)
selector (beast::unit_test)
Selector (xrpl::test::csf)
SemanticVersion (beast)
SemanticVersion_test (beast)
send_always (xrpl)
send_if_not_pred (xrpl)
send_if_pred (xrpl)
sendmax (xrpl::test::jtx)
SEnv (xrpl::test)
seq (xrpl::test::jtx)
SeqEnforcer (xrpl)
SeqProxy (xrpl)
SeqProxy_test (xrpl)
Sequence (xrpl::NodeStore)
SerialIter (xrpl)
Serializer (xrpl)
Serializer_test (xrpl)
Server (xrpl)
short_read_test::Server (xrpl)
Server_test (xrpl::test)
ServerDefinitions (xrpl::detail)
ServerDefinitions_test (xrpl::test)
NetworkOPsImp::ServerFeeSummary (xrpl)
ServerHandler (xrpl)
ServerHandler::ServerHandlerCreator (xrpl)
ServerImpl (xrpl)
ServerInfo_test (xrpl::test)
ServerStatus_test (xrpl::test)
Session (xrpl)
PropertyStream::Set (beast)
SetAccount (xrpl)
Vault::SetArgs (xrpl::test::jtx)
SetAuth_test (xrpl::test)
SetOracle (xrpl)
SetRegularKey (xrpl)
SetRegularKey_test (xrpl)
SetSignerList (xrpl)
SetTrust (xrpl)
SetTrust_test (xrpl::test)
TxQ::Setup (xrpl)
ServerHandler::Setup (xrpl)
Overlay::Setup (xrpl)
HashRouter::Setup (xrpl)
PerfLog::Setup (xrpl::perf)
DatabaseCon::Setup (xrpl)
LedgerLoad_test::SetupData (xrpl)
SField (xrpl)
SHAMap (xrpl)
SHAMap_test (xrpl::tests)
SHAMapAccountStateLeafNode (xrpl)
SHAMapAddNode (xrpl)
SHAMapHash (xrpl)
SHAMapInnerNode (xrpl)
SHAMapItem (xrpl)
SHAMapLeafNode (xrpl)
SHAMapMissingNode (xrpl)
SHAMapNodeID (xrpl)
SHAMapPathProof_test (xrpl::tests)
SHAMapStore (xrpl)
SHAMapStore_test (xrpl::test)
SHAMapStoreImp (xrpl)
SHAMapSync_test (xrpl::tests)
SHAMapSyncFilter (xrpl)
SHAMapTreeNode (xrpl)
SHAMapTxLeafNode (xrpl)
SHAMapTxPlusMetaLeafNode (xrpl)
Share (xrpl::test::csf)
SharedIntrusive (xrpl)
SharedIntrusiveAdoptIncrementStrongTag (xrpl)
SharedIntrusiveAdoptNoIncrementTag (xrpl)
SharedWeakCachePointer (xrpl)
SharedWeakUnion (xrpl)
ValidVault::Shares (xrpl)
short_read_test (xrpl)
sig (xrpl::test::jtx::batch)
sig (xrpl::test::jtx)
signer (xrpl::test::jtx)
SignerEntries (xrpl)
SignerEntries::SignerEntry (xrpl)
SigningForParams (xrpl::RPC::detail)
Env_ss::SignSubmitRunner (xrpl::test::jtx)
Sim (xrpl::test::csf)
SimDurationCollector (xrpl::test::csf)
SimpleWriter (xrpl)
Simulate_test (xrpl::test)
SingleMetrics (xrpl::metrics)
Journal::Sink (beast)
Logs::Sink (xrpl)
ValidatorSite::Site (xrpl)
SkipList_test (xrpl::test)
SkipListAcquire (xrpl)
SkipListAcquire::SkipListData (xrpl)
SlabAllocator (xrpl)
SlabAllocatorSet (xrpl)
SlabAllocator::SlabBlock (xrpl)
SlabAllocatorSet::SlabConfig (xrpl)
RawStateTable::sleAction (xrpl::detail)
RawStateTable::sles_iter_impl (xrpl::detail)
Ledger::sles_iter_impl (xrpl)
ReadView::sles_type (xrpl)
ValidPermissionedDomain::SleStatus (xrpl)
Slice (xrpl)
Slot (xrpl::PeerFinder)
Slot (xrpl::reduce_relay)
SlotHandouts (xrpl::PeerFinder)
SlotImp (xrpl::PeerFinder)
Slots (xrpl::reduce_relay)
XChainSim_test::SmBase (xrpl::test)
XChainSim_test::SmCreateAccount (xrpl::test)
XChainSim_test::SmTransfer (xrpl::test)
TxQ::FeeMetrics::Snapshot (xrpl)
SociDB_test (xrpl)
SOElement (xrpl)
SOTemplate (xrpl)
PropertyStream::Source (beast)
InfoSub::Source (xrpl)
Source (xrpl::PeerFinder)
source_tag (xrpl::test::jtx)
SourceStrings (xrpl::PeerFinder)
SourceStringsImp (xrpl::PeerFinder)
Span (xrpl::ledger_trie_detail)
SpanTip (xrpl)
spinlock (xrpl)
SQLiteDatabase (xrpl)
SQLiteDatabaseImp (xrpl)
Squelch (xrpl::reduce_relay)
SquelchHandler (xrpl::reduce_relay)
SSLHTTPPeer (xrpl)
SSLWSPeer (xrpl)
STAccount (xrpl)
STAccount_test (xrpl)
stag (xrpl::test::jtx)
STAmount (xrpl)
STAmount_test (xrpl)
stAmountField (xrpl::test::jtx)
STArray (xrpl)
StartRound (xrpl::test::csf)
aged_ordered_container::element::stashed (beast::detail)
aged_unordered_container::element::stashed (beast::detail)
NetworkOPsImp::StateAccounting (xrpl)
ExistingElementPool::StateGuard (xrpl::test)
StaticCastTagSharedIntrusive (xrpl)
StaticString (Json)
ManagerImp::Stats (xrpl::PeerFinder)
TaggedCache::Stats (xrpl)
Logic::Stats (xrpl::Resource)
OverlayImpl::Stats (xrpl)
NetworkOPsImp::Stats (xrpl)
LoadMonitor::Stats (xrpl)
LedgerMaster::Stats (xrpl)
StatsDCollector (beast::insight)
StatsDCollectorImp (beast::insight::detail)
StatsDCounterImpl (beast::insight::detail)
StatsDEventImpl (beast::insight::detail)
StatsDGaugeImpl (beast::insight::detail)
StatsDHookImpl (beast::insight::detail)
StatsDMeterImpl (beast::insight::detail)
StatsDMetricBase (beast::insight::detail)
Status (xrpl::RPC)
ValidatorSite::Site::Status (xrpl)
STBase (xrpl)
STBitString (xrpl)
STBlob (xrpl)
STCurrency (xrpl)
Step (xrpl)
TOfferStreamBase::StepCounter (xrpl)
ConnectAttempt::StepTimeouts (xrpl)
STExchange (xrpl)
STExchange< STBlob, Buffer > (xrpl)
STExchange< STBlob, PublicKey > (xrpl)
STExchange< STBlob, Slice > (xrpl)
STExchange< STInteger< U >, T > (xrpl)
STInteger (xrpl)
STInteger_test (xrpl)
STIssue (xrpl)
STIssue_test (xrpl::test)
STLedgerEntry (xrpl)
STNumber (xrpl)
STNumber_test (xrpl)
STObject (xrpl)
STObject_test (xrpl)
Store (xrpl::PeerFinder)
StoreSqdb (xrpl::PeerFinder)
STParsedJSON_test (xrpl)
STParsedJSONObject (xrpl)
STPath (xrpl)
STPathElement (xrpl)
STPathSet (xrpl)
StrandContext (xrpl)
StrandResult (xrpl)
Journal::Stream (beast)
StreambufWSMsg (xrpl)
StreamCollector (xrpl::test::csf)
StreamSink (xrpl::test)
StringUtilities_test (xrpl)
STTx (xrpl)
STTx_test (xrpl)
STValidation (xrpl)
STValidation_test (xrpl)
STVar (xrpl::detail)
STVector256 (xrpl)
STXChainBridge (xrpl)
StyledStreamWriter (Json)
StyledWriter (Json)
NetworkOPsImp::SubAccountHistoryIndex (xrpl)
NetworkOPsImp::SubAccountHistoryInfo (xrpl)
NetworkOPsImp::SubAccountHistoryInfoWeak (xrpl)
LedgerEntry_test::Subfield (xrpl::test)
Transaction::SubmitResult (xrpl)
Submitter (xrpl::test::csf)
SubmitTx (xrpl::test::csf)
Subscribe_test (xrpl::test)
ClosureCounter::Substitute (xrpl)
suite (beast::unit_test)
suite_info (beast::unit_test)
suite_list (beast::unit_test)
reporter::suite_results (beast::unit_test::detail)
suite_results (beast::unit_test)
suite_results (xrpl::detail)
SuiteJournal (xrpl::test)
SuiteJournalSink (xrpl::test)
SuiteLogs (xrpl::test::jtx)
diff --git a/classxrpl_1_1Config-members.html b/classxrpl_1_1Config-members.html index 4a20dc132d..5c1923b954 100644 --- a/classxrpl_1_1Config-members.html +++ b/classxrpl_1_1Config-members.html @@ -88,97 +88,98 @@ $(function() { CONFIG_DIRxrpl::Config CONFIG_FILExrpl::Configprivate configFileNamexrpl::Configstatic - databaseDirNamexrpl::Configstatic - DEBUG_LOGFILExrpl::Configprivate - deprecatedClearSection(std::string const &section)xrpl::BasicConfig - doImportxrpl::Config - ELB_SUPPORTxrpl::Config - exists(std::string const &name) constxrpl::BasicConfig - FAST_LOADxrpl::Config - featuresxrpl::Config - FEE_UNITS_DEPRECATEDxrpl::Configstatic - FEESxrpl::Config - FETCH_DEPTHxrpl::Config - FORCE_MULTI_THREADxrpl::Config - FORCED_LEDGER_RANGE_PRESENTxrpl::Config - FRESH enum valuexrpl::Config - getDebugLogFile() constxrpl::Config - getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) constxrpl::Config - had_trailing_comments() constxrpl::BasicConfig - IO_WORKERSxrpl::Config - IPSxrpl::Config - IPS_FIXEDxrpl::Config - j_xrpl::Configprivate - journal() constxrpl::Config - LEDGER_HISTORYxrpl::Config - LEDGER_REPLAYxrpl::Config - legacy(std::string const &section, std::string value)xrpl::BasicConfig - legacy(std::string const &sectionName) constxrpl::BasicConfig - LOAD enum valuexrpl::Config - load()xrpl::Configprivate - LOAD_FILE enum valuexrpl::Config - loadFromString(std::string const &fileContents)xrpl::Config - map_xrpl::BasicConfigprivate - MAX_DIVERGED_TIMExrpl::Config - MAX_JOB_QUEUE_TXxrpl::Configstatic - MAX_TRANSACTIONSxrpl::Config - MAX_UNKNOWN_TIMExrpl::Config - MIN_JOB_QUEUE_TXxrpl::Configstatic - NETWORK enum valuexrpl::Config - NETWORK_IDxrpl::Config - NETWORK_QUORUMxrpl::Config - NODE_SIZExrpl::Config - NORMAL enum valuexrpl::Config - operator[](std::string const &name) constxrpl::BasicConfig - operator[](std::string const &name)xrpl::BasicConfig - overwrite(std::string const &section, std::string const &key, std::string const &value)xrpl::BasicConfig - PATH_SEARCHxrpl::Config - PATH_SEARCH_FASTxrpl::Config - PATH_SEARCH_MAXxrpl::Config - PATH_SEARCH_OLDxrpl::Config - PEER_PRIVATExrpl::Config - PEERS_IN_MAXxrpl::Config - PEERS_MAXxrpl::Config - PEERS_OUT_MAXxrpl::Config - PREFETCH_WORKERSxrpl::Config - quiet() constxrpl::Config - QUIETxrpl::Configprivate - ramSize_xrpl::Configprivate - RELAY_UNTRUSTED_PROPOSALSxrpl::Config - RELAY_UNTRUSTED_VALIDATIONSxrpl::Config - REPLAY enum valuexrpl::Config - rpc_ipxrpl::Config - RUN_STANDALONExrpl::Configprivate - section(std::string const &name)xrpl::BasicConfig - section(std::string const &name) constxrpl::BasicConfig - SERVER_DOMAINxrpl::Config - setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)xrpl::Config - setupControl(bool bQuiet, bool bSilent, bool bStandalone)xrpl::Config - signingEnabled_xrpl::Configprivate - SILENTxrpl::Configprivate + configLegacyNamexrpl::Configstatic + databaseDirNamexrpl::Configstatic + DEBUG_LOGFILExrpl::Configprivate + deprecatedClearSection(std::string const &section)xrpl::BasicConfig + doImportxrpl::Config + ELB_SUPPORTxrpl::Config + exists(std::string const &name) constxrpl::BasicConfig + FAST_LOADxrpl::Config + featuresxrpl::Config + FEE_UNITS_DEPRECATEDxrpl::Configstatic + FEESxrpl::Config + FETCH_DEPTHxrpl::Config + FORCE_MULTI_THREADxrpl::Config + FORCED_LEDGER_RANGE_PRESENTxrpl::Config + FRESH enum valuexrpl::Config + getDebugLogFile() constxrpl::Config + getValueFor(SizedItem item, std::optional< std::size_t > node=std::nullopt) constxrpl::Config + had_trailing_comments() constxrpl::BasicConfig + IO_WORKERSxrpl::Config + IPSxrpl::Config + IPS_FIXEDxrpl::Config + j_xrpl::Configprivate + journal() constxrpl::Config + LEDGER_HISTORYxrpl::Config + LEDGER_REPLAYxrpl::Config + legacy(std::string const &section, std::string value)xrpl::BasicConfig + legacy(std::string const &sectionName) constxrpl::BasicConfig + LOAD enum valuexrpl::Config + load()xrpl::Configprivate + LOAD_FILE enum valuexrpl::Config + loadFromString(std::string const &fileContents)xrpl::Config + map_xrpl::BasicConfigprivate + MAX_DIVERGED_TIMExrpl::Config + MAX_JOB_QUEUE_TXxrpl::Configstatic + MAX_TRANSACTIONSxrpl::Config + MAX_UNKNOWN_TIMExrpl::Config + MIN_JOB_QUEUE_TXxrpl::Configstatic + NETWORK enum valuexrpl::Config + NETWORK_IDxrpl::Config + NETWORK_QUORUMxrpl::Config + NODE_SIZExrpl::Config + NORMAL enum valuexrpl::Config + operator[](std::string const &name) constxrpl::BasicConfig + operator[](std::string const &name)xrpl::BasicConfig + overwrite(std::string const &section, std::string const &key, std::string const &value)xrpl::BasicConfig + PATH_SEARCHxrpl::Config + PATH_SEARCH_FASTxrpl::Config + PATH_SEARCH_MAXxrpl::Config + PATH_SEARCH_OLDxrpl::Config + PEER_PRIVATExrpl::Config + PEERS_IN_MAXxrpl::Config + PEERS_MAXxrpl::Config + PEERS_OUT_MAXxrpl::Config + PREFETCH_WORKERSxrpl::Config + quiet() constxrpl::Config + QUIETxrpl::Configprivate + ramSize_xrpl::Configprivate + RELAY_UNTRUSTED_PROPOSALSxrpl::Config + RELAY_UNTRUSTED_VALIDATIONSxrpl::Config + REPLAY enum valuexrpl::Config + rpc_ipxrpl::Config + RUN_STANDALONExrpl::Configprivate + section(std::string const &name)xrpl::BasicConfig + section(std::string const &name) constxrpl::BasicConfig + SERVER_DOMAINxrpl::Config + setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)xrpl::Config + setupControl(bool bQuiet, bool bSilent, bool bStandalone)xrpl::Config + signingEnabled_xrpl::Configprivate silent() constxrpl::Config - SSL_VERIFYxrpl::Config - SSL_VERIFY_DIRxrpl::Config - SSL_VERIFY_FILExrpl::Config - standalone() constxrpl::Config - START_LEDGERxrpl::Config - START_UPxrpl::Config - START_VALIDxrpl::Config - StartUpType enum namexrpl::Config - SWEEP_INTERVALxrpl::Config - TRAP_TX_HASHxrpl::Config - TX_REDUCE_RELAY_ENABLExrpl::Config - TX_REDUCE_RELAY_METRICSxrpl::Config - TX_REDUCE_RELAY_MIN_PEERSxrpl::Config - TX_RELAY_PERCENTAGExrpl::Config - USE_TX_TABLESxrpl::Configprivate - useTxTables() constxrpl::Config - VALIDATION_QUORUMxrpl::Config - VALIDATOR_LIST_THRESHOLDxrpl::Config - validatorsFileNamexrpl::Configstatic - VP_REDUCE_RELAY_BASE_SQUELCH_ENABLExrpl::Config - VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERSxrpl::Config - WORKERSxrpl::Config + SILENTxrpl::Configprivate + SSL_VERIFYxrpl::Config + SSL_VERIFY_DIRxrpl::Config + SSL_VERIFY_FILExrpl::Config + standalone() constxrpl::Config + START_LEDGERxrpl::Config + START_UPxrpl::Config + START_VALIDxrpl::Config + StartUpType enum namexrpl::Config + SWEEP_INTERVALxrpl::Config + TRAP_TX_HASHxrpl::Config + TX_REDUCE_RELAY_ENABLExrpl::Config + TX_REDUCE_RELAY_METRICSxrpl::Config + TX_REDUCE_RELAY_MIN_PEERSxrpl::Config + TX_RELAY_PERCENTAGExrpl::Config + USE_TX_TABLESxrpl::Configprivate + useTxTables() constxrpl::Config + VALIDATION_QUORUMxrpl::Config + VALIDATOR_LIST_THRESHOLDxrpl::Config + validatorsFileNamexrpl::Configstatic + VP_REDUCE_RELAY_BASE_SQUELCH_ENABLExrpl::Config + VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERSxrpl::Config + WORKERSxrpl::Config
@@ -443,7 +445,7 @@ Private Attributes
-

Definition at line 243 of file Config.cpp.

+

Definition at line 244 of file Config.cpp.

@@ -465,7 +467,7 @@ Private Attributes

Returns the full path and filename of the debug log file.

-

Definition at line 1063 of file Config.cpp.

+

Definition at line 1064 of file Config.cpp.

@@ -492,7 +494,7 @@ Private Attributes
-

Definition at line 437 of file Config.cpp.

+

Definition at line 438 of file Config.cpp.

@@ -534,7 +536,7 @@ Private Attributes
-

Definition at line 292 of file Config.cpp.

+

Definition at line 293 of file Config.cpp.

@@ -570,7 +572,7 @@ Private Attributes
-

Definition at line 250 of file Config.cpp.

+

Definition at line 251 of file Config.cpp.

@@ -598,7 +600,7 @@ Private Attributes -

Definition at line 460 of file Config.cpp.

+

Definition at line 461 of file Config.cpp.

@@ -617,7 +619,7 @@ Private Attributes
-

Definition at line 307 of file Config.h.

+

Definition at line 308 of file Config.h.

@@ -636,7 +638,7 @@ Private Attributes
-

Definition at line 312 of file Config.h.

+

Definition at line 313 of file Config.h.

@@ -655,7 +657,7 @@ Private Attributes
-

Definition at line 317 of file Config.h.

+

Definition at line 318 of file Config.h.

@@ -674,7 +676,7 @@ Private Attributes
-

Definition at line 323 of file Config.h.

+

Definition at line 324 of file Config.h.

@@ -693,7 +695,7 @@ Private Attributes
-

Definition at line 329 of file Config.h.

+

Definition at line 330 of file Config.h.

@@ -740,7 +742,7 @@ Private Attributes
Returns
The value for the requested item.
Note
The defaults are selected so as to be reasonable, but the node size is an imprecise metric that combines multiple aspects of the underlying system; this means that we can't provide optimal defaults in the code for every case.
-

Definition at line 1097 of file Config.cpp.

+

Definition at line 1098 of file Config.cpp.

@@ -759,7 +761,7 @@ Private Attributes
-

Definition at line 356 of file Config.h.

+

Definition at line 357 of file Config.h.

@@ -1137,7 +1139,7 @@ Private Attributes - +
char const *const xrpl::Config::configFileName = "rippled.cfg"char const *const xrpl::Config::configFileName = "xrpld.cfg"
@@ -1149,6 +1151,30 @@ Private Attributes

Definition at line 70 of file Config.h.

+
+
+ +

◆ configLegacyName

+ +
+
+ + + + + +
+ + + + +
char const *const xrpl::Config::configLegacyName = "rippled.cfg"
+
+static
+
+ +

Definition at line 71 of file Config.h.

+
@@ -1171,7 +1197,7 @@ Private Attributes
-

Definition at line 71 of file Config.h.

+

Definition at line 72 of file Config.h.

@@ -1195,7 +1221,7 @@ Private Attributes
-

Definition at line 72 of file Config.h.

+

Definition at line 73 of file Config.h.

@@ -1219,7 +1245,7 @@ Private Attributes
-

Definition at line 79 of file Config.h.

+

Definition at line 80 of file Config.h.

@@ -1235,7 +1261,7 @@ Private Attributes
-

Definition at line 82 of file Config.h.

+

Definition at line 83 of file Config.h.

@@ -1259,7 +1285,7 @@ Private Attributes
-

Definition at line 85 of file Config.h.

+

Definition at line 86 of file Config.h.

@@ -1283,7 +1309,7 @@ Private Attributes
-

Definition at line 89 of file Config.h.

+

Definition at line 90 of file Config.h.

@@ -1307,7 +1333,7 @@ Private Attributes
-

Definition at line 91 of file Config.h.

+

Definition at line 92 of file Config.h.

@@ -1331,7 +1357,7 @@ Private Attributes
-

Definition at line 92 of file Config.h.

+

Definition at line 93 of file Config.h.

@@ -1363,7 +1389,7 @@ Private Attributes
  • If no ledger is loaded, the default ledger with the root account is created.
  • -

    Definition at line 102 of file Config.h.

    +

    Definition at line 103 of file Config.h.

    @@ -1387,7 +1413,7 @@ Private Attributes
    -

    Definition at line 104 of file Config.h.

    +

    Definition at line 105 of file Config.h.

    @@ -1414,7 +1440,7 @@ Private Attributes

    Determines if the server will sign a tx, given an account's secret seed.

    In the past, this was allowed, but this functionality can have security implications. The new default is to not allow this functionality, but a config option is included to enable this.

    -

    Definition at line 112 of file Config.h.

    +

    Definition at line 113 of file Config.h.

    @@ -1438,7 +1464,7 @@ Private Attributes
    -

    Definition at line 115 of file Config.h.

    +

    Definition at line 116 of file Config.h.

    @@ -1454,7 +1480,7 @@ Private Attributes
    -

    Definition at line 118 of file Config.h.

    +

    Definition at line 119 of file Config.h.

    @@ -1470,7 +1496,7 @@ Private Attributes
    -

    Definition at line 119 of file Config.h.

    +

    Definition at line 120 of file Config.h.

    @@ -1486,7 +1512,7 @@ Private Attributes
    -

    Definition at line 122 of file Config.h.

    +

    Definition at line 123 of file Config.h.

    @@ -1502,7 +1528,7 @@ Private Attributes
    -

    Definition at line 125 of file Config.h.

    +

    Definition at line 126 of file Config.h.

    @@ -1518,7 +1544,7 @@ Private Attributes
    -

    Definition at line 128 of file Config.h.

    +

    Definition at line 129 of file Config.h.

    @@ -1534,7 +1560,7 @@ Private Attributes
    -

    Definition at line 130 of file Config.h.

    +

    Definition at line 131 of file Config.h.

    @@ -1550,7 +1576,7 @@ Private Attributes
    -

    Definition at line 132 of file Config.h.

    +

    Definition at line 133 of file Config.h.

    @@ -1566,7 +1592,7 @@ Private Attributes
    -

    Definition at line 134 of file Config.h.

    +

    Definition at line 135 of file Config.h.

    @@ -1582,7 +1608,7 @@ Private Attributes
    -

    Definition at line 137 of file Config.h.

    +

    Definition at line 138 of file Config.h.

    @@ -1606,7 +1632,7 @@ Private Attributes
    -

    Definition at line 141 of file Config.h.

    +

    Definition at line 142 of file Config.h.

    @@ -1622,7 +1648,7 @@ Private Attributes
    -

    Definition at line 145 of file Config.h.

    +

    Definition at line 146 of file Config.h.

    @@ -1638,7 +1664,7 @@ Private Attributes
    -

    Definition at line 150 of file Config.h.

    +

    Definition at line 151 of file Config.h.

    @@ -1654,7 +1680,7 @@ Private Attributes
    -

    Definition at line 151 of file Config.h.

    +

    Definition at line 152 of file Config.h.

    @@ -1670,7 +1696,7 @@ Private Attributes
    -

    Definition at line 154 of file Config.h.

    +

    Definition at line 155 of file Config.h.

    @@ -1686,7 +1712,7 @@ Private Attributes
    -

    Definition at line 160 of file Config.h.

    +

    Definition at line 161 of file Config.h.

    @@ -1702,7 +1728,7 @@ Private Attributes
    -

    Definition at line 161 of file Config.h.

    +

    Definition at line 162 of file Config.h.

    @@ -1718,7 +1744,7 @@ Private Attributes
    -

    Definition at line 162 of file Config.h.

    +

    Definition at line 163 of file Config.h.

    @@ -1734,7 +1760,7 @@ Private Attributes
    -

    Definition at line 176 of file Config.h.

    +

    Definition at line 177 of file Config.h.

    @@ -1750,7 +1776,7 @@ Private Attributes
    -

    Definition at line 177 of file Config.h.

    +

    Definition at line 178 of file Config.h.

    @@ -1766,7 +1792,7 @@ Private Attributes
    -

    Definition at line 178 of file Config.h.

    +

    Definition at line 179 of file Config.h.

    @@ -1782,7 +1808,7 @@ Private Attributes
    -

    Definition at line 179 of file Config.h.

    +

    Definition at line 180 of file Config.h.

    @@ -1798,7 +1824,7 @@ Private Attributes
    -

    Definition at line 183 of file Config.h.

    +

    Definition at line 184 of file Config.h.

    @@ -1814,7 +1840,7 @@ Private Attributes
    -

    Definition at line 185 of file Config.h.

    +

    Definition at line 186 of file Config.h.

    @@ -1830,7 +1856,7 @@ Private Attributes
    -

    Definition at line 188 of file Config.h.

    +

    Definition at line 189 of file Config.h.

    @@ -1846,7 +1872,7 @@ Private Attributes
    -

    Definition at line 189 of file Config.h.

    +

    Definition at line 190 of file Config.h.

    @@ -1862,7 +1888,7 @@ Private Attributes
    -

    Definition at line 194 of file Config.h.

    +

    Definition at line 195 of file Config.h.

    @@ -1878,7 +1904,7 @@ Private Attributes
    -

    Definition at line 196 of file Config.h.

    +

    Definition at line 197 of file Config.h.

    @@ -1894,7 +1920,7 @@ Private Attributes
    -

    Definition at line 197 of file Config.h.

    +

    Definition at line 198 of file Config.h.

    @@ -1910,7 +1936,7 @@ Private Attributes
    -

    Definition at line 198 of file Config.h.

    +

    Definition at line 199 of file Config.h.

    @@ -1926,7 +1952,7 @@ Private Attributes
    -

    Definition at line 201 of file Config.h.

    +

    Definition at line 202 of file Config.h.

    @@ -1942,7 +1968,7 @@ Private Attributes
    -

    Definition at line 204 of file Config.h.

    +

    Definition at line 205 of file Config.h.

    @@ -1958,7 +1984,7 @@ Private Attributes
    -

    Definition at line 207 of file Config.h.

    +

    Definition at line 208 of file Config.h.

    @@ -1982,7 +2008,7 @@ Private Attributes
    -

    Definition at line 208 of file Config.h.

    +

    Definition at line 209 of file Config.h.

    @@ -2006,7 +2032,7 @@ Private Attributes
    -

    Definition at line 209 of file Config.h.

    +

    Definition at line 210 of file Config.h.

    @@ -2022,7 +2048,7 @@ Private Attributes
    -

    Definition at line 212 of file Config.h.

    +

    Definition at line 213 of file Config.h.

    @@ -2038,7 +2064,7 @@ Private Attributes
    -

    Definition at line 215 of file Config.h.

    +

    Definition at line 216 of file Config.h.

    @@ -2054,7 +2080,7 @@ Private Attributes
    -

    Definition at line 216 of file Config.h.

    +

    Definition at line 217 of file Config.h.

    @@ -2070,7 +2096,7 @@ Private Attributes
    -

    Definition at line 217 of file Config.h.

    +

    Definition at line 218 of file Config.h.

    @@ -2086,7 +2112,7 @@ Private Attributes
    -

    Definition at line 220 of file Config.h.

    +

    Definition at line 221 of file Config.h.

    @@ -2102,7 +2128,7 @@ Private Attributes
    -

    Definition at line 224 of file Config.h.

    +

    Definition at line 225 of file Config.h.

    @@ -2118,7 +2144,7 @@ Private Attributes
    -

    Definition at line 229 of file Config.h.

    +

    Definition at line 230 of file Config.h.

    @@ -2134,7 +2160,7 @@ Private Attributes
    -

    Definition at line 235 of file Config.h.

    +

    Definition at line 236 of file Config.h.

    @@ -2150,7 +2176,7 @@ Private Attributes
    -

    Definition at line 239 of file Config.h.

    +

    Definition at line 240 of file Config.h.

    @@ -2166,7 +2192,7 @@ Private Attributes
    -

    Definition at line 246 of file Config.h.

    +

    Definition at line 247 of file Config.h.

    @@ -2182,7 +2208,7 @@ Private Attributes
    -

    Definition at line 249 of file Config.h.

    +

    Definition at line 250 of file Config.h.

    @@ -2198,7 +2224,7 @@ Private Attributes
    -

    Definition at line 252 of file Config.h.

    +

    Definition at line 253 of file Config.h.

    @@ -2214,7 +2240,7 @@ Private Attributes
    -

    Definition at line 255 of file Config.h.

    +

    Definition at line 256 of file Config.h.

    @@ -2230,7 +2256,7 @@ Private Attributes
    -

    Definition at line 257 of file Config.h.

    +

    Definition at line 258 of file Config.h.

    @@ -2246,7 +2272,7 @@ Private Attributes
    -

    Definition at line 259 of file Config.h.

    +

    Definition at line 260 of file Config.h.

    @@ -2262,7 +2288,7 @@ Private Attributes
    -

    Definition at line 262 of file Config.h.

    +

    Definition at line 263 of file Config.h.

    @@ -2278,7 +2304,7 @@ Private Attributes
    -

    Definition at line 265 of file Config.h.

    +

    Definition at line 266 of file Config.h.

    @@ -2294,7 +2320,7 @@ Private Attributes
    -

    Definition at line 268 of file Config.h.

    +

    Definition at line 269 of file Config.h.

    @@ -2310,7 +2336,7 @@ Private Attributes
    -

    Definition at line 271 of file Config.h.

    +

    Definition at line 272 of file Config.h.

    @@ -2326,7 +2352,7 @@ Private Attributes
    -

    Definition at line 279 of file Config.h.

    +

    Definition at line 280 of file Config.h.

    @@ -2342,7 +2368,7 @@ Private Attributes
    -

    Definition at line 281 of file Config.h.

    +

    Definition at line 282 of file Config.h.

    diff --git a/classxrpl_1_1Config__test-members.html b/classxrpl_1_1Config__test-members.html index 9e52cc01fc..cb239b75ca 100644 --- a/classxrpl_1_1Config__test-members.html +++ b/classxrpl_1_1Config__test-members.html @@ -113,23 +113,24 @@ $(function() { testcasebeast::unit_test::suite testColons()xrpl::Config_test testComments()xrpl::Config_test - testDbPath()xrpl::Config_test - testGetters()xrpl::Config_test - testLegacy()xrpl::Config_test - testNetworkID()xrpl::Config_test - testOverlay()xrpl::Config_test - testPort()xrpl::Config_test - testSetup(bool explicitPath)xrpl::Config_test - testValidatorKeys()xrpl::Config_test - testValidatorsFile()xrpl::Config_test - testWhitespace()xrpl::Config_test - testZeroPort()xrpl::Config_test - this_suite()beast::unit_test::suitestatic - unexcept(F &&f, String const &reason)beast::unit_test::suite - unexcept(F &&f)beast::unit_test::suite - unexpected(Condition shouldBeFalse, String const &reason)beast::unit_test::suite - unexpected(Condition shouldBeFalse)beast::unit_test::suite - ~suite()=defaultbeast::unit_test::suitevirtual + testConfigFile()xrpl::Config_test + testDbPath()xrpl::Config_test + testGetters()xrpl::Config_test + testLegacy()xrpl::Config_test + testNetworkID()xrpl::Config_test + testOverlay()xrpl::Config_test + testPort()xrpl::Config_test + testSetup(bool explicitPath)xrpl::Config_test + testValidatorKeys()xrpl::Config_test + testValidatorsFile()xrpl::Config_test + testWhitespace()xrpl::Config_test + testZeroPort()xrpl::Config_test + this_suite()beast::unit_test::suitestatic + unexcept(F &&f, String const &reason)beast::unit_test::suite + unexcept(F &&f)beast::unit_test::suite + unexpected(Condition shouldBeFalse, String const &reason)beast::unit_test::suite + unexpected(Condition shouldBeFalse)beast::unit_test::suite + ~suite()=defaultbeast::unit_test::suitevirtual