2016-01-18 15:33:29 +00:00
|
|
|
// Copyright (c) 2011-2016 The Cryptonote developers
|
2015-09-18 11:55:31 +00:00
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2015-05-27 12:08:46 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Common/ConsoleHandler.h"
|
|
|
|
|
|
|
|
#include <Logging/LoggerRef.h>
|
|
|
|
#include <Logging/LoggerManager.h>
|
|
|
|
|
|
|
|
namespace CryptoNote {
|
|
|
|
class core;
|
2015-07-30 15:22:07 +00:00
|
|
|
class NodeServer;
|
2015-05-27 12:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class DaemonCommandsHandler
|
|
|
|
{
|
|
|
|
public:
|
2015-07-30 15:22:07 +00:00
|
|
|
DaemonCommandsHandler(CryptoNote::core& core, CryptoNote::NodeServer& srv, Logging::LoggerManager& log);
|
2015-05-27 12:08:46 +00:00
|
|
|
|
|
|
|
bool start_handling() {
|
|
|
|
m_consoleHandler.start();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void stop_handling() {
|
|
|
|
m_consoleHandler.stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Common::ConsoleHandler m_consoleHandler;
|
|
|
|
CryptoNote::core& m_core;
|
2015-07-30 15:22:07 +00:00
|
|
|
CryptoNote::NodeServer& m_srv;
|
2015-05-27 12:08:46 +00:00
|
|
|
Logging::LoggerRef logger;
|
|
|
|
Logging::LoggerManager& m_logManager;
|
|
|
|
|
|
|
|
std::string get_commands_str();
|
2015-07-30 15:22:07 +00:00
|
|
|
bool print_block_by_height(uint32_t height);
|
2015-05-27 12:08:46 +00:00
|
|
|
bool print_block_by_hash(const std::string& arg);
|
|
|
|
|
|
|
|
bool exit(const std::vector<std::string>& args);
|
|
|
|
bool help(const std::vector<std::string>& args);
|
|
|
|
bool print_pl(const std::vector<std::string>& args);
|
|
|
|
bool show_hr(const std::vector<std::string>& args);
|
|
|
|
bool hide_hr(const std::vector<std::string>& args);
|
|
|
|
bool print_bc_outs(const std::vector<std::string>& args);
|
|
|
|
bool print_cn(const std::vector<std::string>& args);
|
|
|
|
bool print_bc(const std::vector<std::string>& args);
|
|
|
|
bool print_bci(const std::vector<std::string>& args);
|
|
|
|
bool set_log(const std::vector<std::string>& args);
|
|
|
|
bool print_block(const std::vector<std::string>& args);
|
|
|
|
bool print_tx(const std::vector<std::string>& args);
|
|
|
|
bool print_pool(const std::vector<std::string>& args);
|
|
|
|
bool print_pool_sh(const std::vector<std::string>& args);
|
|
|
|
bool start_mining(const std::vector<std::string>& args);
|
|
|
|
bool stop_mining(const std::vector<std::string>& args);
|
|
|
|
};
|