rippled
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ripple::Config Class Reference
Inheritance diagram for ripple::Config:
Inheritance graph
[legend]
Collaboration diagram for ripple::Config:
Collaboration graph
[legend]

Public Types

enum  StartUpType {
  FRESH, NORMAL, LOAD, LOAD_FILE,
  REPLAY, NETWORK
}
 

Public Member Functions

boost::filesystem::path getDebugLogFile () const
 Returns the full path and filename of the debug log file. More...
 
 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. More...
 
bool quiet () const
 
bool silent () const
 
bool standalone () const
 
bool reporting () const
 
bool useTxTables () const
 
bool reportingReadOnly () const
 
void setReportingReadOnly (bool b)
 
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. More...
 
bool exists (std::string const &name) const
 Returns true if a section with the given name exists. More...
 
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. More...
 
void deprecatedClearSection (std::string const &section)
 Remove all the key/value pairs from the section. More...
 
void legacy (std::string const &section, std::string value)
 Set a value that is not a key/value pair. More...
 
std::string legacy (std::string const &sectionName) const
 Get the legacy value of a section. More...
 
bool had_trailing_comments () const
 
Sectionsection (std::string const &name)
 Returns the section with the given name. More...
 
Section const & section (std::string const &name) const
 
Section const & operator[] (std::string const &name) const
 
Sectionoperator[] (std::string const &name)
 
Sectionsection (std::string const &name)
 Returns the section with the given name. More...
 
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 nodeToShard = false
 
bool ELB_SUPPORT = false
 
std::vector< std::stringIPS
 
std::vector< std::stringIPS_FIXED
 
std::vector< std::stringSNTP_SERVERS
 
StartUpType START_UP = NORMAL
 
bool START_VALID = false
 
std::string START_LEDGER
 
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_ENABLE = false
 
bool VP_REDUCE_RELAY_SQUELCH = false
 
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
 

Static Public Attributes

static char const *const configFileName = "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
 
const beast::Journal j_
 
bool QUIET = false
 
bool SILENT = false
 
bool RUN_STANDALONE = false
 Operate in stand-alone mode. More...
 
bool RUN_REPORTING = false
 
bool REPORTING_READ_ONLY = false
 
bool USE_TX_TABLES = true
 
bool signingEnabled_ = false
 Determines if the server will sign a tx, given an account's secret seed. More...
 
const std::uint64_t ramSize_
 
std::map< std::string, Section, boost::beast::iless > map_
 

Detailed Description

Definition at line 89 of file Config.h.

Member Enumeration Documentation

◆ StartUpType

Enumerator
FRESH 
NORMAL 
LOAD 
LOAD_FILE 
REPLAY 
NETWORK 

Definition at line 153 of file Config.h.

Constructor & Destructor Documentation

◆ Config()

ripple::Config::Config ( )

Definition at line 267 of file Config.cpp.

Member Function Documentation

◆ getDebugLogFile()

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

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

Definition at line 988 of file Config.cpp.

◆ load()

void ripple::Config::load ( )
private

Definition at line 435 of file Config.cpp.

◆ setup()

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

Definition at line 315 of file Config.cpp.

◆ setupControl()

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

Definition at line 273 of file Config.cpp.

◆ loadFromString()

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

Load the config from the contents of the string.

Parameters
fileContentsString representing the config contents.

Definition at line 457 of file Config.cpp.

◆ quiet()

bool ripple::Config::quiet ( ) const

Definition at line 322 of file Config.h.

◆ silent()

bool ripple::Config::silent ( ) const

Definition at line 327 of file Config.h.

◆ standalone()

bool ripple::Config::standalone ( ) const

Definition at line 332 of file Config.h.

◆ reporting()

bool ripple::Config::reporting ( ) const

Definition at line 337 of file Config.h.

◆ useTxTables()

bool ripple::Config::useTxTables ( ) const

Definition at line 343 of file Config.h.

◆ reportingReadOnly()

bool ripple::Config::reportingReadOnly ( ) const

Definition at line 349 of file Config.h.

◆ setReportingReadOnly()

void ripple::Config::setReportingReadOnly ( bool  b)

Definition at line 355 of file Config.h.

◆ canSign()

bool ripple::Config::canSign ( ) const

Definition at line 361 of file Config.h.

◆ getValueFor()

int ripple::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 1022 of file Config.cpp.

◆ exists()

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

Returns true if a section with the given name exists.

Definition at line 121 of file BasicConfig.cpp.

◆ section() [1/2]

Section & ripple::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 127 of file BasicConfig.cpp.

◆ section() [2/2]

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

Definition at line 133 of file BasicConfig.cpp.

◆ operator[]() [1/2]

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

Definition at line 236 of file BasicConfig.h.

◆ operator[]() [2/2]

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

Definition at line 242 of file BasicConfig.h.

◆ overwrite()

void ripple::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 143 of file BasicConfig.cpp.

◆ deprecatedClearSection()

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

Remove all the key/value pairs from the section.

Definition at line 156 of file BasicConfig.cpp.

◆ legacy() [1/2]

void ripple::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 164 of file BasicConfig.cpp.

◆ legacy() [2/2]

std::string ripple::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 170 of file BasicConfig.cpp.

◆ had_trailing_comments()

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

Definition at line 292 of file BasicConfig.h.

◆ build()

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

Definition at line 176 of file BasicConfig.cpp.

Member Data Documentation

◆ configFileName

char const *const ripple::Config::configFileName = "rippled.cfg"
static

Definition at line 93 of file Config.h.

◆ databaseDirName

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

Definition at line 94 of file Config.h.

◆ validatorsFileName

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

Definition at line 95 of file Config.h.

◆ CONFIG_FILE

boost::filesystem::path ripple::Config::CONFIG_FILE
private

Definition at line 102 of file Config.h.

◆ CONFIG_DIR

boost::filesystem::path ripple::Config::CONFIG_DIR

Definition at line 105 of file Config.h.

◆ DEBUG_LOGFILE

boost::filesystem::path ripple::Config::DEBUG_LOGFILE
private

Definition at line 108 of file Config.h.

◆ j_

const beast::Journal ripple::Config::j_
private

Definition at line 112 of file Config.h.

◆ QUIET

bool ripple::Config::QUIET = false
private

Definition at line 114 of file Config.h.

◆ SILENT

bool ripple::Config::SILENT = false
private

Definition at line 115 of file Config.h.

◆ RUN_STANDALONE

bool ripple::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 125 of file Config.h.

◆ RUN_REPORTING

bool ripple::Config::RUN_REPORTING = false
private

Definition at line 127 of file Config.h.

◆ REPORTING_READ_ONLY

bool ripple::Config::REPORTING_READ_ONLY = false
private

Definition at line 129 of file Config.h.

◆ USE_TX_TABLES

bool ripple::Config::USE_TX_TABLES = true
private

Definition at line 131 of file Config.h.

◆ signingEnabled_

bool ripple::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 139 of file Config.h.

◆ ramSize_

const std::uint64_t ripple::Config::ramSize_
private

Definition at line 142 of file Config.h.

◆ doImport

bool ripple::Config::doImport = false

Definition at line 145 of file Config.h.

◆ nodeToShard

bool ripple::Config::nodeToShard = false

Definition at line 146 of file Config.h.

◆ ELB_SUPPORT

bool ripple::Config::ELB_SUPPORT = false

Definition at line 147 of file Config.h.

◆ IPS

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

Definition at line 149 of file Config.h.

◆ IPS_FIXED

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

Definition at line 150 of file Config.h.

◆ SNTP_SERVERS

std::vector<std::string> ripple::Config::SNTP_SERVERS

Definition at line 151 of file Config.h.

◆ START_UP

StartUpType ripple::Config::START_UP = NORMAL

Definition at line 154 of file Config.h.

◆ START_VALID

bool ripple::Config::START_VALID = false

Definition at line 156 of file Config.h.

◆ START_LEDGER

std::string ripple::Config::START_LEDGER

Definition at line 158 of file Config.h.

◆ NETWORK_ID

uint32_t ripple::Config::NETWORK_ID = 0

Definition at line 161 of file Config.h.

◆ FEE_UNITS_DEPRECATED

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

Definition at line 165 of file Config.h.

◆ NETWORK_QUORUM

std::size_t ripple::Config::NETWORK_QUORUM = 1

Definition at line 169 of file Config.h.

◆ RELAY_UNTRUSTED_VALIDATIONS

int ripple::Config::RELAY_UNTRUSTED_VALIDATIONS = 1

Definition at line 174 of file Config.h.

◆ RELAY_UNTRUSTED_PROPOSALS

int ripple::Config::RELAY_UNTRUSTED_PROPOSALS = 0

Definition at line 175 of file Config.h.

◆ PEER_PRIVATE

bool ripple::Config::PEER_PRIVATE = false

Definition at line 178 of file Config.h.

◆ PEERS_MAX

std::size_t ripple::Config::PEERS_MAX = 0

Definition at line 184 of file Config.h.

◆ PEERS_OUT_MAX

std::size_t ripple::Config::PEERS_OUT_MAX = 0

Definition at line 185 of file Config.h.

◆ PEERS_IN_MAX

std::size_t ripple::Config::PEERS_IN_MAX = 0

Definition at line 186 of file Config.h.

◆ PATH_SEARCH_OLD

int ripple::Config::PATH_SEARCH_OLD = 2

Definition at line 200 of file Config.h.

◆ PATH_SEARCH

int ripple::Config::PATH_SEARCH = 2

Definition at line 201 of file Config.h.

◆ PATH_SEARCH_FAST

int ripple::Config::PATH_SEARCH_FAST = 2

Definition at line 202 of file Config.h.

◆ PATH_SEARCH_MAX

int ripple::Config::PATH_SEARCH_MAX = 3

Definition at line 203 of file Config.h.

◆ VALIDATION_QUORUM

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

Definition at line 207 of file Config.h.

◆ FEES

FeeSetup ripple::Config::FEES

Definition at line 209 of file Config.h.

◆ LEDGER_HISTORY

std::uint32_t ripple::Config::LEDGER_HISTORY = 256

Definition at line 212 of file Config.h.

◆ FETCH_DEPTH

std::uint32_t ripple::Config::FETCH_DEPTH = 1000000000

Definition at line 213 of file Config.h.

◆ NODE_SIZE

std::size_t ripple::Config::NODE_SIZE = 0

Definition at line 218 of file Config.h.

◆ SSL_VERIFY

bool ripple::Config::SSL_VERIFY = true

Definition at line 220 of file Config.h.

◆ SSL_VERIFY_FILE

std::string ripple::Config::SSL_VERIFY_FILE

Definition at line 221 of file Config.h.

◆ SSL_VERIFY_DIR

std::string ripple::Config::SSL_VERIFY_DIR

Definition at line 222 of file Config.h.

◆ COMPRESSION

bool ripple::Config::COMPRESSION = false

Definition at line 225 of file Config.h.

◆ LEDGER_REPLAY

bool ripple::Config::LEDGER_REPLAY = false

Definition at line 228 of file Config.h.

◆ MAX_TRANSACTIONS

int ripple::Config::MAX_TRANSACTIONS = 250

Definition at line 231 of file Config.h.

◆ MAX_JOB_QUEUE_TX

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

Definition at line 232 of file Config.h.

◆ MIN_JOB_QUEUE_TX

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

Definition at line 233 of file Config.h.

◆ AMENDMENT_MAJORITY_TIME

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

Definition at line 236 of file Config.h.

◆ WORKERS

int ripple::Config::WORKERS = 0

Definition at line 239 of file Config.h.

◆ IO_WORKERS

int ripple::Config::IO_WORKERS = 0

Definition at line 240 of file Config.h.

◆ PREFETCH_WORKERS

int ripple::Config::PREFETCH_WORKERS = 0

Definition at line 241 of file Config.h.

◆ FORCE_MULTI_THREAD

bool ripple::Config::FORCE_MULTI_THREAD = false

Definition at line 244 of file Config.h.

◆ SWEEP_INTERVAL

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

Definition at line 248 of file Config.h.

◆ VP_REDUCE_RELAY_ENABLE

bool ripple::Config::VP_REDUCE_RELAY_ENABLE = false

Definition at line 253 of file Config.h.

◆ VP_REDUCE_RELAY_SQUELCH

bool ripple::Config::VP_REDUCE_RELAY_SQUELCH = false

Definition at line 262 of file Config.h.

◆ TX_REDUCE_RELAY_ENABLE

bool ripple::Config::TX_REDUCE_RELAY_ENABLE = false

Definition at line 264 of file Config.h.

◆ TX_REDUCE_RELAY_METRICS

bool ripple::Config::TX_REDUCE_RELAY_METRICS = false

Definition at line 271 of file Config.h.

◆ TX_REDUCE_RELAY_MIN_PEERS

std::size_t ripple::Config::TX_REDUCE_RELAY_MIN_PEERS = 20

Definition at line 274 of file Config.h.

◆ TX_RELAY_PERCENTAGE

std::size_t ripple::Config::TX_RELAY_PERCENTAGE = 25

Definition at line 277 of file Config.h.

◆ rpc_ip

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

Definition at line 280 of file Config.h.

◆ features

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

Definition at line 282 of file Config.h.

◆ SERVER_DOMAIN

std::string ripple::Config::SERVER_DOMAIN

Definition at line 284 of file Config.h.

◆ MAX_UNKNOWN_TIME

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

Definition at line 287 of file Config.h.

◆ MAX_DIVERGED_TIME

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

Definition at line 290 of file Config.h.

◆ BETA_RPC_API

bool ripple::Config::BETA_RPC_API = false

Definition at line 293 of file Config.h.

◆ FAST_LOAD

bool ripple::Config::FAST_LOAD = false

Definition at line 296 of file Config.h.

◆ map_

std::map<std::string, Section, boost::beast::iless> ripple::BasicConfig::map_
privateinherited

Definition at line 218 of file BasicConfig.h.