From 0c8823074a6a639937a4f8d9e107894d992cae24 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 16 Aug 2021 17:45:20 +0800 Subject: [PATCH 01/24] cryptonote_format_utils_basic added to CMakeLists --- CMakeLists.txt | 3 ++- cmake/FindMonero.cmake | 7 +++++++ src/page.h | 9 ++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70d3c7d..5959be9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,8 +143,9 @@ set(LIBRARIES device ${WALLET_CRYPTO} cryptonote_core - cryptonote_protocol cryptonote_basic + cryptonote_format_utils_basic + cryptonote_protocol multisig daemonizer blocks diff --git a/cmake/FindMonero.cmake b/cmake/FindMonero.cmake index f9b73ae..5fdaa6b 100644 --- a/cmake/FindMonero.cmake +++ b/cmake/FindMonero.cmake @@ -67,6 +67,13 @@ if (EXISTS ${MONERO_BUILD_DIR}/src/ringct/libringct_basic.a) PROPERTY IMPORTED_LOCATION ${MONERO_BUILD_DIR}/src/ringct/libringct_basic.a) endif() +if (EXISTS ${MONERO_BUILD_DIR}/src/cryptonote_basic/libcryptonote_format_utils_basic.a) + message(STATUS FindMonero " found libcryptonote_format_utils_basic.a") + add_library(cryptonote_format_utils_basic STATIC IMPORTED) + set_property(TARGET cryptonote_format_utils_basic + PROPERTY IMPORTED_LOCATION ${MONERO_BUILD_DIR}/src/cryptonote_basic/libcryptonote_format_utils_basic.a) +endif() + message(STATUS ${MONERO_SOURCE_DIR}/build) diff --git a/src/page.h b/src/page.h index dbd513f..9a1e400 100644 --- a/src/page.h +++ b/src/page.h @@ -1446,7 +1446,8 @@ show_block_hex(size_t block_height, bool complete_blk) return string {"Failed to obtain complete block data "}; } - std::string complete_block_data_str; + //epee::byte_slice complete_block_data_slice; + std::string complete_block_data_str; if(!epee::serialization::store_t_to_binary( complete_block_data, complete_block_data_str)) @@ -1455,6 +1456,12 @@ show_block_hex(size_t block_height, bool complete_blk) return string {"Failed to obtain complete block data"}; } + //std::string block_data_str( + // complete_block_data_slice.begin(), + // complete_block_data_slice.end()); + + //return epee::string_tools + // ::buff_to_hex_nodelimer(block_data_str); return epee::string_tools ::buff_to_hex_nodelimer(complete_block_data_str); } From be9eaed846661e374412156b7d721a957f3c35ba Mon Sep 17 00:00:00 2001 From: Victor Unegbu Date: Sun, 11 Apr 2021 00:13:07 -0500 Subject: [PATCH 02/24] dockerized xmrblocks --- Dockerfile | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..880581e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:20.04 as builder + +ENV DEBIAN_FRONTEND="noninteractive" + +RUN apt-get update && apt install -y --no-install-recommends \ + git \ + build-essential \ + cmake \ + miniupnpc \ + graphviz \ + doxygen \ + pkg-config \ + ca-certificates \ + zip \ + libboost-all-dev \ + libunbound-dev \ + libunwind8-dev \ + libssl-dev \ + libcurl4-openssl-dev \ + libgtest-dev \ + libreadline-dev \ + libzmq3-dev \ + libsodium-dev \ + libhidapi-dev \ + libhidapi-libusb0 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /root + +RUN git clone --recursive -b release-v0.17 https://github.com/monero-project/monero.git \ + && cd monero \ + && USE_SINGLE_BUILDDIR=1 make + +COPY . /root/onion-monero-blockchain-explorer/ +WORKDIR /root/onion-monero-blockchain-explorer/build +RUN cmake .. +RUN make + +# use ldd and awk to bundle up dynamic libraries for the final image +RUN zip /lib.zip $(ldd xmrblocks | grep -E '/[^\ ]*' -o) + +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND="noninteractive" +RUN apt-get update && apt-get install -y --no-install-recommends \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /lib.zip . +RUN unzip -o lib.zip && rm -rf lib.zip + +RUN useradd -ms /bin/bash monero \ + && mkdir -p /home/monero/.bitmonero \ + && chown -R monero:monero /home/monero/.bitmonero +USER monero +WORKDIR /home/monero + +COPY --chown=monero:monero --from=builder /root/onion-monero-blockchain-explorer/build/xmrblocks . +COPY --chown=monero:monero --from=builder /root/onion-monero-blockchain-explorer/build/templates ./templates/ + +VOLUME /home/monero/.bitmonero +EXPOSE 8081 + +ENTRYPOINT ["/bin/sh", "-c", "./xmrblocks"] From 3bb3611191f328b3bd97ff04b1aadc9d0a43c0eb Mon Sep 17 00:00:00 2001 From: Victor Unegbu Date: Sun, 26 Sep 2021 17:29:33 -0500 Subject: [PATCH 03/24] Update README.md with docker usage --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 72d18cc..0f4a4c0 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,42 @@ Example output: Go to your browser: http://127.0.0.1:8081 +## Compiling and running with Docker + +The explorer can also be compiled using `docker build` as follows: + +``` +docker build --no-cache -t xmrblocks . +``` + +- Wait one hour or more +- The build needs 3 GB space. +- The final container image is ~200MB + +To run it, mount the monero blockchain onto the container as volume. + +``` +# either run in foreground +docker run -it \ + -v xmrdata:/home/monero/.bitmonero \ + -p 8081:8081 \ + xmrblocks + +# or in background +docker run -it -d \ + -v xmrdata:/home/monero/.bitmonero \ + -p 8081:8081 \ + xmrblocks +``` + +Example output: + +``` +[ec2-user@ip-10-0-0-1 ~]$ docker run --rm -it -v xmrdata:/home/monero/.bitmonero xmrblocks +Staring in non-ssl mode +(2020-04-20 16:20:00) [INFO ] Crow/0.1 server is running at 0.0.0.0:8081 using 1 threads +``` + ## The explorer's command line options ``` From a3e57af718fb79465ecc94f61f09536334bce9b0 Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Fri, 19 Nov 2021 20:22:07 +0000 Subject: [PATCH 04/24] Correct misspelling of "daemon" for "daemon-url" Just a simple fix, as "daemon" was misspelled "deamon", even in the flag/arg. --- main.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.cpp b/main.cpp index 016363f..2d823d4 100644 --- a/main.cpp +++ b/main.cpp @@ -56,7 +56,7 @@ main(int ac, const char* av[]) auto port_opt = opts.get_option("port"); auto bindaddr_opt = opts.get_option("bindaddr"); auto bc_path_opt = opts.get_option("bc-path"); - auto deamon_url_opt = opts.get_option("deamon-url"); + auto daemon_url_opt = opts.get_option("daemon-url"); auto ssl_crt_file_opt = opts.get_option("ssl-crt-file"); auto ssl_key_file_opt = opts.get_option("ssl-key-file"); auto no_blocks_on_index_opt = opts.get_option("no-blocks-on-index"); @@ -205,12 +205,12 @@ main(int ac, const char* av[]) return EXIT_FAILURE; } - string deamon_url {*deamon_url_opt}; + string daemon_url {*daemon_url_opt}; - if (testnet && deamon_url == "http:://127.0.0.1:18081") - deamon_url = "http:://127.0.0.1:28081"; - if (stagenet && deamon_url == "http:://127.0.0.1:18081") - deamon_url = "http:://127.0.0.1:38081"; + if (testnet && daemon_url == "http:://127.0.0.1:18081") + daemon_url = "http:://127.0.0.1:28081"; + if (stagenet && daemon_url == "http:://127.0.0.1:18081") + daemon_url = "http:://127.0.0.1:38081"; uint64_t mempool_info_timeout {5000}; @@ -247,8 +247,8 @@ main(int ac, const char* av[]) = blockchain_path; xmreg::CurrentBlockchainStatus::nettype = nettype; - xmreg::CurrentBlockchainStatus::deamon_url - = deamon_url; + xmreg::CurrentBlockchainStatus::daemon_url + = daemon_url; xmreg::CurrentBlockchainStatus::set_blockchain_variables( &mcore, core_storage); @@ -264,8 +264,8 @@ main(int ac, const char* av[]) = blockchain_path; xmreg::MempoolStatus::nettype = nettype; - xmreg::MempoolStatus::deamon_url - = deamon_url; + xmreg::MempoolStatus::daemon_url + = daemon_url; xmreg::MempoolStatus::login = daemon_rpc_login; xmreg::MempoolStatus::set_blockchain_variables( @@ -299,7 +299,7 @@ main(int ac, const char* av[]) // contains logic for the website xmreg::page xmrblocks(&mcore, core_storage, - deamon_url, + daemon_url, nettype, enable_pusher, enable_randomx, From 9324140d0ed1f2a575810da2e1a25fcec765a038 Mon Sep 17 00:00:00 2001 From: sethsimmons Date: Fri, 19 Nov 2021 15:36:10 -0500 Subject: [PATCH 05/24] Comment and optimize Dockerfile --- Dockerfile | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 880581e..66572d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ +# Use ubuntu:20.04 as base for builder stage image FROM ubuntu:20.04 as builder +# Set Monero branch/tag to be used for monerod compilation +ARG MONERO_BRANCH=release-v0.17 + +# Added DEBIAN_FRONTEND=noninteractive to workaround tzdata prompt on installation ENV DEBIAN_FRONTEND="noninteractive" +# Install dependencies for monerod and xmrblocks compilation RUN apt-get update && apt install -y --no-install-recommends \ git \ build-essential \ @@ -23,42 +29,65 @@ RUN apt-get update && apt install -y --no-install-recommends \ libsodium-dev \ libhidapi-dev \ libhidapi-libusb0 \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# Set compilation environment variables +ENV CFLAGS='-fPIC' +ENV CXXFLAGS='-fPIC' +ENV USE_SINGLE_BUILDDIR 1 +ENV BOOST_DEBUG 1 + WORKDIR /root -RUN git clone --recursive -b release-v0.17 https://github.com/monero-project/monero.git \ +# Clone and compile monerod with all available threads +ARG MONERO_BRANCH +ARG NPROC +RUN git clone --recursive --branch ${MONERO_BRANCH} https://github.com/monero-project/monero.git \ && cd monero \ - && USE_SINGLE_BUILDDIR=1 make + && test -z "$NPROC" && nproc > /nproc || echo -n "$NPROC" > /nproc && make -j"$(cat /nproc)" +# Copy and cmake xmrblocks COPY . /root/onion-monero-blockchain-explorer/ WORKDIR /root/onion-monero-blockchain-explorer/build RUN cmake .. -RUN make -# use ldd and awk to bundle up dynamic libraries for the final image +# Compile xmrblocks with all available threads +RUN test -z "$NPROC" && nproc > /nproc || echo -n "$NPROC" > /nproc && make -j"$(cat /nproc)" + +# Use ldd and awk to bundle up dynamic libraries for the final image RUN zip /lib.zip $(ldd xmrblocks | grep -E '/[^\ ]*' -o) +# Use ubuntu:20.04 as base for final image FROM ubuntu:20.04 +# Added DEBIAN_FRONTEND=noninteractive to workaround tzdata prompt on installation ENV DEBIAN_FRONTEND="noninteractive" + +# Install unzip to handle bundled libs from builder stage RUN apt-get update && apt-get install -y --no-install-recommends \ unzip \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /lib.zip . RUN unzip -o lib.zip && rm -rf lib.zip +# Add user and setup directories for monerod and xmrblocks RUN useradd -ms /bin/bash monero \ && mkdir -p /home/monero/.bitmonero \ && chown -R monero:monero /home/monero/.bitmonero USER monero -WORKDIR /home/monero +# Switch to home directory and install newly built xmrblocks binary +WORKDIR /home/monero COPY --chown=monero:monero --from=builder /root/onion-monero-blockchain-explorer/build/xmrblocks . COPY --chown=monero:monero --from=builder /root/onion-monero-blockchain-explorer/build/templates ./templates/ +# Expose volume used for lmdb access by xmrblocks VOLUME /home/monero/.bitmonero + +# Expose default explorer http port EXPOSE 8081 ENTRYPOINT ["/bin/sh", "-c", "./xmrblocks"] From 9dab408094f49c926c33f3db8a58a1c29e253281 Mon Sep 17 00:00:00 2001 From: sethsimmons Date: Fri, 19 Nov 2021 15:39:22 -0500 Subject: [PATCH 06/24] Further fix occurrences of "deamon" --- README.md | 2 +- src/CmdLineOptions.cpp | 2 +- src/CurrentBlockchainStatus.cpp | 2 +- src/CurrentBlockchainStatus.h | 2 +- src/MempoolStatus.cpp | 6 +-- src/MempoolStatus.h | 2 +- src/page.h | 8 ++-- src/rpccalls.cpp | 70 ++++++++++++++++----------------- src/rpccalls.h | 16 ++++---- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 0f4a4c0..d1bb778 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ xmrblocks, Onion Monero Blockchain Explorer: functionality --ssl-key-file arg path to key file for ssl (https) functionality - -d [ --deamon-url ] arg (=http:://127.0.0.1:18081) + -d [ --daemon-url ] arg (=http:://127.0.0.1:18081) Monero daemon url --daemon-login arg Specify username[:password] for daemon RPC client diff --git a/src/CmdLineOptions.cpp b/src/CmdLineOptions.cpp index 4304fc1..f5cc787 100644 --- a/src/CmdLineOptions.cpp +++ b/src/CmdLineOptions.cpp @@ -71,7 +71,7 @@ namespace xmreg "path to key file for ssl (https) functionality") ("daemon-login", value(), "Specify username[:password] for daemon RPC client") - ("deamon-url,d", value()->default_value("http:://127.0.0.1:18081"), + ("daemon-url,d", value()->default_value("http:://127.0.0.1:18081"), "Monero daemon url"); diff --git a/src/CurrentBlockchainStatus.cpp b/src/CurrentBlockchainStatus.cpp index 040f01d..602eec4 100644 --- a/src/CurrentBlockchainStatus.cpp +++ b/src/CurrentBlockchainStatus.cpp @@ -303,7 +303,7 @@ cryptonote::network_type CurrentBlockchainStatus::nettype {cryptonote::network_t string CurrentBlockchainStatus::output_file {"emission_amount.txt"}; -string CurrentBlockchainStatus::deamon_url {"http:://127.0.0.1:18081"}; +string CurrentBlockchainStatus::daemon_url {"http:://127.0.0.1:18081"}; uint64_t CurrentBlockchainStatus::blockchain_chunk_size {10000}; diff --git a/src/CurrentBlockchainStatus.h b/src/CurrentBlockchainStatus.h index 54e0bc1..580ca64 100644 --- a/src/CurrentBlockchainStatus.h +++ b/src/CurrentBlockchainStatus.h @@ -51,7 +51,7 @@ struct CurrentBlockchainStatus static string output_file; - static string deamon_url; + static string daemon_url; // how many blocks to read before thread goes to sleep static uint64_t blockchain_chunk_size; diff --git a/src/MempoolStatus.cpp b/src/MempoolStatus.cpp index b55b312..7f40e23 100644 --- a/src/MempoolStatus.cpp +++ b/src/MempoolStatus.cpp @@ -96,7 +96,7 @@ MempoolStatus::start_mempool_status_thread() bool MempoolStatus::read_mempool() { - rpccalls rpc {deamon_url, login}; + rpccalls rpc {daemon_url, login}; string error_msg; @@ -222,7 +222,7 @@ MempoolStatus::read_mempool() bool MempoolStatus::read_network_info() { - rpccalls rpc {deamon_url, login}; + rpccalls rpc {daemon_url, login}; COMMAND_RPC_GET_INFO::response rpc_network_info; @@ -326,7 +326,7 @@ MempoolStatus::is_thread_running() } bf::path MempoolStatus::blockchain_path {"/home/mwo/.bitmonero/lmdb"}; -string MempoolStatus::deamon_url {"http:://127.0.0.1:18081"}; +string MempoolStatus::daemon_url {"http:://127.0.0.1:18081"}; cryptonote::network_type MempoolStatus::nettype {cryptonote::network_type::MAINNET}; atomic MempoolStatus::is_running {false}; boost::thread MempoolStatus::m_thread; diff --git a/src/MempoolStatus.h b/src/MempoolStatus.h index 8699c65..8c952e0 100644 --- a/src/MempoolStatus.h +++ b/src/MempoolStatus.h @@ -125,7 +125,7 @@ struct MempoolStatus static atomic mempool_size; // size in bytes. static bf::path blockchain_path; - static string deamon_url; + static string daemon_url; static cryptonote::network_type nettype; static rpccalls::login_opt login; diff --git a/src/page.h b/src/page.h index 9a1e400..ce1ebc1 100644 --- a/src/page.h +++ b/src/page.h @@ -498,7 +498,7 @@ public: page(MicroCore* _mcore, Blockchain* _core_storage, - string _deamon_url, + string _daemon_url, cryptonote::network_type _nettype, bool _enable_pusher, bool _enable_randomx, @@ -515,7 +515,7 @@ page(MicroCore* _mcore, rpccalls::login_opt _daemon_rpc_login) : mcore {_mcore}, core_storage {_core_storage}, - rpc {_deamon_url, _daemon_rpc_login}, + rpc {_daemon_url, _daemon_rpc_login}, server_timestamp {std::time(nullptr)}, nettype {_nettype}, enable_pusher {_enable_pusher}, @@ -577,9 +577,9 @@ index2(uint64_t page_no = 0, bool refresh_page = false) { // we get network info, such as current hash rate - // but since this makes a rpc call to deamon, we make it as an async + // but since this makes a rpc call to daemon, we make it as an async // call. this way we dont have to wait with execution of the rest of the - // index2 method, until deamon gives as the required result. + // index2 method, until daemon gives as the required result. std::future network_info_ftr = std::async(std::launch::async, [&] { json j_info; diff --git a/src/rpccalls.cpp b/src/rpccalls.cpp index f0c3a7a..ffd81ca 100644 --- a/src/rpccalls.cpp +++ b/src/rpccalls.cpp @@ -9,26 +9,26 @@ namespace xmreg rpccalls::rpccalls( - string _deamon_url, + string _daemon_url, login_opt login, uint64_t _timeout) - : deamon_url {_deamon_url}, + : daemon_url {_daemon_url}, timeout_time {_timeout} { - epee::net_utils::parse_url(deamon_url, url); + epee::net_utils::parse_url(daemon_url, url); port = std::to_string(url.port); timeout_time_ms = std::chrono::milliseconds {timeout_time}; m_http_client.set_server( - deamon_url, + daemon_url, login, epee::net_utils::ssl_support_t::e_ssl_support_disabled); } bool -rpccalls::connect_to_monero_deamon() +rpccalls::connect_to_monero_daemon() { //std::lock_guard guard(m_daemon_rpc_mutex); @@ -48,9 +48,9 @@ rpccalls::get_current_height() std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_current_height: not connected to deamon" << endl; + cerr << "get_current_height: not connected to daemon" << endl; return false; } @@ -60,8 +60,8 @@ rpccalls::get_current_height() if (!r) { - cerr << "Error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "Error connecting to Monero daemon at " + << daemon_url << endl; return 0; } @@ -80,9 +80,9 @@ rpccalls::get_mempool(vector& mempool_txs) { std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_mempool: not connected to deamon" << endl; + cerr << "get_mempool: not connected to daemon" << endl; return false; } @@ -93,8 +93,8 @@ rpccalls::get_mempool(vector& mempool_txs) if (!r || res.status != CORE_RPC_STATUS_OK) { - cerr << "Error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "Error connecting to Monero daemon at " + << daemon_url << endl; return false; } @@ -127,9 +127,9 @@ rpccalls::commit_tx(tools::wallet2::pending_tx& ptx, string& error_msg) std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "commit_tx: not connected to deamon" << endl; + cerr << "commit_tx: not connected to daemon" << endl; return false; } @@ -166,9 +166,9 @@ rpccalls::get_network_info(COMMAND_RPC_GET_INFO::response& response) { std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_network_info: not connected to deamon" << endl; + cerr << "get_network_info: not connected to daemon" << endl; return false; } @@ -192,15 +192,15 @@ rpccalls::get_network_info(COMMAND_RPC_GET_INFO::response& response) if (!err.empty()) { - cerr << "Error connecting to Monero deamon due to " + cerr << "Error connecting to Monero daemon due to " << err << endl; return false; } } else { - cerr << "Error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "Error connecting to Monero daemon at " + << daemon_url << endl; return false; } @@ -226,9 +226,9 @@ rpccalls::get_hardfork_info(COMMAND_RPC_HARD_FORK_INFO::response& response) { std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_hardfork_info: not connected to deamon" << endl; + cerr << "get_hardfork_info: not connected to daemon" << endl; return false; } @@ -253,15 +253,15 @@ rpccalls::get_hardfork_info(COMMAND_RPC_HARD_FORK_INFO::response& response) if (!err.empty()) { - cerr << "Error connecting to Monero deamon due to " + cerr << "Error connecting to Monero daemon due to " << err << endl; return false; } } else { - cerr << "Error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "Error connecting to Monero daemon at " + << daemon_url << endl; return false; } @@ -294,9 +294,9 @@ rpccalls::get_dynamic_per_kb_fee_estimate( { std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_dynamic_per_kb_fee_estimate: not connected to deamon" << endl; + cerr << "get_dynamic_per_kb_fee_estimate: not connected to daemon" << endl; return false; } @@ -321,15 +321,15 @@ rpccalls::get_dynamic_per_kb_fee_estimate( if (!err.empty()) { - cerr << "Error connecting to Monero deamon due to " + cerr << "Error connecting to Monero daemon due to " << err << endl; return false; } } else { - cerr << "Error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "Error connecting to Monero daemon at " + << daemon_url << endl; return false; } @@ -357,9 +357,9 @@ rpccalls::get_block(string const& blk_hash, block& blk, string& error_msg) { std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_block: not connected to deamon" << endl; + cerr << "get_block: not connected to daemon" << endl; return false; } @@ -384,15 +384,15 @@ rpccalls::get_block(string const& blk_hash, block& blk, string& error_msg) if (!err.empty()) { - cerr << "Error connecting to Monero deamon due to " + cerr << "Error connecting to Monero daemon due to " << err << endl; return false; } } else { - cerr << "get_block: error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "get_block: error connecting to Monero daemon at " + << daemon_url << endl; return false; } diff --git a/src/rpccalls.h b/src/rpccalls.h index 17a2d2c..e8feb50 100644 --- a/src/rpccalls.h +++ b/src/rpccalls.h @@ -69,7 +69,7 @@ using namespace std; class rpccalls { - string deamon_url ; + string daemon_url ; uint64_t timeout_time; std::chrono::milliseconds timeout_time_ms; @@ -85,12 +85,12 @@ public: using login_opt = boost::optional; - rpccalls(string _deamon_url = "http:://127.0.0.1:18081", + rpccalls(string _daemon_url = "http:://127.0.0.1:18081", login_opt _login = login_opt {}, uint64_t _timeout = 200000); bool - connect_to_monero_deamon(); + connect_to_monero_daemon(); uint64_t get_current_height(); @@ -135,9 +135,9 @@ public: { std::lock_guard guard(m_daemon_rpc_mutex); - if (!connect_to_monero_deamon()) + if (!connect_to_monero_daemon()) { - cerr << "get_alt_blocks: not connected to deamon" << endl; + cerr << "get_alt_blocks: not connected to daemon" << endl; return false; } @@ -161,15 +161,15 @@ public: if (!err.empty()) { - cerr << "Error connecting to Monero deamon due to " + cerr << "Error connecting to Monero daemon due to " << err << endl; return false; } } else { - cerr << "Error connecting to Monero deamon at " - << deamon_url << endl; + cerr << "Error connecting to Monero daemon at " + << daemon_url << endl; return false; } From ffddd4576c683215193cc9e4cd9bb9fd701f78a8 Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Fri, 19 Nov 2021 20:53:12 +0000 Subject: [PATCH 07/24] Add Docker Compose example and new instance --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0f4a4c0..c87cd35 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,12 @@ Monero C++ libraries, but also demonstrates how to use: ## Explorer hosts Clearnet versions: - - [https://xmrchain.net/](https://xmrchain.net/) - https enabled, most popular and very stable. - - [https://monerohash.com/explorer/](https://monerohash.com/explorer/) - nice looking one, https enabled. + - [https://xmrchain.net/](https://xmrchain.net/) - HTTPS enabled, most popular, and very stable. + - [https://monerohash.com/explorer/](https://monerohash.com/explorer/) - nice looking one, HTTPS enabled. - [http://monerochain.com/](http://monerochain.com/) - JSON API based, multiple nodes. - - [https://blox.minexmr.com/](https://blox.minexmr.com/) - - https enabled. + - [https://blox.minexmr.com/](https://blox.minexmr.com/) - HTTPS enabled. - [https://community.xmr.to/explorer/mainnet/](https://community.xmr.to/explorer/mainnet/) + - [https://explore.sethforprivacy.com/](https://explore.sethforprivacy.com/) - HTTPS enabled, JSON API enabled, emission enabled, rawtx enabled. Testnet version: @@ -44,6 +45,10 @@ i2p users (main Monero network): - [http://7o4gezpkye6ekibhgpkg7v626ze4idsirapufzrefkdysa6zxhha.b32.i2p/](http://7o4gezpkye6ekibhgpkg7v626ze4idsirapufzrefkdysa6zxhha.b32.i2p/) +Tor versions: + + - [http://exploredv42tq2nowrll6f27nuymenndwupueqvyugaqzbrvmjhhceqd.onion/](http://exploredv42tq2nowrll6f27nuymenndwupueqvyugaqzbrvmjhhceqd.onion/) - Native v3 Onion, JSON API enabled, emission enabled, rawtx enabled. + Alternative block explorers: - [https://localmonero.co/blocks](https://localmonero.co/blocks) @@ -150,9 +155,8 @@ The explorer can also be compiled using `docker build` as follows: docker build --no-cache -t xmrblocks . ``` -- Wait one hour or more - The build needs 3 GB space. -- The final container image is ~200MB +- The final container image is 179MB. To run it, mount the monero blockchain onto the container as volume. @@ -178,6 +182,60 @@ Staring in non-ssl mode (2020-04-20 16:20:00) [INFO ] Crow/0.1 server is running at 0.0.0.0:8081 using 1 threads ``` +### Docker Compose example + +The explorer can also be built and run using Docker Compose, i.e.: + +```yaml +version: '3' +services: + monerod: + image: sethsimmons/simple-monerod:latest + restart: unless-stopped + container_name: monerod + volumes: + - xmrdata:/home/monero/.bitmonero + ports: + - 18080:18080 + - 18089:18089 + command: + - "--rpc-restricted-bind-ip=0.0.0.0" + - "--rpc-restricted-bind-port=18089" + - "--public-node" + - "--no-igd" + - "--enable-dns-blocklist" + - "--prune-blockchain" + + explore: + image: xmrblocks:latest + build: ./onion-monero-blockchain-explorer + container_name: explore + restart: unless-stopped + volumes: + - xmrdata:/home/monero/.bitmonero + ports: + - 8081:8081 + + volumes: + xmrdata: +``` + +To build this image, run the following: + +```bash +git clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git +docker-compose build +``` + +Or build and run in one step via: + +```bash +git clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git +docker-compose up -d +``` + +When running via Docker, please use something like [Traefik](https://doc.traefik.io/traefik/) or [enable SSL](#enable-ssl-https) to secure communications. + ## The explorer's command line options ``` From e03ed49f795ee8982453a6e342d8018a577afced Mon Sep 17 00:00:00 2001 From: sethsimmons Date: Fri, 19 Nov 2021 16:12:19 -0500 Subject: [PATCH 08/24] Add apt upgrade step to resolve vulns --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66572d4..ab2ff16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,9 @@ ARG MONERO_BRANCH=release-v0.17 ENV DEBIAN_FRONTEND="noninteractive" # Install dependencies for monerod and xmrblocks compilation -RUN apt-get update && apt install -y --no-install-recommends \ +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ git \ build-essential \ cmake \ @@ -65,8 +67,9 @@ FROM ubuntu:20.04 ENV DEBIAN_FRONTEND="noninteractive" # Install unzip to handle bundled libs from builder stage -RUN apt-get update && apt-get install -y --no-install-recommends \ - unzip \ +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends unzip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* From ae1df3d0d08d919e0c256429d8787d386abde9cb Mon Sep 17 00:00:00 2001 From: sethsimmons Date: Fri, 19 Nov 2021 16:22:25 -0500 Subject: [PATCH 09/24] Add sane defaults and allow passing args --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index ab2ff16..048b689 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,3 +94,6 @@ VOLUME /home/monero/.bitmonero EXPOSE 8081 ENTRYPOINT ["/bin/sh", "-c", "./xmrblocks"] + +# Set sane defaults that are overridden if the user passes any commands +CMD ["--enable-json-api", "--enable-autorefresh-option", "--enable-emission-monitor", "--enable-pusher"] \ No newline at end of file From 76fb35db008fc008ec407dba4c8f90a69c796e68 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 22 Nov 2021 16:09:59 +0800 Subject: [PATCH 10/24] Fix docker build https://github.com/moneroexamples/onion-monero-blockchain-explorer/issues/250 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 048b689..6dc0332 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,12 +43,12 @@ ENV BOOST_DEBUG 1 WORKDIR /root # Clone and compile monerod with all available threads -ARG MONERO_BRANCH ARG NPROC RUN git clone --recursive --branch ${MONERO_BRANCH} https://github.com/monero-project/monero.git \ && cd monero \ && test -z "$NPROC" && nproc > /nproc || echo -n "$NPROC" > /nproc && make -j"$(cat /nproc)" + # Copy and cmake xmrblocks COPY . /root/onion-monero-blockchain-explorer/ WORKDIR /root/onion-monero-blockchain-explorer/build @@ -96,4 +96,4 @@ EXPOSE 8081 ENTRYPOINT ["/bin/sh", "-c", "./xmrblocks"] # Set sane defaults that are overridden if the user passes any commands -CMD ["--enable-json-api", "--enable-autorefresh-option", "--enable-emission-monitor", "--enable-pusher"] \ No newline at end of file +CMD ["--enable-json-api", "--enable-autorefresh-option", "--enable-emission-monitor", "--enable-pusher"] From 141e6c90fbce73aca2e697b7d0806b94a04f77ad Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 22 Nov 2021 16:14:08 +0800 Subject: [PATCH 11/24] Docker build info updated --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 69ea95a..ba687b3 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,11 @@ Go to your browser: http://127.0.0.1:8081 The explorer can also be compiled using `docker build` as follows: ``` +# build using all CPU cores docker build --no-cache -t xmrblocks . + +# alternatively, specify number of cores to use (e.g. 2) +docker build --no-cache --build-arg NPROC=2 -t xmrblocks . ``` - The build needs 3 GB space. From ac9dc2c511e59afc1d30549258de1ec84604ac95 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 22 Nov 2021 17:58:00 +0800 Subject: [PATCH 12/24] docker example updated --- README.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ba687b3..c7ae3c6 100644 --- a/README.md +++ b/README.md @@ -166,22 +166,16 @@ To run it, mount the monero blockchain onto the container as volume. ``` # either run in foreground -docker run -it \ - -v xmrdata:/home/monero/.bitmonero \ - -p 8081:8081 \ - xmrblocks +docker run -it -v :/home/monero/.bitmonero -p 8081:8081 xmrblocks # or in background -docker run -it -d \ - -v xmrdata:/home/monero/.bitmonero \ - -p 8081:8081 \ - xmrblocks +docker run -it -d -v :/home/monero/.bitmonero -p 8081:8081 xmrblocks ``` Example output: ``` -[ec2-user@ip-10-0-0-1 ~]$ docker run --rm -it -v xmrdata:/home/monero/.bitmonero xmrblocks +docker run --rm -it -v /mnt/w7/bitmonero:/home/monero/.bitmonero xmrblocks Staring in non-ssl mode (2020-04-20 16:20:00) [INFO ] Crow/0.1 server is running at 0.0.0.0:8081 using 1 threads ``` From 803642298d37557a9a0fc368fdbc242abc6b6568 Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Mon, 22 Nov 2021 13:29:49 +0000 Subject: [PATCH 13/24] Minor optimization to reduce layers --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6dc0332..863d2ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,13 +49,10 @@ RUN git clone --recursive --branch ${MONERO_BRANCH} https://github.com/monero-pr && test -z "$NPROC" && nproc > /nproc || echo -n "$NPROC" > /nproc && make -j"$(cat /nproc)" -# Copy and cmake xmrblocks +# Copy and cmake/make xmrblocks with all available threads COPY . /root/onion-monero-blockchain-explorer/ WORKDIR /root/onion-monero-blockchain-explorer/build -RUN cmake .. - -# Compile xmrblocks with all available threads -RUN test -z "$NPROC" && nproc > /nproc || echo -n "$NPROC" > /nproc && make -j"$(cat /nproc)" +RUN cmake .. && make -j"$(cat /nproc)" # Use ldd and awk to bundle up dynamic libraries for the final image RUN zip /lib.zip $(ldd xmrblocks | grep -E '/[^\ ]*' -o) From 4c32276053e17d3b81bd6e112bb6a1cecb82012a Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Mon, 22 Nov 2021 15:38:59 +0000 Subject: [PATCH 14/24] Fix Dockerfile CMD/entrypoint This PR fixes an issue with the entrypoint/CMD usage in the Dockerfile, both fixing an issue that would cause the container to not start, and allowing passing different flags to override. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6dc0332..c9dc9a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,7 +93,7 @@ VOLUME /home/monero/.bitmonero # Expose default explorer http port EXPOSE 8081 -ENTRYPOINT ["/bin/sh", "-c", "./xmrblocks"] +ENTRYPOINT ["/bin/sh", "-c"] # Set sane defaults that are overridden if the user passes any commands -CMD ["--enable-json-api", "--enable-autorefresh-option", "--enable-emission-monitor", "--enable-pusher"] +CMD ["./xmrblocks --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher"] From 75e5db11837af59f9e630733396dd134939a594f Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Mon, 22 Nov 2021 15:43:22 +0000 Subject: [PATCH 15/24] Update Docker Compose and Docker commands This commit simply updates the README to match the working CMD handling in the Dockerfile, allowing users to pass whatever custom flags they would like easily. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index c7ae3c6..be26fd1 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,7 @@ services: - xmrdata:/home/monero/.bitmonero ports: - 8081:8081 + command: "./xmrblocks --daemon-url=monerod:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher" volumes: xmrdata: @@ -302,6 +303,18 @@ alias xmrblocksmainnet='~/onion-monero-blockchain-explorer/build/xmrblocks -- alias xmrblockstestnet='~/onion-monero-blockchain-explorer/build/xmrblocks -t --port 8082 --mainnet-url "http://139.162.32.245:8081" --enable-pusher --enable-emission-monitor' ``` +Example usage when running via Docker: + +```bash +# Run in foreground +docker run -it -v :/home/monero/.bitmonero -p 8081:8081 xmrblocks "./xmrblocks --daemon-url=node.sethforprivacy.com:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher" + +# Run in background +docker run -it -d -v :/home/monero/.bitmonero -p 8081:8081 xmrblocks "./xmrblocks --daemon-url=node.sethforprivacy.com:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher" +``` + +Make sure to always start the portion of command line flags with `./xmrblocks` and set any flags you would like after that, as shown above. + ## Enable Monero emission Obtaining current Monero emission amount is not straight forward. Thus, by default it is From c022b5fdffacce186d3a36de91da80dcf7d88ed3 Mon Sep 17 00:00:00 2001 From: Seth For Privacy Date: Mon, 22 Nov 2021 18:55:53 +0000 Subject: [PATCH 16/24] Correct Compose format of `command` arg --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be26fd1..10e9b9e 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ services: - xmrdata:/home/monero/.bitmonero ports: - 8081:8081 - command: "./xmrblocks --daemon-url=monerod:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher" + command: ["./xmrblocks --daemon-url=monerod:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher"] volumes: xmrdata: From b0262f01762414073edd317db81802f04e1cb22c Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 5 Dec 2021 06:15:09 +0800 Subject: [PATCH 17/24] MONERO_BRANCH=master added to Readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 10e9b9e..d8a6735 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,8 @@ Go to your browser: http://127.0.0.1:8081 ## Compiling and running with Docker -The explorer can also be compiled using `docker build` as follows: +The explorer can also be compiled using `docker build` as described below. By default it compiles +against latest release (`release-v0.17`) branch of monero: ``` # build using all CPU cores @@ -157,6 +158,9 @@ docker build --no-cache -t xmrblocks . # alternatively, specify number of cores to use (e.g. 2) docker build --no-cache --build-arg NPROC=2 -t xmrblocks . + +# to build against development branch of monero (i.e. master branch) +docker build --no-cache --build-arg NPROC=3 -build-arg MONERO_BRANCH=master -t xmrblocks . ``` - The build needs 3 GB space. From a672f3c50704d766321ea8fbaf41c2403397457d Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 5 Dec 2021 07:06:37 +0800 Subject: [PATCH 18/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8a6735..941e96f 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ docker run -it -d -v :/home/monero/.bitmo Example output: ``` -docker run --rm -it -v /mnt/w7/bitmonero:/home/monero/.bitmonero xmrblocks +docker run --rm -it -v /mnt/w7/bitmonero:/home/monero/.bitmonero -p 8081:8081 xmrblocks Staring in non-ssl mode (2020-04-20 16:20:00) [INFO ] Crow/0.1 server is running at 0.0.0.0:8081 using 1 threads ``` From 72eedcf45e60392c27e8bdc3799629bafc7e4215 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 5 Dec 2021 07:11:56 +0800 Subject: [PATCH 19/24] --enable-autorefresh-option not set by default --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3fe2b82..0cdc81e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,4 +93,4 @@ EXPOSE 8081 ENTRYPOINT ["/bin/sh", "-c"] # Set sane defaults that are overridden if the user passes any commands -CMD ["./xmrblocks --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher"] +CMD ["./xmrblocks --enable-json-api --enable-emission-monitor --enable-pusher"] From ac7a5f8c25b2b32176953f07c615321ce447b67c Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 5 Dec 2021 07:13:41 +0800 Subject: [PATCH 20/24] --enable-emission-monitor not set by default --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0cdc81e..fe52db5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,4 +93,4 @@ EXPOSE 8081 ENTRYPOINT ["/bin/sh", "-c"] # Set sane defaults that are overridden if the user passes any commands -CMD ["./xmrblocks --enable-json-api --enable-emission-monitor --enable-pusher"] +CMD ["./xmrblocks --enable-json-api --enable-autorefresh-option --enable-pusher"] From 9a37839f37abef0b8b94ceeba41ab51a41f3fbd8 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 29 Dec 2021 12:40:22 +0800 Subject: [PATCH 21/24] added some debuging info --- src/page.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/page.h b/src/page.h index ce1ebc1..0c5aa60 100644 --- a/src/page.h +++ b/src/page.h @@ -1900,6 +1900,8 @@ show_my_outputs(string tx_hash_str, boost::trim(viewkey_str); boost::trim(raw_tx_data); + cout << "tx hash not provided" << endl; + if (tx_hash_str.empty()) { return string("tx hash not provided!"); @@ -2204,15 +2206,14 @@ show_my_outputs(string tx_hash_str, address_info.address.m_spend_public_key, tx_pubkey); -// cout << pod_to_hex(derivation) << ", " << output_idx << ", " -// << pod_to_hex(address_info.address.m_spend_public_key) << ", " -// << pod_to_hex(outp.first.key) << " == " -// << pod_to_hex(tx_pubkey) << '\n' << '\n'; + // check if generated public key matches the current output's key bool mine_output = (outp.first.key == tx_pubkey); + + bool with_additional = false; if (!mine_output && txd.additional_pks.size() @@ -2229,6 +2230,12 @@ show_my_outputs(string tx_hash_str, with_additional = true; } +// cout << pod_to_hex(derivation) << ", " << output_idx << ", " +// << pod_to_hex(address_info.address.m_spend_public_key) << ", " +// << pod_to_hex(outp.first.key) << " == " +// << pod_to_hex(tx_pubkey) << ", " << mine_output +// << '\n' << '\n'; + // if mine output has RingCT, i.e., tx version is 2 if (mine_output && tx.version == 2) { @@ -2255,6 +2262,8 @@ show_my_outputs(string tx_hash_str, cerr << "\nshow_my_outputs: Cant decode RingCT!\n"; } + //cout << rct_amount << endl; + outp.second = rct_amount; money_transfered[output_idx] = rct_amount; } From 654e860a66a37955ad6fd2d0752a085223f74387 Mon Sep 17 00:00:00 2001 From: garth-xmr <87672640+garth-xmr@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:08:06 -0500 Subject: [PATCH 22/24] README.md: Remove dead explorer links --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 941e96f..90af7d1 100644 --- a/README.md +++ b/README.md @@ -28,18 +28,14 @@ Clearnet versions: - [https://monerohash.com/explorer/](https://monerohash.com/explorer/) - nice looking one, HTTPS enabled. - [http://monerochain.com/](http://monerochain.com/) - JSON API based, multiple nodes. - [https://blox.minexmr.com/](https://blox.minexmr.com/) - HTTPS enabled. - - [https://community.xmr.to/explorer/mainnet/](https://community.xmr.to/explorer/mainnet/) - - [https://explore.sethforprivacy.com/](https://explore.sethforprivacy.com/) - HTTPS enabled, JSON API enabled, emission enabled, rawtx enabled. Testnet version: - [https://testnet.xmrchain.com/](https://testnet.xmrchain.com/) - https enabled. - - [https://community.xmr.to/explorer/testnet/](https://community.xmr.to/explorer/testnet/) Stagenet version: - [https://stagenet.xmrchain.net/](https://stagenet.xmrchain.net/) - - [https://community.xmr.to/explorer/stagenet/](https://community.xmr.to/explorer/stagenet/) i2p users (main Monero network): From b543c59a3cb8ca4f9c2310bf52d87d552c2a2db2 Mon Sep 17 00:00:00 2001 From: plowsof <77655812+plowsof@users.noreply.github.com> Date: Sun, 17 Apr 2022 03:44:03 +0100 Subject: [PATCH 23/24] missing a - --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 90af7d1..943a56b 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ docker build --no-cache -t xmrblocks . docker build --no-cache --build-arg NPROC=2 -t xmrblocks . # to build against development branch of monero (i.e. master branch) -docker build --no-cache --build-arg NPROC=3 -build-arg MONERO_BRANCH=master -t xmrblocks . +docker build --no-cache --build-arg NPROC=3 --build-arg MONERO_BRANCH=master -t xmrblocks . ``` - The build needs 3 GB space. From e63072777d5cf63a53b6055fb395087502c3a0cf Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sat, 7 May 2022 16:01:56 +0800 Subject: [PATCH 24/24] remove network_info_ftr as its unused --- src/page.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/page.h b/src/page.h index 0c5aa60..51f5363 100644 --- a/src/page.h +++ b/src/page.h @@ -575,21 +575,6 @@ page(MicroCore* _mcore, string index2(uint64_t page_no = 0, bool refresh_page = false) { - - // we get network info, such as current hash rate - // but since this makes a rpc call to daemon, we make it as an async - // call. this way we dont have to wait with execution of the rest of the - // index2 method, until daemon gives as the required result. - std::future network_info_ftr = std::async(std::launch::async, [&] - { - json j_info; - - get_monero_network_info(j_info); - - return j_info; - }); - - // get mempool for the front page also using async future std::future mempool_ftr = std::async(std::launch::async, [&] {