Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 15 additions & 3 deletions client/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,24 @@ int main(int argc, char* argv[]) {
}
}

// The snapshot commands end before Peer sets the logger up. Without it Boost.Log prints every
// record of the import, hundreds of thousands of debug and trace lines, to the console: the
// configured levels apply to them as to a running node.
const bool snapshotCommand = vm.count("download-snapshot") > 0 || vm.count("import-snapshot") > 0 || vm.count("export-snapshot") > 0;
if (snapshotCommand) {
logger::initialize(config.getLoggerSettings());
}
auto finishCommand = [](int code) {
logger::cleanup();
return code;
};

// no keys needed: the import writes only the database, the caches and the checkpoint
if (vm.count("download-snapshot") > 0) {
return snapshot_export::runDownload(config, vm["download-snapshot"].as<std::string>());
return finishCommand(snapshot_export::runDownload(config, vm["download-snapshot"].as<std::string>()));
}
if (vm.count("import-snapshot") > 0) {
return snapshot_export::runImport(config, vm["import-snapshot"].as<std::string>());
return finishCommand(snapshot_export::runImport(config, vm["import-snapshot"].as<std::string>()));
}

if (vm.count(cmdline::argSeed) == 0) {
Expand All @@ -242,7 +254,7 @@ int main(int argc, char* argv[]) {
}

if (vm.count("export-snapshot") > 0) {
return snapshot_export::run(config, vm["export-snapshot"].as<std::string>());
return finishCommand(snapshot_export::run(config, vm["export-snapshot"].as<std::string>()));
}

if (vm.count(cmdline::argDumpKeys) > 0) {
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ lines under the new release.
| #114 | the node builds and passes its tests on Windows (MSVC, x64) and macOS (Apple Silicon): POSIX-only code behind `lib/system/platform.hpp`, the database lock now also on Windows, a new `build-platforms.yml` workflow; the release workflow also makes a Windows `.zip` and a macOS package (with Eclipse Temurin 11), kept as artifacts until a mainnet state-digest check on each system |
| #115 | Windows and macOS nodes load the checkpoints and snapshots of Linux and sync mainnet with the same state digests: the binary checkpoint header records `long` as 8 bytes on every system (`cs::ArchiveOutput`, read back by `cs::ArchiveInput`), checkpoint text files are read and written in binary mode, macOS Boost is built as C++17; `Transport` releases the routing table with the p2p host, fixing a use-after-free at exit (a crash on macOS); a platform consensus check in CI |
| #116 | snapshot: `node --survey-snapshots [seconds]` asks the neighbours for the snapshots they serve without opening the chain and prints what they declared; the weekly known-hosts job turns it into `snapshots.md` and `snapshot_sources.txt` (shipped in the packages when present) |
| #117 | client: `--download-snapshot`, `--import-snapshot` and `--export-snapshot` start the logger with the configured levels; they printed every debug and trace record of the import to the console (about 684,000 lines for one `--download-snapshot`, the Docker first start included) |

## community.13 — 2026-10-26

Expand Down
Loading