Skip to content

Commit

Permalink
Generate sample log config
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 16, 2024
1 parent fc3d406 commit 91944ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion nano/nano_node/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion nano/node/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> (), "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<std::string> (), "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 <key>")
("wallet_add_adhoc", "Insert <key> in to <wallet>")
Expand Down Expand Up @@ -671,6 +671,12 @@ 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 () };
config.serialize_toml (toml);
}
else if (type == "tls")
{
valid_type = true;
Expand Down

0 comments on commit 91944ef

Please sign in to comment.