From 156229274faa38347ce30365409991eeb6d0b5ec Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 19 Jan 2018 11:58:27 +0800 Subject: [PATCH] readme updated --- README.md | 5 ++++- src/page.h | 10 ++++++++++ src/templates/js/config.js | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01046c5..b7b7691 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,8 @@ Alternative block explorers: The key features of the Onion Monero Blockchain Explorer are: - - no javascript, no cookies, no web analytics trackers, no images, + - no cookies, no web analytics trackers, no images, + - by default no JavaScript, but can be enabled for client side decoding and proving transactions, - open sourced, - made fully in C++, - showing encrypted payments ID, @@ -176,6 +177,8 @@ xmrblocks, Onion Monero Blockchain Explorer: --show-cache-times [=arg(=1)] (=0) show times of getting data from cache vs no cache --enable-block-cache [=arg(=1)] (=0) enable caching of block details + --enable-js [=arg(=1)] (=0) enable checking outputs and proving txs + using JavaScript on client side --enable-autorefresh-option [=arg(=1)] (=0) enable users to have the index page on autorefresh diff --git a/src/page.h b/src/page.h index f53b927..082a6ec 100644 --- a/src/page.h +++ b/src/page.h @@ -404,6 +404,16 @@ namespace xmreg template_file["config.js"] = xmreg::read(JS_CONFIG); template_file["biginteger.js"] = xmreg::read(JS_BIGINT); + + // need to set "testnet: false," flag to reflect + // if we are running testnet or mainnet explorer + + if (testnet) + template_file["config.js"] = std::regex_replace( + template_file["config.js"], + std::regex("testnet: false"), + "testnet: true" ); + js_html_files += ""; js_html_files += ""; js_html_files += ""; diff --git a/src/templates/js/config.js b/src/templates/js/config.js index 03f521f..993b272 100755 --- a/src/templates/js/config.js +++ b/src/templates/js/config.js @@ -1,5 +1,5 @@ var config = { - testnet: false, //@todo need to make it automated + testnet: false, // this is adjusted page.h if needed. dont need to change manually coinUnitPlaces: 12, txMinConfirms: 10, // corresponds to CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE in Monero txCoinbaseMinConfirms: 60, // corresponds to CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW in Monero