diff --git a/docs/en/proof-of-work/random-x.md b/docs/en/proof-of-work/random-x.md index 5178eeae..4b789b3c 100644 --- a/docs/en/proof-of-work/random-x.md +++ b/docs/en/proof-of-work/random-x.md @@ -1,6 +1,58 @@ --- -title: RandomX +title: "RandomX" + +translationOutdated: "no" +contentOutdated: "no" --- + + +{% if contentOutdated == "yes" %} +## **{{ i18n_str('notices.outdatedContent') }}** + + +{% elif translationOutdated == "yes" %} +## **{{ i18n_str('notices.outdatedTranslation') }}** +{% endif %} + + # RandomX +!!! info "" + {{ i18n_str('proof_of_work.randomx.notice_date') }} + {{ i18n_str('proof_of_work.randomx.notice_text') }} [Monero Outreach](https://github.com/monero-ecosystem/outreach-docs/blob/master/monero-outreach-docs%2Fen%2Fstoryboard%2FrandomX_en.md). + +{{ i18n_str('proof_of_work.randomx.arweave') }} + +{{ i18n_str('proof_of_work.randomx.what_year_q') }} + +### {{ i18n_str('proof_of_work.randomx.what_is_randomx') }} + +{{ i18n_str('proof_of_work.randomx.what_is_randomx_p1') }} + +{{ i18n_str('proof_of_work.randomx.what_is_randomx_p2') }} + +{{ i18n_str('proof_of_work.randomx.what_is_randomx_p3') }} + +| CPU | OS | Threads | RAM | CryptoNight-R (v8) | RandomX Fast Mode | RandomX Light Mode | +|--|--|--|--|--|--|--| +| AMD Ryzen 7 1700 | Ubuntu 16.04 | 8 | 16 GB DDR4 | 650 H/s | 4100 H/s | 620 H/s | +| Intel Core i7-8550U | Windows 10 | 4 | 16 GB DDR4 | 240 H/s | 1700 H/s | 350 H/s | +| Intel Core i3-3220 | Ubuntu 16.04 | 4 | 4 GB DDR3 | 75 H/s | 510 H/s | 150 H/s | + +| GPU | Clockspeed | CryptoNight-R (v8) | RandomX | +|--|--|--|--| +| GTX 1660 Ti | 2070/13760 MHz | 626 H/s (98 W) | 660 H/s (103 W) | +| GTX 1080 Ti | 1930/10010 MHz | 787 H/s (145 W) | 1136 H/s (190 W) | + +### {{ i18n_str('proof_of_work.randomx.randomx_collab') }} + +{{ i18n_str('proof_of_work.randomx.randomx_collab_p1') }} + + +### {{ i18n_str('proof_of_work.randomx.learn_more') }} + +- {{ i18n_str('proof_of_work.randomx.link_monerokon') }}: [ASIC-Resistant Proof of Work: Fact or Fantasy?](https://github.com/monero-ecosystem/outreach-docs/blob/master/monero-outreach-docs%2Fen%2Ftranscriptions%2Fmonero-konferenco-2019%2FASIC-Resistant_Proof_of_Work-Fact_or_Fantasy.md) +- {{ i18n_str('proof_of_work.randomx.link_press') }}: [Monero Arweave Team to Validate the Proof-of-Work](https://github.com/monero-ecosystem/outreach-docs/blob/master/monero-outreach-docs%2Fen%2Fwebsite-sections%2Fnews%2Fmonero_arweave_pow_en.md) +- {{ i18n_str('proof_of_work.randomx.link_monerotalk_1') }}: [monerotalk.live/randomx-progress-w-howard-chu-and-sam-williams-of-arweave](https://www.monerotalk.live/randomx-progress-w-howard-chu-and-sam-williams-of-arweave) +- {{ i18n_str('proof_of_work.randomx.link_monerotalk_2') }}: [youtube.com/watch?v=vGMTrA6NmeM](https://www.youtube.com/watch?v=vGMTrA6NmeM) -For general information about RandomX you can read this [article](https://www.monerooutreach.org/stories/RandomX.html). +_{{ i18n_str('notices.adapted') }} [Monero Outreach](https://github.com/monero-ecosystem/outreach-docs/blob/ac7ccb8284cd68b5a39105e07b3deda068124b7c/monero-outreach-docs/en/storyboard/randomX_en.md)_ diff --git a/docs/macros/i18n/en.yml b/docs/macros/i18n/en.yml new file mode 100644 index 00000000..e1282279 --- /dev/null +++ b/docs/macros/i18n/en.yml @@ -0,0 +1,54 @@ +notices: + outdatedTranslation: "This translation is outdated" + outdatedContent: "The source content is outdated" + adapted: "Adapted for Monero Docs from" + +proof_of_work: + randomx: + notice_date: "**_Written in 2019_**" + notice_text: "Pulled from" + arweave: "**Monero and Arweave to Validate the Proof-of-Work Algorithm. - 5th of June, 2019**" + what_year_q: "What year is it? It seems like only yesterday they were saying that a privacy coin couldn’t be pruned + and that ASICs will win in the end. But here we are — about to prune, and talking about + RandomX... wearing our space helmets. RandomX still must go through the process of becoming + tried and true, but it’s an exciting part of Monero’s pipeline. This guide gives an + overview of its nature and plans, and where you can learn more." + what_is_randomx: "_What is RandomX_" + what_is_randomx_p1: "RandomX is a new Proof-of-Work (PoW) algorithm that Monero is scheduled + to begin using in the next network update. RandomX is designed to be ASIC resistant by + using random code execution and memory-hard techniques to prevent specialized mining + hardware from dominating the network. Because RandomX is optimized for general-purpose + CPUs, the network will become more decentralized and egalitarian in the distribution of + block rewards." + what_is_randomx_p2: "Visit [github.com/tevador/RandomX](https://github.com/tevador/RandomX) + for more details or watch Howard Chu (hyc) speak about [RandomX at Monero Konferenco](https://github.com/monero-ecosystem/outreach-docs/blob/master/monero-outreach-docs%2Fen%2Ftranscriptions%2Fmonero-konferenco-2019%2FASIC-Resistant_Proof_of_Work-Fact_or_Fantasy.md). + At the time of writing, RandomX is beginning the auditing process with [Trail Of Bits](https://www.trailofbits.com/), + [X41](https://www.x41-dsec.de/), [Quarkslab](https://www.quarkslab.com/) and the + [Kudelski Group](https://www.nagra.com/). RandomX is scheduled to go live during the next + Monero network update." + what_is_randomx_p3: "RandomX has two modes with different memory requirements and + performance. _Fast Mode_ requires 2GB of shared memory but has 4x-6x the performance of + _Light Mode_ which only requires 256MB of RAM. _Fast mode_ is intended for dedicated + miners. _Light mode_ is designed to allow full nodes to validate blocks without requiring + the 2+GB of RAM, so that small devices (like ARM single-board computers, e.g. Rock64) can + still be used as standalone nodes." + randomx_collab: "_RandomX Collaboration_" + randomx_collab_p1: "RandomX was developed for Monero by tevador, hyc, vielmetti, antanst + and SChernykh. Other organizations are already interested in adopting it. [Arweave](https://www.arweave.org/) + (a serverless storage enabler) donated the Trail of Bits audit to the Monero community and + will be implementing RandomX ahead of Monero for their unique application. Arweave provides + an innovative cryptocurrency-based approach to decentralized, long-term data storage. + Mining on Arweave relies on both proof of work and — as a new concept unique to + Arweave — proof of access. Arweave miners are incentivized through proof of access to + replicate and have quick access to data stored in the network." + randomx_collab_p2: "[Wownero](http://wownero.org/) is also launching RandomX in their + upcoming v0.6 update and will call it RandomWOW. RandomX code will be updated after the + audits are complete, so there will be some code divergence by the time Monero forks in + October. Another difference is that RandomWOW will have a smaller scratchpad for hashing, + 1MB instead of 2MB, smaller number of VM execution iterations, and increased chained VM + executions per hash to increase program compilation cost for GPUs." + learn_more: "_Learn More_" + link_monerokon: "Howard Chu (hyc) at Monero Konferenco" + link_press: "Press Release with Arweave" + link_monerotalk_1: "MoneroTalk 2019-06-05 - Howard Chu, and Sam Williams of Arweave" + link_monerotalk_2: "MoneroTalk 2019-03-27 - Howard Chu, Tevador, and Needmoney90" diff --git a/main.py b/main.py index 60d4b4b1..b28f7e84 100644 --- a/main.py +++ b/main.py @@ -7,3 +7,24 @@ def define_env(env): def multiply(arg1, arg2): "Multiply 2 numbers" return arg1 * arg2 + + @env.macro + def i18n_str(key_path): + # https://mkdocs-macros-plugin.readthedocs.io/en/latest/macros/ + lang = env.conf['theme']['language'] + # conf is for mkdocs.yml , use variables + result = env.variables[lang] + # print(f"lang: {lang}, string file contents: {result}") + + # the for loop will set translations + # result = result.notices returns the list + # result = result.outdatedTranslation skips over notices and returns the value + for key in key_path.split('.'): + result = result[key] + if result is None: + # fallback to english + lang = "en" + result = env.variables[lang] + for key in key_path.split('.'): + result = result[key] + return result diff --git a/mkdocs.yml b/mkdocs.yml index 5403083b..e2626093 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -194,6 +194,7 @@ plugins: include_dir: docs/macros/includes include_yaml: - docs/macros/monerod.yml + - en: docs/macros/i18n/en.yml - i18n: docs_structure: folder languages: