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
249[[nodiscard]] static std::string
250getEnvVar(char const* name)
251{
252 std::string value;
253
254 if (auto const v = std::getenv(name); v != nullptr)
255 value = v;
256
257 return value;
258}
259
261 : j_(beast::Journal::getNullSink()), ramSize_(detail::getMemorySize() / (1024 * 1024 * 1024))
262{
263}
264
265void
266Config::setupControl(bool bQuiet, bool bSilent, bool bStandalone)
267{
268 XRPL_ASSERT(nodeSize == 0, "xrpl::Config::setupControl : node size not set");
269
270 quiet_ = bQuiet || bSilent;
271 silent_ = bSilent;
272 runStandalone_ = bStandalone;
273
274 // We try to autodetect the appropriate node size by checking available
275 // RAM and CPU resources. We default to "tiny" for standalone mode.
276 if (!bStandalone)
277 {
278 // First, check against 'minimum' RAM requirements per node size:
279 auto const& threshold =
281
282 auto ns = std::ranges::find_if(threshold.second, [this](std::size_t limit) {
283 return (limit == 0) || (ramSize_ < limit);
284 });
285
286 XRPL_ASSERT(ns != threshold.second.end(), "xrpl::Config::setupControl : valid node size");
287
288 if (ns != threshold.second.end())
289 nodeSize = std::distance(threshold.second.begin(), ns);
290
291 // Adjust the size based on the number of hardware threads of
292 // execution available to us:
293 if (auto const hc = std::thread::hardware_concurrency(); hc != 0)
295 }
296
297 XRPL_ASSERT(nodeSize <= 4, "xrpl::Config::setupControl : node size is set");
298}
299
300void
301Config::setup(std::string const& strConf, bool bQuiet, bool bSilent, bool bStandalone)
302{
303 setupControl(bQuiet, bSilent, bStandalone);
304
305 // Determine the config and data directories.
306 // If the config file is found in the current working
307 // directory, use the current working directory as the
308 // config directory and that with "db" as the data
309 // directory.
310 std::filesystem::path dataDir;
311
312 if (!strConf.empty())
313 {
314 // --conf=<path> : everything is relative that file.
315 configFile_ = strConf;
317 configDir.remove_filename();
318 dataDir = configDir / kDatabaseDirName;
319 }
320 else
321 {
322 do
323 {
324 // Check if either of the config files exist in the current working
325 // directory, in which case the databases will be stored in a
326 // subdirectory.
328 dataDir = configDir / kDatabaseDirName;
331 break;
334 break;
335
336 // Check if the home directory is set, and optionally the XDG config
337 // and/or data directories, as the config may be there. See
338 // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html.
339 auto const strHome = getEnvVar("HOME");
340 if (!strHome.empty())
341 {
342 auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
343 auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
344 if (strXdgConfigHome.empty())
345 {
346 // $XDG_CONFIG_HOME was not set, use default based on $HOME.
347 strXdgConfigHome = strHome + "/.config";
348 }
349 if (strXdgDataHome.empty())
350 {
351 // $XDG_DATA_HOME was not set, use default based on $HOME.
352 strXdgDataHome = strHome + "/.local/share";
353 }
354
355 // Check if either of the config files exist in the XDG config
356 // dir.
357 dataDir = strXdgDataHome + "/" + systemName();
358 configDir = strXdgConfigHome + "/" + systemName();
361 break;
364 break;
365 }
366
367 // As a last resort, check the system config directory.
368 dataDir = "/var/lib/" + systemName();
369 configDir = "/etc/" + systemName();
372 break;
374 } while (false);
375 }
376
377 // Update default values
378 load();
379 {
380 // load() may have set a new value for the dataDir
382 if (!dbPath.empty())
383 {
384 dataDir = std::filesystem::path(dbPath);
385 }
386 else if (runStandalone_)
387 {
388 dataDir.clear();
389 }
390 }
391
392 if (!dataDir.empty())
393 {
396
397 if (ec)
398 Throw<std::runtime_error>(std::format("Can not create {}", dataDir.string()));
399
401 }
402
404
405 if (runStandalone_)
406 ledgerHistory = 0;
407
408 Section const ledgerTxTablesSection = section(Sections::kLedgerTxTables);
409 getIfExists(ledgerTxTablesSection, Keys::kUseTxTables, useTxTables_);
410
411 Section const& nodeDbSection{section(Sections::kNodeDatabase)};
412 getIfExists(nodeDbSection, Keys::kFastLoad, fastLoad);
413}
414
415// 0 ports are allowed for unit tests, but still not allowed to be present in
416// config file
417static void
418checkZeroPorts(Config const& config)
419{
420 if (!config.exists(Sections::kServer))
421 return;
422
423 for (auto const& name : config.section(Sections::kServer).values())
424 {
425 if (!config.exists(name))
426 return;
427
428 auto const& section = config[name];
429 auto const optResult = section.get(Keys::kPort);
430 if (optResult)
431 {
432 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
433 if (port == 0u)
434 {
436 ss << "Invalid value '" << *optResult << "' for key 'port' in [" << name << "]";
438 }
439 }
440 }
441}
442
443void
445{
446 // NOTE: this writes to cerr because we want cout to be reserved
447 // for the writing of the json response (so that stdout can be part of a
448 // pipeline, for instance)
449 if (!quiet_)
450 std::cerr << "Loading: " << configFile_ << "\n";
451
453 auto const fileContents = getFileContents(ec, configFile_);
454
455 if (ec)
456 {
457 std::cerr << "Failed to read '" << configFile_ << "'." << ec.value() << ": " << ec.message()
458 << std::endl;
459 return;
460 }
461
462 loadFromString(fileContents);
463 checkZeroPorts(*this);
464}
465
466void
468{
469 IniFileSections secConfig = parseIniFile(fileContents, true);
470
471 build(secConfig);
472
473 if (auto s = getIniFileSection(secConfig, Sections::kIps))
474 ips = *s;
475
476 if (auto s = getIniFileSection(secConfig, Sections::kIpsFixed))
477 ipsFixed = *s;
478
479 // if the user has specified ip:port then replace : with a space.
480 {
481 auto replaceColons = [](std::vector<std::string>& strVec) {
482 static std::regex const kE(":([0-9]+)$");
483 for (auto& line : strVec)
484 {
485 // skip anything that might be an ipv6 address
486 if (std::count(line.begin(), line.end(), ':') != 1)
487 continue;
488
489 std::string const result = std::regex_replace(line, kE, " $1");
490 // sanity check the result of the replace, should be same length
491 // as input
492 if (result.size() == line.size())
493 line = result;
494 }
495 };
496
497 replaceColons(ipsFixed);
498 replaceColons(ips);
499 }
500
501 {
502 std::string dbPath;
503 if (getSingleSection(secConfig, Sections::kDatabasePath, dbPath, j_))
504 {
505 std::filesystem::path const p(dbPath);
507 }
508 }
509
510 std::string strTemp;
511
512 if (getSingleSection(secConfig, Sections::kNetworkId, strTemp, j_))
513 {
514 if (strTemp == "main")
515 {
516 networkId = 0;
517 }
518 else if (strTemp == "testnet")
519 {
520 networkId = 1;
521 }
522 else if (strTemp == "devnet")
523 {
524 networkId = 2;
525 }
526 else
527 {
529 }
530 }
531
532 if (getSingleSection(secConfig, Sections::kPeerPrivate, strTemp, j_))
534
535 if (getSingleSection(secConfig, Sections::kPeersMax, strTemp, j_))
536 {
538 }
539 else
540 {
541 std::optional<std::size_t> peersInMaxOpt{};
542 if (getSingleSection(secConfig, Sections::kPeersInMax, strTemp, j_))
543 {
544 peersInMaxOpt = beast::lexicalCastThrow<std::size_t>(strTemp);
545 if (*peersInMaxOpt > 1000)
546 {
548 "Invalid value specified in [{}] section; the value must be less or equal than "
549 "1000",
551 }
552 }
553
554 std::optional<std::size_t> peersOutMaxOpt{};
555 if (getSingleSection(secConfig, Sections::kPeersOutMax, strTemp, j_))
556 {
557 peersOutMaxOpt = beast::lexicalCastThrow<std::size_t>(strTemp);
558 if (*peersOutMaxOpt < 10 || *peersOutMaxOpt > 1000)
559 {
561 "Invalid value specified in [{}] section; the value must be in range 10-1000",
563 }
564 }
565
566 // if one section is configured then the other must be configured too
567 if ((peersInMaxOpt && !peersOutMaxOpt) || (peersOutMaxOpt && !peersInMaxOpt))
568 {
570 "Both sections [{}] and [{}] must be configured",
573 }
574
575 if (peersInMaxOpt && peersOutMaxOpt)
576 {
577 peersInMax = *peersInMaxOpt;
578 peersOutMax = *peersOutMaxOpt;
579 }
580 }
581
582 if (getSingleSection(secConfig, Sections::kNodeSize, strTemp, j_))
583 {
584 if (boost::iequals(strTemp, "tiny"))
585 {
586 nodeSize = 0;
587 }
588 else if (boost::iequals(strTemp, "small"))
589 {
590 nodeSize = 1;
591 }
592 else if (boost::iequals(strTemp, "medium"))
593 {
594 nodeSize = 2;
595 }
596 else if (boost::iequals(strTemp, "large"))
597 {
598 nodeSize = 3;
599 }
600 else if (boost::iequals(strTemp, "huge"))
601 {
602 nodeSize = 4;
603 }
604 else
605 {
607 }
608 }
609
610 if (getSingleSection(secConfig, Sections::kSigningSupport, strTemp, j_))
612
613 if (getSingleSection(secConfig, Sections::kElbSupport, strTemp, j_))
615
618
619 if (getSingleSection(secConfig, Sections::kSslVerify, strTemp, j_))
621
622 if (getSingleSection(secConfig, Sections::kRelayValidations, strTemp, j_))
623 {
624 if (boost::iequals(strTemp, "all"))
625 {
627 }
628 else if (boost::iequals(strTemp, "trusted"))
629 {
631 }
632 else if (boost::iequals(strTemp, "drop_untrusted"))
633 {
635 }
636 else
637 {
639 "Invalid value specified in [{}] section", Sections::kRelayValidations));
640 }
641 }
642
643 if (getSingleSection(secConfig, Sections::kRelayProposals, strTemp, j_))
644 {
645 if (boost::iequals(strTemp, "all"))
646 {
648 }
649 else if (boost::iequals(strTemp, "trusted"))
650 {
652 }
653 else if (boost::iequals(strTemp, "drop_untrusted"))
654 {
656 }
657 else
658 {
660 std::format("Invalid value specified in [{}] section", Sections::kRelayProposals));
661 }
662 }
663
665 {
667 "Cannot have both [{}] and [{}] config sections",
670 }
671
672 if (getSingleSection(secConfig, Sections::kNetworkQuorum, strTemp, j_))
674
677
679 /* [fee_default] is documented in the example config files as useful for
680 * things like offline transaction signing. Until that's completely
681 * deprecated, allow it to override the [voting] section. */
682 if (getSingleSection(secConfig, Sections::kFeeDefault, strTemp, j_))
683 fees.referenceFee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
684
685 if (getSingleSection(secConfig, Sections::kLedgerHistory, strTemp, j_))
686 {
687 if (boost::iequals(strTemp, "full"))
688 {
690 }
691 else if (boost::iequals(strTemp, "none"))
692 {
693 ledgerHistory = 0;
694 }
695 else
696 {
698 }
699 }
700
701 if (getSingleSection(secConfig, Sections::kFetchDepth, strTemp, j_))
702 {
703 if (boost::iequals(strTemp, "none"))
704 {
705 fetchDepth = 0;
706 }
707 else if (boost::iequals(strTemp, "full"))
708 {
709 fetchDepth = std::numeric_limits<decltype(fetchDepth)>::max();
710 }
711 else
712 {
714 }
715
717 }
718
719 // By default, validators don't have pathfinding enabled, unless it is
720 // explicitly requested by the server's admin.
722 pathSearchMax = 0;
723
724 if (getSingleSection(secConfig, Sections::kPathSearchOld, strTemp, j_))
726 if (getSingleSection(secConfig, Sections::kPathSearch, strTemp, j_))
728 if (getSingleSection(secConfig, Sections::kPathSearchFast, strTemp, j_))
730 if (getSingleSection(secConfig, Sections::kPathSearchMax, strTemp, j_))
732
733 if (getSingleSection(secConfig, Sections::kDebugLogfile, strTemp, j_))
734 debugLogfile_ = strTemp;
735
736 if (getSingleSection(secConfig, Sections::kSweepInterval, strTemp, j_))
737 {
739
741 {
743 "Invalid {}: must be between 10 and 600 inclusive", Sections::kSweepInterval));
744 }
745 }
746
747 if (getSingleSection(secConfig, Sections::kWorkers, strTemp, j_))
748 {
750
752 {
754 "Invalid {}: must be between 1 and 1024 inclusive.", Sections::kWorkers));
755 }
756 }
757
758 if (getSingleSection(secConfig, Sections::kIoWorkers, strTemp, j_))
759 {
761
763 {
765 "Invalid {}: must be between 1 and 1024 inclusive.", Sections::kIoWorkers));
766 }
767 }
768
769 if (getSingleSection(secConfig, Sections::kPrefetchWorkers, strTemp, j_))
770 {
772
774 {
776 "Invalid {}: must be between 1 and 1024 inclusive.", Sections::kPrefetchWorkers));
777 }
778 }
779
780 if (getSingleSection(secConfig, Sections::kCompression, strTemp, j_))
782
783 if (getSingleSection(secConfig, Sections::kLedgerReplay, strTemp, j_))
785
787 {
789
793 // vp_enable config option is deprecated by vp_base_squelch_enable //
794 // This option is kept for backwards compatibility. When squelching //
795 // is the default algorithm, it must be replaced with: //
796 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
797 // sec.value_or("vp_base_squelch_enable", true); //
798 if (sec.exists(Keys::kVpBaseSquelchEnable) && sec.exists(Keys::kVpEnable))
799 {
801 "Invalid {} cannot specify both vp_base_squelch_enable and vp_enable options. "
802 "vp_enable was deprecated and replaced by vp_base_squelch_enable",
804 }
805
806 if (sec.exists(Keys::kVpBaseSquelchEnable))
807 {
809 }
810 else if (sec.exists(Keys::kVpEnable))
811 {
813 }
814 else
815 {
817 }
821
825 // Temporary squelching config for the peers selected as a source of //
826 // validator messages. The config must be removed once squelching is //
827 // made the default routing algorithm. //
830 {
832 "Invalid {} vp_base_squelch_max_selected_peers must be greater than or equal to 3",
834 }
838
839 txReduceRelayEnable = sec.valueOr(Keys::kTxEnable, false);
840 txReduceRelayMetrics = sec.valueOr(Keys::kTxMetrics, false);
841 txReduceRelayMinPeers = sec.valueOr(Keys::kTxMinPeers, 20);
844 {
846 "Invalid {}, tx_min_peers must be greater than or equal to 10, tx_relay_percentage "
847 "must be greater than or equal to 10 and less than or equal to 100",
849 }
850 }
851
852 if (getSingleSection(secConfig, Sections::kMaxTransactions, strTemp, j_))
853 {
856 }
857
858 if (getSingleSection(secConfig, Sections::kServerDomain, strTemp, j_))
859 {
860 if (!isProperlyFormedTomlDomain(strTemp))
861 {
863 "Invalid {}: the domain name does not appear to meet the requirements.",
865 }
866
867 serverDomain = strTemp;
868 }
869
871 {
872 auto const sec = section(Sections::kOverlay);
873
874 using namespace std::chrono;
875
876 try
877 {
878 if (auto val = sec.get(Keys::kMaxUnknownTime))
880 }
881 catch (...)
882 {
884 "Invalid value 'max_unknown_time' in {}: must be of the form '<number>' "
885 "representing seconds.",
887 }
888
889 if (maxUnknownTime < seconds{300} || maxUnknownTime > seconds{1800})
890 {
892 "Invalid value 'max_unknown_time' in {}: the time must be between 300 and 1800 "
893 "seconds, inclusive.",
895 }
896
897 try
898 {
899 if (auto val = sec.get(Keys::kMaxDivergedTime))
901 }
902 catch (...)
903 {
905 "Invalid value 'max_diverged_time' in {}: must be of the form '<number>' "
906 "representing seconds.",
908 }
909
911 {
913 "Invalid value 'max_diverged_time' in {}: the time must be between 60 and 900 "
914 "seconds, inclusive.",
916 }
917
918 // Both manifest counts parse and validate identically, so read them
919 // the same way. Returns nullopt when the key is absent, leaving the
920 // built-in default in effect at the use site.
921 auto manifestCount = [&sec](char const* key) -> std::optional<std::size_t> {
923
924 try
925 {
926 if (auto val = sec.get(key))
928 }
929 catch (...)
930 {
932 "Invalid value '{}' in {}: must be of the form '<number>' representing a count "
933 "of manifests.",
934 key,
936 }
937
938 if (count && (*count < kMinManifestCount || *count > kMaxManifestCount))
939 {
941 "Invalid value '{}' in {}: the count must be between {} and {}, inclusive.",
942 key,
946 }
947
948 return count;
949 };
950
953 }
954
955 if (getSingleSection(secConfig, Sections::kAmendmentMajorityTime, strTemp, j_))
956 {
957 using namespace std::chrono;
958 boost::regex const re(R"(^\s*(\d+)\s*(minutes|hours|days|weeks)\s*(\s+.*)?$)");
959 boost::smatch match;
960 if (!boost::regex_match(strTemp, match, re))
961 {
963 "Invalid {}, must be: [0-9]+ [minutes|hours|days|weeks]",
965 }
966
967 auto const duration = beast::lexicalCastThrow<std::uint32_t>(match[1].str());
968
969 if (boost::iequals(match[2], "minutes"))
970 {
972 }
973 else if (boost::iequals(match[2], "hours"))
974 {
976 }
977 else if (boost::iequals(match[2], "days"))
978 {
980 }
981 else if (boost::iequals(match[2], "weeks"))
982 {
984 }
985
987 {
989 "Invalid {}, the minimum amount of time an amendment must hold a majority is 15 "
990 "minutes",
992 }
993 }
994
995 if (getSingleSection(secConfig, Sections::kBetaRpcApi, strTemp, j_))
997
998 // Do not load trusted validator configuration for standalone mode
999 if (!runStandalone_)
1000 {
1001 // If a file was explicitly specified, then throw if the
1002 // path is malformed or if the file does not exist or is
1003 // not a file.
1004 // If the specified file is not an absolute path, then look
1005 // for it in the same directory as the config file.
1006 // If no path was specified, then look for validators.txt
1007 // in the same directory as the config file, but don't complain
1008 // if we can't find it.
1009 std::filesystem::path validatorsFile;
1010
1011 if (getSingleSection(secConfig, Sections::kValidatorsFile, strTemp, j_))
1012 {
1013 validatorsFile = strTemp;
1014
1015 if (validatorsFile.empty())
1016 {
1018 std::format("Invalid path specified in [{}]", Sections::kValidatorsFile));
1019 }
1020
1021 if (!validatorsFile.is_absolute() && !configDir.empty())
1022 validatorsFile = configDir / validatorsFile;
1023
1024 if (!std::filesystem::exists(validatorsFile))
1025 {
1027 "The file specified in [{}] does not exist: {}",
1029 validatorsFile.string()));
1030 }
1031 else if (
1032 !std::filesystem::is_regular_file(validatorsFile) &&
1033 !std::filesystem::is_symlink(validatorsFile))
1034 {
1036 "Invalid file specified in [{}]: {}",
1038 validatorsFile.string()));
1039 }
1040 }
1041 else if (!configDir.empty())
1042 {
1043 validatorsFile = configDir / kValidatorsFileName;
1044
1045 if (!validatorsFile.empty())
1046 {
1047 if (!std::filesystem::exists(validatorsFile) ||
1048 (!std::filesystem::is_regular_file(validatorsFile) &&
1049 !std::filesystem::is_symlink(validatorsFile)))
1050 {
1051 validatorsFile.clear();
1052 }
1053 }
1054 }
1055
1056 if (!validatorsFile.empty() && std::filesystem::exists(validatorsFile) &&
1057 (std::filesystem::is_regular_file(validatorsFile) ||
1058 std::filesystem::is_symlink(validatorsFile)))
1059 {
1060 std::error_code ec;
1061 auto const data = getFileContents(ec, validatorsFile);
1062 if (ec)
1063 {
1065 "Failed to read '{}': {} (error {})",
1066 validatorsFile.string(),
1067 ec.message(),
1068 ec.value()));
1069 }
1070
1071 auto iniFile = parseIniFile(data, true);
1072
1073 auto entries = getIniFileSection(iniFile, Sections::kValidators);
1074
1075 if (entries != nullptr)
1077
1078 auto valKeyEntries = getIniFileSection(iniFile, Sections::kValidatorKeys);
1079
1080 if (valKeyEntries != nullptr)
1081 section(Sections::kValidatorKeys).append(*valKeyEntries);
1082
1083 auto valSiteEntries = getIniFileSection(iniFile, Sections::kValidatorListSites);
1084
1085 if (valSiteEntries != nullptr)
1087
1088 auto valListKeys = getIniFileSection(iniFile, Sections::kValidatorListKeys);
1089
1090 if (valListKeys != nullptr)
1092
1093 auto valListThreshold = getIniFileSection(iniFile, Sections::kValidatorListThreshold);
1094
1095 if (valListThreshold != nullptr)
1097
1098 if ((entries == nullptr) && (valKeyEntries == nullptr) && (valListKeys == nullptr))
1099 {
1101 "The file specified in [{}] does not contain a [{}], [{}] or [{}] section: {}",
1106 validatorsFile.string()));
1107 }
1108 }
1109
1111 auto const& listThreshold = section(Sections::kValidatorListThreshold);
1112 if (listThreshold.lines().empty())
1113 {
1114 return std::nullopt;
1115 }
1116 if (listThreshold.values().size() == 1)
1117 {
1118 auto strTemp = listThreshold.values()[0];
1119 auto const listThreshold = beast::lexicalCastThrow<std::size_t>(strTemp);
1120 if (listThreshold == 0)
1121 {
1122 return std::nullopt; // NOTE: Explicitly ask for computed
1123 }
1124 if (listThreshold > section(Sections::kValidatorListKeys).values().size())
1125 {
1127 "Value in config section [{}] exceeds the number of configured list keys",
1129 }
1130 return listThreshold;
1131 }
1132
1134 "Config section [{}] should contain single value only",
1136 }();
1137
1138 // Consolidate [validator_keys] and [validators]
1140
1143 {
1145 std::format("[{}] config section is missing", Sections::kValidatorListKeys));
1146 }
1147 }
1148
1149 {
1150 auto const part = section(Sections::kFeatures);
1151 for (auto const& s : part.values())
1152 {
1153 if (auto const f = getRegisteredFeature(s))
1154 {
1155 features.insert(*f);
1156 }
1157 else
1158 {
1159 Throw<std::runtime_error>(std::format("Unknown feature: {} in config file.", s));
1160 }
1161 }
1162 }
1163
1164 // This doesn't properly belong here, but check to make sure that the
1165 // value specified for network_quorum is achievable:
1166 {
1167 auto pm = peersMax;
1168
1169 // FIXME this apparently magic value is actually defined as a constant
1170 // elsewhere (see defaultMaxPeers) but we handle this check here.
1171 if (pm == 0)
1172 pm = 21;
1173
1174 if (networkQuorum > pm)
1175 {
1177 "The minimum number of required peers (network_quorum) exceeds "
1178 "the maximum number of allowed peers (peers_max)");
1179 }
1180 }
1181}
1182
1185{
1186 auto logFile = debugLogfile_;
1187
1188 if (!logFile.empty() && !logFile.is_absolute())
1189 {
1190 // Unless an absolute path for the log file is specified, the
1191 // path is relative to the config file directory.
1192 logFile = std::filesystem::absolute(configDir / logFile);
1193 }
1194
1195 if (!logFile.empty())
1196 {
1197 auto logDir = logFile.parent_path();
1198
1199 if (!std::filesystem::is_directory(logDir))
1200 {
1201 std::error_code ec;
1203
1204 // If we fail, we warn but continue so that the calling code can
1205 // decide how to handle this situation.
1206 if (ec)
1207 {
1208 std::cerr << "Unable to create log file path " << logDir << ": " << ec.message()
1209 << '\n';
1210 }
1211 }
1212 }
1213
1214 return logFile;
1215}
1216
1217int
1219{
1220 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
1221 XRPL_ASSERT(index < kSizedItems.size(), "xrpl::Config::getValueFor : valid index input");
1222 XRPL_ASSERT(!node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node");
1223 return kSizedItems.at(index).second.at(node.value_or(nodeSize));
1224}
1225
1227setupFeeVote(Section const& section)
1228{
1229 FeeSetup setup;
1230 {
1231 std::uint64_t temp = 0;
1232 if (set(temp, Keys::kReferenceFee, section) &&
1234 setup.referenceFee = temp;
1235 }
1236 {
1237 std::uint32_t temp = 0;
1238 if (set(temp, Keys::kAccountReserve, section))
1239 setup.accountReserve = temp;
1240 if (set(temp, Keys::kOwnerReserve, section))
1241 setup.ownerReserve = temp;
1242 }
1243 return setup;
1244}
1245
1246DatabaseCon::Setup
1248{
1249 DatabaseCon::Setup setup;
1250
1251 setup.startUp = c.startUp;
1252 setup.standAlone = c.standalone();
1254 if (!setup.standAlone && setup.dataDir.empty())
1255 {
1256 Throw<std::runtime_error>("database_path must be set.");
1257 }
1258
1259 if (!setup.globalPragma)
1260 {
1261 auto const& sqlite = c.section(Sections::kSqlite);
1263 result->reserve(3);
1264
1265 // defaults
1266 std::string safetyLevel;
1267 std::string journalMode = "wal";
1268 std::string synchronous = "normal";
1269 std::string tempStore = "file";
1270 bool showRiskWarning = false;
1271
1272 if (set(safetyLevel, "safety_level", sqlite))
1273 {
1274 if (boost::iequals(safetyLevel, "low"))
1275 {
1276 // low safety defaults
1277 journalMode = "memory";
1278 synchronous = "off";
1279 tempStore = "memory";
1280 showRiskWarning = true;
1281 }
1282 else if (!boost::iequals(safetyLevel, "high"))
1283 {
1285 std::format("Invalid safety_level value: {}", safetyLevel));
1286 }
1287 }
1288
1289 {
1290 // #journal_mode Valid values : delete, truncate, persist,
1291 // memory, wal, off
1292 if (set(journalMode, "journal_mode", sqlite) && !safetyLevel.empty())
1293 {
1295 "Configuration file may not define both "
1296 "\"safety_level\" and \"journal_mode\"");
1297 }
1298 bool const higherRisk =
1299 boost::iequals(journalMode, "memory") || boost::iequals(journalMode, "off");
1300 showRiskWarning = showRiskWarning || higherRisk;
1301 if (higherRisk || boost::iequals(journalMode, "delete") ||
1302 boost::iequals(journalMode, "truncate") || boost::iequals(journalMode, "persist") ||
1303 boost::iequals(journalMode, "wal"))
1304 {
1305 result->emplace_back(commonDbPragmaJournal(journalMode));
1306 }
1307 else
1308 {
1310 std::format("Invalid journal_mode value: {}", journalMode));
1311 }
1312 }
1313
1314 {
1315 // #synchronous Valid values : off, normal, full, extra
1316 if (set(synchronous, "synchronous", sqlite) && !safetyLevel.empty())
1317 {
1319 "Configuration file may not define both "
1320 "\"safety_level\" and \"synchronous\"");
1321 }
1322 bool const higherRisk = boost::iequals(synchronous, "off");
1323 showRiskWarning = showRiskWarning || higherRisk;
1324 if (higherRisk || boost::iequals(synchronous, "normal") ||
1325 boost::iequals(synchronous, "full") || boost::iequals(synchronous, "extra"))
1326 {
1327 result->emplace_back(commonDbPragmaSync(synchronous));
1328 }
1329 else
1330 {
1332 std::format("Invalid synchronous value: {}", synchronous));
1333 }
1334 }
1335
1336 {
1337 // #temp_store Valid values : default, file, memory
1338 if (set(tempStore, "temp_store", sqlite) && !safetyLevel.empty())
1339 {
1341 "Configuration file may not define both "
1342 "\"safety_level\" and \"temp_store\"");
1343 }
1344 bool const higherRisk = boost::iequals(tempStore, "memory");
1345 showRiskWarning = showRiskWarning || higherRisk;
1346 if (higherRisk || boost::iequals(tempStore, "default") ||
1347 boost::iequals(tempStore, "file"))
1348 {
1349 result->emplace_back(commonDbPragmaTemp(tempStore));
1350 }
1351 else
1352 {
1353 Throw<std::runtime_error>(std::format("Invalid temp_store value: {}", tempStore));
1354 }
1355 }
1356
1357 if (showRiskWarning && j && c.ledgerHistory > kSqliteTuningCutoff)
1358 {
1359 JLOG(j->warn()) << "reducing the data integrity guarantees from the "
1360 "default [sqlite] behavior is not recommended for "
1361 "nodes storing large amounts of history, because of the "
1362 "difficulty inherent in rebuilding corrupted data.";
1363 }
1364 XRPL_ASSERT(
1365 result->size() == 3, "xrpl::setup_DatabaseCon::globalPragma : result size is 3");
1366 setup.globalPragma = std::move(result);
1367 }
1368 setup.useGlobalPragma = true;
1369
1370 auto setPragma = [](std::string& pragma, std::string const& key, int64_t value) {
1371 pragma = "PRAGMA " + key + "=" + std::to_string(value) + ";";
1372 };
1373
1374 // Lgr Pragma
1375 setPragma(setup.lgrPragma[0], "journal_size_limit", 1582080);
1376
1377 // TX Pragma
1378 int64_t pageSize = 4096;
1379 int64_t journalSizeLimit = 1582080;
1381 {
1382 auto& s = c.section(Sections::kSqlite);
1383 set(journalSizeLimit, Keys::kJournalSizeLimit, s);
1384 set(pageSize, Keys::kPageSize, s);
1385 if (pageSize < 512 || pageSize > 65536)
1386 Throw<std::runtime_error>("Invalid page_size. Must be between 512 and 65536.");
1387
1388 if ((pageSize & (pageSize - 1)) != 0)
1389 Throw<std::runtime_error>("Invalid page_size. Must be a power of 2.");
1390 }
1391
1392 setPragma(setup.txPragma[0], "page_size", pageSize);
1393 setPragma(setup.txPragma[1], "journal_size_limit", journalSizeLimit);
1394 setPragma(setup.txPragma[2], "max_page_count", 4294967294);
1395 setPragma(setup.txPragma[3], "mmap_size", 17179869184);
1396
1397 return setup;
1398}
1399} // 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::unordered_set< UInt256, beast::Uhash<> > features
static constexpr std::string_view kConfigLegacyName
std::optional< std::size_t > maxUntrustedCount
std::chrono::seconds maxDivergedTime
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
static constexpr std::string_view kDatabaseDirName
std::size_t vpReduceRelaySquelchMaxSelectedPeers
////////////////// !
static constexpr std::string_view kConfigFileName
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
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
std::optional< std::size_t > validatorListThreshold
std::filesystem::path debugLogfile_
bool runStandalone_
Operate in stand-alone mode.
static constexpr std::string_view kValidatorsFileName
bool txReduceRelayEnable
////////////// END OF TEMPORARY CODE BLOCK /////////////////////
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.
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:28
std::vector< std::string > const & values() const
Returns all the values in the section.
Definition BasicConfig.h:68
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
std::chrono::duration< int, std::ratio_multiply< std::chrono::hours::period, std::ratio< 24 > > > Days
Definition chrono.h:19
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)
std::optional< UInt256 > getRegisteredFeature(std::string 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::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)
DatabaseCon::Setup setupDatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
std::chrono::duration< int, std::ratio_multiply< Days::period, std::ratio< 7 > > > Weeks
Definition chrono.h:22
std::unordered_map< std::string, std::vector< std::string > > IniFileSections
Definition BasicConfig.h:19
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:142
static constexpr auto kTxRelayPercentage
Definition Constants.h:173
static constexpr auto kFastLoad
Definition Constants.h:106
static constexpr auto kTxMetrics
Definition Constants.h:171
static constexpr auto kAccountReserve
Definition Constants.h:84
static constexpr auto kUseTxTables
Definition Constants.h:177
static constexpr auto kReferenceFee
Definition Constants.h:150
static constexpr auto kVpBaseSquelchEnable
Definition Constants.h:179
static constexpr auto kPort
Definition Constants.h:146
static constexpr auto kMaxUnknownTime
Definition Constants.h:123
static constexpr auto kJournalSizeLimit
Definition Constants.h:116
static constexpr auto kTxMinPeers
Definition Constants.h:172
static constexpr auto kVpEnable
Definition Constants.h:181
static constexpr auto kMaxTrustedCount
Definition Constants.h:122
static constexpr auto kMaxUntrustedCount
Definition Constants.h:124
static constexpr auto kVpBaseSquelchMaxSelectedPeers
Definition Constants.h:180
static constexpr auto kMaxDivergedTime
Definition Constants.h:120
static constexpr auto kTxEnable
Definition Constants.h:170
static constexpr auto kOwnerReserve
Definition Constants.h:141
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)