diff --git a/Config_8cpp_source.html b/Config_8cpp_source.html index 89b5231287..41169d6bde 100644 --- a/Config_8cpp_source.html +++ b/Config_8cpp_source.html @@ -456,695 +456,697 @@ $(document).ready(function() { init_codefold(0); });
358 std::string const dbPath(legacy("database_path"));
359 if (!dbPath.empty())
360 dataDir = boost::filesystem::path(dbPath);
-
361 }
-
362
-
363 if (!RUN_STANDALONE)
-
364 {
-
365 boost::system::error_code ec;
-
366 boost::filesystem::create_directories(dataDir, ec);
-
367
-
368 if (ec)
-
369 Throw<std::runtime_error>(boost::str(boost::format("Can not create %s") % dataDir));
-
370
-
371 legacy("database_path", boost::filesystem::absolute(dataDir).string());
-
372 }
-
373
-
374 HTTPClient::initializeSSLContext(this->SSL_VERIFY_DIR, this->SSL_VERIFY_FILE, this->SSL_VERIFY, j_);
+
361 else if (RUN_STANDALONE)
+
362 dataDir.clear();
+
363 }
+
364
+
365 if (!dataDir.empty())
+
366 {
+
367 boost::system::error_code ec;
+
368 boost::filesystem::create_directories(dataDir, ec);
+
369
+
370 if (ec)
+
371 Throw<std::runtime_error>(boost::str(boost::format("Can not create %s") % dataDir));
+
372
+
373 legacy("database_path", boost::filesystem::absolute(dataDir).string());
+
374 }
375
-
376 if (RUN_STANDALONE)
-
377 LEDGER_HISTORY = 0;
-
378
-
379 std::string ledgerTxDbType;
-
380 Section ledgerTxTablesSection = section("ledger_tx_tables");
-
381 get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
-
382
-
383 Section& nodeDbSection{section(ConfigSection::nodeDatabase())};
-
384 get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
-
385}
+
376 HTTPClient::initializeSSLContext(this->SSL_VERIFY_DIR, this->SSL_VERIFY_FILE, this->SSL_VERIFY, j_);
+
377
+
378 if (RUN_STANDALONE)
+
379 LEDGER_HISTORY = 0;
+
380
+
381 std::string ledgerTxDbType;
+
382 Section ledgerTxTablesSection = section("ledger_tx_tables");
+
383 get_if_exists(ledgerTxTablesSection, "use_tx_tables", USE_TX_TABLES);
+
384
+
385 Section& nodeDbSection{section(ConfigSection::nodeDatabase())};
+
386 get_if_exists(nodeDbSection, "fast_load", FAST_LOAD);
+
387}
-
386
-
387// 0 ports are allowed for unit tests, but still not allowed to be present in
-
388// config file
-
389static void
-
-
390checkZeroPorts(Config const& config)
-
391{
-
392 if (!config.exists("server"))
-
393 return;
-
394
-
395 for (auto const& name : config.section("server").values())
-
396 {
-
397 if (!config.exists(name))
-
398 return;
-
399
-
400 auto const& section = config[name];
-
401 auto const optResult = section.get("port");
-
402 if (optResult)
-
403 {
-
404 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
-
405 if (!port)
-
406 {
-
407 std::stringstream ss;
-
408 ss << "Invalid value '" << *optResult << "' for key 'port' in [" << name << "]";
-
409 Throw<std::runtime_error>(ss.str());
-
410 }
-
411 }
-
412 }
-
413}
+
388
+
389// 0 ports are allowed for unit tests, but still not allowed to be present in
+
390// config file
+
391static void
+
+
392checkZeroPorts(Config const& config)
+
393{
+
394 if (!config.exists("server"))
+
395 return;
+
396
+
397 for (auto const& name : config.section("server").values())
+
398 {
+
399 if (!config.exists(name))
+
400 return;
+
401
+
402 auto const& section = config[name];
+
403 auto const optResult = section.get("port");
+
404 if (optResult)
+
405 {
+
406 auto const port = beast::lexicalCast<std::uint16_t>(*optResult);
+
407 if (!port)
+
408 {
+ +
410 ss << "Invalid value '" << *optResult << "' for key 'port' in [" << name << "]";
+
411 Throw<std::runtime_error>(ss.str());
+
412 }
+
413 }
+
414 }
+
415}
-
414
-
415void
-
- -
417{
-
418 // NOTE: this writes to cerr because we want cout to be reserved
-
419 // for the writing of the json response (so that stdout can be part of a
-
420 // pipeline, for instance)
-
421 if (!QUIET)
-
422 std::cerr << "Loading: " << CONFIG_FILE << "\n";
-
423
-
424 boost::system::error_code ec;
-
425 auto const fileContents = getFileContents(ec, CONFIG_FILE);
-
426
-
427 if (ec)
-
428 {
-
429 std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value() << ": " << ec.message() << std::endl;
-
430 return;
-
431 }
-
432
-
433 loadFromString(fileContents);
-
434 checkZeroPorts(*this);
-
435}
+
416
+
417void
+
+ +
419{
+
420 // NOTE: this writes to cerr because we want cout to be reserved
+
421 // for the writing of the json response (so that stdout can be part of a
+
422 // pipeline, for instance)
+
423 if (!QUIET)
+
424 std::cerr << "Loading: " << CONFIG_FILE << "\n";
+
425
+
426 boost::system::error_code ec;
+
427 auto const fileContents = getFileContents(ec, CONFIG_FILE);
+
428
+
429 if (ec)
+
430 {
+
431 std::cerr << "Failed to read '" << CONFIG_FILE << "'." << ec.value() << ": " << ec.message() << std::endl;
+
432 return;
+
433 }
+
434
+
435 loadFromString(fileContents);
+
436 checkZeroPorts(*this);
+
437}
-
436
-
437void
-
- -
439{
-
440 IniFileSections secConfig = parseIniFile(fileContents, true);
-
441
-
442 build(secConfig);
+
438
+
439void
+
+ +
441{
+
442 IniFileSections secConfig = parseIniFile(fileContents, true);
443
-
444 if (auto s = getIniFileSection(secConfig, SECTION_IPS))
-
445 IPS = *s;
-
446
-
447 if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
-
448 IPS_FIXED = *s;
-
449
-
450 // if the user has specified ip:port then replace : with a space.
-
451 {
-
452 auto replaceColons = [](std::vector<std::string>& strVec) {
-
453 static std::regex const e(":([0-9]+)$");
-
454 for (auto& line : strVec)
-
455 {
-
456 // skip anything that might be an ipv6 address
-
457 if (std::count(line.begin(), line.end(), ':') != 1)
-
458 continue;
-
459
-
460 std::string result = std::regex_replace(line, e, " $1");
-
461 // sanity check the result of the replace, should be same length
-
462 // as input
-
463 if (result.size() == line.size())
-
464 line = result;
-
465 }
-
466 };
-
467
-
468 replaceColons(IPS_FIXED);
-
469 replaceColons(IPS);
-
470 }
-
471
-
472 {
-
473 std::string dbPath;
-
474 if (getSingleSection(secConfig, "database_path", dbPath, j_))
-
475 {
-
476 boost::filesystem::path p(dbPath);
-
477 legacy("database_path", boost::filesystem::absolute(p).string());
-
478 }
-
479 }
-
480
-
481 std::string strTemp;
+
444 build(secConfig);
+
445
+
446 if (auto s = getIniFileSection(secConfig, SECTION_IPS))
+
447 IPS = *s;
+
448
+
449 if (auto s = getIniFileSection(secConfig, SECTION_IPS_FIXED))
+
450 IPS_FIXED = *s;
+
451
+
452 // if the user has specified ip:port then replace : with a space.
+
453 {
+
454 auto replaceColons = [](std::vector<std::string>& strVec) {
+
455 static std::regex const e(":([0-9]+)$");
+
456 for (auto& line : strVec)
+
457 {
+
458 // skip anything that might be an ipv6 address
+
459 if (std::count(line.begin(), line.end(), ':') != 1)
+
460 continue;
+
461
+
462 std::string result = std::regex_replace(line, e, " $1");
+
463 // sanity check the result of the replace, should be same length
+
464 // as input
+
465 if (result.size() == line.size())
+
466 line = result;
+
467 }
+
468 };
+
469
+
470 replaceColons(IPS_FIXED);
+
471 replaceColons(IPS);
+
472 }
+
473
+
474 {
+
475 std::string dbPath;
+
476 if (getSingleSection(secConfig, "database_path", dbPath, j_))
+
477 {
+
478 boost::filesystem::path p(dbPath);
+
479 legacy("database_path", boost::filesystem::absolute(p).string());
+
480 }
+
481 }
482
-
483 if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
-
484 {
-
485 if (strTemp == "main")
-
486 NETWORK_ID = 0;
-
487 else if (strTemp == "testnet")
-
488 NETWORK_ID = 1;
-
489 else if (strTemp == "devnet")
-
490 NETWORK_ID = 2;
-
491 else
-
492 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
-
493 }
-
494
-
495 if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
-
496 PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
-
497
-
498 if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
-
499 {
-
500 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
-
501 }
-
502 else
-
503 {
-
504 std::optional<std::size_t> peers_in_max{};
-
505 if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
-
506 {
-
507 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
508 if (*peers_in_max > 1000)
-
509 Throw<std::runtime_error>("Invalid value specified in [" SECTION_PEERS_IN_MAX
-
510 "] section; the value must be less or equal than 1000");
-
511 }
-
512
-
513 std::optional<std::size_t> peers_out_max{};
-
514 if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
-
515 {
-
516 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
-
517 if (*peers_out_max < 10 || *peers_out_max > 1000)
-
518 Throw<std::runtime_error>("Invalid value specified in [" SECTION_PEERS_OUT_MAX
-
519 "] section; the value must be in range 10-1000");
-
520 }
-
521
-
522 // if one section is configured then the other must be configured too
-
523 if ((peers_in_max && !peers_out_max) || (peers_out_max && !peers_in_max))
-
524 Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
-
525 "]"
-
526 "and [" SECTION_PEERS_OUT_MAX "] must be configured");
-
527
-
528 if (peers_in_max && peers_out_max)
-
529 {
-
530 PEERS_IN_MAX = *peers_in_max;
-
531 PEERS_OUT_MAX = *peers_out_max;
-
532 }
-
533 }
-
534
-
535 if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
-
536 {
-
537 if (boost::iequals(strTemp, "tiny"))
-
538 NODE_SIZE = 0;
-
539 else if (boost::iequals(strTemp, "small"))
-
540 NODE_SIZE = 1;
-
541 else if (boost::iequals(strTemp, "medium"))
-
542 NODE_SIZE = 2;
-
543 else if (boost::iequals(strTemp, "large"))
-
544 NODE_SIZE = 3;
-
545 else if (boost::iequals(strTemp, "huge"))
-
546 NODE_SIZE = 4;
-
547 else
-
548 NODE_SIZE = std::min<std::size_t>(4, beast::lexicalCastThrow<std::size_t>(strTemp));
-
549 }
-
550
-
551 if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
-
552 signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
-
553
-
554 if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
-
555 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
-
556
-
557 getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
-
558 getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
-
559
-
560 if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
-
561 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
-
562
-
563 if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
-
564 {
-
565 if (boost::iequals(strTemp, "all"))
- -
567 else if (boost::iequals(strTemp, "trusted"))
- -
569 else if (boost::iequals(strTemp, "drop_untrusted"))
- -
571 else
-
572 Throw<std::runtime_error>("Invalid value specified in [" SECTION_RELAY_VALIDATIONS "] section");
-
573 }
-
574
-
575 if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
-
576 {
-
577 if (boost::iequals(strTemp, "all"))
- -
579 else if (boost::iequals(strTemp, "trusted"))
- -
581 else if (boost::iequals(strTemp, "drop_untrusted"))
- -
583 else
-
584 Throw<std::runtime_error>("Invalid value specified in [" SECTION_RELAY_PROPOSALS "] section");
-
585 }
-
586
-
587 if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
-
588 Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED "] and [" SECTION_VALIDATOR_TOKEN
-
589 "] config sections");
-
590
-
591 if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
-
592 NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
-
593
-
594 FEES = setup_FeeVote(section("voting"));
-
595 /* [fee_default] is documented in the example config files as useful for
-
596 * things like offline transaction signing. Until that's completely
-
597 * deprecated, allow it to override the [voting] section. */
-
598 if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
-
599 FEES.reference_fee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
-
600
-
601 if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
-
602 {
-
603 if (boost::iequals(strTemp, "full"))
- -
605 else if (boost::iequals(strTemp, "none"))
-
606 LEDGER_HISTORY = 0;
-
607 else
-
608 LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
609 }
-
610
-
611 if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
-
612 {
-
613 if (boost::iequals(strTemp, "none"))
-
614 FETCH_DEPTH = 0;
-
615 else if (boost::iequals(strTemp, "full"))
-
616 FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
-
617 else
-
618 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
-
619
-
620 if (FETCH_DEPTH < 10)
-
621 FETCH_DEPTH = 10;
-
622 }
-
623
-
624 // By default, validators don't have pathfinding enabled, unless it is
-
625 // explicitly requested by the server's admin.
-
626 if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
-
627 PATH_SEARCH_MAX = 0;
-
628
-
629 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
-
630 PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
-
631 if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
-
632 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
-
633 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
-
634 PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
-
635 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
-
636 PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
-
637
-
638 if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
-
639 DEBUG_LOGFILE = strTemp;
-
640
-
641 if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
-
642 {
-
643 SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
-
644
-
645 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
-
646 Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL ": must be between 10 and 600 inclusive");
-
647 }
-
648
-
649 if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
-
650 {
-
651 WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
652
-
653 if (WORKERS < 1 || WORKERS > 1024)
-
654 Throw<std::runtime_error>("Invalid " SECTION_WORKERS ": must be between 1 and 1024 inclusive.");
-
655 }
-
656
-
657 if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
-
658 {
-
659 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
660
-
661 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
-
662 Throw<std::runtime_error>("Invalid " SECTION_IO_WORKERS ": must be between 1 and 1024 inclusive.");
-
663 }
-
664
-
665 if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
-
666 {
-
667 PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
-
668
-
669 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
-
670 Throw<std::runtime_error>("Invalid " SECTION_PREFETCH_WORKERS ": must be between 1 and 1024 inclusive.");
-
671 }
-
672
-
673 if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
-
674 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
-
675
-
676 if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
-
677 LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
-
678
-
679 if (exists(SECTION_REDUCE_RELAY))
-
680 {
-
681 auto sec = section(SECTION_REDUCE_RELAY);
-
682
-
684 // vp_enable config option is deprecated by vp_base_squelch_enable //
-
685 // This option is kept for backwards compatibility. When squelching //
-
686 // is the default algorithm, it must be replaced with: //
-
687 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
-
688 // sec.value_or("vp_base_squelch_enable", true); //
-
689 if (sec.exists("vp_base_squelch_enable") && sec.exists("vp_enable"))
-
690 Throw<std::runtime_error>("Invalid " SECTION_REDUCE_RELAY
-
691 " cannot specify both vp_base_squelch_enable and vp_enable "
-
692 "options. "
-
693 "vp_enable was deprecated and replaced by "
-
694 "vp_base_squelch_enable");
-
695
-
696 if (sec.exists("vp_base_squelch_enable"))
-
697 VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = sec.value_or("vp_base_squelch_enable", false);
-
698 else if (sec.exists("vp_enable"))
-
699 VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = sec.value_or("vp_enable", false);
-
700 else
- -
703
-
705 // Temporary squelching config for the peers selected as a source of //
-
706 // validator messages. The config must be removed once squelching is //
-
707 // made the default routing algorithm. //
-
708 VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS = sec.value_or("vp_base_squelch_max_selected_peers", 5);
- -
710 Throw<std::runtime_error>("Invalid " SECTION_REDUCE_RELAY
-
711 " vp_base_squelch_max_selected_peers must be "
-
712 "greater than or equal to 3");
-
714
-
715 TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
-
716 TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
-
717 TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
-
718 TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
-
719 if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 || TX_REDUCE_RELAY_MIN_PEERS < 10)
-
720 Throw<std::runtime_error>("Invalid " SECTION_REDUCE_RELAY
-
721 ", tx_min_peers must be greater than or equal to 10"
-
722 ", tx_relay_percentage must be greater than or equal to 10 "
-
723 "and less than or equal to 100");
-
724 }
-
725
-
726 if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
-
727 {
-
728 MAX_TRANSACTIONS = std::clamp(beast::lexicalCastThrow<int>(strTemp), MIN_JOB_QUEUE_TX, MAX_JOB_QUEUE_TX);
-
729 }
-
730
-
731 if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
-
732 {
-
733 if (!isProperlyFormedTomlDomain(strTemp))
-
734 {
-
735 Throw<std::runtime_error>("Invalid " SECTION_SERVER_DOMAIN
-
736 ": the domain name does not appear to meet the requirements.");
-
737 }
-
738
-
739 SERVER_DOMAIN = strTemp;
-
740 }
-
741
-
742 if (exists(SECTION_OVERLAY))
-
743 {
-
744 auto const sec = section(SECTION_OVERLAY);
-
745
-
746 using namespace std::chrono;
+
483 std::string strTemp;
+
484
+
485 if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
+
486 {
+
487 if (strTemp == "main")
+
488 NETWORK_ID = 0;
+
489 else if (strTemp == "testnet")
+
490 NETWORK_ID = 1;
+
491 else if (strTemp == "devnet")
+
492 NETWORK_ID = 2;
+
493 else
+
494 NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
+
495 }
+
496
+
497 if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
+
498 PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
+
499
+
500 if (getSingleSection(secConfig, SECTION_PEERS_MAX, strTemp, j_))
+
501 {
+
502 PEERS_MAX = beast::lexicalCastThrow<std::size_t>(strTemp);
+
503 }
+
504 else
+
505 {
+
506 std::optional<std::size_t> peers_in_max{};
+
507 if (getSingleSection(secConfig, SECTION_PEERS_IN_MAX, strTemp, j_))
+
508 {
+
509 peers_in_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
510 if (*peers_in_max > 1000)
+
511 Throw<std::runtime_error>("Invalid value specified in [" SECTION_PEERS_IN_MAX
+
512 "] section; the value must be less or equal than 1000");
+
513 }
+
514
+
515 std::optional<std::size_t> peers_out_max{};
+
516 if (getSingleSection(secConfig, SECTION_PEERS_OUT_MAX, strTemp, j_))
+
517 {
+
518 peers_out_max = beast::lexicalCastThrow<std::size_t>(strTemp);
+
519 if (*peers_out_max < 10 || *peers_out_max > 1000)
+
520 Throw<std::runtime_error>("Invalid value specified in [" SECTION_PEERS_OUT_MAX
+
521 "] section; the value must be in range 10-1000");
+
522 }
+
523
+
524 // if one section is configured then the other must be configured too
+
525 if ((peers_in_max && !peers_out_max) || (peers_out_max && !peers_in_max))
+
526 Throw<std::runtime_error>("Both sections [" SECTION_PEERS_IN_MAX
+
527 "]"
+
528 "and [" SECTION_PEERS_OUT_MAX "] must be configured");
+
529
+
530 if (peers_in_max && peers_out_max)
+
531 {
+
532 PEERS_IN_MAX = *peers_in_max;
+
533 PEERS_OUT_MAX = *peers_out_max;
+
534 }
+
535 }
+
536
+
537 if (getSingleSection(secConfig, SECTION_NODE_SIZE, strTemp, j_))
+
538 {
+
539 if (boost::iequals(strTemp, "tiny"))
+
540 NODE_SIZE = 0;
+
541 else if (boost::iequals(strTemp, "small"))
+
542 NODE_SIZE = 1;
+
543 else if (boost::iequals(strTemp, "medium"))
+
544 NODE_SIZE = 2;
+
545 else if (boost::iequals(strTemp, "large"))
+
546 NODE_SIZE = 3;
+
547 else if (boost::iequals(strTemp, "huge"))
+
548 NODE_SIZE = 4;
+
549 else
+
550 NODE_SIZE = std::min<std::size_t>(4, beast::lexicalCastThrow<std::size_t>(strTemp));
+
551 }
+
552
+
553 if (getSingleSection(secConfig, SECTION_SIGNING_SUPPORT, strTemp, j_))
+
554 signingEnabled_ = beast::lexicalCastThrow<bool>(strTemp);
+
555
+
556 if (getSingleSection(secConfig, SECTION_ELB_SUPPORT, strTemp, j_))
+
557 ELB_SUPPORT = beast::lexicalCastThrow<bool>(strTemp);
+
558
+
559 getSingleSection(secConfig, SECTION_SSL_VERIFY_FILE, SSL_VERIFY_FILE, j_);
+
560 getSingleSection(secConfig, SECTION_SSL_VERIFY_DIR, SSL_VERIFY_DIR, j_);
+
561
+
562 if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
+
563 SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
+
564
+
565 if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
+
566 {
+
567 if (boost::iequals(strTemp, "all"))
+ +
569 else if (boost::iequals(strTemp, "trusted"))
+ +
571 else if (boost::iequals(strTemp, "drop_untrusted"))
+ +
573 else
+
574 Throw<std::runtime_error>("Invalid value specified in [" SECTION_RELAY_VALIDATIONS "] section");
+
575 }
+
576
+
577 if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
+
578 {
+
579 if (boost::iequals(strTemp, "all"))
+ +
581 else if (boost::iequals(strTemp, "trusted"))
+ +
583 else if (boost::iequals(strTemp, "drop_untrusted"))
+ +
585 else
+
586 Throw<std::runtime_error>("Invalid value specified in [" SECTION_RELAY_PROPOSALS "] section");
+
587 }
+
588
+
589 if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
+
590 Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED "] and [" SECTION_VALIDATOR_TOKEN
+
591 "] config sections");
+
592
+
593 if (getSingleSection(secConfig, SECTION_NETWORK_QUORUM, strTemp, j_))
+
594 NETWORK_QUORUM = beast::lexicalCastThrow<std::size_t>(strTemp);
+
595
+
596 FEES = setup_FeeVote(section("voting"));
+
597 /* [fee_default] is documented in the example config files as useful for
+
598 * things like offline transaction signing. Until that's completely
+
599 * deprecated, allow it to override the [voting] section. */
+
600 if (getSingleSection(secConfig, SECTION_FEE_DEFAULT, strTemp, j_))
+
601 FEES.reference_fee = beast::lexicalCastThrow<std::uint64_t>(strTemp);
+
602
+
603 if (getSingleSection(secConfig, SECTION_LEDGER_HISTORY, strTemp, j_))
+
604 {
+
605 if (boost::iequals(strTemp, "full"))
+ +
607 else if (boost::iequals(strTemp, "none"))
+
608 LEDGER_HISTORY = 0;
+
609 else
+
610 LEDGER_HISTORY = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
611 }
+
612
+
613 if (getSingleSection(secConfig, SECTION_FETCH_DEPTH, strTemp, j_))
+
614 {
+
615 if (boost::iequals(strTemp, "none"))
+
616 FETCH_DEPTH = 0;
+
617 else if (boost::iequals(strTemp, "full"))
+
618 FETCH_DEPTH = std::numeric_limits<decltype(FETCH_DEPTH)>::max();
+
619 else
+
620 FETCH_DEPTH = beast::lexicalCastThrow<std::uint32_t>(strTemp);
+
621
+
622 if (FETCH_DEPTH < 10)
+
623 FETCH_DEPTH = 10;
+
624 }
+
625
+
626 // By default, validators don't have pathfinding enabled, unless it is
+
627 // explicitly requested by the server's admin.
+
628 if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
+
629 PATH_SEARCH_MAX = 0;
+
630
+
631 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
+
632 PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
+
633 if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))
+
634 PATH_SEARCH = beast::lexicalCastThrow<int>(strTemp);
+
635 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_FAST, strTemp, j_))
+
636 PATH_SEARCH_FAST = beast::lexicalCastThrow<int>(strTemp);
+
637 if (getSingleSection(secConfig, SECTION_PATH_SEARCH_MAX, strTemp, j_))
+
638 PATH_SEARCH_MAX = beast::lexicalCastThrow<int>(strTemp);
+
639
+
640 if (getSingleSection(secConfig, SECTION_DEBUG_LOGFILE, strTemp, j_))
+
641 DEBUG_LOGFILE = strTemp;
+
642
+
643 if (getSingleSection(secConfig, SECTION_SWEEP_INTERVAL, strTemp, j_))
+
644 {
+
645 SWEEP_INTERVAL = beast::lexicalCastThrow<std::size_t>(strTemp);
+
646
+
647 if (SWEEP_INTERVAL < 10 || SWEEP_INTERVAL > 600)
+
648 Throw<std::runtime_error>("Invalid " SECTION_SWEEP_INTERVAL ": must be between 10 and 600 inclusive");
+
649 }
+
650
+
651 if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
+
652 {
+
653 WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
654
+
655 if (WORKERS < 1 || WORKERS > 1024)
+
656 Throw<std::runtime_error>("Invalid " SECTION_WORKERS ": must be between 1 and 1024 inclusive.");
+
657 }
+
658
+
659 if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
+
660 {
+
661 IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
662
+
663 if (IO_WORKERS < 1 || IO_WORKERS > 1024)
+
664 Throw<std::runtime_error>("Invalid " SECTION_IO_WORKERS ": must be between 1 and 1024 inclusive.");
+
665 }
+
666
+
667 if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
+
668 {
+
669 PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
+
670
+
671 if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
+
672 Throw<std::runtime_error>("Invalid " SECTION_PREFETCH_WORKERS ": must be between 1 and 1024 inclusive.");
+
673 }
+
674
+
675 if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
+
676 COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
+
677
+
678 if (getSingleSection(secConfig, SECTION_LEDGER_REPLAY, strTemp, j_))
+
679 LEDGER_REPLAY = beast::lexicalCastThrow<bool>(strTemp);
+
680
+
681 if (exists(SECTION_REDUCE_RELAY))
+
682 {
+
683 auto sec = section(SECTION_REDUCE_RELAY);
+
684
+
686 // vp_enable config option is deprecated by vp_base_squelch_enable //
+
687 // This option is kept for backwards compatibility. When squelching //
+
688 // is the default algorithm, it must be replaced with: //
+
689 // VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = //
+
690 // sec.value_or("vp_base_squelch_enable", true); //
+
691 if (sec.exists("vp_base_squelch_enable") && sec.exists("vp_enable"))
+
692 Throw<std::runtime_error>("Invalid " SECTION_REDUCE_RELAY
+
693 " cannot specify both vp_base_squelch_enable and vp_enable "
+
694 "options. "
+
695 "vp_enable was deprecated and replaced by "
+
696 "vp_base_squelch_enable");
+
697
+
698 if (sec.exists("vp_base_squelch_enable"))
+
699 VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = sec.value_or("vp_base_squelch_enable", false);
+
700 else if (sec.exists("vp_enable"))
+
701 VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = sec.value_or("vp_enable", false);
+
702 else
+ +
705
+
707 // Temporary squelching config for the peers selected as a source of //
+
708 // validator messages. The config must be removed once squelching is //
+
709 // made the default routing algorithm. //
+
710 VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS = sec.value_or("vp_base_squelch_max_selected_peers", 5);
+ +
712 Throw<std::runtime_error>("Invalid " SECTION_REDUCE_RELAY
+
713 " vp_base_squelch_max_selected_peers must be "
+
714 "greater than or equal to 3");
+
716
+
717 TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
+
718 TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
+
719 TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
+
720 TX_RELAY_PERCENTAGE = sec.value_or("tx_relay_percentage", 25);
+
721 if (TX_RELAY_PERCENTAGE < 10 || TX_RELAY_PERCENTAGE > 100 || TX_REDUCE_RELAY_MIN_PEERS < 10)
+
722 Throw<std::runtime_error>("Invalid " SECTION_REDUCE_RELAY
+
723 ", tx_min_peers must be greater than or equal to 10"
+
724 ", tx_relay_percentage must be greater than or equal to 10 "
+
725 "and less than or equal to 100");
+
726 }
+
727
+
728 if (getSingleSection(secConfig, SECTION_MAX_TRANSACTIONS, strTemp, j_))
+
729 {
+
730 MAX_TRANSACTIONS = std::clamp(beast::lexicalCastThrow<int>(strTemp), MIN_JOB_QUEUE_TX, MAX_JOB_QUEUE_TX);
+
731 }
+
732
+
733 if (getSingleSection(secConfig, SECTION_SERVER_DOMAIN, strTemp, j_))
+
734 {
+
735 if (!isProperlyFormedTomlDomain(strTemp))
+
736 {
+
737 Throw<std::runtime_error>("Invalid " SECTION_SERVER_DOMAIN
+
738 ": the domain name does not appear to meet the requirements.");
+
739 }
+
740
+
741 SERVER_DOMAIN = strTemp;
+
742 }
+
743
+
744 if (exists(SECTION_OVERLAY))
+
745 {
+
746 auto const sec = section(SECTION_OVERLAY);
747
-
748 try
-
749 {
-
750 if (auto val = sec.get("max_unknown_time"))
-
751 MAX_UNKNOWN_TIME = seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
752 }
-
753 catch (...)
-
754 {
-
755 Throw<std::runtime_error>("Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
756 ": must be of the form '<number>' representing seconds.");
-
757 }
-
758
-
759 if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
-
760 Throw<std::runtime_error>("Invalid value 'max_unknown_time' in " SECTION_OVERLAY
-
761 ": the time must be between 300 and 1800 seconds, inclusive.");
-
762
-
763 try
-
764 {
-
765 if (auto val = sec.get("max_diverged_time"))
-
766 MAX_DIVERGED_TIME = seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
-
767 }
-
768 catch (...)
-
769 {
-
770 Throw<std::runtime_error>("Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
771 ": must be of the form '<number>' representing seconds.");
-
772 }
-
773
- -
775 {
-
776 Throw<std::runtime_error>("Invalid value 'max_diverged_time' in " SECTION_OVERLAY
-
777 ": the time must be between 60 and 900 seconds, inclusive.");
-
778 }
-
779 }
-
780
-
781 if (getSingleSection(secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
-
782 {
-
783 using namespace std::chrono;
-
784 boost::regex const re("^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
-
785 boost::smatch match;
-
786 if (!boost::regex_match(strTemp, match, re))
-
787 Throw<std::runtime_error>("Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
788 ", must be: [0-9]+ [minutes|hours|days|weeks]");
-
789
-
790 std::uint32_t duration = beast::lexicalCastThrow<std::uint32_t>(match[1].str());
+
748 using namespace std::chrono;
+
749
+
750 try
+
751 {
+
752 if (auto val = sec.get("max_unknown_time"))
+
753 MAX_UNKNOWN_TIME = seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
754 }
+
755 catch (...)
+
756 {
+
757 Throw<std::runtime_error>("Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
758 ": must be of the form '<number>' representing seconds.");
+
759 }
+
760
+
761 if (MAX_UNKNOWN_TIME < seconds{300} || MAX_UNKNOWN_TIME > seconds{1800})
+
762 Throw<std::runtime_error>("Invalid value 'max_unknown_time' in " SECTION_OVERLAY
+
763 ": the time must be between 300 and 1800 seconds, inclusive.");
+
764
+
765 try
+
766 {
+
767 if (auto val = sec.get("max_diverged_time"))
+
768 MAX_DIVERGED_TIME = seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
+
769 }
+
770 catch (...)
+
771 {
+
772 Throw<std::runtime_error>("Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
773 ": must be of the form '<number>' representing seconds.");
+
774 }
+
775
+ +
777 {
+
778 Throw<std::runtime_error>("Invalid value 'max_diverged_time' in " SECTION_OVERLAY
+
779 ": the time must be between 60 and 900 seconds, inclusive.");
+
780 }
+
781 }
+
782
+
783 if (getSingleSection(secConfig, SECTION_AMENDMENT_MAJORITY_TIME, strTemp, j_))
+
784 {
+
785 using namespace std::chrono;
+
786 boost::regex const re("^\\s*(\\d+)\\s*(minutes|hours|days|weeks)\\s*(\\s+.*)?$");
+
787 boost::smatch match;
+
788 if (!boost::regex_match(strTemp, match, re))
+
789 Throw<std::runtime_error>("Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
790 ", must be: [0-9]+ [minutes|hours|days|weeks]");
791
-
792 if (boost::iequals(match[2], "minutes"))
- -
794 else if (boost::iequals(match[2], "hours"))
- -
796 else if (boost::iequals(match[2], "days"))
- -
798 else if (boost::iequals(match[2], "weeks"))
- -
800
- -
802 Throw<std::runtime_error>("Invalid " SECTION_AMENDMENT_MAJORITY_TIME
-
803 ", the minimum amount of time an amendment must hold a "
-
804 "majority is 15 minutes");
-
805 }
-
806
-
807 if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
-
808 BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
-
809
-
810 // Do not load trusted validator configuration for standalone mode
-
811 if (!RUN_STANDALONE)
-
812 {
-
813 // If a file was explicitly specified, then throw if the
-
814 // path is malformed or if the file does not exist or is
-
815 // not a file.
-
816 // If the specified file is not an absolute path, then look
-
817 // for it in the same directory as the config file.
-
818 // If no path was specified, then look for validators.txt
-
819 // in the same directory as the config file, but don't complain
-
820 // if we can't find it.
-
821 boost::filesystem::path validatorsFile;
-
822
-
823 if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
-
824 {
-
825 validatorsFile = strTemp;
-
826
-
827 if (validatorsFile.empty())
-
828 Throw<std::runtime_error>("Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
-
829
-
830 if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
-
831 validatorsFile = CONFIG_DIR / validatorsFile;
-
832
-
833 if (!boost::filesystem::exists(validatorsFile))
-
834 Throw<std::runtime_error>(
-
835 "The file specified in [" SECTION_VALIDATORS_FILE
-
836 "] "
-
837 "does not exist: " +
-
838 validatorsFile.string());
-
839
-
840 else if (
-
841 !boost::filesystem::is_regular_file(validatorsFile) && !boost::filesystem::is_symlink(validatorsFile))
-
842 Throw<std::runtime_error>(
-
843 "Invalid file specified in [" SECTION_VALIDATORS_FILE "]: " + validatorsFile.string());
-
844 }
-
845 else if (!CONFIG_DIR.empty())
-
846 {
-
847 validatorsFile = CONFIG_DIR / validatorsFileName;
-
848
-
849 if (!validatorsFile.empty())
-
850 {
-
851 if (!boost::filesystem::exists(validatorsFile))
-
852 validatorsFile.clear();
-
853 else if (
-
854 !boost::filesystem::is_regular_file(validatorsFile) &&
-
855 !boost::filesystem::is_symlink(validatorsFile))
-
856 validatorsFile.clear();
-
857 }
-
858 }
-
859
-
860 if (!validatorsFile.empty() && boost::filesystem::exists(validatorsFile) &&
-
861 (boost::filesystem::is_regular_file(validatorsFile) || boost::filesystem::is_symlink(validatorsFile)))
-
862 {
-
863 boost::system::error_code ec;
-
864 auto const data = getFileContents(ec, validatorsFile);
-
865 if (ec)
-
866 {
-
867 Throw<std::runtime_error>(
-
868 "Failed to read '" + validatorsFile.string() + "'." + std::to_string(ec.value()) + ": " +
-
869 ec.message());
-
870 }
-
871
-
872 auto iniFile = parseIniFile(data, true);
+
792 std::uint32_t duration = beast::lexicalCastThrow<std::uint32_t>(match[1].str());
+
793
+
794 if (boost::iequals(match[2], "minutes"))
+ +
796 else if (boost::iequals(match[2], "hours"))
+ +
798 else if (boost::iequals(match[2], "days"))
+ +
800 else if (boost::iequals(match[2], "weeks"))
+ +
802
+ +
804 Throw<std::runtime_error>("Invalid " SECTION_AMENDMENT_MAJORITY_TIME
+
805 ", the minimum amount of time an amendment must hold a "
+
806 "majority is 15 minutes");
+
807 }
+
808
+
809 if (getSingleSection(secConfig, SECTION_BETA_RPC_API, strTemp, j_))
+
810 BETA_RPC_API = beast::lexicalCastThrow<bool>(strTemp);
+
811
+
812 // Do not load trusted validator configuration for standalone mode
+
813 if (!RUN_STANDALONE)
+
814 {
+
815 // If a file was explicitly specified, then throw if the
+
816 // path is malformed or if the file does not exist or is
+
817 // not a file.
+
818 // If the specified file is not an absolute path, then look
+
819 // for it in the same directory as the config file.
+
820 // If no path was specified, then look for validators.txt
+
821 // in the same directory as the config file, but don't complain
+
822 // if we can't find it.
+
823 boost::filesystem::path validatorsFile;
+
824
+
825 if (getSingleSection(secConfig, SECTION_VALIDATORS_FILE, strTemp, j_))
+
826 {
+
827 validatorsFile = strTemp;
+
828
+
829 if (validatorsFile.empty())
+
830 Throw<std::runtime_error>("Invalid path specified in [" SECTION_VALIDATORS_FILE "]");
+
831
+
832 if (!validatorsFile.is_absolute() && !CONFIG_DIR.empty())
+
833 validatorsFile = CONFIG_DIR / validatorsFile;
+
834
+
835 if (!boost::filesystem::exists(validatorsFile))
+
836 Throw<std::runtime_error>(
+
837 "The file specified in [" SECTION_VALIDATORS_FILE
+
838 "] "
+
839 "does not exist: " +
+
840 validatorsFile.string());
+
841
+
842 else if (
+
843 !boost::filesystem::is_regular_file(validatorsFile) && !boost::filesystem::is_symlink(validatorsFile))
+
844 Throw<std::runtime_error>(
+
845 "Invalid file specified in [" SECTION_VALIDATORS_FILE "]: " + validatorsFile.string());
+
846 }
+
847 else if (!CONFIG_DIR.empty())
+
848 {
+
849 validatorsFile = CONFIG_DIR / validatorsFileName;
+
850
+
851 if (!validatorsFile.empty())
+
852 {
+
853 if (!boost::filesystem::exists(validatorsFile))
+
854 validatorsFile.clear();
+
855 else if (
+
856 !boost::filesystem::is_regular_file(validatorsFile) &&
+
857 !boost::filesystem::is_symlink(validatorsFile))
+
858 validatorsFile.clear();
+
859 }
+
860 }
+
861
+
862 if (!validatorsFile.empty() && boost::filesystem::exists(validatorsFile) &&
+
863 (boost::filesystem::is_regular_file(validatorsFile) || boost::filesystem::is_symlink(validatorsFile)))
+
864 {
+
865 boost::system::error_code ec;
+
866 auto const data = getFileContents(ec, validatorsFile);
+
867 if (ec)
+
868 {
+
869 Throw<std::runtime_error>(
+
870 "Failed to read '" + validatorsFile.string() + "'." + std::to_string(ec.value()) + ": " +
+
871 ec.message());
+
872 }
873
-
874 auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
+
874 auto iniFile = parseIniFile(data, true);
875
-
876 if (entries)
-
877 section(SECTION_VALIDATORS).append(*entries);
-
878
-
879 auto valKeyEntries = getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
+
876 auto entries = getIniFileSection(iniFile, SECTION_VALIDATORS);
+
877
+
878 if (entries)
+
879 section(SECTION_VALIDATORS).append(*entries);
880
-
881 if (valKeyEntries)
-
882 section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
-
883
-
884 auto valSiteEntries = getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
+
881 auto valKeyEntries = getIniFileSection(iniFile, SECTION_VALIDATOR_KEYS);
+
882
+
883 if (valKeyEntries)
+
884 section(SECTION_VALIDATOR_KEYS).append(*valKeyEntries);
885
-
886 if (valSiteEntries)
-
887 section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
-
888
-
889 auto valListKeys = getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
+
886 auto valSiteEntries = getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_SITES);
+
887
+
888 if (valSiteEntries)
+
889 section(SECTION_VALIDATOR_LIST_SITES).append(*valSiteEntries);
890
-
891 if (valListKeys)
-
892 section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
-
893
-
894 auto valListThreshold = getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
+
891 auto valListKeys = getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_KEYS);
+
892
+
893 if (valListKeys)
+
894 section(SECTION_VALIDATOR_LIST_KEYS).append(*valListKeys);
895
-
896 if (valListThreshold)
-
897 section(SECTION_VALIDATOR_LIST_THRESHOLD).append(*valListThreshold);
-
898
-
899 if (!entries && !valKeyEntries && !valListKeys)
-
900 Throw<std::runtime_error>(
-
901 "The file specified in [" SECTION_VALIDATORS_FILE
-
902 "] "
-
903 "does not contain a [" SECTION_VALIDATORS
-
904 "], "
-
905 "[" SECTION_VALIDATOR_KEYS
-
906 "] or "
-
907 "[" SECTION_VALIDATOR_LIST_KEYS
-
908 "]"
-
909 " section: " +
-
910 validatorsFile.string());
-
911 }
-
912
- -
914 auto const& listThreshold = section(SECTION_VALIDATOR_LIST_THRESHOLD);
-
915 if (listThreshold.lines().empty())
-
916 return std::nullopt;
-
917 else if (listThreshold.values().size() == 1)
-
918 {
-
919 auto strTemp = listThreshold.values()[0];
-
920 auto const listThreshold = beast::lexicalCastThrow<std::size_t>(strTemp);
-
921 if (listThreshold == 0)
-
922 return std::nullopt; // NOTE: Explicitly ask for computed
-
923 else if (listThreshold > section(SECTION_VALIDATOR_LIST_KEYS).values().size())
-
924 {
-
925 Throw<std::runtime_error>(
-
926 "Value in config section "
-
927 "[" SECTION_VALIDATOR_LIST_THRESHOLD "] exceeds the number of configured list keys");
-
928 }
-
929 return listThreshold;
-
930 }
-
931 else
-
932 {
-
933 Throw<std::runtime_error>(
-
934 "Config section "
-
935 "[" SECTION_VALIDATOR_LIST_THRESHOLD "] should contain single value only");
-
936 }
-
937 }();
-
938
-
939 // Consolidate [validator_keys] and [validators]
-
940 section(SECTION_VALIDATORS).append(section(SECTION_VALIDATOR_KEYS).lines());
-
941
-
942 if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
-
943 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
-
944 {
-
945 Throw<std::runtime_error>("[" + std::string(SECTION_VALIDATOR_LIST_KEYS) + "] config section is missing");
-
946 }
-
947 }
-
948
-
949 {
-
950 auto const part = section("features");
-
951 for (auto const& s : part.values())
-
952 {
-
953 if (auto const f = getRegisteredFeature(s))
-
954 features.insert(*f);
-
955 else
-
956 Throw<std::runtime_error>("Unknown feature: " + s + " in config file.");
-
957 }
-
958 }
-
959
-
960 // This doesn't properly belong here, but check to make sure that the
-
961 // value specified for network_quorum is achievable:
-
962 {
-
963 auto pm = PEERS_MAX;
-
964
-
965 // FIXME this apparently magic value is actually defined as a constant
-
966 // elsewhere (see defaultMaxPeers) but we handle this check here.
-
967 if (pm == 0)
-
968 pm = 21;
-
969
-
970 if (NETWORK_QUORUM > pm)
-
971 {
-
972 Throw<std::runtime_error>(
-
973 "The minimum number of required peers (network_quorum) exceeds "
-
974 "the maximum number of allowed peers (peers_max)");
-
975 }
-
976 }
-
977}
+
896 auto valListThreshold = getIniFileSection(iniFile, SECTION_VALIDATOR_LIST_THRESHOLD);
+
897
+
898 if (valListThreshold)
+
899 section(SECTION_VALIDATOR_LIST_THRESHOLD).append(*valListThreshold);
+
900
+
901 if (!entries && !valKeyEntries && !valListKeys)
+
902 Throw<std::runtime_error>(
+
903 "The file specified in [" SECTION_VALIDATORS_FILE
+
904 "] "
+
905 "does not contain a [" SECTION_VALIDATORS
+
906 "], "
+
907 "[" SECTION_VALIDATOR_KEYS
+
908 "] or "
+
909 "[" SECTION_VALIDATOR_LIST_KEYS
+
910 "]"
+
911 " section: " +
+
912 validatorsFile.string());
+
913 }
+
914
+ +
916 auto const& listThreshold = section(SECTION_VALIDATOR_LIST_THRESHOLD);
+
917 if (listThreshold.lines().empty())
+
918 return std::nullopt;
+
919 else if (listThreshold.values().size() == 1)
+
920 {
+
921 auto strTemp = listThreshold.values()[0];
+
922 auto const listThreshold = beast::lexicalCastThrow<std::size_t>(strTemp);
+
923 if (listThreshold == 0)
+
924 return std::nullopt; // NOTE: Explicitly ask for computed
+
925 else if (listThreshold > section(SECTION_VALIDATOR_LIST_KEYS).values().size())
+
926 {
+
927 Throw<std::runtime_error>(
+
928 "Value in config section "
+
929 "[" SECTION_VALIDATOR_LIST_THRESHOLD "] exceeds the number of configured list keys");
+
930 }
+
931 return listThreshold;
+
932 }
+
933 else
+
934 {
+
935 Throw<std::runtime_error>(
+
936 "Config section "
+
937 "[" SECTION_VALIDATOR_LIST_THRESHOLD "] should contain single value only");
+
938 }
+
939 }();
+
940
+
941 // Consolidate [validator_keys] and [validators]
+
942 section(SECTION_VALIDATORS).append(section(SECTION_VALIDATOR_KEYS).lines());
+
943
+
944 if (!section(SECTION_VALIDATOR_LIST_SITES).lines().empty() &&
+
945 section(SECTION_VALIDATOR_LIST_KEYS).lines().empty())
+
946 {
+
947 Throw<std::runtime_error>("[" + std::string(SECTION_VALIDATOR_LIST_KEYS) + "] config section is missing");
+
948 }
+
949 }
+
950
+
951 {
+
952 auto const part = section("features");
+
953 for (auto const& s : part.values())
+
954 {
+
955 if (auto const f = getRegisteredFeature(s))
+
956 features.insert(*f);
+
957 else
+
958 Throw<std::runtime_error>("Unknown feature: " + s + " in config file.");
+
959 }
+
960 }
+
961
+
962 // This doesn't properly belong here, but check to make sure that the
+
963 // value specified for network_quorum is achievable:
+
964 {
+
965 auto pm = PEERS_MAX;
+
966
+
967 // FIXME this apparently magic value is actually defined as a constant
+
968 // elsewhere (see defaultMaxPeers) but we handle this check here.
+
969 if (pm == 0)
+
970 pm = 21;
+
971
+
972 if (NETWORK_QUORUM > pm)
+
973 {
+
974 Throw<std::runtime_error>(
+
975 "The minimum number of required peers (network_quorum) exceeds "
+
976 "the maximum number of allowed peers (peers_max)");
+
977 }
+
978 }
+
979}
-
978
-
979boost::filesystem::path
-
- -
981{
-
982 auto log_file = DEBUG_LOGFILE;
-
983
-
984 if (!log_file.empty() && !log_file.is_absolute())
-
985 {
-
986 // Unless an absolute path for the log file is specified, the
-
987 // path is relative to the config file directory.
-
988 log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
-
989 }
-
990
-
991 if (!log_file.empty())
-
992 {
-
993 auto log_dir = log_file.parent_path();
-
994
-
995 if (!boost::filesystem::is_directory(log_dir))
-
996 {
-
997 boost::system::error_code ec;
-
998 boost::filesystem::create_directories(log_dir, ec);
-
999
-
1000 // If we fail, we warn but continue so that the calling code can
-
1001 // decide how to handle this situation.
-
1002 if (ec)
-
1003 {
-
1004 std::cerr << "Unable to create log file path " << log_dir << ": " << ec.message() << '\n';
-
1005 }
-
1006 }
-
1007 }
-
1008
-
1009 return log_file;
-
1010}
+
980
+
981boost::filesystem::path
+
+ +
983{
+
984 auto log_file = DEBUG_LOGFILE;
+
985
+
986 if (!log_file.empty() && !log_file.is_absolute())
+
987 {
+
988 // Unless an absolute path for the log file is specified, the
+
989 // path is relative to the config file directory.
+
990 log_file = boost::filesystem::absolute(log_file, CONFIG_DIR);
+
991 }
+
992
+
993 if (!log_file.empty())
+
994 {
+
995 auto log_dir = log_file.parent_path();
+
996
+
997 if (!boost::filesystem::is_directory(log_dir))
+
998 {
+
999 boost::system::error_code ec;
+
1000 boost::filesystem::create_directories(log_dir, ec);
+
1001
+
1002 // If we fail, we warn but continue so that the calling code can
+
1003 // decide how to handle this situation.
+
1004 if (ec)
+
1005 {
+
1006 std::cerr << "Unable to create log file path " << log_dir << ": " << ec.message() << '\n';
+
1007 }
+
1008 }
+
1009 }
+
1010
+
1011 return log_file;
+
1012}
-
1011
-
1012int
-
- -
1014{
-
1015 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
-
1016 XRPL_ASSERT(index < sizedItems.size(), "xrpl::Config::getValueFor : valid index input");
-
1017 XRPL_ASSERT(!node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node");
-
1018 return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
-
1019}
+
1013
+
1014int
+
+ +
1016{
+
1017 auto const index = static_cast<std::underlying_type_t<SizedItem>>(item);
+
1018 XRPL_ASSERT(index < sizedItems.size(), "xrpl::Config::getValueFor : valid index input");
+
1019 XRPL_ASSERT(!node || *node <= 4, "xrpl::Config::getValueFor : unset or valid node");
+
1020 return sizedItems.at(index).second.at(node.value_or(NODE_SIZE));
+
1021}
-
1020
- -
-
1022setup_FeeVote(Section const& section)
-
1023{
-
1024 FeeSetup setup;
-
1025 {
-
1026 std::uint64_t temp;
-
1027 if (set(temp, "reference_fee", section) && temp <= std::numeric_limits<XRPAmount::value_type>::max())
-
1028 setup.reference_fee = temp;
-
1029 }
-
1030 {
-
1031 std::uint32_t temp;
-
1032 if (set(temp, "account_reserve", section))
-
1033 setup.account_reserve = temp;
-
1034 if (set(temp, "owner_reserve", section))
-
1035 setup.owner_reserve = temp;
-
1036 }
-
1037 return setup;
-
1038}
+
1022
+ +
+
1024setup_FeeVote(Section const& section)
+
1025{
+
1026 FeeSetup setup;
+
1027 {
+
1028 std::uint64_t temp;
+
1029 if (set(temp, "reference_fee", section) && temp <= std::numeric_limits<XRPAmount::value_type>::max())
+
1030 setup.reference_fee = temp;
+
1031 }
+
1032 {
+
1033 std::uint32_t temp;
+
1034 if (set(temp, "account_reserve", section))
+
1035 setup.account_reserve = temp;
+
1036 if (set(temp, "owner_reserve", section))
+
1037 setup.owner_reserve = temp;
+
1038 }
+
1039 return setup;
+
1040}
-
1039
-
1040} // namespace xrpl
+
1041
+
1042} // namespace xrpl
@@ -1165,7 +1167,7 @@ $(document).ready(function() { init_codefold(0); });
bool COMPRESSION
Definition Config.h:201
static char const *const configLegacyName
Definition Config.h:71
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:86
-
void load()
Definition Config.cpp:416
+
void load()
Definition Config.cpp:418
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:280
boost::filesystem::path CONFIG_FILE
Definition Config.h:80
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
@@ -1191,9 +1193,9 @@ $(document).ready(function() { init_codefold(0); });
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:438
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
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:980
+
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:982
bool QUIET
Definition Config.h:92
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
@@ -1211,7 +1213,7 @@ $(document).ready(function() { init_codefold(0); });
void setupControl(bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:244
std::size_t NETWORK_QUORUM
Definition Config.h:146
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:1013
+
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:1015
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:126
@@ -1252,7 +1254,7 @@ $(document).ready(function() { init_codefold(0); });
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:1022
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
std::chrono::duration< int, std::ratio_multiply< days::period, std::ratio< 7 > > > weeks
Definition chrono.h:21
SizedItem
Definition Config.h:25
@@ -1273,7 +1275,7 @@ $(document).ready(function() { init_codefold(0); });
static std::string const & systemName()
std::chrono::duration< int, std::ratio_multiply< std::chrono::hours::period, std::ratio< 24 > > > days
Definition chrono.h:19
bool get_if_exists(Section const &section, std::string const &name, T &v)
-
static void checkZeroPorts(Config const &config)
Definition Config.cpp:390
+
static void checkZeroPorts(Config const &config)
Definition Config.cpp:392
std::optional< uint256 > getRegisteredFeature(std::string const &name)
Definition Feature.cpp:336
diff --git a/Config_8h_source.html b/Config_8h_source.html index 577488c16a..69727c7d32 100644 --- a/Config_8h_source.html +++ b/Config_8h_source.html @@ -422,7 +422,7 @@ $(document).ready(function() { init_codefold(0); });
bool COMPRESSION
Definition Config.h:201
static char const *const configLegacyName
Definition Config.h:71
boost::filesystem::path DEBUG_LOGFILE
Definition Config.h:86
-
void load()
Definition Config.cpp:416
+
void load()
Definition Config.cpp:418
bool doImport
Definition Config.h:119
StartUpType START_UP
Definition Config.h:129
std::optional< std::size_t > VALIDATOR_LIST_THRESHOLD
Definition Config.h:280
@@ -458,12 +458,12 @@ $(document).ready(function() { init_codefold(0); });
std::uint64_t const ramSize_
Definition Config.h:116
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:438
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
std::optional< std::pair< std::uint32_t, std::uint32_t > > FORCED_LEDGER_RANGE_PRESENT
Definition Config.h:278
static constexpr std::uint32_t FEE_UNITS_DEPRECATED
Definition Config.h:142
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:980
+
boost::filesystem::path getDebugLogFile() const
Returns the full path and filename of the debug log file.
Definition Config.cpp:982
bool QUIET
Definition Config.h:92
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
std::chrono::seconds MAX_UNKNOWN_TIME
Definition Config.h:262
@@ -491,7 +491,7 @@ $(document).ready(function() { init_codefold(0); });
std::size_t NETWORK_QUORUM
Definition Config.h:146
FeeSetup FEES
Definition Config.h:185
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:1013
+
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:1015
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:126
@@ -512,7 +512,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:1022
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
SizedItem
Definition Config.h:25
diff --git a/Config__test_8cpp_source.html b/Config__test_8cpp_source.html index 10490332ab..831dda6639 100644 --- a/Config__test_8cpp_source.html +++ b/Config__test_8cpp_source.html @@ -1712,7 +1712,7 @@ $(document).ready(function() { init_codefold(0); });
std::vector< std::string > IPS
Definition Config.h:123
bool standalone() const
Definition Config.h:312
void setup(std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
Definition Config.cpp:278
-
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:438
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
std::uint32_t LEDGER_HISTORY
Definition Config.h:188
std::vector< std::string > IPS_FIXED
Definition Config.h:126
static char const *const databaseDirName
Definition Config.h:72
diff --git a/FeeVote__test_8cpp_source.html b/FeeVote__test_8cpp_source.html index 57ee19390d..f15af8333b 100644 --- a/FeeVote__test_8cpp_source.html +++ b/FeeVote__test_8cpp_source.html @@ -830,7 +830,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:117
create_genesis_t const create_genesis
Definition Ledger.cpp:32
-
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1022
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
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/LedgerReplay__test_8cpp_source.html b/LedgerReplay__test_8cpp_source.html index 12d159193c..4a387d115d 100644 --- a/LedgerReplay__test_8cpp_source.html +++ b/LedgerReplay__test_8cpp_source.html @@ -1690,7 +1690,7 @@ $(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:438
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
bool LEDGER_REPLAY
Definition Config.h:204
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index 4652c15230..6ebcc88e8d 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -5114,7 +5114,7 @@ $(document).ready(function() { init_codefold(0); });
@ tefPAST_SEQ
Definition TER.h:156
std::uint64_t getQuality(uint256 const &uBase)
Definition Indexes.cpp:126
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition AccountID.cpp:92
-
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1022
+
FeeSetup setup_FeeVote(Section const &section)
Definition Config.cpp:1024
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j, SpendableHandling includeFullBalance=shSIMPLE_BALANCE)
Definition View.cpp:392
Number root(Number f, unsigned d)
Definition Number.cpp:938
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)
diff --git a/Node_8cpp_source.html b/Node_8cpp_source.html index dbe9b92b77..1448b4054b 100644 --- a/Node_8cpp_source.html +++ b/Node_8cpp_source.html @@ -1287,7 +1287,7 @@ $(document).ready(function() { init_codefold(0); }); -
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:1013
+
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:1015
LockedSociSession checkoutDb()
diff --git a/PeerFinder__test_8cpp_source.html b/PeerFinder__test_8cpp_source.html index 96aef407bf..bac4a7f86e 100644 --- a/PeerFinder__test_8cpp_source.html +++ b/PeerFinder__test_8cpp_source.html @@ -645,7 +645,7 @@ $(document).ready(function() { init_codefold(0); });
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:438
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
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
diff --git a/SHAMapStoreImp_8cpp_source.html b/SHAMapStoreImp_8cpp_source.html index 2d084db219..9cadaa8c1a 100644 --- a/SHAMapStoreImp_8cpp_source.html +++ b/SHAMapStoreImp_8cpp_source.html @@ -750,7 +750,7 @@ $(document).ready(function() { init_codefold(0); });
Section & section(std::string const &name)
Returns the section with the given name.
bool useTxTables() const
Definition Config.h:318
-
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:1013
+
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:1015
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 415142ae75..6dc94b452e 100644 --- a/SHAMapStore__test_8cpp_source.html +++ b/SHAMapStore__test_8cpp_source.html @@ -705,7 +705,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:1013
+
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:1015
beast::Journal journal(std::string const &name)
Definition Log.cpp:134
A NodeStore::Scheduler which uses the JobQueue.
static Manager & instance()
Returns the instance of the manager singleton.
diff --git a/Version__test_8cpp_source.html b/Version__test_8cpp_source.html index 65dbf19745..4a0e3e25b9 100644 --- a/Version__test_8cpp_source.html +++ b/Version__test_8cpp_source.html @@ -338,7 +338,7 @@ $(document).ready(function() { init_codefold(0); });
testcase_t testcase
Memberspace for declaring test cases.
Definition suite.h:148
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:438
+
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
diff --git a/classxrpl_1_1Config.html b/classxrpl_1_1Config.html index 2a37fc48b3..97d91f1b26 100644 --- a/classxrpl_1_1Config.html +++ b/classxrpl_1_1Config.html @@ -467,7 +467,7 @@ Private Attributes

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

-

Definition at line 980 of file Config.cpp.

+

Definition at line 982 of file Config.cpp.

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

Definition at line 416 of file Config.cpp.

+

Definition at line 418 of file Config.cpp.

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

Definition at line 438 of file Config.cpp.

+

Definition at line 440 of file Config.cpp.

@@ -742,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 1013 of file Config.cpp.

+

Definition at line 1015 of file Config.cpp.

diff --git a/compression__test_8cpp_source.html b/compression__test_8cpp_source.html index 1c09bdc2fc..3ddfb9160c 100644 --- a/compression__test_8cpp_source.html +++ b/compression__test_8cpp_source.html @@ -555,7 +555,7 @@ $(document).ready(function() { init_codefold(0); });
xrpl::Application::config
virtual Config & config()=0
xrpl::Config
Definition Config.h:67
xrpl::Config::COMPRESSION
bool COMPRESSION
Definition Config.h:201
-
xrpl::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:438
+
xrpl::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
xrpl::Config::VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
xrpl::Logs
Manages partitions for logging.
Definition Log.h:33
xrpl::Message
Definition Message.h:31
diff --git a/namespacexrpl.html b/namespacexrpl.html index 7c482aa37e..d16e39426a 100644 --- a/namespacexrpl.html +++ b/namespacexrpl.html @@ -47331,7 +47331,7 @@ template<class Clock , class Duration , class Rep , class Period >
-

Definition at line 1022 of file Config.cpp.

+

Definition at line 1024 of file Config.cpp.

@@ -47539,7 +47539,7 @@ template<class Clock , class Duration , class Rep , class Period >
-

Definition at line 390 of file Config.cpp.

+

Definition at line 392 of file Config.cpp.

diff --git a/reduce__relay__test_8cpp_source.html b/reduce__relay__test_8cpp_source.html index 7f03eb1380..85522c39e6 100644 --- a/reduce__relay__test_8cpp_source.html +++ b/reduce__relay__test_8cpp_source.html @@ -1899,7 +1899,7 @@ $(document).ready(function() { init_codefold(0); });
xrpl::Application::config
virtual Config & config()=0
xrpl::Config
Definition Config.h:67
xrpl::Config::COMPRESSION
bool COMPRESSION
Definition Config.h:201
-
xrpl::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:438
+
xrpl::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
xrpl::Config::VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE
Definition Config.h:229
xrpl::Config::VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS
Definition Config.h:235
xrpl::Logs
Manages partitions for logging.
Definition Log.h:33
diff --git a/tx__reduce__relay__test_8cpp_source.html b/tx__reduce__relay__test_8cpp_source.html index 3eac2a7ee0..720b153273 100644 --- a/tx__reduce__relay__test_8cpp_source.html +++ b/tx__reduce__relay__test_8cpp_source.html @@ -366,7 +366,7 @@ $(document).ready(function() { init_codefold(0); });
xrpl::Config
Definition Config.h:67
xrpl::Config::TX_REDUCE_RELAY_ENABLE
bool TX_REDUCE_RELAY_ENABLE
Definition Config.h:239
xrpl::Config::TX_RELAY_PERCENTAGE
std::size_t TX_RELAY_PERCENTAGE
Definition Config.h:252
-
xrpl::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:438
+
xrpl::Config::loadFromString
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Definition Config.cpp:440
xrpl::Config::TX_REDUCE_RELAY_METRICS
bool TX_REDUCE_RELAY_METRICS
Definition Config.h:246
xrpl::Config::TX_REDUCE_RELAY_MIN_PEERS
std::size_t TX_REDUCE_RELAY_MIN_PEERS
Definition Config.h:249
xrpl::OverlayImpl
Definition OverlayImpl.h:44