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 std::uint32_t FEE_UNITS_DEPRECATED = 10
 
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 67 of file Config.h.

Constructor & Destructor Documentation

◆ Config()

xrpl::Config::Config ( )

Definition at line 239 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 982 of file Config.cpp.

◆ load()

void xrpl::Config::load ( )
private

Definition at line 418 of file Config.cpp.

◆ setup()

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

Definition at line 278 of file Config.cpp.

◆ setupControl()

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

Definition at line 244 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 440 of file Config.cpp.

◆ quiet()

bool xrpl::Config::quiet ( ) const

Definition at line 302 of file Config.h.

◆ silent()

bool xrpl::Config::silent ( ) const

Definition at line 307 of file Config.h.

◆ standalone()

bool xrpl::Config::standalone ( ) const

Definition at line 312 of file Config.h.

◆ useTxTables()

bool xrpl::Config::useTxTables ( ) const

Definition at line 318 of file Config.h.

◆ canSign()

bool xrpl::Config::canSign ( ) const

Definition at line 324 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 1015 of file Config.cpp.

◆ journal()

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

Definition at line 350 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 111 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 117 of file BasicConfig.cpp.

◆ section() [2/2]

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

Definition at line 123 of file BasicConfig.cpp.

◆ operator[]() [1/2]

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

Definition at line 216 of file BasicConfig.h.

◆ operator[]() [2/2]

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

Definition at line 222 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 133 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 140 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 148 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 154 of file BasicConfig.cpp.

◆ had_trailing_comments()

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

Definition at line 269 of file BasicConfig.h.

◆ build()

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

Definition at line 160 of file BasicConfig.cpp.

Member Data Documentation

◆ configFileName

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

Definition at line 71 of file Config.h.

◆ configLegacyName

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

Definition at line 72 of file Config.h.

◆ databaseDirName

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

Definition at line 73 of file Config.h.

◆ validatorsFileName

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

Definition at line 74 of file Config.h.

◆ CONFIG_FILE

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

Definition at line 81 of file Config.h.

◆ CONFIG_DIR

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

Definition at line 84 of file Config.h.

◆ DEBUG_LOGFILE

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

Definition at line 87 of file Config.h.

◆ j_

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

Definition at line 91 of file Config.h.

◆ QUIET

bool xrpl::Config::QUIET = false
private

Definition at line 93 of file Config.h.

◆ SILENT

bool xrpl::Config::SILENT = false
private

Definition at line 94 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 104 of file Config.h.

◆ USE_TX_TABLES

bool xrpl::Config::USE_TX_TABLES = true
private

Definition at line 106 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 114 of file Config.h.

◆ ramSize_

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

Definition at line 117 of file Config.h.

◆ doImport

bool xrpl::Config::doImport = false

Definition at line 120 of file Config.h.

◆ ELB_SUPPORT

bool xrpl::Config::ELB_SUPPORT = false

Definition at line 121 of file Config.h.

◆ IPS

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

Definition at line 124 of file Config.h.

◆ IPS_FIXED

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

Definition at line 127 of file Config.h.

◆ START_UP

StartUpType xrpl::Config::START_UP = StartUpType::NORMAL

Definition at line 129 of file Config.h.

◆ START_VALID

bool xrpl::Config::START_VALID = false

Definition at line 131 of file Config.h.

◆ START_LEDGER

std::string xrpl::Config::START_LEDGER

Definition at line 133 of file Config.h.

◆ TRAP_TX_HASH

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

Definition at line 135 of file Config.h.

◆ NETWORK_ID

uint32_t xrpl::Config::NETWORK_ID = 0

Definition at line 138 of file Config.h.

◆ FEE_UNITS_DEPRECATED

constexpr std::uint32_t xrpl::Config::FEE_UNITS_DEPRECATED = 10
staticconstexpr

Definition at line 142 of file Config.h.

◆ NETWORK_QUORUM

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

Definition at line 146 of file Config.h.

◆ RELAY_UNTRUSTED_VALIDATIONS

int xrpl::Config::RELAY_UNTRUSTED_VALIDATIONS = 1

Definition at line 151 of file Config.h.

◆ RELAY_UNTRUSTED_PROPOSALS

int xrpl::Config::RELAY_UNTRUSTED_PROPOSALS = 0

Definition at line 152 of file Config.h.

◆ PEER_PRIVATE

bool xrpl::Config::PEER_PRIVATE = false

Definition at line 155 of file Config.h.

◆ PEERS_MAX

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

Definition at line 161 of file Config.h.

◆ PEERS_OUT_MAX

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

Definition at line 162 of file Config.h.

◆ PEERS_IN_MAX

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

Definition at line 163 of file Config.h.

◆ PATH_SEARCH_OLD

int xrpl::Config::PATH_SEARCH_OLD = 2

Definition at line 177 of file Config.h.

◆ PATH_SEARCH

int xrpl::Config::PATH_SEARCH = 2

Definition at line 178 of file Config.h.

◆ PATH_SEARCH_FAST

int xrpl::Config::PATH_SEARCH_FAST = 2

Definition at line 179 of file Config.h.

◆ PATH_SEARCH_MAX

int xrpl::Config::PATH_SEARCH_MAX = 3

Definition at line 180 of file Config.h.

◆ VALIDATION_QUORUM

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

Definition at line 183 of file Config.h.

◆ FEES

FeeSetup xrpl::Config::FEES

Definition at line 185 of file Config.h.

◆ LEDGER_HISTORY

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

Definition at line 188 of file Config.h.

◆ FETCH_DEPTH

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

Definition at line 189 of file Config.h.

◆ NODE_SIZE

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

Definition at line 194 of file Config.h.

◆ SSL_VERIFY

bool xrpl::Config::SSL_VERIFY = true

Definition at line 196 of file Config.h.

◆ SSL_VERIFY_FILE

std::string xrpl::Config::SSL_VERIFY_FILE

Definition at line 197 of file Config.h.

◆ SSL_VERIFY_DIR

std::string xrpl::Config::SSL_VERIFY_DIR

Definition at line 198 of file Config.h.

◆ COMPRESSION

bool xrpl::Config::COMPRESSION = false

Definition at line 201 of file Config.h.

◆ LEDGER_REPLAY

bool xrpl::Config::LEDGER_REPLAY = false

Definition at line 204 of file Config.h.

◆ MAX_TRANSACTIONS

int xrpl::Config::MAX_TRANSACTIONS = 250

Definition at line 207 of file Config.h.

◆ MAX_JOB_QUEUE_TX

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

Definition at line 208 of file Config.h.

◆ MIN_JOB_QUEUE_TX

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

Definition at line 209 of file Config.h.

◆ AMENDMENT_MAJORITY_TIME

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

Definition at line 212 of file Config.h.

◆ WORKERS

int xrpl::Config::WORKERS = 0

Definition at line 215 of file Config.h.

◆ IO_WORKERS

int xrpl::Config::IO_WORKERS = 0

Definition at line 216 of file Config.h.

◆ PREFETCH_WORKERS

int xrpl::Config::PREFETCH_WORKERS = 0

Definition at line 217 of file Config.h.

◆ FORCE_MULTI_THREAD

bool xrpl::Config::FORCE_MULTI_THREAD = false

Definition at line 220 of file Config.h.

◆ SWEEP_INTERVAL

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

Definition at line 224 of file Config.h.

◆ VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE

bool xrpl::Config::VP_REDUCE_RELAY_BASE_SQUELCH_ENABLE = false

Definition at line 229 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 235 of file Config.h.

◆ TX_REDUCE_RELAY_ENABLE

bool xrpl::Config::TX_REDUCE_RELAY_ENABLE = false

Definition at line 239 of file Config.h.

◆ TX_REDUCE_RELAY_METRICS

bool xrpl::Config::TX_REDUCE_RELAY_METRICS = false

Definition at line 246 of file Config.h.

◆ TX_REDUCE_RELAY_MIN_PEERS

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

Definition at line 249 of file Config.h.

◆ TX_RELAY_PERCENTAGE

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

Definition at line 252 of file Config.h.

◆ rpc_ip

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

Definition at line 255 of file Config.h.

◆ features

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

Definition at line 257 of file Config.h.

◆ SERVER_DOMAIN

std::string xrpl::Config::SERVER_DOMAIN

Definition at line 259 of file Config.h.

◆ MAX_UNKNOWN_TIME

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

Definition at line 262 of file Config.h.

◆ MAX_DIVERGED_TIME

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

Definition at line 265 of file Config.h.

◆ BETA_RPC_API

bool xrpl::Config::BETA_RPC_API = false

Definition at line 268 of file Config.h.

◆ FAST_LOAD

bool xrpl::Config::FAST_LOAD = false

Definition at line 271 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 278 of file Config.h.

◆ VALIDATOR_LIST_THRESHOLD

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

Definition at line 280 of file Config.h.

◆ map_

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

Definition at line 198 of file BasicConfig.h.