Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpcdaemon: fix position of logs folder #1900

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions silkworm/rpc/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,20 +305,22 @@ void Daemon::start() {
end_point, api_spec, ioc, worker_pool_, settings_.cors_domain, std::move(jwt_secret),
settings_.use_websocket, settings_.ws_compression, std::move(ilog_settings));
};
auto set_container_folder = [](InterfaceLogSettings& ilog_settings, const std::filesystem::path& datadir) {
ilog_settings.container_folder = datadir / ilog_settings.container_folder;
};

// Put the interface logs into the data folder
std::filesystem::path data_folder{};
if (chaindata_env_) {
data_folder = chaindata_env_->get_path().parent_path();
auto chaindata_path{chaindata_env_->get_path()};
// Trick to remove any empty filename because MDBX chaindata path ends with '/'
if (chaindata_path.filename().empty()) {
chaindata_path = chaindata_path.parent_path();
}
data_folder = chaindata_path.parent_path();
}
if (settings_.datadir) {
data_folder = *settings_.datadir;
}
set_container_folder(settings_.eth_ifc_log_settings, data_folder);
set_container_folder(settings_.engine_ifc_log_settings, data_folder);
settings_.eth_ifc_log_settings.container_folder = data_folder / settings_.eth_ifc_log_settings.container_folder;
settings_.engine_ifc_log_settings.container_folder = data_folder / settings_.engine_ifc_log_settings.container_folder;

// Create and start the configured RPC services for each execution context
for (std::size_t i{0}; i < settings_.context_pool_settings.num_contexts; ++i) {
Expand Down
Loading