xrpld
Loading...
Searching...
No Matches
xrpld/core/detail/Config.cpp
1#include <xrpld/core/Config.h>
2
3#include <xrpl/basics/FileUtilities.h>
4#include <xrpl/basics/Log.h>
5#include <xrpl/basics/StringUtilities.h>
6#include <xrpl/basics/chrono.h>
7#include <xrpl/basics/contract.h>
8#include <xrpl/beast/core/LexicalCast.h>
9#include <xrpl/beast/utility/Journal.h>
10#include <xrpl/beast/utility/instrumentation.h>
11#include <xrpl/config/BasicConfig.h>
12#include <xrpl/config/Constants.h>
13#include <xrpl/net/HTTPClient.h>
14#include <xrpl/protocol/Feature.h>
15#include <xrpl/protocol/SystemParameters.h>
16#include <xrpl/rdb/DBInit.h>
17#include <xrpl/rdb/DatabaseCon.h>
18
19#include <boost/algorithm/string/classification.hpp>
20#include <boost/algorithm/string/predicate.hpp>
21#include <boost/algorithm/string/replace.hpp>
22#include <boost/algorithm/string/split.hpp>
23#include <boost/algorithm/string/trim.hpp>
24#include <boost/multiprecision/detail/endian.hpp>
25#include <boost/predef.h>
26#include <boost/regex.hpp> // IWYU pragma: keep
27#include <boost/regex/v5/regex.hpp>
28#include <boost/regex/v5/regex_match.hpp>
29
30#include <algorithm>
31#include <array>
32#include <chrono>
33#include <cstdint>
34#include <cstdlib>
35#include <filesystem>
36#include <format>
37#include <iostream>
38#include <iterator>
39#include <limits>
40#include <memory>
41#include <optional>
42#include <regex>
43#include <sstream>
44#include <stdexcept>
45#include <string>
46#include <system_error>
47#include <thread>
48#include <type_traits>
49#include <utility>
50#include <vector>
51
52#if BOOST_OS_WINDOWS
53#include <sysinfoapi.h>
54
55namespace xrpl::detail {
56
57[[nodiscard]] std::uint64_t
58getMemorySize()
59{
60 if (MEMORYSTATUSEX msx{sizeof(MEMORYSTATUSEX)}; GlobalMemoryStatusEx(&msx))
61 return static_cast<std::uint64_t>(msx.ullTotalPhys);
62
63 return 0;
64}
65
66} // namespace xrpl::detail
67
68#endif
69
70#if BOOST_OS_LINUX
71#include <sys/sysinfo.h> // IWYU pragma: keep
72
73namespace xrpl::detail {
74
75[[nodiscard]] std::uint64_t
76getMemorySize()
77{
78 if (struct sysinfo si{}; sysinfo(&si) == 0)
79 return static_cast<std::uint64_t>(si.totalram) * si.mem_unit;
80
81 return 0;
82}
83
84} // namespace xrpl::detail
85
86#endif
87
88#if BOOST_OS_MACOS
89#include <sys/sysctl.h>
90
91namespace xrpl::detail {
92
93[[nodiscard]] std::uint64_t
94getMemorySize()
95{
96 int mib[] = {CTL_HW, HW_MEMSIZE};
97 std::int64_t ram = 0;
98 size_t size = sizeof(ram);
99
100 if (sysctl(mib, 2, &ram, &size, nullptr, 0) == 0)
101 return static_cast<std::uint64_t>(ram);
102
103 return 0;
104}
105
106} // namespace xrpl::detail
107
108#endif
109
110namespace xrpl {
111
112// clang-format off
113// The configurable node sizes are "tiny", "small", "medium", "large", "huge"
114inline constexpr std::array<std::pair<SizedItem, std::array<int, 5>>, 13>
116{{
117 // FIXME: We should document each of these items, explaining exactly
118 // what they control and whether there exists an explicit
119 // config option that can be used to override the default.
120
121 // tiny small medium large huge
122 {SizedItem::SweepInterval, {{ 10, 30, 60, 90, 120 }}},
123 {SizedItem::TreeCacheSize, {{ 262144, 524288, 2097152, 4194304, 8388608 }}},
124 {SizedItem::TreeCacheAge, {{ 30, 60, 90, 120, 900 }}},
125 {SizedItem::LedgerSize, {{ 32, 32, 64, 256, 384 }}},
126 {SizedItem::LedgerAge, {{ 30, 60, 180, 300, 600 }}},
127 {SizedItem::LedgerFetch, {{ 2, 3, 4, 5, 8 }}},
128 {SizedItem::HashNodeDbCache, {{ 4, 12, 24, 64, 128 }}},
129 {SizedItem::TxnDbCache, {{ 4, 12, 24, 64, 128 }}},
130 {SizedItem::LgrDbCache, {{ 4, 8, 16, 32, 128 }}},
131 {SizedItem::OpenFinalLimit, {{ 8, 16, 32, 64, 128 }}},
132 {SizedItem::BurstSize, {{ 4, 8, 16, 32, 48 }}},
133 {SizedItem::RamSizeGb, {{ 6, 8, 12, 24, 0 }}},
134 {SizedItem::AccountIdCacheSize, {{ 20047, 50053, 77081, 150061, 300007 }}}
135}};
136// clang-format on
137
138// Ensure that the order of entries in the table corresponds to the
139// order of entries in the enum:
140static_assert(
141 []() constexpr -> bool {
143
144 for (auto const& i : kSizedItems)
145 {
146 if (static_cast<std::underlying_type_t<SizedItem>>(i.first) != idx)
147 return false;
148
149 ++idx;
150 }
151
152 return true;
153 }(),
154 "Mismatch between sized item enum & array indices");
155
156//
157// TODO: Check permissions on config file before using it.
158//
159
160#define SECTION_DEFAULT_NAME ""
161
163parseIniFile(std::string const& strInput, bool const bTrim)
164{
165 std::string strData(strInput);
167 IniFileSections secResult;
168
169 // Convert DOS format to unix.
170 boost::algorithm::replace_all(strData, "\r\n", "\n");
171
172 // Convert MacOS format to unix.
173 boost::algorithm::replace_all(strData, "\r", "\n");
174
175 boost::algorithm::split(vLines, strData, boost::algorithm::is_any_of("\n"));
176
177 // Set the default Section name.
178 std::string strSection = SECTION_DEFAULT_NAME; // NOLINT(readability-redundant-string-init)
179
180 // Initialize the default Section.
181 secResult[strSection] = IniFileSections::mapped_type();
182
183 // Parse each line.
184 for (auto& strValue : vLines)
185 {
186 if (bTrim)
187 strValue = trimWhitespace(strValue);
188
189 if (strValue.empty() || strValue[0] == '#')
190 {
191 // Blank line or comment, do nothing.
192 }
193 else if (strValue[0] == '[' && strValue[strValue.length() - 1] == ']')
194 {
195 // New Section.
196 strSection = strValue.substr(1, strValue.length() - 2);
197 secResult.emplace(strSection, IniFileSections::mapped_type{});
198 }
199 else
200 {
201 // Another line for Section.
202 if (!strValue.empty())
203 secResult[strSection].push_back(strValue);
204 }
205 }
206
207 return secResult;
208}
209
210IniFileSections::mapped_type*
211getIniFileSection(IniFileSections& secSource, std::string const& strSection)
212{
213 if (auto it = secSource.find(strSection); it != secSource.end())
214 return &(it->second);
215
216 return nullptr;
217}
218
219bool
221 IniFileSections& secSource,
222 std::string const& strSection,
223 std::string& strValue,
225{
226 auto const pmtEntries = getIniFileSection(secSource, strSection);
227
228 if ((pmtEntries != nullptr) && pmtEntries->size() == 1)
229 {
230 strValue = (*pmtEntries)[0];
231 return true;
232 }
233
234 if (pmtEntries != nullptr)
235 {
236 JLOG(j.warn()) << "Section '" << strSection << "': requires 1 line not "
237 << pmtEntries->size() << " lines.";
238 }
239
240 return false;
241}
242
243//------------------------------------------------------------------------------
244//
245// Config
246//
247//------------------------------------------------------------------------------
248
249char const* const Config::kConfigFileName = "xrpld.cfg";
250char const* const Config::kConfigLegacyName = "rippled.cfg";
251char const* const Config::kDatabaseDirName = "db";
252char const* const Config::kValidatorsFileName = "validators.txt";
253
254[[nodiscard]] static std::string
255getEnvVar(char const* name)
256{
257 std::string value;
258
259 if (auto const v = std::getenv(name); v != nullptr)
260 value = v;
261
262 return value;
263}
264
266 : j_(beast::Journal::getNullSink()), ramSize_(detail::getMemorySize() / (1024 * 1024 * 1024))
267{
268}
269
270void
271Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone)
272{
273 XRPL_ASSERT(nodeSize == 0, "xrpl::Config::setupControl : node size not set");
274
275 quiet_ = bQuiet || bSilent;
276 silent_ = bSilent;
277 runStandalone_ = bStandalone;
278
279 // We try to autodetect the appropriate node size by checking available
280 // RAM and CPU resources. We default to "tiny" for standalone mode.
281 if (!bStandalone)
282 {
283 // First, check against 'minimum' RAM requirements per node size:
284 auto const& threshold =
286
287 auto ns = std::ranges::find_if(threshold.second, [this](std::size_t limit) {
288 return (limit == 0) || (ramSize_ < limit);
289 });
290
291 XRPL_ASSERT(ns != threshold.second.end(), "xrpl::Config::setupControl : valid node size");
292
293 if (ns != threshold.second.end())
294 nodeSize = std::distance(threshold.second.begin(), ns);
295
296 // Adjust the size based on the number of hardware threads of
297 // execution available to us:
298 if (auto const hc = std::thread::hardware_concurrency(); hc != 0)
300 }
301
302 XRPL_ASSERT(nodeSize <= 4, "xrpl::Config::setupControl : node size is set");
303}
304
305void
306Config::setup(std::string const& strConf, bool bQuiet, bool bSilent, bool bStandalone)
307{
308 setupControl(bQuiet, bSilent, bStandalone);
309
310 // Determine the config and data directories.
311 // If the config file is found in the current working
312 // directory, use the current working directory as the
313 // config directory and that with "db" as the data
314 // directory.
315 std::filesystem::path dataDir;
316
317 if (!strConf.empty())
318 {
319 // --conf=<path> : everything is relative that file.
320 configFile_ = strConf;
322 configDir.remove_filename();
323 dataDir = configDir / kDatabaseDirName;
324 }
325 else
326 {
327 do
328 {
329 // Check if either of the config files exist in the current working
330 // directory, in which case the databases will be stored in a
331 // subdirectory.
333 dataDir = configDir / kDatabaseDirName;
336 break;
339 break;
340
341 // Check if the home directory is set, and optionally the XDG config
342 // and/or data directories, as the config may be there. See
343 // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html.
344 auto const strHome = getEnvVar("HOME");
345 if (!strHome.empty())
346 {
347 auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
348 auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
349 if (strXdgConfigHome.empty())
350 {
351 // $XDG_CONFIG_HOME was not set, use default based on $HOME.
352 strXdgConfigHome = strHome + "/.config";
353 }
354 if (strXdgDataHome.empty())
355 {
356 // $XDG_DATA_HOME was not set, use default based on $HOME.
357 strXdgDataHome = strHome + "/.local/share";
358 }
359
360 // Check if either of the config files exist in the XDG config
361 // dir.
362 dataDir = strXdgDataHome + "/" + systemName();
363 configDir = strXdgConfigHome + "/" + systemName();
366 break;
369 break;
370 }
371
372 // As a last resort, check the system config directory.
373 dataDir = "/var/lib/" + systemName();
374 configDir = "/etc/" + systemName();
377 break;
379 } while (false);
380 }
381
382 // Update default values
383 load();
384 {
385 // load() may have set a new value for the dataDir
387 if (!dbPath.empty())
388 {
389 dataDir = std::filesystem::path(dbPath);
390 }
391 else if (runStandalone_)
392 {
393 dataDir.clear();
394 }
395 }
396
397 if (!dataDir.empty())
398 {
401
402 if (ec)
403 Throw<std::runtime_error>(std::format("Can not create {}", dataDir.string()));
404
406 }
407
409
410 if (runStandalone_)
411 ledgerHistory = 0;
412
413 Section const ledgerTxTablesSection = section(Sections::kLedgerTxTables);
414 getIfExists(ledgerTxTablesSection, Keys::kUseTxTables, useTxTables_);
415
416 Section const& nodeDbSection{section(Sections::kNodeDatabase)};
417 getIfExists(nodeDbSection, Keys::kFastLoad, fastLoad);
418}
419
420// 0 ports are allowed for unit tests, but still not allowed to be present in
421// config file
422static void
423checkZeroPorts(Config const& config)
424{
425 if (!config.exists(Sections::kServer))
426 return;
427
428 for (auto const& name : config.section(Sections::kServer).values())
429 {
430 if (!config.exists(name))
431 return;
432
433 auto const& section = config[name];
434 auto const optResult = section.get(Keys::kPort);
435 if (optResult)
436 {
437 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
438 if (port == 0u)
439 {
441 ss << "Invalid value '" << *optResult << "' for key 'port' in [" << name << "]";
443 }
444 }
445 }
446}
447
448void
450{
451 // NOTE: this writes to cerr because we want cout to be reserved
452 // for the writing of the json response (so that stdout can be part of a
453 // pipeline, for instance)
454 if (!quiet_)
455 std::cerr << "Loading: " << configFile_ << "\n";
456
458 auto const fileContents = getFileContents(ec, configFile_);
459
460 if (ec)
461 {
462 std::cerr << "Failed to read '" << configFile_ << "'." << ec.value() << ": " << ec.message()
463 << std::endl;
464 return;
465 }
466
467 loadFromString(fileContents);
468 checkZeroPorts(*this);
469}
470
471void
473{
474 IniFileSections secConfig = parseIniFile(fileContents, true);
475
476 build(secConfig);
477
478 if (auto s = getIniFileSection(secConfig, Sections::kIps))
479 ips = *s;
480
481 if (auto s = getIniFileSection(secConfig, Sections::kIpsFixed))
482 ipsFixed = *s;
483
484 // if the user has specified ip:port then replace : with a space.
485 {
486 auto replaceColons = [](std::vector<std::string>& strVec) {
487 static std::regex const kE(":([0-9]+)$");
488 for (auto& line : strVec)
489 {
490 // skip anything that might be an ipv6 address
491 if (std::count(line.begin(), line.end(), ':') != 1)
492 continue;
493
494 std::string const result = std::regex_replace(line, kE, " $1");
495 // sanity check the result of the replace, should be same length
496 // as input
497 if (result.size() == line.size())
498 line = result;
499 }
500 };
501
502 replaceColons(ipsFixed);
503 replaceColons(ips);
504 }
505
506 {
507 std::string dbPath;
508 if (getSingleSection(secConfig, Sections::kDatabasePath, dbPath, j_))
509 {
510 std::filesystem::path const p(dbPath);
512 }
513 }
514
515 std::string strTemp;
516
517 if (getSingleSection(secConfig, Sections::kNetworkId, strTemp, j_))
518 {
519 if (strTemp == "main")
520 {
521 networkId = 0;
522 }
523 else if (strTemp == "testnet")
524 {
525 networkId = 1;
526 }
527 else if (strTemp == "devnet")
528 {
529 networkId = 2;
530 }
531 else
532 {
534 }
535 }
536
537 if (getSingleSection(secConfig, Sections::kPeerPrivate, strTemp, j_))
539
540 if (getSingleSection(secConfig, Sections::kPeersMax, strTemp, j_))
541 {
543 }
544 else
545 {
546 std::optional<std::size_t> peersInMaxOpt{};
547 if (getSingleSection(secConfig, Sections::kPeersInMax, strTemp, j_))
548 {
549 peersInMaxOpt = beast::lexicalCastThrow<std::size_t>(strTemp);
550 if (*peersInMaxOpt > 1000)
551 {
553 std::string("Invalid value specified in [") + Sections::kPeersInMax +
554 "] section; the value must be less or equal than 1000");
555 }
556 }
557
558 std::optional<std::size_t> peersOutMaxOpt{};
559 if (getSingleSection(secConfig, Sections::kPeersOutMax, strTemp, j_))
560 {
561 peersOutMaxOpt = beast::lexicalCastThrow<std::size_t>(strTemp);
562 if (*peersOutMaxOpt < 10 || *peersOutMaxOpt > 1000)
563 {
565 std::string("Invalid value specified in [") + Sections::kPeersOutMax +
566 "] section; the value must be in range 10-1000");
567 }
568 }
569
570 // if one section is configured then the other must be configured too
571 if ((peersInMaxOpt && !peersOutMaxOpt) || (peersOutMaxOpt && !peersInMaxOpt))
572 {
574 std::string("Both sections [") + Sections::kPeersInMax + "]" + " and [" +
575 Sections::kPeersOutMax + "] must be configured");
576 }
577
578 if (peersInMaxOpt && peersOutMaxOpt)
579 {
580 peersInMax = *peersInMaxOpt;
581 peersOutMax = *peersOutMaxOpt;
582 }
583 }
584
585 if (getSingleSection(secConfig, Sections::kNodeSize, strTemp, j_))
586 {
587 if (boost::iequals(strTemp, "tiny"))
588 {
589 nodeSize = 0;
590 }
591 else if (boost::iequals(strTemp, "small"))
592 {
593 nodeSize = 1;
594 }
595 else if (boost::iequals(strTemp, "medium"))
596 {
597 nodeSize = 2;
598 }
599 else if (boost::iequals(strTemp, "large"))
600 {
601 nodeSize = 3;
602 }
603 else if (boost::iequals(strTemp, "huge"))
604 {
605 nodeSize = 4;
606 }
607 else
608 {
610 }
611 }
612
613 if (getSingleSection(secConfig, Sections::kSigningSupport, strTemp, j_))
615
616 if (getSingleSection(secConfig, Sections::kElbSupport, strTemp, j_))
618
621
622 if (getSingleSection(secConfig, Sections::kSslVerify, strTemp, j_))
624
625 if (getSingleSection(secConfig, Sections::kRelayValidations, strTemp, j_))
626 {
627 if (boost::iequals(strTemp, "all"))
628 {
630 }
631 else if (boost::iequals(strTemp, "trusted"))
632 {
634 }
635 else if (boost::iequals(strTemp, "drop_untrusted"))
636 {
638 }
639 else
640 {
642 std::string("Invalid value specified in [") + Sections::kRelayValidations +
643 "] section");
644 }
645 }
646
647 if (getSingleSection(secConfig, Sections::kRelayProposals, strTemp, j_))
648 {
649 if (boost::iequals(strTemp, "all"))
650 {
652 }
653 else if (boost::iequals(strTemp, "trusted"))
654 {
656 }
657 else if (boost::iequals(strTemp, "drop_untrusted"))
658 {
660 }
661 else
662 {
664 std::string("Invalid value specified in [") + Sections::kRelayProposals +
665 "] section");
666 }
667 }
668
670 {
672 std::string("Cannot have both [") + Sections::kValidationSeed + "] and [" +
673 Sections::kValidatorToken + "] config sections");
674 }
675
676 if (getSingleSection(secConfig, Sections::kNetworkQuorum, strTemp, j_))
678
681
683 /* [fee_default] is documented in the example config files as useful for
684 * things like offline transaction signing. Until that's completely
685 * deprecated, allow it to override the [voting] section. */
686 if (getSingleSection(secConfig, Sections::kFeeDefault, strTemp, j_))
687 fees.referenceFee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
688
689 if (getSingleSection(secConfig, Sections::kLedgerHistory, strTemp, j_))
690 {
691 if (boost::iequals(strTemp, "full"))
692 {
694 }
695 else if (boost::iequals(strTemp, "none"))
696 {
697 ledgerHistory = 0;
698 }
699 else
700 {
702 }
703 }
704
705 if (getSingleSection(secConfig, Sections::kFetchDepth, strTemp, j_))
706 {
707 if (boost::iequals(strTemp, "none"))
708 {
709 fetchDepth = 0;
710 }
711 else if (boost::iequals(strTemp, "full"))
712 {
713 fetchDepth = std::numeric_limits<decltype(fetchDepth)>::max();
714 }
715 else
716 {
718 }
719
721 }
722
723 // By default, validators don't have pathfinding enabled, unless it is
724 // explicitly requested by the server's admin.
726 pathSearchMax = 0;
727
728 if (getSingleSection(secConfig, Sections::kPathSearchOld, strTemp, j_))
730 if (getSingleSection(secConfig, Sections::kPathSearch, strTemp, j_))
732 if (getSingleSection(secConfig, Sections::kPathSearchFast, strTemp, j_))
734 if (getSingleSection(secConfig, Sections::kPathSearchMax, strTemp, j_))
736
737 if (getSingleSection(secConfig, Sections::kDebugLogfile, strTemp, j_))
738 debugLogfile_ = strTemp;
739
740 if (getSingleSection(secConfig, Sections::kSweepInterval, strTemp, j_))
741 {
743
745 {
748 ": must be between 10 and 600 inclusive");
749 }
750 }
751
752 if (getSingleSection(secConfig, Sections::kWorkers, strTemp, j_))
753 {
755
757 {
759 std::string("Invalid ") + Sections::kWorkers +
760 ": must be between 1 and 1024 inclusive.");
761 }
762 }
763
764 if (getSingleSection(secConfig, Sections::kIoWorkers, strTemp, j_))
765 {
767
769 {
771 std::string("Invalid ") + Sections::kIoWorkers +
772 ": must be between 1 and 1024 inclusive.");
773 }
774 }
775
776 if (getSingleSection(secConfig, Sections::kPrefetchWorkers, strTemp, j_))
777 {
779
781 {
784 ": must be between 1 and 1024 inclusive.");
785 }
786 }
787
788 if (getSingleSection(secConfig, Sections::kCompression, strTemp, j_))
790
791 if (getSingleSection(secConfig, Sections::kLedgerReplay, strTemp, j_))
793
795 {
797
801 // vp_enable config option is deprecated by vp_base_squelch_enable //
802 // This option is kept for backwards compatibility. When squelching //
803 // is the default algorithm, it must be replaced with: //
804 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
805 // sec.value_or("vp_base_squelch_enable", true); //
806 if (sec.exists(Keys::kVpBaseSquelchEnable) && sec.exists(Keys::kVpEnable))
807 {
809 std::string("Invalid ") + Sections::kReduceRelay +
810 " cannot specify both vp_base_squelch_enable and vp_enable "
811 "options. "
812 "vp_enable was deprecated and replaced by "
813 "vp_base_squelch_enable");
814 }
815
816 if (sec.exists(Keys::kVpBaseSquelchEnable))
817 {
819 }
820 else if (sec.exists(Keys::kVpEnable))
821 {
823 }
824 else
825 {
827 }
831
835 // Temporary squelching config for the peers selected as a source of //
836 // validator messages. The config must be removed once squelching is //
837 // made the default routing algorithm. //
840 {
842 std::string("Invalid ") + Sections::kReduceRelay +
843 " vp_base_squelch_max_selected_peers must be "
844 "greater than or equal to 3");
845 }
849
850 txReduceRelayEnable = sec.valueOr(Keys::kTxEnable, false);
851 txReduceRelayMetrics = sec.valueOr(Keys::kTxMetrics, false);
852 txReduceRelayMinPeers = sec.valueOr(Keys::kTxMinPeers, 20);
855 {
857 std::string("Invalid ") + Sections::kReduceRelay +
858 ", tx_min_peers must be greater than or equal to 10"
859 ", tx_relay_percentage must be greater than or equal to 10 "
860 "and less than or equal to 100");
861 }
862 }
863
864 if (getSingleSection(secConfig, Sections::kMaxTransactions, strTemp, j_))
865 {
868 }
869
870 if (getSingleSection(secConfig, Sections::kServerDomain, strTemp, j_))
871 {
872 if (!isProperlyFormedTomlDomain(strTemp))
873 {
876 ": the domain name does not appear to meet the requirements.");
877 }
878
879 serverDomain = strTemp;
880 }
881
883 {
884 auto const sec = section(Sections::kOverlay);
885
886 using namespace std::chrono;
887
888 try
889 {
890 if (auto val = sec.get(Keys::kMaxUnknownTime))
892 }
893 catch (...)
894 {
896 std::string("Invalid value 'max_unknown_time' in ") + Sections::kOverlay +
897 ": must be of the form '<number>' representing seconds.");
898 }
899
900 if (maxUnknownTime < seconds{300} || maxUnknownTime > seconds{1800})
901 {
903 std::string("Invalid value 'max_unknown_time' in ") + Sections::kOverlay +
904 ": the time must be between 300 and 1800 seconds, inclusive.");
905 }
906
907 try
908 {
909 if (auto val = sec.get(Keys::kMaxDivergedTime))
911 }
912 catch (...)
913 {
915 std::string("Invalid value 'max_diverged_time' in ") + Sections::kOverlay +
916 ": must be of the form '<number>' representing seconds.");
917 }
918
920 {
922 std::string("Invalid value 'max_diverged_time' in ") + Sections::kOverlay +
923 ": the time must be between 60 and 900 seconds, inclusive.");
924 }
925
926 // Both manifest counts parse and validate identically, so read them
927 // the same way. Returns nullopt when the key is absent, leaving the
928 // built-in default in effect at the use site.
929 auto manifestCount = [&sec](char const* key) -> std::optional<std::size_t> {
931
932 try
933 {
934 if (auto val = sec.get(key))
936 }
937 catch (...)
938 {
940 std::string("Invalid value '") + key + "' in " + Sections::kOverlay +
941 ": must be of the form '<number>' representing a count of manifests.");
942 }
943
944 if (count && (*count < kMinManifestCount || *count > kMaxManifestCount))
945 {
947 std::string("Invalid value '") + key + "' in " + Sections::kOverlay +
948 ": the count must be between " + std::to_string(kMinManifestCount) + " and " +
949 std::to_string(kMaxManifestCount) + ", inclusive.");
950 }
951
952 return count;
953 };
954
957 }
958
959 if (getSingleSection(secConfig, Sections::kAmendmentMajorityTime, strTemp, j_))
960 {
961 using namespace std::chrono;
962 boost::regex const re(R"(^\s*(\d+)\s*(minutes|hours|days|weeks)\s*(\s+.*)?$)");
963 boost::smatch match;
964 if (!boost::regex_match(strTemp, match, re))
965 {
968 ", must be: [0-9]+ [minutes|hours|days|weeks]");
969 }
970
971 auto const duration = beast::lexicalCastThrow<std::uint32_t>(match[1].str());
972
973 if (boost::iequals(match[2], "minutes"))
974 {
976 }
977 else if (boost::iequals(match[2], "hours"))
978 {
980 }
981 else if (boost::iequals(match[2], "days"))
982 {
984 }
985 else if (boost::iequals(match[2], "weeks"))
986 {
988 }
989
991 {
994 ", the minimum amount of time an amendment must hold a "
995 "majority is 15 minutes");
996 }
997 }
998
999 if (getSingleSection(secConfig, Sections::kBetaRpcApi, strTemp, j_))
1001
1002 // Do not load trusted validator configuration for standalone mode
1003 if (!runStandalone_)
1004 {
1005 // If a file was explicitly specified, then throw if the
1006 // path is malformed or if the file does not exist or is
1007 // not a file.
1008 // If the specified file is not an absolute path, then look
1009 // for it in the same directory as the config file.
1010 // If no path was specified, then look for validators.txt
1011 // in the same directory as the config file, but don't complain
1012 // if we can't find it.
1013 std::filesystem::path validatorsFile;
1014
1015 if (getSingleSection(secConfig, Sections::kValidatorsFile, strTemp, j_))
1016 {
1017 validatorsFile = strTemp;
1018
1019 if (validatorsFile.empty())
1020 {
1022 std::string("Invalid path specified in [") + Sections::kValidatorsFile + "]");
1023 }
1024
1025 if (!validatorsFile.is_absolute() && !configDir.empty())
1026 validatorsFile = configDir / validatorsFile;
1027
1028 if (!std::filesystem::exists(validatorsFile))
1029 {
1031 std::string("The file specified in [") + Sections::kValidatorsFile +
1032 "] "
1033 "does not exist: " +
1034 validatorsFile.string());
1035 }
1036 else if (
1037 !std::filesystem::is_regular_file(validatorsFile) &&
1038 !std::filesystem::is_symlink(validatorsFile))
1039 {
1041 std::string("Invalid file specified in [") + Sections::kValidatorsFile +
1042 "]: " + validatorsFile.string());
1043 }
1044 }
1045 else if (!configDir.empty())
1046 {
1047 validatorsFile = configDir / kValidatorsFileName;
1048
1049 if (!validatorsFile.empty())
1050 {
1051 if (!std::filesystem::exists(validatorsFile) ||
1052 (!std::filesystem::is_regular_file(validatorsFile) &&
1053 !std::filesystem::is_symlink(validatorsFile)))
1054 {
1055 validatorsFile.clear();
1056 }
1057 }
1058 }
1059
1060 if (!validatorsFile.empty() && std::filesystem::exists(validatorsFile) &&
1061 (std::filesystem::is_regular_file(validatorsFile) ||
1062 std::filesystem::is_symlink(validatorsFile)))
1063 {
1064 std::error_code ec;
1065 auto const data = getFileContents(ec, validatorsFile);
1066 if (ec)
1067 {
1069 "Failed to read '" + validatorsFile.string() + "'." +
1070 std::to_string(ec.value()) + ": " + ec.message());
1071 }
1072
1073 auto iniFile = parseIniFile(data, true);
1074
1075 auto entries = getIniFileSection(iniFile, Sections::kValidators);
1076
1077 if (entries != nullptr)
1079
1080 auto valKeyEntries = getIniFileSection(iniFile, Sections::kValidatorKeys);
1081
1082 if (valKeyEntries != nullptr)
1083 section(Sections::kValidatorKeys).append(*valKeyEntries);
1084
1085 auto valSiteEntries = getIniFileSection(iniFile, Sections::kValidatorListSites);
1086
1087 if (valSiteEntries != nullptr)
1089
1090 auto valListKeys = getIniFileSection(iniFile, Sections::kValidatorListKeys);
1091
1092 if (valListKeys != nullptr)
1094
1095 auto valListThreshold = getIniFileSection(iniFile, Sections::kValidatorListThreshold);
1096
1097 if (valListThreshold != nullptr)
1099
1100 if ((entries == nullptr) && (valKeyEntries == nullptr) && (valListKeys == nullptr))
1101 {
1103 std::string("The file specified in [") + Sections::kValidatorsFile +
1104 "] "
1105 "does not contain a [" +
1107 "], "
1108 "[" +
1110 "] or "
1111 "[" +
1113 "]"
1114 " section: " +
1115 validatorsFile.string());
1116 }
1117 }
1118
1120 auto const& listThreshold = section(Sections::kValidatorListThreshold);
1121 if (listThreshold.lines().empty())
1122 {
1123 return std::nullopt;
1124 }
1125 if (listThreshold.values().size() == 1)
1126 {
1127 auto strTemp = listThreshold.values()[0];
1128 auto const listThreshold = beast::lexicalCastThrow<std::size_t>(strTemp);
1129 if (listThreshold == 0)
1130 {
1131 return std::nullopt; // NOTE: Explicitly ask for computed
1132 }
1133 if (listThreshold > section(Sections::kValidatorListKeys).values().size())
1134 {
1137 "Value in config section "
1138 "[") +
1140 "] exceeds the number of configured list keys");
1141 }
1142 return listThreshold;
1143 }
1144
1147 "Config section "
1148 "[") +
1149 Sections::kValidatorListThreshold + "] should contain single value only");
1150 }();
1151
1152 // Consolidate [validator_keys] and [validators]
1154
1157 {
1159 "[" + std::string(Sections::kValidatorListKeys) + "] config section is missing");
1160 }
1161 }
1162
1163 {
1164 auto const part = section(Sections::kFeatures);
1165 for (auto const& s : part.values())
1166 {
1167 if (auto const f = getRegisteredFeature(s))
1168 {
1169 features.insert(*f);
1170 }
1171 else
1172 {
1173 Throw<std::runtime_error>("Unknown feature: " + s + " in config file.");
1174 }
1175 }
1176 }
1177
1178 // This doesn't properly belong here, but check to make sure that the
1179 // value specified for network_quorum is achievable:
1180 {
1181 auto pm = peersMax;
1182
1183 // FIXME this apparently magic value is actually defined as a constant
1184 // elsewhere (see defaultMaxPeers) but we handle this check here.
1185 if (pm == 0)
1186 pm = 21;
1187
1188 if (networkQuorum > pm)
1189 {
1191 "The minimum number of required peers (network_quorum) exceeds "
1192 "the maximum number of allowed peers (peers_max)");
1193 }
1194 }
1195}
1196
1199{
1200 auto logFile = debugLogfile_;
1201
1202 if (!logFile.empty() && !logFile.is_absolute())
1203 {
1204 // Unless an absolute path for the log file is specified, the
1205 // path is relative to the config file directory.
1206 logFile = std::filesystem::absolute(configDir / logFile);
1207 }
1208
1209 if (!logFile.empty())
1210 {
1211 auto logDir = logFile.parent_path();
1212
1213 if (!std::filesystem::is_directory(logDir))
1214 {
1215 std::error_code ec;
1217
1218 // If we fail, we warn but continue so that the calling code can
1219 // decide how to handle this situation.
1220 if (ec)
1221 {
1222 std::cerr << "Unable to create log file path " << logDir << ": " << ec.message()
1223 << '\n';
1224 }
1225 }
1226 }
1227
1228 return logFile;
1229}
1230
1231int
1233{
1234 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
1235 XRPL_ASSERT(index < kSizedItems.size(), "xrpl::Config::getValueFor : valid index input");
1236 XRPL_ASSERT(!node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node");
1237 return kSizedItems.at(index).second.at(node.value_or(nodeSize));
1238}
1239
1241setupFeeVote(Section const& section)
1242{
1243 FeeSetup setup;
1244 {
1245 std::uint64_t temp = 0;
1246 if (set(temp, Keys::kReferenceFee, section) &&
1248 setup.referenceFee = temp;
1249 }
1250 {
1251 std::uint32_t temp = 0;
1252 if (set(temp, Keys::kAccountReserve, section))
1253 setup.accountReserve = temp;
1254 if (set(temp, Keys::kOwnerReserve, section))
1255 setup.ownerReserve = temp;
1256 }
1257 return setup;
1258}
1259
1260DatabaseCon::Setup
1262{
1263 DatabaseCon::Setup setup;
1264
1265 setup.startUp = c.startUp;
1266 setup.standAlone = c.standalone();
1268 if (!setup.standAlone && setup.dataDir.empty())
1269 {
1270 Throw<std::runtime_error>("database_path must be set.");
1271 }
1272
1273 if (!setup.globalPragma)
1274 {
1275 auto const& sqlite = c.section(Sections::kSqlite);
1277 result->reserve(3);
1278
1279 // defaults
1280 std::string safetyLevel;
1281 std::string journalMode = "wal";
1282 std::string synchronous = "normal";
1283 std::string tempStore = "file";
1284 bool showRiskWarning = false;
1285
1286 if (set(safetyLevel, "safety_level", sqlite))
1287 {
1288 if (boost::iequals(safetyLevel, "low"))
1289 {
1290 // low safety defaults
1291 journalMode = "memory";
1292 synchronous = "off";
1293 tempStore = "memory";
1294 showRiskWarning = true;
1295 }
1296 else if (!boost::iequals(safetyLevel, "high"))
1297 {
1298 Throw<std::runtime_error>("Invalid safety_level value: " + safetyLevel);
1299 }
1300 }
1301
1302 {
1303 // #journal_mode Valid values : delete, truncate, persist,
1304 // memory, wal, off
1305 if (set(journalMode, "journal_mode", sqlite) && !safetyLevel.empty())
1306 {
1308 "Configuration file may not define both "
1309 "\"safety_level\" and \"journal_mode\"");
1310 }
1311 bool const higherRisk =
1312 boost::iequals(journalMode, "memory") || boost::iequals(journalMode, "off");
1313 showRiskWarning = showRiskWarning || higherRisk;
1314 if (higherRisk || boost::iequals(journalMode, "delete") ||
1315 boost::iequals(journalMode, "truncate") || boost::iequals(journalMode, "persist") ||
1316 boost::iequals(journalMode, "wal"))
1317 {
1318 result->emplace_back(commonDbPragmaJournal(journalMode));
1319 }
1320 else
1321 {
1322 Throw<std::runtime_error>("Invalid journal_mode value: " + journalMode);
1323 }
1324 }
1325
1326 {
1327 // #synchronous Valid values : off, normal, full, extra
1328 if (set(synchronous, "synchronous", sqlite) && !safetyLevel.empty())
1329 {
1331 "Configuration file may not define both "
1332 "\"safety_level\" and \"synchronous\"");
1333 }
1334 bool const higherRisk = boost::iequals(synchronous, "off");
1335 showRiskWarning = showRiskWarning || higherRisk;
1336 if (higherRisk || boost::iequals(synchronous, "normal") ||
1337 boost::iequals(synchronous, "full") || boost::iequals(synchronous, "extra"))
1338 {
1339 result->emplace_back(commonDbPragmaSync(synchronous));
1340 }
1341 else
1342 {
1343 Throw<std::runtime_error>("Invalid synchronous value: " + synchronous);
1344 }
1345 }
1346
1347 {
1348 // #temp_store Valid values : default, file, memory
1349 if (set(tempStore, "temp_store", sqlite) && !safetyLevel.empty())
1350 {
1352 "Configuration file may not define both "
1353 "\"safety_level\" and \"temp_store\"");
1354 }
1355 bool const higherRisk = boost::iequals(tempStore, "memory");
1356 showRiskWarning = showRiskWarning || higherRisk;
1357 if (higherRisk || boost::iequals(tempStore, "default") ||
1358 boost::iequals(tempStore, "file"))
1359 {
1360 result->emplace_back(commonDbPragmaTemp(tempStore));
1361 }
1362 else
1363 {
1364 Throw<std::runtime_error>("Invalid temp_store value: " + tempStore);
1365 }
1366 }
1367
1368 if (showRiskWarning && j && c.ledgerHistory > kSqliteTuningCutoff)
1369 {
1370 JLOG(j->warn()) << "reducing the data integrity guarantees from the "
1371 "default [sqlite] behavior is not recommended for "
1372 "nodes storing large amounts of history, because of the "
1373 "difficulty inherent in rebuilding corrupted data.";
1374 }
1375 XRPL_ASSERT(
1376 result->size() == 3, "xrpl::setup_DatabaseCon::globalPragma : result size is 3");
1377 setup.globalPragma = std::move(result);
1378 }
1379 setup.useGlobalPragma = true;
1380
1381 auto setPragma = [](std::string& pragma, std::string const& key, int64_t value) {
1382 pragma = "PRAGMA " + key + "=" + std::to_string(value) + ";";
1383 };
1384
1385 // Lgr Pragma
1386 setPragma(setup.lgrPragma[0], "journal_size_limit", 1582080);
1387
1388 // TX Pragma
1389 int64_t pageSize = 4096;
1390 int64_t journalSizeLimit = 1582080;
1392 {
1393 auto& s = c.section(Sections::kSqlite);
1394 set(journalSizeLimit, Keys::kJournalSizeLimit, s);
1395 set(pageSize, Keys::kPageSize, s);
1396 if (pageSize < 512 || pageSize > 65536)
1397 Throw<std::runtime_error>("Invalid page_size. Must be between 512 and 65536.");
1398
1399 if ((pageSize & (pageSize - 1)) != 0)
1400 Throw<std::runtime_error>("Invalid page_size. Must be a power of 2.");
1401 }
1402
1403 setPragma(setup.txPragma[0], "page_size", pageSize);
1404 setPragma(setup.txPragma[1], "journal_size_limit", journalSizeLimit);
1405 setPragma(setup.txPragma[2], "max_page_count", 4294967294);
1406 setPragma(setup.txPragma[3], "mmap_size", 17179869184);
1407
1408 return setup;
1409}
1410} // namespace xrpl
T absolute(T... args)
T clamp(T... args)
A generic endpoint for log messages.
Definition Journal.h:44
Stream warn() const
Definition Journal.h:356
void build(IniFileSections const &ifs)
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.
static constexpr int kMinJobQueueTx
std::filesystem::path configFile_
std::optional< std::size_t > maxUntrustedCount
std::chrono::seconds maxDivergedTime
std::unordered_set< uint256, beast::Uhash<> > features
static constexpr int kMaxJobQueueTx
std::optional< int > sweepInterval
std::uint32_t fetchDepth
beast::Journal const j_
bool standalone() const
std::size_t txReduceRelayMinPeers
static constexpr std::size_t kMinManifestCount
std::optional< std::size_t > maxTrustedCount
std::size_t vpReduceRelaySquelchMaxSelectedPeers
////////////////// !
std::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
static constexpr std::size_t kMaxManifestCount
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
std::chrono::seconds maxUnknownTime
static char const *const kDatabaseDirName
std::uint64_t const ramSize_
std::vector< std::string > ipsFixed
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
std::string sslVerifyFile
std::optional< std::size_t > maxSubscriptionsPerConnection
std::size_t txRelayPercentage
static char const *const kConfigLegacyName
std::optional< std::size_t > validatorListThreshold
std::filesystem::path debugLogfile_
bool runStandalone_
Operate in stand-alone mode.
bool txReduceRelayEnable
////////////// END OF TEMPORARY CODE BLOCK /////////////////////
static char const *const kConfigFileName
std::vector< std::string > ips
bool signingEnabled_
Determines if the server will sign a tx, given an account's secret seed.
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
std::uint32_t ledgerHistory
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.
static char const *const kValidatorsFileName
std::size_t networkQuorum
std::filesystem::path configDir
std::chrono::seconds amendmentMajorityTime
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:29
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:69
void append(std::vector< std::string > const &lines)
Append a set of lines to this section.
T count(T... args)
T create_directories(T... args)
T current_path(T... args)
T data(T... args)
T distance(T... args)
T emplace(T... args)
T empty(T... args)
T end(T... args)
T endl(T... args)
T exists(T... args)
T find(T... args)
T format(T... args)
T getenv(T... args)
T hardware_concurrency(T... args)
T is_absolute(T... args)
T is_directory(T... args)
T is_regular_file(T... args)
T make_unique(T... args)
T max(T... args)
T message(T... args)
T min(T... args)
constexpr Out lexicalCastThrow(In in)
Convert from one type to another, throw on error.
constexpr Out lexicalCast(In in, Out defaultValue=Out())
Convert from one type to another.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
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,...
constexpr std::uint32_t kSqliteTuningCutoff
Definition DBInit.h:43
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)
FeeSetup setupFeeVote(Section const &section)
bool getSingleSection(IniFileSections &secSource, std::string const &strSection, std::string &strValue, beast::Journal j)
IniFileSections::mapped_type * getIniFileSection(IniFileSections &secSource, std::string const &strSection)
constexpr std::array< std::pair< SizedItem, std::array< int, 5 > >, 13 > kSizedItems
IniFileSections parseIniFile(std::string const &strInput, bool const bTrim)
bool getIfExists(Section const &section, std::string const &name, T &v)
std::string commonDbPragmaJournal(std::string_view journalMode)
Definition DBInit.h:21
std::string trimWhitespace(std::string str)
Remove leading and trailing ASCII whitespace.
std::chrono::duration< int, std::ratio_multiply< days::period, std::ratio< 7 > > > weeks
Definition chrono.h:22
std::string commonDbPragmaTemp(std::string_view tempStore)
Definition DBInit.h:33
static std::string const & systemName()
std::string getFileContents(std::error_code &ec, std::filesystem::path const &sourcePath, std::optional< std::size_t > maxSize=std::nullopt)
static void checkZeroPorts(Config const &config)
std::chrono::duration< int, std::ratio_multiply< std::chrono::hours::period, std::ratio< 24 > > > days
Definition chrono.h:19
DatabaseCon::Setup setupDatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
std::optional< uint256 > getRegisteredFeature(std::string const &name)
std::unordered_map< std::string, std::vector< std::string > > IniFileSections
Definition BasicConfig.h:20
std::string commonDbPragmaSync(std::string_view synchronous)
Definition DBInit.h:27
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Definition contract.h:52
T regex_replace(T... args)
T size(T... args)
T str(T... args)
std::array< std::string, 4 > txPragma
Definition DatabaseCon.h:98
static std::unique_ptr< std::vector< std::string > const > globalPragma
Definition DatabaseCon.h:97
std::filesystem::path dataDir
Definition DatabaseCon.h:82
std::array< std::string, 1 > lgrPragma
Definition DatabaseCon.h:99
Fee schedule for startup / standalone, and to vote for.
XRPAmount accountReserve
The account reserve requirement in drops.
XRPAmount ownerReserve
The per-owned item reserve requirement in drops.
XRPAmount referenceFee
The cost of a reference transaction in drops.
static constexpr auto kPageSize
Definition Constants.h:141
static constexpr auto kTxRelayPercentage
Definition Constants.h:172
static constexpr auto kFastLoad
Definition Constants.h:106
static constexpr auto kTxMetrics
Definition Constants.h:170
static constexpr auto kAccountReserve
Definition Constants.h:84
static constexpr auto kUseTxTables
Definition Constants.h:176
static constexpr auto kReferenceFee
Definition Constants.h:149
static constexpr auto kVpBaseSquelchEnable
Definition Constants.h:178
static constexpr auto kPort
Definition Constants.h:145
static constexpr auto kMaxUnknownTime
Definition Constants.h:123
static constexpr auto kJournalSizeLimit
Definition Constants.h:116
static constexpr auto kTxMinPeers
Definition Constants.h:171
static constexpr auto kVpEnable
Definition Constants.h:180
static constexpr auto kMaxTrustedCount
Definition Constants.h:122
static constexpr auto kMaxUntrustedCount
Definition Constants.h:124
static constexpr auto kVpBaseSquelchMaxSelectedPeers
Definition Constants.h:179
static constexpr auto kMaxDivergedTime
Definition Constants.h:120
static constexpr auto kTxEnable
Definition Constants.h:169
static constexpr auto kOwnerReserve
Definition Constants.h:140
static constexpr auto kAmendmentMajorityTime
Definition Constants.h:8
static constexpr auto kMaxSubscriptionsPerConnection
Definition Constants.h:28
static constexpr auto kPeersInMax
Definition Constants.h:41
static constexpr auto kMaxTransactions
Definition Constants.h:29
static constexpr auto kRelayProposals
Definition Constants.h:53
static constexpr auto kSweepInterval
Definition Constants.h:65
static constexpr auto kNodeSize
Definition Constants.h:34
static constexpr auto kServerDomain
Definition Constants.h:57
static constexpr auto kIps
Definition Constants.h:23
static constexpr auto kOverlay
Definition Constants.h:35
static constexpr auto kReduceRelay
Definition Constants.h:51
static constexpr auto kValidatorListThreshold
Definition Constants.h:72
static constexpr auto kValidators
Definition Constants.h:74
static constexpr auto kSslVerifyFile
Definition Constants.h:64
static constexpr auto kValidatorListKeys
Definition Constants.h:70
static constexpr auto kSslVerifyDir
Definition Constants.h:63
static constexpr auto kNetworkQuorum
Definition Constants.h:31
static constexpr auto kValidationSeed
Definition Constants.h:67
static constexpr auto kSigningSupport
Definition Constants.h:58
static constexpr auto kCompression
Definition Constants.h:11
static constexpr auto kPeersMax
Definition Constants.h:42
static constexpr auto kPathSearchOld
Definition Constants.h:39
static constexpr auto kServer
Definition Constants.h:56
static constexpr auto kLedgerHistory
Definition Constants.h:25
static constexpr auto kElbSupport
Definition Constants.h:15
static constexpr auto kValidatorKeys
Definition Constants.h:68
static constexpr auto kPeerPrivate
Definition Constants.h:40
static constexpr auto kSslVerify
Definition Constants.h:62
static constexpr auto kPeersOutMax
Definition Constants.h:43
static constexpr auto kFeeDefault
Definition Constants.h:17
static constexpr auto kValidatorsFile
Definition Constants.h:75
static constexpr auto kPathSearchMax
Definition Constants.h:38
static constexpr auto kRelayValidations
Definition Constants.h:54
static constexpr auto kNodeDatabase
Definition Constants.h:32
static constexpr auto kIpsFixed
Definition Constants.h:24
static constexpr auto kDatabasePath
Definition Constants.h:13
static constexpr auto kPathSearch
Definition Constants.h:36
static constexpr auto kLedgerReplay
Definition Constants.h:26
static constexpr auto kPrefetchWorkers
Definition Constants.h:50
static constexpr auto kDebugLogfile
Definition Constants.h:14
static constexpr auto kSqlite
Definition Constants.h:61
static constexpr auto kValidatorToken
Definition Constants.h:73
static constexpr auto kPathSearchFast
Definition Constants.h:37
static constexpr auto kVoting
Definition Constants.h:78
static constexpr auto kLedgerTxTables
Definition Constants.h:27
static constexpr auto kBetaRpcApi
Definition Constants.h:9
static constexpr auto kIoWorkers
Definition Constants.h:22
static constexpr auto kFetchDepth
Definition Constants.h:18
static constexpr auto kValidatorListSites
Definition Constants.h:71
static constexpr auto kWorkers
Definition Constants.h:79
static constexpr auto kNetworkId
Definition Constants.h:30
static constexpr auto kFeatures
Definition Constants.h:16
T substr(T... args)
T to_string(T... args)
T value(T... args)
T value_or(T... args)