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

Print info about network and path, when running daemon #1953

Merged
merged 6 commits into from
Jun 6, 2019
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
5 changes: 5 additions & 0 deletions nano/nano_node/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ void nano_daemon::daemon::run (boost::filesystem::path const & data_path, nano::
auto node (std::make_shared<nano::node> (init, io_ctx, data_path, alarm, config.node, opencl_work, flags));
if (!init.error ())
{
auto network_label = node->network_params.network.get_current_network_as_string ();
auto version = (NANO_VERSION_PATCH == 0) ? NANO_MAJOR_MINOR_VERSION : NANO_MAJOR_MINOR_RC_VERSION;
std::cout << "Network: " << network_label << ", version: " << version << std::endl
<< "Path: " << node->application_path.string () << std::endl;

node->start ();
nano::ipc::ipc_server ipc_server (*node, config.rpc);
#if BOOST_PROCESS_SUPPORTED
Expand Down
4 changes: 4 additions & 0 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ startup_time (std::chrono::steady_clock::now ())
}
});
}

if (NANO_VERSION_PATCH == 0)
{
logger.always_log ("Node starting, version: ", NANO_MAJOR_MINOR_VERSION);
Expand All @@ -414,6 +415,9 @@ startup_time (std::chrono::steady_clock::now ())
logger.always_log ("Node starting, version: ", NANO_MAJOR_MINOR_RC_VERSION);
}

auto network_label = network_params.network.get_current_network_as_string ();
logger.always_log ("Active network: ", network_label);

logger.always_log (boost::str (boost::format ("Work pool running %1% threads") % work.threads.size ()));

if (config.logging.node_lifetime_tracing ())
Expand Down
10 changes: 3 additions & 7 deletions nano/qt/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,10 @@ balance_label (new QLabel),
wallet (wallet_a)
{
your_account_label->setStyleSheet ("font-weight: bold;");
std::string network = "Live";
if (wallet.node.network_params.network.is_beta_network ())
std::string network = wallet.node.network_params.network.get_current_network_as_string ();
if (!network.empty ())
Copy link
Contributor

@wezrule wezrule May 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably unnecessary (overly defensive) as network will always be populated, but it's fine as well.

{
network = "Beta";
}
else if (wallet.node.network_params.network.is_test_network ())
{
network = "Test";
network[0] = std::toupper (network[0]);
}
if (NANO_VERSION_PATCH == 0)
{
Expand Down