From 2a74d3f7a9573d1e1ff0e2a478748a06b5995c78 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 28 May 2018 16:10:46 +0800 Subject: [PATCH] Ported to Aeon https://github.com/moneroexamples/onion-monero-blockchain-explorer/pull/118 --- CMakeLists.txt | 10 ++++---- README.md | 35 ++++++++++++++------------ main.cpp | 12 ++++----- src/CmdLineOptions.cpp | 2 +- src/CurrentBlockchainStatus.cpp | 2 +- src/MempoolStatus.cpp | 2 +- src/page.h | 2 +- src/rpccalls.h | 2 +- src/templates/address.html | 2 +- src/templates/checkrawoutputkeys.html | 2 +- src/templates/footer.html | 4 +-- src/templates/header.html | 4 +-- src/templates/index2.html | 2 +- src/templates/js/config.js | 26 +++++++++---------- src/templates/my_outputs.html | 4 +-- src/templates/partials/tx_details.html | 20 +++++++-------- 16 files changed, 67 insertions(+), 64 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32ed10f..1786578 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8) set(PROJECT_NAME - xmrblocks) + aeonblocks) project(${PROJECT_NAME}) @@ -15,13 +15,13 @@ if (WIN32) endif() -if (NOT MONERO_DIR) - set(MONERO_DIR ~/monero) +if (NOT AEON_DIR) + set(AEON_DIR ~/aeon) endif() -message(STATUS MONERO_DIR ": ${MONERO_DIR}") +message(STATUS AEON_DIR ": ${AEON_DIR}") -set(MONERO_SOURCE_DIR ${MONERO_DIR} +set(MONERO_SOURCE_DIR ${AEON_DIR} CACHE PATH "Path to the root directory for Monero") # set location of monero build tree diff --git a/README.md b/README.md index 31f8e6c..275e56f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Onion Monero Blockchain Explorer +# Onion Aeon Blockchain Explorer Currently available Monero blockchain explorers have several limitations which are of special importance to privacy-oriented users: @@ -107,9 +107,9 @@ sudo apt install git build-essential cmake libboost-all-dev miniupnpc libunbound # go to home folder cd ~ -git clone --recursive https://github.com/monero-project/monero +git clone --recursive https://github.com/aeonix/aeon -cd monero/ +cd aeon/ # checkout last monero version git checkout -b last_release v0.12.1.0 @@ -123,7 +123,7 @@ Once the Monero is compiles, the explorer can be downloaded and compiled as follows: ```bash -# go to home folder if still in ~/monero +# go to home folder if still in ~/aeon cd ~ # download the source code @@ -132,14 +132,17 @@ git clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git # enter the downloaded sourced code folder cd onion-monero-blockchain-explorer +# checkout the aeon branch +git checkout origin/aeon + # make a build folder and enter it mkdir build && cd build # create the makefile cmake .. -# altearnatively can use: cmake -DMONERO_DIR=/path/to/monero_folder .. -# if monero is not in ~/monero +# altearnatively can use: cmake -DAEON_DIR=/path/to/aeon_folder .. +# if monero is not in ~/aeon # # also can build with ASAN (sanitizers), for example # cmake -DSANITIZE_ADDRESS=On .. @@ -151,7 +154,7 @@ make To run it: ``` -./xmrblocks +./aeonblocks ``` By default it will look for blockchain in its default location i.e., `~/.bitmonero/lmdb`. @@ -166,7 +169,7 @@ For example: Example output: ```bash -[mwo@arch onion-monero-blockchain-explorer]$ ./xmrblocks +[mwo@arch onion-monero-blockchain-explorer]$ ./aeonblocks 2016-May-28 10:04:49.160280 Blockchain initialized. last block: 1056761, d0.h0.m12.s47 time ago, current difficulty: 1517857750 (2016-05-28 02:04:49) [INFO ] Crow/0.1 server is running, local port 8081 ``` @@ -176,7 +179,7 @@ Go to your browser: http://127.0.0.1:8081 ## The explorer's command line options ``` -xmrblocks, Onion Monero Blockchain Explorer: +aeonblocks, Onion Monero Blockchain Explorer: -h [ --help ] [=arg(=1)] (=0) produce help message -t [ --testnet ] [=arg(=1)] (=0) use testnet blockchain -s [ --stagenet ] [=arg(=1)] (=0) use stagenet blockchain @@ -224,7 +227,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 [ --deamon-url ] arg (=http:://127.0.0.1:11181) Monero deamon url ``` @@ -232,10 +235,10 @@ Example usage, defined as bash aliases. ```bash # for mainnet explorer -alias xmrblocksmainnet='~/onion-monero-blockchain-explorer/build/xmrblocks --port 8081 --testnet-url "http://139.162.32.245:8082" --enable-pusher --enable-emission-monitor' +alias aeonblocksmainnet='~/onion-monero-blockchain-explorer/build/aeonblocks --port 8081 --testnet-url "http://139.162.32.245:8082" --enable-pusher --enable-emission-monitor' # for testnet explorer -alias xmrblockstestnet='~/onion-monero-blockchain-explorer/build/xmrblocks -t --port 8082 --mainnet-url "http://139.162.32.245:8081" --enable-pusher --enable-emission-monitor' +alias aeonblockstestnet='~/onion-monero-blockchain-explorer/build/aeonblocks -t --port 8082 --mainnet-url "http://139.162.32.245:8081" --enable-pusher --enable-emission-monitor' ``` These are aliases similar to those used for http://139.162.32.245:8081/ and http://139.162.32.245:8082/, respectively. @@ -247,7 +250,7 @@ disabled. To enable it use `--enable-emission-monitor` flag, e.g., ```bash -xmrblocks --enable-emission-monitor +aeonblocks --enable-emission-monitor ``` This flag will enable emission monitoring thread. When started, the thread @@ -285,7 +288,7 @@ By default, decoding and proving tx's outputs are done on the server side. To do (private view and tx keys are not send to the server) JavaScript-based decoding can be enabled: ``` -xmrblocks --enable-js +aeonblocks --enable-js ``` ## Enable SSL (https) @@ -301,10 +304,10 @@ openssl req -new -key server.key -out server.csr openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt ``` -Having the `crt` and `key` files, run `xmrblocks` in the following way: +Having the `crt` and `key` files, run `aeonblocks` in the following way: ```bash -./xmrblocks --ssl-crt-file=/tmp/server.crt --ssl-key-file=/tmp/server.key +./aeonblocks --ssl-crt-file=/tmp/server.crt --ssl-key-file=/tmp/server.key ``` Note: Because we generated our own certificate, modern browsers will complain diff --git a/main.cpp b/main.cpp index 5b89673..99cbb36 100644 --- a/main.cpp +++ b/main.cpp @@ -166,10 +166,10 @@ main(int ac, const char* av[]) string deamon_url {*deamon_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 && deamon_url == "http:://127.0.0.1:11181") + deamon_url = "http:://127.0.0.1:21181"; + if (stagenet && deamon_url == "http:://127.0.0.1:11181") + deamon_url = "http:://127.0.0.1:31181"; uint64_t mempool_info_timeout {5000}; @@ -323,7 +323,7 @@ main(int ac, const char* av[]) || post_body.count("viewkey") == 0 || post_body.count("tx_hash") == 0) { - return string("xmr address, viewkey or tx hash not provided"); + return string("AEON address, viewkey or tx hash not provided"); } string tx_hash = remove_bad_chars(post_body["tx_hash"]); @@ -365,7 +365,7 @@ main(int ac, const char* av[]) || post_body.count("txprvkey") == 0 || post_body.count("txhash") == 0) { - return string("xmr address, tx private key or " + return string("AEON address, tx private key or " "tx hash not provided"); } diff --git a/src/CmdLineOptions.cpp b/src/CmdLineOptions.cpp index 8bf4fd4..bf902cd 100644 --- a/src/CmdLineOptions.cpp +++ b/src/CmdLineOptions.cpp @@ -69,7 +69,7 @@ namespace xmreg "path to crt file for ssl (https) functionality") ("ssl-key-file", value(), "path to key file for ssl (https) functionality") - ("deamon-url,d", value()->default_value("http:://127.0.0.1:18081"), + ("deamon-url,d", value()->default_value("http:://127.0.0.1:11181"), "Monero deamon url"); diff --git a/src/CurrentBlockchainStatus.cpp b/src/CurrentBlockchainStatus.cpp index 1a4b1ab..5de97a7 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::deamon_url {"http:://127.0.0.1:11181"}; uint64_t CurrentBlockchainStatus::blockchain_chunk_size {10000}; diff --git a/src/MempoolStatus.cpp b/src/MempoolStatus.cpp index 76b5e90..0ace78a 100644 --- a/src/MempoolStatus.cpp +++ b/src/MempoolStatus.cpp @@ -317,7 +317,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::deamon_url {"http:://127.0.0.1:11181"}; cryptonote::network_type MempoolStatus::nettype {cryptonote::network_type::MAINNET}; atomic MempoolStatus::is_running {false}; boost::thread MempoolStatus::m_thread; diff --git a/src/page.h b/src/page.h index 787c734..2bf49d3 100644 --- a/src/page.h +++ b/src/page.h @@ -1578,7 +1578,7 @@ public: if (!xmreg::parse_str_address(xmr_address_str, address_info, nettype)) { cerr << "Cant parse string address: " << xmr_address_str << endl; - return string("Cant parse xmr address: " + xmr_address_str); + return string("Cant parse AEON address: " + xmr_address_str); } // parse string representing given private key diff --git a/src/rpccalls.h b/src/rpccalls.h index 720936e..bb0fb0a 100644 --- a/src/rpccalls.h +++ b/src/rpccalls.h @@ -81,7 +81,7 @@ class rpccalls public: - rpccalls(string _deamon_url = "http:://127.0.0.1:18081", + rpccalls(string _deamon_url = "http:://127.0.0.1:11181", uint64_t _timeout = 200000); bool diff --git a/src/templates/address.html b/src/templates/address.html index 5e3f157..90361d2 100644 --- a/src/templates/address.html +++ b/src/templates/address.html @@ -28,7 +28,7 @@

Transactions:
Sorry, its not possible to find txs associated with - normal addresses in Monero + normal addresses in Aeon


diff --git a/src/templates/checkrawoutputkeys.html b/src/templates/checkrawoutputkeys.html index 572bbdc..017590f 100644 --- a/src/templates/checkrawoutputkeys.html +++ b/src/templates/checkrawoutputkeys.html @@ -15,7 +15,7 @@

Output keys for address: {{address}}

Viewkey: {{viewkey}}

{{#has_total_xmr}} -

Total xmr: {{total_xmr}}

+

Total AEON: {{total_xmr}}

{{/has_total_xmr}}
diff --git a/src/templates/footer.html b/src/templates/footer.html index 4e0cbe6..47eb7eb 100644 --- a/src/templates/footer.html +++ b/src/templates/footer.html @@ -1,8 +1,8 @@
- source code + source code | explorer version (api): {{git_branch_name}}-{{last_git_commit_date}}-{{last_git_commit_hash}} ({{api}}) - | monero version: {{monero_version_full}} + | Aeon version: {{monero_version_full}}
diff --git a/src/templates/header.html b/src/templates/header.html index 7c53e54..c2845fa 100644 --- a/src/templates/header.html +++ b/src/templates/header.html @@ -6,7 +6,7 @@ {{#refresh}} {{/refresh}} - Onion Monero Blockchain Explorer + Onion Aeon Blockchain Explorer