Compare commits

...

56 Commits

Author SHA1 Message Date
Bart
94c0949df3 Improve variable naming 2025-12-02 15:19:34 -05:00
Bart
79a82c9c55 Update script to exclude support for legacy config file name 2025-12-02 14:58:27 -05:00
Bart
3b45ed8f5a Merge branch 'bthomee/rename_namespace' into bthomee/rename_config 2025-12-02 14:44:10 -05:00
Bart
c40c939a16 Support reading both xrpld.cfg and rippled.cfg 2025-12-02 14:26:11 -05:00
Bart
68faad9e33 Merge branch 'bthomee/rename_namespace' into bthomee/rename_config 2025-11-14 17:20:14 -05:00
Bart
91da840760 Merge branch 'bthomee/rename_namespace' into bthomee/rename_config 2025-11-10 17:36:11 -05:00
Bart
90cbab8ead Merge branch 'bthomee/rename_binary' into bthomee/rename_config 2025-11-07 11:36:56 +00:00
Bart Thomee
03f9873b6c Use braces and quotes appropriately 2025-11-02 18:40:59 +00:00
Bart Thomee
8527bf568d Merge branch 'bthomee/rename_binary' into bthomee/rename_config 2025-11-02 18:38:23 +00:00
Bart Thomee
f1b283f63e Use braces and quotes appropriately 2025-11-02 18:37:32 +00:00
Bart Thomee
a765784c49 Merge branch 'bthomee/rename_cmake' into bthomee/rename_binary 2025-11-02 18:36:53 +00:00
Bart Thomee
037f54a4d5 Use braces and quotes appropriately 2025-11-02 18:36:35 +00:00
Bart Thomee
4cae198dca Merge branch 'bthomee/rename_copyright' into bthomee/rename_cmake 2025-11-02 18:36:08 +00:00
Bart Thomee
f77dc6cefc Use braces and quotes appropriately 2025-11-02 18:35:49 +00:00
Bart Thomee
9816765706 Merge branch 'bthomee/rename_definitions' into bthomee/rename_copyright 2025-11-02 18:35:32 +00:00
Bart Thomee
4d58bb1cc9 Use braces and quotes appropriately 2025-11-02 18:35:20 +00:00
Bart Thomee
cb9d7e6b14 Use pushd and popd 2025-11-02 18:33:28 +00:00
Bart Thomee
cc8c465267 Merge branch 'bthomee/rename_copyright' into bthomee/rename_cmake 2025-11-02 18:26:38 +00:00
Bart Thomee
7b1d653191 Use pushd and popd 2025-11-02 18:26:21 +00:00
Bart Thomee
b8e676898e refactor: Rename rippled.cfg to xrpld.cfg 2025-11-02 15:28:52 +00:00
Bart Thomee
80b1c7114c refactor: Rename rippled binary to xrpld and add symlink 2025-11-02 13:19:58 +00:00
Bart Thomee
f1a0d141b3 Fix script 2025-11-02 13:05:44 +00:00
Bart Thomee
81e715a68d Remove useless command 2025-11-02 12:52:34 +00:00
Bart Thomee
fafe87f547 Work around rename command not being available in CI images 2025-11-01 14:30:44 -04:00
Bart Thomee
1ba1ca775b Merge branch 'bthomee/rename_copyright' into bthomee/rename_cmake 2025-11-01 13:44:09 -04:00
Bart Thomee
96732f8b4c Merge branch 'bthomee/rename_definitions' into bthomee/rename_copyright 2025-11-01 13:43:00 -04:00
Bart Thomee
13c3d28568 Fix bad merge 2025-11-01 13:40:49 -04:00
Bart Thomee
45dd129f83 Add cmake script to CI check pipeline 2025-11-01 13:19:05 -04:00
Bart Thomee
b516a17cac Merge branch 'bthomee/rename_copyright' into bthomee/rename_cmake 2025-11-01 13:18:21 -04:00
Bart Thomee
972ddde705 Merge branch 'bthomee/rename_definitions' into bthomee/rename_copyright 2025-11-01 12:53:00 -04:00
Bart Thomee
487bc23e23 Merge branch 'develop' into bthomee/rename_definitions 2025-11-01 12:50:29 -04:00
Bart Thomee
fe515e8ab4 Restore renaming of the .cfg file 2025-10-30 16:46:23 -04:00
Bart Thomee
dc966e8a4d Merge branch 'bthomee/rename_copyright' into bthomee/rename_cmake 2025-10-30 16:04:56 -04:00
Bart Thomee
bf6308cb4e Merge branch 'bthomee/rename_definitions' into bthomee/rename_copyright 2025-10-30 16:04:27 -04:00
Bart
36ad664623 Merge branch 'develop' into bthomee/rename_definitions 2025-10-30 16:01:02 -04:00
Bart Thomee
296f82629a Handle rerunning of the script 2025-10-30 15:57:20 -04:00
Bart Thomee
808dcfb389 Fix typo in README 2025-10-30 15:15:50 -04:00
Bart Thomee
115f01978d refactor: Rename cmake files and definitions 2025-10-30 15:11:18 -04:00
Bart Thomee
4af408fcd6 Fix typo in comment 2025-10-23 11:06:42 -04:00
Bart Thomee
b50bd88aba Add modified files 2025-10-23 11:04:30 -04:00
Bart Thomee
ac7cd17472 refactor: Remove unnecessary copyright notices already covered by LICENSE.md 2025-10-23 11:03:01 -04:00
Bart Thomee
fc33a8e0ce Use gnu-sed on MacOS 2025-10-23 10:59:35 -04:00
Bart
154d6fa740 Merge branch 'develop' into bthomee/rename_definitions 2025-10-23 10:49:14 -04:00
Bart Thomee
594b81bd72 Add paths to CI trigger 2025-10-23 10:46:26 -04:00
Bart Thomee
cbc69ed62f Specify directory 2025-10-23 10:44:41 -04:00
Bart Thomee
613954184a Add CI step to enforce renaming 2025-10-23 10:39:42 -04:00
Bart Thomee
18c459f903 Merge branch 'develop' into bthomee/rename_definitions 2025-10-23 10:34:33 -04:00
Bart Thomee
56ac3a7323 Merge branch 'develop' into bthomee/rename_definitions 2025-10-22 09:24:20 -04:00
Bart Thomee
5bf234337e Merge branch 'develop' into bthomee/rename_definitions 2025-10-20 10:50:06 -04:00
Bart
b985a108cb Merge branch 'develop' into bthomee/rename_definitions 2025-10-08 11:18:30 -04:00
Bart
ec128fe1e1 Merge branch 'develop' into bthomee/rename_definitions 2025-09-27 12:27:02 +02:00
Bart Thomee
c420ceb84a Add readme 2025-09-27 12:16:15 +02:00
Bart Thomee
e0691144ae Expand scope 2025-09-27 11:08:40 +02:00
Bart Thomee
1570e2e057 Merge branch 'develop' into bthomee/rename_definitions 2025-09-27 11:06:10 +02:00
Bart Thomee
e7c72f0c05 Reduce scope 2025-09-27 11:01:28 +02:00
Bart Thomee
656d4b4100 Renames RIPPLED_ and RIPPLE_ definitions to XRPL_ 2025-09-26 21:10:39 +02:00
16 changed files with 210 additions and 102 deletions

View File

@@ -31,6 +31,9 @@ run from the repository root.
the `xrpld` binary.
5. `.github/scripts/rename/namespace.sh`: This script will rename the C++
namespaces from `ripple` to `xrpl`.
6. `.github/scripts/rename/config.sh`: This script will rename the config from
`rippled.cfg` to `xrpld.cfg`, and updating the code accordingly. The old
filename will still be accepted.
You can run all these scripts from the repository root as follows:
@@ -40,4 +43,5 @@ You can run all these scripts from the repository root as follows:
./.github/scripts/rename/cmake.sh .
./.github/scripts/rename/binary.sh .
./.github/scripts/rename/namespace.sh .
./.github/scripts/rename/config.sh .
```

62
.github/scripts/rename/config.sh vendored Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
# Exit the script as soon as an error occurs.
set -e
# On MacOS, ensure that GNU sed is installed and available as `gsed`.
SED_COMMAND=sed
if [[ "${OSTYPE}" == 'darwin'* ]]; then
if ! command -v gsed &> /dev/null; then
echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'."
exit 1
fi
SED_COMMAND=gsed
fi
# This script renames the config from `rippled.cfg` to `xrpld.cfg`, and updates
# the code accordingly. The old filename will still be accepted.
# Usage: .github/scripts/rename/config.sh <repository directory>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <repository directory>"
exit 1
fi
DIRECTORY=$1
echo "Processing directory: ${DIRECTORY}"
if [ ! -d "${DIRECTORY}" ]; then
echo "Error: Directory '${DIRECTORY}' does not exist."
exit 1
fi
pushd ${DIRECTORY}
# Add the xrpld.cfg to the .gitignore.
if ! grep -q 'xrpld.cfg' .gitignore; then
${SED_COMMAND} -i '/rippled.cfg/a\
xrpld.cfg' .gitignore
fi
# Rename the files.
if [ -e rippled.cfg ]; then
mv rippled.cfg xrpld.cfg
fi
if [ -e cfg/rippled-example.cfg ]; then
mv cfg/rippled-example.cfg cfg/xrpld-example.cfg
fi
# Rename inside the files.
DIRECTORIES=("cfg" "cmake" "include" "src")
for DIRECTORY in "${DIRECTORIES[@]}"; do
echo "Processing directory: ${DIRECTORY}"
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do
echo "Processing file: ${FILE}"
${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}"
done
done
# Restore the old config file name in the code that maintains support for now.
${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp
popd
echo "Renaming complete."

View File

@@ -29,6 +29,8 @@ jobs:
run: .github/scripts/rename/binary.sh .
- name: Check namespaces
run: .github/scripts/rename/namespace.sh .
- name: Check config name
run: .github/scripts/rename/config.sh .
- name: Check for differences
env:
MESSAGE: |

1
.gitignore vendored
View File

@@ -54,6 +54,7 @@ debug_log.txt
# Ignore customized configs
rippled.cfg
xrpld.cfg
validators.txt
# Doxygen generated documentation output

View File

@@ -1,7 +1,7 @@
#
# Default validators.txt
#
# This file is located in the same folder as your rippled.cfg file
# This file is located in the same folder as your xrpld.cfg file
# and defines which validators your server trusts not to collude.
#
# This file is UTF-8 with DOS, UNIX, or Mac style line endings.

View File

@@ -33,14 +33,14 @@
# configuration options. When the rippled server instance is launched, it
# looks for a file with the following name:
#
# rippled.cfg
# xrpld.cfg
#
# For more information on where the rippled server instance searches for the
# file, visit:
#
# https://xrpl.org/commandline-usage.html#generic-options
#
# This file should be named rippled.cfg. This file is UTF-8 with DOS, UNIX,
# This file should be named xrpld.cfg. This file is UTF-8 with DOS, UNIX,
# or Mac style end of lines. Blank lines and lines beginning with '#' are
# ignored. Undefined sections are reserved. No escapes are currently defined.
#
@@ -745,7 +745,7 @@
#
# Specify the file by its name or path.
# Unless an absolute path is specified, it will be considered relative to
# the folder in which the rippled.cfg file is located.
# the folder in which the xrpld.cfg file is located.
#
# Examples:
# /home/ripple/validators.txt
@@ -902,7 +902,7 @@
# the performance of the server.
#
# Partial pathnames will be considered relative to the location of
# the rippled.cfg file.
# the xrpld.cfg file.
#
# [node_db] Settings for the Node Database (required)
#
@@ -1069,7 +1069,7 @@
# The server creates and maintains 4 to 5 bookkeeping SQLite databases in
# the 'database_path' location. If you omit this configuration setting,
# the server creates a directory called "db" located in the same place as
# your rippled.cfg file.
# your xrpld.cfg file.
# Partial pathnames are relative to the location of the rippled executable.
#
# [sqlite] Tuning settings for the SQLite databases (optional)
@@ -1533,7 +1533,7 @@ advisory_delete=0
# File containing trusted validator keys or validator list publishers.
# Unless an absolute path is specified, it will be considered relative to the
# folder in which the rippled.cfg file is located.
# folder in which the xrpld.cfg file is located.
[validators_file]
validators.txt

View File

@@ -61,7 +61,7 @@ if (is_root_project AND TARGET xrpld)
message (\"-- Skipping : \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\")
endif ()
endmacro()
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/rippled-example.cfg\" etc rippled.cfg)
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg)
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
")
install(CODE "

View File

@@ -130,7 +130,7 @@ newer versions of RocksDB (TBD).
## Discussion
RocksDBQuickFactory is intended to provide a testbed for comparing potential
rocksdb performance with the existing recommended configuration in rippled.cfg.
rocksdb performance with the existing recommended configuration in xrpld.cfg.
Through various executions and profiling some conclusions are presented below.
- If the write ahead log is enabled, insert speed soon clogs up under load. The

View File

@@ -18,8 +18,8 @@ void
ManagerImp::missing_backend()
{
Throw<std::runtime_error>(
"Your rippled.cfg is missing a [node_db] entry, "
"please see the rippled-example.cfg file!");
"Your xrpld.cfg is missing a [node_db] entry, "
"please see the xrpld-example.cfg file!");
}
// We shouldn't rely on global variables for lifetime management because their

View File

@@ -123,13 +123,14 @@ public:
beast::unit_test::suite& test,
path subDir,
path const& dbPath,
path const& configFile,
path const& validatorsFile,
bool useCounter = true,
std::string confContents = "")
: FileDirGuard(
test,
std::move(subDir),
path(Config::configFileName),
configFile,
confContents.empty()
? configContents(dbPath.string(), validatorsFile.string())
: confContents,
@@ -323,38 +324,47 @@ port_wss_admin
BEAST_EXPECT(c.legacy("database_path") == "");
}
}
char const* configFiles[] = {
Config::configFileName, Config::configLegacyName};
for (auto const& configFile : configFiles)
{
// read from file absolute path
auto const cwd = current_path();
xrpl::detail::DirGuard const g0(*this, "test_db");
path const dataDirRel("test_data_dir");
path const dataDirAbs(cwd / g0.subdir() / dataDirRel);
detail::RippledCfgGuard const g(
*this, g0.subdir(), dataDirAbs, "", false);
auto const& c(g.config());
BEAST_EXPECT(g.dataDirExists());
BEAST_EXPECT(g.configFileExists());
BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
}
{
// read from file relative path
std::string const dbPath("my_db");
detail::RippledCfgGuard const g(*this, "test_db", dbPath, "");
auto const& c(g.config());
std::string const nativeDbPath = absolute(path(dbPath)).string();
BEAST_EXPECT(g.dataDirExists());
BEAST_EXPECT(g.configFileExists());
BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
}
{
// read from file no path
detail::RippledCfgGuard const g(*this, "test_db", "", "");
auto const& c(g.config());
std::string const nativeDbPath =
absolute(g.subdir() / path(Config::databaseDirName)).string();
BEAST_EXPECT(g.dataDirExists());
BEAST_EXPECT(g.configFileExists());
BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
{
// read from file absolute path
auto const cwd = current_path();
xrpl::detail::DirGuard const g0(*this, "test_db");
path const dataDirRel("test_data_dir");
path const dataDirAbs(cwd / g0.subdir() / dataDirRel);
detail::RippledCfgGuard const g(
*this, g0.subdir(), dataDirAbs, configFile, "", false);
auto const& c(g.config());
BEAST_EXPECT(g.dataDirExists());
BEAST_EXPECT(g.configFileExists());
BEAST_EXPECT(c.legacy("database_path") == dataDirAbs.string());
}
{
// read from file relative path
std::string const dbPath("my_db");
detail::RippledCfgGuard const g(
*this, "test_db", dbPath, configFile, "");
auto const& c(g.config());
std::string const nativeDbPath =
absolute(path(dbPath)).string();
BEAST_EXPECT(g.dataDirExists());
BEAST_EXPECT(g.configFileExists());
BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
}
{
// read from file no path
detail::RippledCfgGuard const g(
*this, "test_db", "", configFile, "");
auto const& c(g.config());
std::string const nativeDbPath =
absolute(g.subdir() / path(Config::databaseDirName))
.string();
BEAST_EXPECT(g.dataDirExists());
BEAST_EXPECT(g.configFileExists());
BEAST_EXPECT(c.legacy("database_path") == nativeDbPath);
}
}
}
@@ -737,7 +747,12 @@ trustthesevalidators.gov
detail::ValidatorsTxtGuard const vtg(
*this, "test_cfg", valFileName);
detail::RippledCfgGuard const rcg(
*this, vtg.subdir(), "", valFileName, false);
*this,
vtg.subdir(),
"",
Config::configFileName,
valFileName,
false);
BEAST_EXPECT(vtg.validatorsFileExists());
BEAST_EXPECT(rcg.configFileExists());
auto const& c(rcg.config());
@@ -759,7 +774,12 @@ trustthesevalidators.gov
*this, "test_cfg", "validators.txt");
auto const valFilePath = ".." / vtg.subdir() / "validators.txt";
detail::RippledCfgGuard const rcg(
*this, vtg.subdir(), "", valFilePath, false);
*this,
vtg.subdir(),
"",
Config::configFileName,
valFilePath,
false);
BEAST_EXPECT(vtg.validatorsFileExists());
BEAST_EXPECT(rcg.configFileExists());
auto const& c(rcg.config());
@@ -779,7 +799,7 @@ trustthesevalidators.gov
detail::ValidatorsTxtGuard const vtg(
*this, "test_cfg", "validators.txt");
detail::RippledCfgGuard const rcg(
*this, vtg.subdir(), "", "", false);
*this, vtg.subdir(), "", Config::configFileName, "", false);
BEAST_EXPECT(vtg.validatorsFileExists());
BEAST_EXPECT(rcg.configFileExists());
auto const& c(rcg.config());
@@ -804,7 +824,12 @@ trustthesevalidators.gov
*this, vtg.subdir(), "validators.txt", false);
BEAST_EXPECT(vtgDefault.validatorsFileExists());
detail::RippledCfgGuard const rcg(
*this, vtg.subdir(), "", vtg.validatorsFile(), false);
*this,
vtg.subdir(),
"",
Config::configFileName,
vtg.validatorsFile(),
false);
BEAST_EXPECT(rcg.configFileExists());
auto const& c(rcg.config());
BEAST_EXPECT(c.legacy("validators_file") == vtg.validatorsFile());
@@ -861,7 +886,7 @@ trustthesevalidators.gov
}
{
// load should throw if [validator_list_threshold] is present both
// in rippled cfg and validators file
// in xrpld.cfg and validators file
boost::format cc(R"rippleConfig(
[validators_file]
%1%
@@ -890,7 +915,7 @@ trustthesevalidators.gov
}
{
// load should throw if [validators], [validator_keys] and
// [validator_list_keys] are missing from rippled cfg and
// [validator_list_keys] are missing from xrpld.cfg and
// validators file
Config c;
boost::format cc("[validators_file]\n%1%\n");
@@ -921,7 +946,11 @@ trustthesevalidators.gov
testSetup(bool explicitPath)
{
detail::RippledCfgGuard const cfg(
*this, "testSetup", explicitPath ? "test_db" : "", "");
*this,
"testSetup",
explicitPath ? "test_db" : "",
Config::configFileName,
"");
/* RippledCfgGuard has a Config object that gets loaded on
construction, but Config::setup is not reentrant, so we
need a fresh config for every test case, so ignore it.
@@ -1039,7 +1068,8 @@ trustthesevalidators.gov
void
testPort()
{
detail::RippledCfgGuard const cfg(*this, "testPort", "", "");
detail::RippledCfgGuard const cfg(
*this, "testPort", "", Config::configFileName, "");
auto const& conf = cfg.config();
if (!BEAST_EXPECT(conf.exists("port_rpc")))
return;
@@ -1066,7 +1096,13 @@ trustthesevalidators.gov
try
{
detail::RippledCfgGuard const cfg(
*this, "testPort", "", "", true, contents);
*this,
"testPort",
"",
Config::configFileName,
"",
true,
contents);
BEAST_EXPECT(false);
}
catch (std::exception const& ex)

View File

@@ -87,7 +87,7 @@ private:
/// If the node is out of sync during an online_delete healthWait()
/// call, sleep the thread for this time, and continue checking until
/// recovery.
/// See also: "recovery_wait_seconds" in rippled-example.cfg
/// See also: "recovery_wait_seconds" in xrpld-example.cfg
std::chrono::seconds recoveryWaitTime_{5};
// these do not exist upon SHAMapStore creation, but do exist

View File

@@ -68,6 +68,7 @@ class Config : public BasicConfig
public:
// Settings related to the configuration file location and directories
static char const* const configFileName;
static char const* const configLegacyName;
static char const* const databaseDirName;
static char const* const validatorsFileName;

View File

@@ -221,11 +221,12 @@ getSingleSection(
//------------------------------------------------------------------------------
//
// Config (DEPRECATED)
// Config
//
//------------------------------------------------------------------------------
char const* const Config::configFileName = "rippled.cfg";
char const* const Config::configFileName = "xrpld.cfg";
char const* const Config::configLegacyName = "rippled.cfg";
char const* const Config::databaseDirName = "db";
char const* const Config::validatorsFileName = "validators.txt";
@@ -295,76 +296,79 @@ Config::setup(
bool bSilent,
bool bStandalone)
{
boost::filesystem::path dataDir;
std::string strDbPath, strConfFile;
setupControl(bQuiet, bSilent, bStandalone);
// Determine the config and data directories.
// If the config file is found in the current working
// directory, use the current working directory as the
// config directory and that with "db" as the data
// directory.
setupControl(bQuiet, bSilent, bStandalone);
strDbPath = databaseDirName;
if (!strConf.empty())
strConfFile = strConf;
else
strConfFile = configFileName;
boost::filesystem::path dataDir;
if (!strConf.empty())
{
// --conf=<path> : everything is relative that file.
CONFIG_FILE = strConfFile;
CONFIG_FILE = strConf;
CONFIG_DIR = boost::filesystem::absolute(CONFIG_FILE);
CONFIG_DIR.remove_filename();
dataDir = CONFIG_DIR / strDbPath;
dataDir = CONFIG_DIR / databaseDirName;
}
else
{
CONFIG_DIR = boost::filesystem::current_path();
CONFIG_FILE = CONFIG_DIR / strConfFile;
dataDir = CONFIG_DIR / strDbPath;
// Construct XDG config and data home.
// http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
auto const strHome = getEnvVar("HOME");
auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
if (boost::filesystem::exists(CONFIG_FILE)
// Can we figure out XDG dirs?
|| (strHome.empty() &&
(strXdgConfigHome.empty() || strXdgDataHome.empty())))
{
// Current working directory is fine, put dbs in a subdir.
}
else
do
{
// Construct XDG config and data home.
// http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html.
auto const strHome = getEnvVar("HOME");
auto strXdgConfigHome = getEnvVar("XDG_CONFIG_HOME");
auto strXdgDataHome = getEnvVar("XDG_DATA_HOME");
// Check if either of the config files exist in the current working
// directory, in which case the databases will be stored in a
// subdirectory.
CONFIG_DIR = boost::filesystem::current_path();
dataDir = CONFIG_DIR / databaseDirName;
CONFIG_FILE = CONFIG_DIR / configFileName;
if (boost::filesystem::exists(CONFIG_FILE))
break;
CONFIG_FILE = CONFIG_DIR / configLegacyName;
if (boost::filesystem::exists(CONFIG_FILE))
break;
// Check if the XDG config and/or data directories are set, in which
// case we will use them, unless $HOME is not set.
if (strHome.empty() &&
(strXdgConfigHome.empty() || strXdgDataHome.empty()))
break;
if (strXdgConfigHome.empty())
{
// $XDG_CONFIG_HOME was not set, use default based on $HOME.
strXdgConfigHome = strHome + "/.config";
}
if (strXdgDataHome.empty())
{
// $XDG_DATA_HOME was not set, use default based on $HOME.
strXdgDataHome = strHome + "/.local/share";
}
CONFIG_DIR = strXdgConfigHome + "/" + systemName();
CONFIG_FILE = CONFIG_DIR / strConfFile;
// Check if either of the config files exist in the XDG config dir.
dataDir = strXdgDataHome + "/" + systemName();
CONFIG_DIR = strXdgConfigHome + "/" + systemName();
CONFIG_FILE = CONFIG_DIR / configFileName;
if (boost::filesystem::exists(CONFIG_FILE))
break;
CONFIG_FILE = CONFIG_DIR / configLegacyName;
if (boost::filesystem::exists(CONFIG_FILE))
break;
if (!boost::filesystem::exists(CONFIG_FILE))
{
CONFIG_DIR = "/etc/opt/" + systemName();
CONFIG_FILE = CONFIG_DIR / strConfFile;
dataDir = "/var/opt/" + systemName();
}
}
// As a last resort, check the system config directory.
dataDir = "/var/opt/" + systemName();
CONFIG_DIR = "/etc/opt/" + systemName();
CONFIG_FILE = CONFIG_DIR / configFileName;
if (boost::filesystem::exists(CONFIG_FILE))
break;
CONFIG_FILE = CONFIG_DIR / configLegacyName;
} while (false);
}
// Update default values
@@ -374,11 +378,9 @@ Config::setup(
std::string const dbPath(legacy("database_path"));
if (!dbPath.empty())
dataDir = boost::filesystem::path(dbPath);
else if (RUN_STANDALONE)
dataDir.clear();
}
if (!dataDir.empty())
if (!RUN_STANDALONE)
{
boost::system::error_code ec;
boost::filesystem::create_directories(dataDir, ec);

View File

@@ -373,7 +373,7 @@ command. The key is in the `pubkey_node` value, and is a text string
beginning with the letter `n`. The key is maintained across runs in a
database.
Cluster members are configured in the `rippled.cfg` file under
Cluster members are configured in the `xrpld.cfg` file under
`[cluster_nodes]`. Each member should be configured on a line beginning
with the node public key, followed optionally by a space and a friendly
name.

View File

@@ -514,7 +514,7 @@ OverlayImpl::start()
m_peerFinder->addFallbackStrings(base + name, ips);
});
// Add the ips_fixed from the rippled.cfg file
// Add the ips_fixed from the xrpld.cfg file
if (!app_.config().standalone() && !app_.config().IPS_FIXED.empty())
{
m_resolver.resolve(

View File

@@ -41,7 +41,7 @@ public:
using microseconds = std::chrono::microseconds;
/**
* Configuration from [perf] section of rippled.cfg.
* Configuration from [perf] section of xrpld.cfg.
*/
struct Setup
{