rippled
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
xrpl::Config Class Reference

#include <Config.h>

Inheritance diagram for xrpl::Config:
Inheritance graph
[legend]
Collaboration diagram for xrpl::Config:
Collaboration graph
[legend]

Public Member Functions

boost::filesystem::path getDebugLogFile () const
 Returns the full path and filename of the debug log file.
 
 Config ()
 
void setup (std::string const &strConf, bool bQuiet, bool bSilent, bool bStandalone)
 
void setupControl (bool bQuiet, bool bSilent, bool bStandalone)
 
void loadFromString (std::string const &fileContents)
 Load the config from the contents of the string.
 
bool quiet () const
 
bool silent () const
 
bool standalone () const
 
bool useTxTables () const
 
bool canSign () const
 
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.
 
beast::Journal journal () const
 
bool exists (std::string const &name) const
 Returns true if a section with the given name exists.
 
void overwrite (std::string const &section, std::string const &key, std::string const &value)
 Overwrite a key/value pair with a command line argument If the section does not exist it is created.
 
void deprecatedClearSection (std::string const &section)
 Remove all the key/value pairs from the section.
 
void legacy (std::string const &section, std::string value)
 Set a value that is not a key/value pair.
 
std::string legacy (std::string const &sectionName) const
 Get the legacy value of a section.
 
bool had_trailing_comments () const
 
Sectionsection (std::string const &name)
 Returns the section with the given name.
 
Section const & section (std::string const &name) const
 
Section const & operator[] (std::string const &name) const
 
Sectionoperator[] (std::string const &name)
 

Public Attributes

boost::filesystem::path CONFIG_DIR
 
bool doImport = false
 
bool ELB_SUPPORT = false
 
std::vector< std::stringIPS
 
std::vector< std::stringIPS_FIXED
 
StartUpType START_UP = StartUpType::Normal
 
bool START_VALID = false
 
std::string START_LEDGER
 
std::optional< uint256TRAP_TX_HASH
 
uint32_t NETWORK_ID = 0
 
std::size_t NETWORK_QUORUM = 1
 
int RELAY_UNTRUSTED_VALIDATIONS = 1
 
int RELAY_UNTRUSTED_PROPOSALS = 0
 
bool PEER_PRIVATE = false
 
std::size_t PEERS_MAX = 0
 
std::size_t PEERS_OUT_MAX = 0
 
std::size_t PEERS_IN_MAX = 0
 
int PATH_SEARCH_OLD = 2
 
int PATH_SEARCH = 2
 
int PATH_SEARCH_FAST = 2
 
int PATH_SEARCH_MAX = 3
 
std::optional< std::size_tVALIDATION_QUORUM
 
FeeSetup FEES
 
std::uint32_t LEDGER_HISTORY = 256
 
std::uint32_t FETCH_DEPTH = 1000000000
 
std::size_t NODE_SIZE = 0
 
bool SSL_VERIFY = true
 
std::string SSL_VERIFY_FILE
 
std::string SSL_VERIFY_DIR
 
bool COMPRESSION = false
 
bool LEDGER_REPLAY = false
 
int MAX_TRANSACTIONS = 250
 
std::chrono::seconds AMENDMENT_MAJORITY_TIME = defaultAmendmentMajorityTime
 
int WORKERS = 0
 
int IO_WORKERS = 0
 
int PREFETCH_WORKERS = 0
 
bool FORCE_MULTI_THREAD = false
 
std::optional< int > SWEEP_INTERVAL
 
bool VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = false
 
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS = 5
 
bool TX_REDUCE_RELAY_ENABLE = false
 
bool TX_REDUCE_RELAY_METRICS = false
 
std::size_t TX_REDUCE_RELAY_MIN_PEERS = 20
 
std::size_t TX_RELAY_PERCENTAGE = 25
 
std::optional< beast::IP::Endpointrpc_ip
 
std::unordered_set< uint256, beast::uhash<> > features
 
std::string SERVER_DOMAIN
 
std::chrono::seconds MAX_UNKNOWN_TIME {600}
 
std::chrono::seconds MAX_DIVERGED_TIME {300}
 
bool BETA_RPC_API = false
 
bool FAST_LOAD = false
 
std::optional< std::pair< std::uint32_t, std::uint32_t > > FORCED_LEDGER_RANGE_PRESENT
 
std::optional< std::size_tVALIDATOR_LIST_THRESHOLD
 

Static Public Attributes

static char const *const configFileName = "xrpld.cfg"
 
static char const *const configLegacyName = "rippled.cfg"
 
static char const *const databaseDirName = "db"
 
static char const *const validatorsFileName = "validators.txt"
 
static constexpr int MAX_JOB_QUEUE_TX = 1000
 
static constexpr int MIN_JOB_QUEUE_TX = 100
 

Protected Member Functions

void build (IniFileSections const &ifs)
 

Private Member Functions

void load ()
 

Private Attributes

boost::filesystem::path CONFIG_FILE
 
boost::filesystem::path DEBUG_LOGFILE
 
beast::Journal const j_
 
bool QUIET = false
 
bool SILENT = false
 
bool RUN_STANDALONE = false
 Operate in stand-alone mode.
 
bool USE_TX_TABLES = true
 
bool signingEnabled_ = false
 Determines if the server will sign a tx, given an account's secret seed.
 
std::uint64_t const ramSize_
 
std::unordered_map< std::string, Sectionmap_
 

Detailed Description

Definition at line 75 of file Config.h.

Constructor & Destructor Documentation

◆ Config()

xrpl::Config::Config ( )

Definition at line 244 of file Config.cpp.

Member Function Documentation

◆ getDebugLogFile()

boost::filesystem::path xrpl::Config::getDebugLogFile ( ) const

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

Definition at line 1116 of file Config.cpp.

◆ load()

void xrpl::Config::load ( )
private

Definition at line 429 of file Config.cpp.

◆ setup()

void xrpl::Config::setup ( std::string const &  strConf,
bool  bQuiet,
bool  bSilent,
bool  bStandalone 
)

Definition at line 285 of file Config.cpp.

◆ setupControl()

void xrpl::Config::setupControl ( bool  bQuiet,
bool  bSilent,
bool  bStandalone 
)

Definition at line 250 of file Config.cpp.

◆ loadFromString()

void xrpl::Config::loadFromString ( std::string const &  fileContents)

Load the config from the contents of the string.

Parameters
fileContentsString representing the config contents.

Definition at line 452 of file Config.cpp.

◆ quiet()

bool xrpl::Config::quiet ( ) const

Definition at line 306 of file Config.h.

◆ silent()

bool xrpl::Config::silent ( ) const

Definition at line 311 of file Config.h.

◆ standalone()

bool xrpl::Config::standalone ( ) const

Definition at line 316 of file Config.h.

◆ useTxTables()

bool xrpl::Config::useTxTables ( ) const

Definition at line 322 of file Config.h.

◆ canSign()

bool xrpl::Config::canSign ( ) const

Definition at line 328 of file Config.h.

◆ getValueFor()

int xrpl::Config::getValueFor ( SizedItem  item,
std::optional< std::size_t node = std::nullopt 
) const

Retrieve the default value for the item at the specified node size.

Parameters
itemThe item for which the default value is needed
nodeOptional value, used to adjust the result to match the size of a node (0: tiny, ..., 4: huge). If unseated, uses the configured size (NODE_SIZE).
Exceptions
Thismethod can throw std::out_of_range if you ask for values that it does not recognize or request a non-default node-size.
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 1150 of file Config.cpp.

◆ journal()

beast::Journal xrpl::Config::journal ( ) const

Definition at line 354 of file Config.h.

◆ exists()

bool xrpl::BasicConfig::exists ( std::string const &  name) const
inherited

Returns true if a section with the given name exists.

Definition at line 115 of file BasicConfig.cpp.

◆ section() [1/2]

Section & xrpl::BasicConfig::section ( std::string const &  name)
inherited

Returns the section with the given name.

If the section does not exist, an empty section is returned.

Definition at line 121 of file BasicConfig.cpp.

◆ section() [2/2]

Section const & xrpl::BasicConfig::section ( std::string const &  name) const
inherited

Definition at line 127 of file BasicConfig.cpp.

◆ operator[]() [1/2]

Section const & xrpl::BasicConfig::operator[] ( std::string const &  name) const
inherited

Definition at line 217 of file BasicConfig.h.

◆ operator[]() [2/2]

Section & xrpl::BasicConfig::operator[] ( std::string const &  name)
inherited

Definition at line 223 of file BasicConfig.h.

◆ overwrite()

void xrpl::BasicConfig::overwrite ( std::string const &  section,
std::string const &  key,
std::string const &  value 
)
inherited

Overwrite a key/value pair with a command line argument If the section does not exist it is created.

The previous value, if any, is overwritten.

Definition at line 137 of file BasicConfig.cpp.

◆ deprecatedClearSection()

void xrpl::BasicConfig::deprecatedClearSection ( std::string const &  section)
inherited

Remove all the key/value pairs from the section.

Definition at line 145 of file BasicConfig.cpp.

◆ legacy() [1/2]

void xrpl::BasicConfig::legacy ( std::string const &  section,
std::string  value 
)
inherited

Set a value that is not a key/value pair.

The value is stored as the section's first value and may be retrieved through section::legacy.

Parameters
sectionName of the section to modify.
valueContents of the legacy value.

Definition at line 153 of file BasicConfig.cpp.

◆ legacy() [2/2]

std::string xrpl::BasicConfig::legacy ( std::string const &  sectionName) const
inherited

Get the legacy value of a section.

A section with a single-line value may be retrieved as a legacy value.

Parameters
sectionNameRetrieve the contents of this section's legacy value.
Returns
Contents of the legacy value.

Definition at line 159 of file BasicConfig.cpp.

◆ had_trailing_comments()

bool xrpl::BasicConfig::had_trailing_comments ( ) const
inherited

Definition at line 270 of file BasicConfig.h.

◆ build()

void xrpl::BasicConfig::build ( IniFileSections const &  ifs)
protectedinherited

Definition at line 165 of file BasicConfig.cpp.

Member Data Documentation

◆ configFileName

char const *const xrpl::Config::configFileName = "xrpld.cfg"
static

Definition at line 79 of file Config.h.

◆ configLegacyName

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

Definition at line 80 of file Config.h.

◆ databaseDirName

char const *const xrpl::Config::databaseDirName = "db"
static

Definition at line 81 of file Config.h.

◆ validatorsFileName

char const *const xrpl::Config::validatorsFileName = "validators.txt"
static

Definition at line 82 of file Config.h.

◆ CONFIG_FILE

boost::filesystem::path xrpl::Config::CONFIG_FILE
private

Definition at line 89 of file Config.h.

◆ CONFIG_DIR

boost::filesystem::path xrpl::Config::CONFIG_DIR

Definition at line 92 of file Config.h.

◆ DEBUG_LOGFILE

boost::filesystem::path xrpl::Config::DEBUG_LOGFILE
private

Definition at line 95 of file Config.h.

◆ j_

beast::Journal const xrpl::Config::j_
private

Definition at line 99 of file Config.h.

◆ QUIET

bool xrpl::Config::QUIET = false
private

Definition at line 101 of file Config.h.

◆ SILENT

bool xrpl::Config::SILENT = false
private

Definition at line 102 of file Config.h.

◆ RUN_STANDALONE

bool xrpl::Config::RUN_STANDALONE = false
private

Operate in stand-alone mode.

In stand alone mode:

  • Peer connections are not attempted or accepted
  • The ledger is not advanced automatically.
  • If no ledger is loaded, the default ledger with the root account is created.

Definition at line 112 of file Config.h.

◆ USE_TX_TABLES

bool xrpl::Config::USE_TX_TABLES = true
private

Definition at line 114 of file Config.h.

◆ signingEnabled_

bool xrpl::Config::signingEnabled_ = false
private

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

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

Definition at line 122 of file Config.h.

◆ ramSize_

std::uint64_t const xrpl::Config::ramSize_
private

Definition at line 125 of file Config.h.

◆ doImport

bool xrpl::Config::doImport = false

Definition at line 128 of file Config.h.

◆ ELB_SUPPORT

bool xrpl::Config::ELB_SUPPORT = false

Definition at line 129 of file Config.h.

◆ IPS

std::vector<std::string> xrpl::Config::IPS

Definition at line 132 of file Config.h.

◆ IPS_FIXED

std::vector<std::string> xrpl::Config::IPS_FIXED

Definition at line 135 of file Config.h.

◆ START_UP

StartUpType xrpl::Config::START_UP = StartUpType::Normal

Definition at line 137 of file Config.h.

◆ START_VALID

bool xrpl::Config::START_VALID = false

Definition at line 139 of file Config.h.

◆ START_LEDGER

std::string xrpl::Config::START_LEDGER

Definition at line 141 of file Config.h.

◆ TRAP_TX_HASH

std::optional<uint256> xrpl::Config::TRAP_TX_HASH

Definition at line 143 of file Config.h.

◆ NETWORK_ID

uint32_t xrpl::Config::NETWORK_ID = 0

Definition at line 146 of file Config.h.

◆ NETWORK_QUORUM

std::size_t xrpl::Config::NETWORK_QUORUM = 1

Definition at line 150 of file Config.h.

◆ RELAY_UNTRUSTED_VALIDATIONS

int xrpl::Config::RELAY_UNTRUSTED_VALIDATIONS = 1

Definition at line 155 of file Config.h.

◆ RELAY_UNTRUSTED_PROPOSALS

int xrpl::Config::RELAY_UNTRUSTED_PROPOSALS = 0

Definition at line 156 of file Config.h.

◆ PEER_PRIVATE

bool xrpl::Config::PEER_PRIVATE = false

Definition at line 159 of file Config.h.

◆ PEERS_MAX

std::size_t xrpl::Config::PEERS_MAX = 0

Definition at line 165 of file Config.h.

◆ PEERS_OUT_MAX

std::size_t xrpl::Config::PEERS_OUT_MAX = 0

Definition at line 166 of file Config.h.

◆ PEERS_IN_MAX

std::size_t xrpl::Config::PEERS_IN_MAX = 0

Definition at line 167 of file Config.h.

◆ PATH_SEARCH_OLD

int xrpl::Config::PATH_SEARCH_OLD = 2

Definition at line 181 of file Config.h.

◆ PATH_SEARCH

int xrpl::Config::PATH_SEARCH = 2

Definition at line 182 of file Config.h.

◆ PATH_SEARCH_FAST

int xrpl::Config::PATH_SEARCH_FAST = 2

Definition at line 183 of file Config.h.

◆ PATH_SEARCH_MAX

int xrpl::Config::PATH_SEARCH_MAX = 3

Definition at line 184 of file Config.h.

◆ VALIDATION_QUORUM

std::optional<std::size_t> xrpl::Config::VALIDATION_QUORUM

Definition at line 187 of file Config.h.

◆ FEES

FeeSetup xrpl::Config::FEES

Definition at line 189 of file Config.h.

◆ LEDGER_HISTORY

std::uint32_t xrpl::Config::LEDGER_HISTORY = 256

Definition at line 192 of file Config.h.

◆ FETCH_DEPTH

std::uint32_t xrpl::Config::FETCH_DEPTH = 1000000000

Definition at line 193 of file Config.h.

◆ NODE_SIZE

std::size_t xrpl::Config::NODE_SIZE = 0

Definition at line 198 of file Config.h.

◆ SSL_VERIFY

bool xrpl::Config::SSL_VERIFY = true

Definition at line 200 of file Config.h.

◆ SSL_VERIFY_FILE

std::string xrpl::Config::SSL_VERIFY_FILE

Definition at line 201 of file Config.h.

◆ SSL_VERIFY_DIR

std::string xrpl::Config::SSL_VERIFY_DIR

Definition at line 202 of file Config.h.

◆ COMPRESSION

bool xrpl::Config::COMPRESSION = false

Definition at line 205 of file Config.h.

◆ LEDGER_REPLAY

bool xrpl::Config::LEDGER_REPLAY = false

Definition at line 208 of file Config.h.

◆ MAX_TRANSACTIONS

int xrpl::Config::MAX_TRANSACTIONS = 250

Definition at line 211 of file Config.h.

◆ MAX_JOB_QUEUE_TX

constexpr int xrpl::Config::MAX_JOB_QUEUE_TX = 1000
staticconstexpr

Definition at line 212 of file Config.h.

◆ MIN_JOB_QUEUE_TX

constexpr int xrpl::Config::MIN_JOB_QUEUE_TX = 100
staticconstexpr

Definition at line 213 of file Config.h.

◆ AMENDMENT_MAJORITY_TIME

std::chrono::seconds xrpl::Config::AMENDMENT_MAJORITY_TIME = defaultAmendmentMajorityTime

Definition at line 216 of file Config.h.

◆ WORKERS

int xrpl::Config::WORKERS = 0

Definition at line 219 of file Config.h.

◆ IO_WORKERS

int xrpl::Config::IO_WORKERS = 0

Definition at line 220 of file Config.h.

◆ PREFETCH_WORKERS

int xrpl::Config::PREFETCH_WORKERS = 0

Definition at line 221 of file Config.h.

◆ FORCE_MULTI_THREAD

bool xrpl::Config::FORCE_MULTI_THREAD = false

Definition at line 224 of file Config.h.

◆ SWEEP_INTERVAL

std::optional<int> xrpl::Config::SWEEP_INTERVAL

Definition at line 228 of file Config.h.

◆ VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE

bool xrpl::Config::VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = false

Definition at line 233 of file Config.h.

◆ VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS

std::size_t xrpl::Config::VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS = 5

Definition at line 239 of file Config.h.

◆ TX_REDUCE_RELAY_ENABLE

bool xrpl::Config::TX_REDUCE_RELAY_ENABLE = false

Definition at line 243 of file Config.h.

◆ TX_REDUCE_RELAY_METRICS

bool xrpl::Config::TX_REDUCE_RELAY_METRICS = false

Definition at line 250 of file Config.h.

◆ TX_REDUCE_RELAY_MIN_PEERS

std::size_t xrpl::Config::TX_REDUCE_RELAY_MIN_PEERS = 20

Definition at line 253 of file Config.h.

◆ TX_RELAY_PERCENTAGE

std::size_t xrpl::Config::TX_RELAY_PERCENTAGE = 25

Definition at line 256 of file Config.h.

◆ rpc_ip

std::optional<beast::IP::Endpoint> xrpl::Config::rpc_ip

Definition at line 259 of file Config.h.

◆ features

std::unordered_set<uint256, beast::uhash<> > xrpl::Config::features

Definition at line 261 of file Config.h.

◆ SERVER_DOMAIN

std::string xrpl::Config::SERVER_DOMAIN

Definition at line 263 of file Config.h.

◆ MAX_UNKNOWN_TIME

std::chrono::seconds xrpl::Config::MAX_UNKNOWN_TIME {600}

Definition at line 266 of file Config.h.

◆ MAX_DIVERGED_TIME

std::chrono::seconds xrpl::Config::MAX_DIVERGED_TIME {300}

Definition at line 269 of file Config.h.

◆ BETA_RPC_API

bool xrpl::Config::BETA_RPC_API = false

Definition at line 272 of file Config.h.

◆ FAST_LOAD

bool xrpl::Config::FAST_LOAD = false

Definition at line 275 of file Config.h.

◆ FORCED_LEDGER_RANGE_PRESENT

std::optional<std::pair<std::uint32_t, std::uint32_t> > xrpl::Config::FORCED_LEDGER_RANGE_PRESENT

Definition at line 282 of file Config.h.

◆ VALIDATOR_LIST_THRESHOLD

std::optional<std::size_t> xrpl::Config::VALIDATOR_LIST_THRESHOLD

Definition at line 284 of file Config.h.

◆ map_

std::unordered_map<std::string, Section> xrpl::BasicConfig::map_
privateinherited

Definition at line 199 of file BasicConfig.h.