From ffe89f4426f665f567f623da6ad42701bf092cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Fri, 12 Jan 2024 18:49:26 +0100 Subject: [PATCH] SAMPLE CONFIG --- CMakeLists.txt | 1 + nano/nano_node/CMakeLists.txt | 4 +++- nano/node/cli.cpp | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 378521dc45..23d5376dbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -764,6 +764,7 @@ endif() if(NANO_GUI OR RAIBLOCKS_GUI) install(FILES ${PROJECT_BINARY_DIR}/config-node.toml.sample DESTINATION .) install(FILES ${PROJECT_BINARY_DIR}/config-rpc.toml.sample DESTINATION .) + install(FILES ${PROJECT_BINARY_DIR}/config-log.toml.sample DESTINATION .) if(WIN32) set(PLATFORM_QT_PACKAGES WinExtras) else() diff --git a/nano/nano_node/CMakeLists.txt b/nano/nano_node/CMakeLists.txt index 5da26671ee..48d42d3586 100644 --- a/nano/nano_node/CMakeLists.txt +++ b/nano/nano_node/CMakeLists.txt @@ -18,7 +18,9 @@ add_custom_command( COMMAND nano_node --generate_config node > ${PROJECT_BINARY_DIR}/config-node.toml.sample COMMAND nano_node --generate_config rpc > - ${PROJECT_BINARY_DIR}/config-rpc.toml.sample) + ${PROJECT_BINARY_DIR}/config-rpc.toml.sample + COMMAND nano_node --generate_config log > + ${PROJECT_BINARY_DIR}/config-log.toml.sample) if((NANO_GUI OR RAIBLOCKS_GUI) AND NOT APPLE) if(WIN32) diff --git a/nano/node/cli.cpp b/nano/node/cli.cpp index 9ec0539b4c..50a2a73e36 100644 --- a/nano/node/cli.cpp +++ b/nano/node/cli.cpp @@ -58,7 +58,7 @@ void nano::add_node_options (boost::program_options::options_description & descr ("rebuild_database", "Rebuild LMDB database with vacuum for best compaction") ("migrate_database_lmdb_to_rocksdb", "Migrates LMDB database to RocksDB") ("diagnostics", "Run internal diagnostics") - ("generate_config", boost::program_options::value (), "Write configuration to stdout, populated with defaults suitable for this system. Pass the configuration type node, rpc or tls. See also use_defaults.") + ("generate_config", boost::program_options::value (), "Write configuration to stdout, populated with defaults suitable for this system. Pass the configuration type node, rpc or log. See also use_defaults.") ("key_create", "Generates a adhoc random keypair and prints it to stdout") ("key_expand", "Derive public key and account number from ") ("wallet_add_adhoc", "Insert in to ") @@ -671,6 +671,14 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map nano::rpc_config config{ nano::dev::network_params.network }; config.serialize_toml (toml); } + else if (type == "log") + { + valid_type = true; + nano::log_config config{ nano::log_config::daemon_default () }; + nano::tomlconfig config_toml; + config.serialize (config_toml); + toml.put_child ("log", config_toml); + } else if (type == "tls") { valid_type = true;