danicoin/src/daemon/DaemonCommandsHandler.h

73 lines
2.4 KiB
C
Raw Normal View History

2015-05-27 12:08:46 +00:00
// Copyright (c) 2012-2015, The CryptoNote developers, The Bytecoin developers
//
// This file is part of Bytecoin.
//
// Bytecoin is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Bytecoin is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Bytecoin. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "Common/ConsoleHandler.h"
#include <Logging/LoggerRef.h>
#include <Logging/LoggerManager.h>
namespace CryptoNote {
class core;
class node_server;
}
class DaemonCommandsHandler
{
public:
DaemonCommandsHandler(CryptoNote::core& core, CryptoNote::node_server& srv, Logging::LoggerManager& log);
bool start_handling() {
m_consoleHandler.start();
return true;
}
void stop_handling() {
m_consoleHandler.stop();
}
private:
Common::ConsoleHandler m_consoleHandler;
CryptoNote::core& m_core;
CryptoNote::node_server& m_srv;
Logging::LoggerRef logger;
Logging::LoggerManager& m_logManager;
std::string get_commands_str();
bool print_block_by_height(uint64_t height);
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);
};