Skip to content

Commit

Permalink
Deployed 6fefeca with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 5, 2023
1 parent eee5e9b commit cc87310
Show file tree
Hide file tree
Showing 12 changed files with 263 additions and 58 deletions.
4 changes: 4 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
<li class="toctree-l1"><a class="reference internal" href="/mappings/">Mappings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/aggregator/">Aggregator</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/metrics/">Metrics</a>
</li>
Expand Down
159 changes: 159 additions & 0 deletions aggregator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="../img/favicon.ico" />
<title>Aggregator - Consensus Blockchain Decentralization - Docs</title>
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />

<script>
// Current page data
var mkdocs_page_name = "Aggregator";
var mkdocs_page_input_path = "aggregator.md";
var mkdocs_page_url = null;
</script>

<!--[if lt IE 9]>
<script src="../js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body class="wy-body-for-nav" role="document">

<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Consensus Blockchain Decentralization - Docs
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>

<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="..">Home</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../setup/">How to use</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../data/">Data Collection</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../parsers/">Parsers</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../mappings/">Mappings</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Aggregator</a>
<ul class="current">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../metrics/">Metrics</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contribute/">How to contribute</a>
</li>
</ul>
</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Consensus Blockchain Decentralization - Docs</a>

</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href=".." class="icon icon-home" aria-label="Docs"></a></li>
<li class="breadcrumb-item active">Aggregator</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">

<h1 id="aggregator">Aggregator</h1>
<p>The aggregator obtains the mapped data of a ledger (from <code>output/&lt;project_name&gt;/mapped_data.json</code>), aggregates it
over the given timeframe(s) and outputs one or more <code>csv</code> files with the distribution of block to entities,
structured as follows:</p>
<pre><code>Entity,Resources
&lt;name of entity&gt;,&lt;(int) number of blocks&gt;
</code></pre>
<p>Specifically, if the <code>timeframe</code> argument is provided during execution, then the mapping outputs a single <code>csv</code>
file that corresponds to that timeframe. Otherwise, it outputs a <code>csv</code> file for each month contained in the default
time range (as specified in the <a href="https://github.com/Blockchain-Technology-Lab/pooling-analysis/blob/main/config.yaml">config file</a>).
It also outputs a <code>csv</code> file for each year contained in the relevant time frames.</p>
<p>Each <code>csv</code> file is named after the timeframe over which the mapping was executed (e.g., <code>2021-04.csv</code>) and is
stored in a dedicated folder in the project's output directory (<code>output/&lt;project_name&gt;/blocks_per_entity/</code>).</p>

</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href="../mappings/" class="btn btn-neutral float-left" title="Mappings"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="../metrics/" class="btn btn-neutral float-right" title="Metrics">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>

<hr/>

<div role="contentinfo">
<!-- Copyright etc -->
</div>

Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>

</div>
</div>

</section>

</div>

<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">


<span><a href="../mappings/" style="color: #fcfcfc">&laquo; Previous</a></span>


<span><a href="../metrics/" style="color: #fcfcfc">Next &raquo;</a></span>

</span>
</div>
<script src="../js/jquery-3.6.0.min.js"></script>
<script>var base_url = "..";</script>
<script src="../js/theme_extra.js"></script>
<script src="../js/theme.js"></script>
<script src="../search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
26 changes: 14 additions & 12 deletions contribute/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
<li class="toctree-l1"><a class="reference internal" href="../mappings/">Mappings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../aggregator/">Aggregator</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../metrics/">Metrics</a>
</li>
Expand Down Expand Up @@ -115,27 +119,25 @@ <h1 id="how-to-contribute">How to contribute</h1>
<h2 id="add-support-for-ledgers">Add support for ledgers</h2>
<p>You can add support for a ledger that is not already supported as follows.</p>
<h3 id="mapping-information">Mapping information</h3>
<p>In the directory <code>mapping_information</code>, there exist three folders (<code>addresses</code>,
<p>In the directory <code>mapping_information/</code>, there exist three folders (<code>addresses</code>,
<code>clusters</code>, <code>identifiers</code>). In each folder, add a file named
<code>&lt;project_name&gt;.json</code>, if there exist such information for the new ledger (for
more details on what type of information each folder corresponds to see the
<a href="https://blockchain-technology-lab.github.io/consensus-decentralization/mappings/">mapping
documentation</a>).</p>
<h3 id="parser-and-mapping">Parser and mapping</h3>
<p>In the directory <code>consensus_decentralization/parsers</code>, create a file named <code>&lt;project_name&gt;_parser.py</code>,
if no existing parser can be reused. In this file create a new class, which
<p>If no existing parser can be reused, create a file named <code>&lt;project_name&gt;_parser.py</code> in the directory
<code>consensus_decentralization/parsers/</code>.
In this file create a new class, which
inherits from the <code>DefaultParser</code> class of <code>default_parser.py</code>. Then,
override its <code>parse</code> method in order to implement the new parser (or override another
method if there are only small changes needed, e.g. <code>parse_identifiers</code> if the only thing
that is different from the default parser is the way identifiers are decoded).</p>
<p>In the directory <code>consensus_decentralization/mappings</code>, create a file named
<code>&lt;project_name&gt;_mapping.py</code>, if no existing mapping can be reused. In this file
<p>If no existing mapping can be reused, create a file named <code>&lt;project_name&gt;_mapping.py</code> in the directory
<code>consensus_decentralization/mappings/</code>. In this file
create a new class, which inherits from the <code>DefaultMapping</code> class of <code>default_mapping.py</code>.
Then, override its <code>process</code> method. This method takes as input a time period in
the form <code>yyyy-mm-dd</code> (e.g., '2022' for the year 2022, '2022-11' for November
2022, '2022-11-12' for 12 November 2022), returns a dictionary of the form
<code>{'&lt;entity name&gt;': &lt;number of resources&gt;}</code>, and creates a csv file with the mapped
data for this timeframe in the <code>output</code> directory.</p>
Then, override its <code>perform_mapping</code> method and/or any other methods that are required
(e.g. <code>map_from_known_identifiers</code>).</p>
<p>Then, you should enable support for the new ledger in the parser and mapping
module scripts. Specifically:</p>
<ul>
Expand All @@ -147,8 +149,8 @@ <h3 id="parser-and-mapping">Parser and mapping</h3>
<p><em>Notes</em>:</p>
<ul>
<li>You should add an entry in each dictionary, regardless of whether you use a new or existing parser or mapping – if no
new parser or mapping class was created for the project, simply assign the suitable class (e.g. DefaultParser or
DefaultMapping) to the project's name in the corresponding dictionary.</li>
new parser or mapping class was created for the project, simply assign the suitable class (e.g. <code>DefaultParser</code> or
<code>DefaultMapping</code>) to the project's name in the corresponding dictionary.</li>
<li>If you create a new parser/mapping, you should also add unit
tests <a href="https://github.com/Blockchain-Technology-Lab/consensus-decentralization/tree/main/tests">here</a></li>
</ul>
Expand Down
4 changes: 4 additions & 0 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
<li class="toctree-l1"><a class="reference internal" href="../mappings/">Mappings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../aggregator/">Aggregator</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../metrics/">Metrics</a>
</li>
Expand Down
18 changes: 12 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
<li class="toctree-l1"><a class="reference internal" href="mappings/">Mappings</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="aggregator/">Aggregator</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="metrics/">Metrics</a>
</li>
Expand Down Expand Up @@ -106,15 +110,17 @@ <h2 id="overview">Overview</h2>
<ul>
<li>Parser</li>
<li>Mapping</li>
<li>Aggregator</li>
<li>Metrics</li>
</ul>
<p>The parser is responsible for pre-processing the raw data that comes from a full node. It produces a file
with all the information that is needed for the mapping.</p>
<p>The mapping takes the output of the parser and combines it with some other
sources of information. It then outputs a file that reveals the distribution of
resources to different entities. In this context, "resources" correspond to the
number of produced blocks.</p>
<p>This distribution is the input for the metrics module, which tracks various
<p>The mapping takes the output of the parser, combines it with some other sources of information, and produces a new
file that includes attribution data for each block and which mapping method was used to obtain it.</p>
<p>The aggregator takes as input the output of the mapping, as well as one or more time frames to aggregate over. It then
outputs a file for each time frame that reveals the distribution of resources to different entities during that time
frame. In this context, "resources" correspond to the number of produced blocks.</p>
<p>These distributions are then the input for the metrics module, which tracks various
decentralization-related metrics and produces files with the results.</p>
<p>More details about the different modules can be found in the corresponding <a href="parsers/">Parser</a>, <a href="mappings/">Mapping</a>
and <a href="metrics/">Metrics</a> pages.</p>
Expand Down Expand Up @@ -194,5 +200,5 @@ <h2 id="contributing">Contributing</h2>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2023-10-04 14:57:17.934477+00:00
Build Date UTC : 2023-10-05 13:47:03.079361+00:00
-->
Loading

0 comments on commit cc87310

Please sign in to comment.