add --enable-randomx flag

master
moneroexamples 5 years ago
parent 6a85c3f1e6
commit 101203e2bd

@ -160,6 +160,7 @@ xmrblocks, Onion Monero Blockchain Explorer:
-t [ --testnet ] [=arg(=1)] (=0) use testnet blockchain -t [ --testnet ] [=arg(=1)] (=0) use testnet blockchain
-s [ --stagenet ] [=arg(=1)] (=0) use stagenet blockchain -s [ --stagenet ] [=arg(=1)] (=0) use stagenet blockchain
--enable-pusher [=arg(=1)] (=0) enable signed transaction pusher --enable-pusher [=arg(=1)] (=0) enable signed transaction pusher
--enable-randomx [=arg(=1)] (=0) enable generation of randomx code
--enable-mixin-details [=arg(=1)] (=0) --enable-mixin-details [=arg(=1)] (=0)
enable mixin details for key images, enable mixin details for key images,
e.g., timescale, mixin of mixins, in tx e.g., timescale, mixin of mixins, in tx
@ -168,7 +169,9 @@ xmrblocks, Onion Monero Blockchain Explorer:
enable key images file checker enable key images file checker
--enable-output-key-checker [=arg(=1)] (=0) --enable-output-key-checker [=arg(=1)] (=0)
enable outputs key file checker enable outputs key file checker
--enable-json-api [=arg(=1)] (=1) enable JSON REST api --enable-json-api [=arg(=1)] (=0) enable JSON REST api
--enable-as-hex [=arg(=1)] (=0) enable links to provide hex
represtations of a tx and a block
--enable-autorefresh-option [=arg(=1)] (=0) --enable-autorefresh-option [=arg(=1)] (=0)
enable users to have the index page on enable users to have the index page on
autorefresh autorefresh
@ -176,6 +179,7 @@ xmrblocks, Onion Monero Blockchain Explorer:
enable Monero total emission monitoring enable Monero total emission monitoring
thread thread
-p [ --port ] arg (=8081) default explorer port -p [ --port ] arg (=8081) default explorer port
-x [ --bindaddr ] arg (=0.0.0.0) default bind address for the explorer
--testnet-url arg you can specify testnet url, if you run --testnet-url arg you can specify testnet url, if you run
it on mainnet or stagenet. link will it on mainnet or stagenet. link will
show on front page to testnet explorer show on front page to testnet explorer
@ -191,6 +195,9 @@ xmrblocks, Onion Monero Blockchain Explorer:
for mempool data for the front page for mempool data for the front page
--mempool-refresh-time arg (=5) time, in seconds, for each refresh of --mempool-refresh-time arg (=5) time, in seconds, for each refresh of
mempool state mempool state
-c [ --concurrency ] arg (=0) number of threads handling http
queries. Default is 0 which means it is
based you on the cpu
-b [ --bc-path ] arg path to lmdb folder of the blockchain, -b [ --bc-path ] arg path to lmdb folder of the blockchain,
e.g., ~/.bitmonero/lmdb e.g., ~/.bitmonero/lmdb
--ssl-crt-file arg path to crt file for ssl (https) --ssl-crt-file arg path to crt file for ssl (https)
@ -198,7 +205,7 @@ xmrblocks, Onion Monero Blockchain Explorer:
--ssl-key-file arg path to key file for ssl (https) --ssl-key-file arg path to key file for ssl (https)
functionality functionality
-d [ --deamon-url ] arg (=http:://127.0.0.1:18081) -d [ --deamon-url ] arg (=http:://127.0.0.1:18081)
Monero deamon url Monero daemon url
``` ```
Example usage, defined as bash aliases. Example usage, defined as bash aliases.

@ -71,6 +71,7 @@ main(int ac, const char* av[])
auto enable_output_key_checker_opt = opts.get_option<bool>("enable-output-key-checker"); auto enable_output_key_checker_opt = opts.get_option<bool>("enable-output-key-checker");
auto enable_autorefresh_option_opt = opts.get_option<bool>("enable-autorefresh-option"); auto enable_autorefresh_option_opt = opts.get_option<bool>("enable-autorefresh-option");
auto enable_pusher_opt = opts.get_option<bool>("enable-pusher"); auto enable_pusher_opt = opts.get_option<bool>("enable-pusher");
auto enable_randomx_opt = opts.get_option<bool>("enable-randomx");
auto enable_mixin_details_opt = opts.get_option<bool>("enable-mixin-details"); auto enable_mixin_details_opt = opts.get_option<bool>("enable-mixin-details");
auto enable_json_api_opt = opts.get_option<bool>("enable-json-api"); auto enable_json_api_opt = opts.get_option<bool>("enable-json-api");
auto enable_as_hex_opt = opts.get_option<bool>("enable-as-hex"); auto enable_as_hex_opt = opts.get_option<bool>("enable-as-hex");
@ -93,6 +94,7 @@ main(int ac, const char* av[])
cryptonote::network_type::STAGENET : cryptonote::network_type::MAINNET; cryptonote::network_type::STAGENET : cryptonote::network_type::MAINNET;
bool enable_pusher {*enable_pusher_opt}; bool enable_pusher {*enable_pusher_opt};
bool enable_randomx {*enable_randomx_opt};
bool enable_key_image_checker {*enable_key_image_checker_opt}; bool enable_key_image_checker {*enable_key_image_checker_opt};
bool enable_autorefresh_option {*enable_autorefresh_option_opt}; bool enable_autorefresh_option {*enable_autorefresh_option_opt};
bool enable_output_key_checker {*enable_output_key_checker_opt}; bool enable_output_key_checker {*enable_output_key_checker_opt};
@ -269,6 +271,7 @@ main(int ac, const char* av[])
deamon_url, deamon_url,
nettype, nettype,
enable_pusher, enable_pusher,
enable_randomx,
enable_as_hex, enable_as_hex,
enable_key_image_checker, enable_key_image_checker,
enable_output_key_checker, enable_output_key_checker,

@ -29,6 +29,8 @@ namespace xmreg
"use stagenet blockchain") "use stagenet blockchain")
("enable-pusher", value<bool>()->default_value(false)->implicit_value(true), ("enable-pusher", value<bool>()->default_value(false)->implicit_value(true),
"enable signed transaction pusher") "enable signed transaction pusher")
("enable-randomx", value<bool>()->default_value(false)->implicit_value(true),
"enable generation of randomx code")
("enable-mixin-details", value<bool>()->default_value(false)->implicit_value(true), ("enable-mixin-details", value<bool>()->default_value(false)->implicit_value(true),
"enable mixin details for key images, e.g., timescale, mixin of mixins, in tx context") "enable mixin details for key images, e.g., timescale, mixin of mixins, in tx context")
("enable-key-image-checker", value<bool>()->default_value(false)->implicit_value(true), ("enable-key-image-checker", value<bool>()->default_value(false)->implicit_value(true),
@ -68,7 +70,7 @@ namespace xmreg
("ssl-key-file", value<string>(), ("ssl-key-file", value<string>(),
"path to key file for ssl (https) functionality") "path to key file for ssl (https) functionality")
("deamon-url,d", value<string>()->default_value("http:://127.0.0.1:18081"), ("deamon-url,d", value<string>()->default_value("http:://127.0.0.1:18081"),
"Monero deamon url"); "Monero daemon url");
store(command_line_parser(acc, avv) store(command_line_parser(acc, avv)

@ -474,6 +474,8 @@ bool stagenet;
bool enable_pusher; bool enable_pusher;
bool enable_randomx;
bool enable_key_image_checker; bool enable_key_image_checker;
bool enable_output_key_checker; bool enable_output_key_checker;
bool enable_mixins_details; bool enable_mixins_details;
@ -506,6 +508,7 @@ page(MicroCore* _mcore,
string _deamon_url, string _deamon_url,
cryptonote::network_type _nettype, cryptonote::network_type _nettype,
bool _enable_pusher, bool _enable_pusher,
bool _enable_randomx,
bool _enable_as_hex, bool _enable_as_hex,
bool _enable_key_image_checker, bool _enable_key_image_checker,
bool _enable_output_key_checker, bool _enable_output_key_checker,
@ -522,6 +525,7 @@ page(MicroCore* _mcore,
server_timestamp {std::time(nullptr)}, server_timestamp {std::time(nullptr)},
nettype {_nettype}, nettype {_nettype},
enable_pusher {_enable_pusher}, enable_pusher {_enable_pusher},
enable_randomx {_enable_randomx},
enable_as_hex {_enable_as_hex}, enable_as_hex {_enable_as_hex},
enable_key_image_checker {_enable_key_image_checker}, enable_key_image_checker {_enable_key_image_checker},
enable_output_key_checker {_enable_output_key_checker}, enable_output_key_checker {_enable_output_key_checker},
@ -1139,7 +1143,8 @@ show_block(uint64_t _blk_height)
{"delta_time" , delta_time}, {"delta_time" , delta_time},
{"blk_nonce" , blk.nonce}, {"blk_nonce" , blk.nonce},
{"blk_pow_hash" , blk_pow_hash_str}, {"blk_pow_hash" , blk_pow_hash_str},
{"is_randomx" , (blk.major_version >= 12)}, {"is_randomx" , (blk.major_version >= 12
&& enable_randomx == true)},
{"blk_difficulty" , blk_difficulty.str()}, {"blk_difficulty" , blk_difficulty.str()},
{"age_format" , age.second}, {"age_format" , age.second},
{"major_ver" , std::to_string(blk.major_version)}, {"major_ver" , std::to_string(blk.major_version)},
@ -1242,6 +1247,12 @@ show_block(string _blk_hash)
string string
show_randomx(uint64_t _blk_height) show_randomx(uint64_t _blk_height)
{ {
if (enable_randomx == false)
{
return "RandomX code generation disabled! Use --enable-randomx"
" flag to enable if.";
}
// get block at the given height i // get block at the given height i
block blk; block blk;

Loading…
Cancel
Save