Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
rpc_command_executor.h
Go to the documentation of this file.
1
8
9
// Copyrights(c) 2017-2021, The Electroneum Project
10
// Copyrights(c) 2014-2019, The Monero Project
11
//
12
// All rights reserved.
13
//
14
// Redistribution and use in source and binary forms, with or without modification, are
15
// permitted provided that the following conditions are met:
16
//
17
// 1. Redistributions of source code must retain the above copyright notice, this list of
18
// conditions and the following disclaimer.
19
//
20
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
21
// of conditions and the following disclaimer in the documentation and/or other
22
// materials provided with the distribution.
23
//
24
// 3. Neither the name of the copyright holder nor the names of its contributors may be
25
// used to endorse or promote products derived from this software without specific
26
// prior written permission.
27
//
28
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
29
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
31
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
36
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
//
38
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
39
40
#pragma once
41
42
#include <boost/optional/optional_fwd.hpp>
43
44
#include "
common/common_fwd.h
"
45
#include "
common/rpc_client.h
"
46
#include "
cryptonote_basic/cryptonote_basic.h
"
47
#include "
net/net_fwd.h
"
48
#include "
rpc/core_rpc_server.h
"
49
50
#undef ELECTRONEUM_DEFAULT_LOG_CATEGORY
51
#define ELECTRONEUM_DEFAULT_LOG_CATEGORY "daemon"
52
53
namespace
daemonize
{
54
55
class
t_rpc_command_executor
final {
56
private
:
57
tools::t_rpc_client
* m_rpc_client;
58
cryptonote::core_rpc_server
* m_rpc_server;
59
bool
m_is_rpc;
60
61
public
:
62
t_rpc_command_executor
(
63
uint32_t
ip
64
,
uint16_t
port
65
,
const
boost::optional<tools::login>& user
66
,
const
epee::net_utils::ssl_options_t
& ssl_options
67
,
bool
is_rpc =
true
68
,
cryptonote::core_rpc_server
* rpc_server = NULL
69
);
70
71
~t_rpc_command_executor
();
72
73
bool
print_peer_list
(
bool
white =
true
,
bool
gray =
true
,
size_t
limit = 0);
74
75
bool
print_peer_list_stats
();
76
77
bool
save_blockchain
();
78
79
bool
show_hash_rate
();
80
81
bool
hide_hash_rate
();
82
83
bool
show_difficulty
();
84
85
bool
show_status
();
86
87
bool
print_connections
();
88
89
bool
print_blockchain_info
(
uint64_t
start_block_index,
uint64_t
end_block_index);
90
91
bool
set_log_level
(
int8_t
level);
92
93
bool
set_log_categories
(
const
std::string &categories);
94
95
bool
print_height
();
96
97
bool
print_block_by_hash
(
crypto::hash
block_hash,
bool
include_hex);
98
99
bool
print_block_by_height
(
uint64_t
height
,
bool
include_hex);
100
101
bool
print_transaction
(
crypto::hash
transaction_hash,
bool
include_hex,
bool
include_json);
102
103
bool
is_key_image_spent
(
const
crypto::key_image
&ki);
104
105
bool
is_public_output_spent
(
const
cryptonote::txin_to_key_public
& txin);
106
107
bool
print_transaction_pool_long
();
108
109
bool
print_transaction_pool_short
();
110
111
bool
print_transaction_pool_stats
();
112
113
bool
start_mining
(
cryptonote::account_public_address
address
,
uint64_t
num_threads,
cryptonote::network_type
nettype,
bool
do_background_mining =
false
,
bool
ignore_battery =
false
);
114
115
bool
stop_mining
();
116
117
bool
mining_status
();
118
119
bool
stop_daemon
();
120
121
bool
print_status
();
122
123
bool
get_limit
();
124
125
bool
get_limit_up
();
126
127
bool
get_limit_down
();
128
129
bool
set_limit
(
int64_t
limit_down,
int64_t
limit_up);
130
131
bool
out_peers
(
uint64_t
limit);
132
133
bool
in_peers
(
uint64_t
limit);
134
135
bool
start_save_graph
();
136
137
bool
stop_save_graph
();
138
139
bool
hard_fork_info
(
uint8_t
version
);
140
141
bool
print_bans
();
142
143
bool
ban
(
const
std::string &ip, time_t seconds);
144
145
bool
unban
(
const
std::string &ip);
146
147
bool
flush_txpool
(
const
std::string &txid);
148
149
bool
output_histogram
(
const
std::vector<uint64_t> &amounts,
uint64_t
min_count,
uint64_t
max_count);
150
151
bool
print_coinbase_tx_sum
(
uint64_t
height
,
uint64_t
count);
152
153
bool
alt_chain_info
(
const
std::string &tip);
154
155
bool
print_blockchain_dynamic_stats
(
uint64_t
nblocks);
156
157
bool
update
(
const
std::string &command);
158
159
bool
relay_tx
(
const
std::string &txid);
160
161
bool
sync_info
();
162
163
bool
pop_blocks
(
uint64_t
num_blocks
);
164
165
bool
prune_blockchain
();
166
167
bool
check_blockchain_pruning
();
168
169
bool
print_net_stats
();
170
171
bool
set_validator_key
(
const
std::string &
key
);
172
173
bool
generate_ed25519_keypair
();
174
175
bool
sign_message
(
const
std::string
privateKey
,
const
std::string
message
);
176
};
177
178
}
// namespace daemonize
height
uint64_t height
Definition
blockchain.cpp:91
version
uint8_t version
Definition
blockchain.cpp:90
num_blocks
uint64_t num_blocks(const std::vector< test_event_entry > &events)
Definition
chaingen.cpp:1044
cryptonote::core_rpc_server
Definition
core_rpc_server.h:59
daemonize::t_rpc_command_executor::stop_save_graph
bool stop_save_graph()
Definition
rpc_command_executor.cpp:1598
daemonize::t_rpc_command_executor::print_status
bool print_status()
Definition
rpc_command_executor.cpp:1374
daemonize::t_rpc_command_executor::print_height
bool print_height()
Definition
rpc_command_executor.cpp:792
daemonize::t_rpc_command_executor::set_limit
bool set_limit(int64_t limit_down, int64_t limit_up)
Definition
rpc_command_executor.cpp:1422
daemonize::t_rpc_command_executor::check_blockchain_pruning
bool check_blockchain_pruning()
Definition
rpc_command_executor.cpp:2280
daemonize::t_rpc_command_executor::is_public_output_spent
bool is_public_output_spent(const cryptonote::txin_to_key_public &txin)
Definition
rpc_command_executor.cpp:1017
daemonize::t_rpc_command_executor::get_limit_up
bool get_limit_up()
Definition
rpc_command_executor.cpp:1453
daemonize::t_rpc_command_executor::ban
bool ban(const std::string &ip, time_t seconds)
Definition
rpc_command_executor.cpp:1689
daemonize::t_rpc_command_executor::is_key_image_spent
bool is_key_image_spent(const crypto::key_image &ki)
Definition
rpc_command_executor.cpp:981
daemonize::t_rpc_command_executor::hide_hash_rate
bool hide_hash_rate()
Definition
rpc_command_executor.cpp:289
daemonize::t_rpc_command_executor::print_transaction_pool_stats
bool print_transaction_pool_stats()
Definition
rpc_command_executor.cpp:1192
daemonize::t_rpc_command_executor::output_histogram
bool output_histogram(const std::vector< uint64_t > &amounts, uint64_t min_count, uint64_t max_count)
Definition
rpc_command_executor.cpp:1791
daemonize::t_rpc_command_executor::print_block_by_height
bool print_block_by_height(uint64_t height, bool include_hex)
Definition
rpc_command_executor.cpp:853
daemonize::t_rpc_command_executor::get_limit
bool get_limit()
Definition
rpc_command_executor.cpp:1394
daemonize::t_rpc_command_executor::show_difficulty
bool show_difficulty()
Definition
rpc_command_executor.cpp:317
daemonize::t_rpc_command_executor::prune_blockchain
bool prune_blockchain()
Definition
rpc_command_executor.cpp:2251
daemonize::t_rpc_command_executor::print_transaction
bool print_transaction(crypto::hash transaction_hash, bool include_hex, bool include_json)
Definition
rpc_command_executor.cpp:887
daemonize::t_rpc_command_executor::print_transaction_pool_short
bool print_transaction_pool_short()
Definition
rpc_command_executor.cpp:1140
daemonize::t_rpc_command_executor::get_limit_down
bool get_limit_down()
Definition
rpc_command_executor.cpp:1480
daemonize::t_rpc_command_executor::print_blockchain_info
bool print_blockchain_info(uint64_t start_block_index, uint64_t end_block_index)
Definition
rpc_command_executor.cpp:692
daemonize::t_rpc_command_executor::hard_fork_info
bool hard_fork_info(uint8_t version)
Definition
rpc_command_executor.cpp:1624
daemonize::t_rpc_command_executor::print_connections
bool print_connections()
Definition
rpc_command_executor.cpp:568
daemonize::t_rpc_command_executor::print_peer_list_stats
bool print_peer_list_stats()
Definition
rpc_command_executor.cpp:207
daemonize::t_rpc_command_executor::show_hash_rate
bool show_hash_rate()
Definition
rpc_command_executor.cpp:262
daemonize::t_rpc_command_executor::alt_chain_info
bool alt_chain_info(const std::string &tip)
Definition
rpc_command_executor.cpp:1865
daemonize::t_rpc_command_executor::set_validator_key
bool set_validator_key(const std::string &key)
Definition
rpc_command_executor.cpp:2227
daemonize::t_rpc_command_executor::show_status
bool show_status()
Definition
rpc_command_executor.cpp:389
daemonize::t_rpc_command_executor::t_rpc_command_executor
t_rpc_command_executor(uint32_t ip, uint16_t port, const boost::optional< tools::login > &user, const epee::net_utils::ssl_options_t &ssl_options, bool is_rpc=true, cryptonote::core_rpc_server *rpc_server=NULL)
Definition
rpc_command_executor.cpp:127
daemonize::t_rpc_command_executor::stop_daemon
bool stop_daemon()
Definition
rpc_command_executor.cpp:1332
daemonize::t_rpc_command_executor::print_bans
bool print_bans()
Definition
rpc_command_executor.cpp:1657
daemonize::t_rpc_command_executor::sign_message
bool sign_message(const std::string privateKey, const std::string message)
Definition
rpc_command_executor.cpp:2339
daemonize::t_rpc_command_executor::print_transaction_pool_long
bool print_transaction_pool_long()
Definition
rpc_command_executor.cpp:1057
daemonize::t_rpc_command_executor::generate_ed25519_keypair
bool generate_ed25519_keypair()
Definition
rpc_command_executor.cpp:2316
daemonize::t_rpc_command_executor::print_blockchain_dynamic_stats
bool print_blockchain_dynamic_stats(uint64_t nblocks)
Definition
rpc_command_executor.cpp:1930
daemonize::t_rpc_command_executor::set_log_level
bool set_log_level(int8_t level)
Definition
rpc_command_executor.cpp:736
daemonize::t_rpc_command_executor::in_peers
bool in_peers(uint64_t limit)
Definition
rpc_command_executor.cpp:1539
daemonize::t_rpc_command_executor::start_mining
bool start_mining(cryptonote::account_public_address address, uint64_t num_threads, cryptonote::network_type nettype, bool do_background_mining=false, bool ignore_battery=false)
Definition
rpc_command_executor.cpp:1277
daemonize::t_rpc_command_executor::start_save_graph
bool start_save_graph()
Definition
rpc_command_executor.cpp:1571
daemonize::t_rpc_command_executor::unban
bool unban(const std::string &ip)
Definition
rpc_command_executor.cpp:1725
daemonize::t_rpc_command_executor::print_coinbase_tx_sum
bool print_coinbase_tx_sum(uint64_t height, uint64_t count)
Definition
rpc_command_executor.cpp:1830
daemonize::t_rpc_command_executor::print_peer_list
bool print_peer_list(bool white=true, bool gray=true, size_t limit=0)
Definition
rpc_command_executor.cpp:163
daemonize::t_rpc_command_executor::pop_blocks
bool pop_blocks(uint64_t num_blocks)
Definition
rpc_command_executor.cpp:2200
daemonize::t_rpc_command_executor::mining_status
bool mining_status()
Definition
rpc_command_executor.cpp:492
daemonize::t_rpc_command_executor::update
bool update(const std::string &command)
Definition
rpc_command_executor.cpp:2051
daemonize::t_rpc_command_executor::sync_info
bool sync_info()
Definition
rpc_command_executor.cpp:2132
daemonize::t_rpc_command_executor::print_net_stats
bool print_net_stats()
Definition
rpc_command_executor.cpp:632
daemonize::t_rpc_command_executor::set_log_categories
bool set_log_categories(const std::string &categories)
Definition
rpc_command_executor.cpp:764
daemonize::t_rpc_command_executor::flush_txpool
bool flush_txpool(const std::string &txid)
Definition
rpc_command_executor.cpp:1761
daemonize::t_rpc_command_executor::relay_tx
bool relay_tx(const std::string &txid)
Definition
rpc_command_executor.cpp:2103
daemonize::t_rpc_command_executor::save_blockchain
bool save_blockchain()
Definition
rpc_command_executor.cpp:235
daemonize::t_rpc_command_executor::out_peers
bool out_peers(uint64_t limit)
Definition
rpc_command_executor.cpp:1507
daemonize::t_rpc_command_executor::stop_mining
bool stop_mining()
Definition
rpc_command_executor.cpp:1306
daemonize::t_rpc_command_executor::print_block_by_hash
bool print_block_by_hash(crypto::hash block_hash, bool include_hex)
Definition
rpc_command_executor.cpp:819
daemonize::t_rpc_command_executor::~t_rpc_command_executor
~t_rpc_command_executor()
Definition
rpc_command_executor.cpp:155
epee::net_utils::ssl_options_t
Definition
net_ssl.h:74
tools::t_rpc_client
Definition
rpc_client.h:46
common_fwd.h
core_rpc_server.h
cryptonote_basic.h
privateKey
std::string privateKey
Definition
delegated_pow.cpp:8
message
std::string message("Message requiring signing")
key
const char * key
Definition
hmac_keccak.cpp:39
crypto::key_image
POD_CLASS key_image
Definition
crypto.h:105
crypto::hash
POD_CLASS hash
Definition
hash.h:50
cryptonote::network_type
network_type
Definition
cryptonote_config.h:247
daemonize
Definition
command_parser_executor.cpp:38
net_fwd.h
rpc_client.h
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
int64_t
signed __int64 int64_t
Definition
stdint.h:135
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
uint64_t
unsigned __int64 uint64_t
Definition
stdint.h:136
int8_t
signed char int8_t
Definition
stdint.h:121
cryptonote::account_public_address
Definition
cryptonote_basic.h:75
cryptonote::txin_to_key_public
Definition
cryptonote_basic.h:211
address
const char * address
Definition
multisig.cpp:37
src
daemon
rpc_command_executor.h
Generated on
for Electroneum by
1.17.0