Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0781559
Update automation.sh
LauraAntunes1 Mar 3, 2026
900c1c3
Implement Tor node redistribution in parse.py instead of distribution.py
LauraAntunes1 Mar 3, 2026
2ce349c
Delete bitcoin/distribution.py
LauraAntunes1 Mar 3, 2026
d981f66
Add compute_metrics.py
LauraAntunes1 Mar 3, 2026
046ac9b
Create concentration_ratio.py
LauraAntunes1 Mar 3, 2026
33ab5ec
Upload metrics files
LauraAntunes1 Mar 3, 2026
c780365
Update README.md
LauraAntunes1 Mar 3, 2026
4820164
Reorder metrics computation and visualisation sections in workflow
LauraAntunes1 Mar 4, 2026
c508167
Delete unused script
LauraAntunes1 Mar 4, 2026
3f12547
Delete unused script
LauraAntunes1 Mar 4, 2026
68d7b75
Remove unused analyze.py and collect_osdata.py
LauraAntunes1 Mar 4, 2026
117b95a
Metrics now layer-agnostic
LauraAntunes1 Mar 6, 2026
aa2dec5
Metrics now layer-agnostic
LauraAntunes1 Mar 6, 2026
9e6e680
Metrics now layer-agnostic
LauraAntunes1 Mar 6, 2026
b5bd2ec
Metrics now layer-agnostic
LauraAntunes1 Mar 6, 2026
d524a6d
Metrics now layer-agnostic
LauraAntunes1 Mar 6, 2026
32011d9
Metrics now layer-agnostic
LauraAntunes1 Mar 6, 2026
bc1db11
Unused metrics
LauraAntunes1 Mar 10, 2026
517fdf8
Unused metrics
LauraAntunes1 Mar 10, 2026
f9d98bc
Add network and geo metrics to config.yaml
LauraAntunes1 Mar 10, 2026
594013d
Refactor script to accept metric names as parameters
LauraAntunes1 Mar 10, 2026
3fa89d8
Add functions to retrieve network and geo metrics from config file
LauraAntunes1 Mar 10, 2026
639e404
Add metrics directory and related Python files
LauraAntunes1 Mar 10, 2026
3a35644
Refactor ledger name extraction and processing logic
LauraAntunes1 Mar 10, 2026
1061ea4
Refactor compute_metrics to use compute_concentration_ratio
LauraAntunes1 Mar 10, 2026
4ffcd55
Concentration ratio's top-N is now a parameter
LauraAntunes1 Mar 10, 2026
d69344e
Concentration ratio's top-N is now a parameter
LauraAntunes1 Mar 10, 2026
61a96a5
Concentration ratio's top-N is now a parameter
LauraAntunes1 Mar 10, 2026
7860933
Add function to get ledgers without Tor parameter
LauraAntunes1 Mar 10, 2026
74672c1
Add parse_parameters for ledgers without Tor
LauraAntunes1 Mar 10, 2026
2a5d15f
Ledgers without Tor are now parameters
LauraAntunes1 Mar 10, 2026
b641976
Rename parameter
LauraAntunes1 Mar 10, 2026
40590a5
Update automation.sh
LauraAntunes1 Mar 10, 2026
a995b9d
Revert "Unused metrics"
LauraAntunes1 Mar 13, 2026
f73591e
Revert "Unused metrics"
LauraAntunes1 Mar 13, 2026
a3a1d90
Update automation.sh
LauraAntunes1 Mar 16, 2026
2bccfdd
Remove 'max power ratio' occurrences
LauraAntunes1 Mar 17, 2026
8e6431b
Update compute_metrics.py
LauraAntunes1 Mar 17, 2026
f230445
Entropy function's alpha now configurable
LauraAntunes1 Mar 17, 2026
0061c14
Metrics now loaded as a dictionary from config.yaml
LauraAntunes1 Mar 18, 2026
f9e77f5
Update requirements.txt
LauraAntunes1 Mar 18, 2026
0d6d67d
No default values for metrics and without_tor not only for bitcoin
LauraAntunes1 Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This component of the project analyses the decentralisation of Bitcoin, Bitcoin
2. **Data Collection:** Scripts collect data about nodes like IP addresses and client versions.
3. **Data Parsing:** `parse.py` formats raw logs into structured files.
4. **Visualisation:** `plot.py` generates several graphs.
5. **Metrics Computation:** `compute_metrics.py` calculates decentralisation metrics.

---

Expand All @@ -27,24 +28,19 @@ This component of the project analyses the decentralisation of Bitcoin, Bitcoin
- **`parse.py`**
Processes raw data (e.g., logs from crawling) into structured formats (JSON, CSV) for easier analysis and plotting.

- **`analyze.py`** (Not in use)
Analyses datasets to extract decentralisation metrics.

- **`distribution.py`**
Distributes Tor nodes among others proportionally, by country or organisation.
- **`compute_metrics.py`**
Computes network decentralisation metrics (HHI, Nakamoto coefficient, entropy, concentration ratios) from CSV files.

- **`plot.py`**
Generates data visualisations.

- **`collect_geodata.py`**
Uses third-party APIs to enrich nodes with geolocation info (country, city, organisation).

- **`collect_osdata.py`** (Not in use)
Identifies the operating system running on nodes.

- **`cleanup_dead_nodes.py`**
Scans stored node datasets to remove offline or unreachable nodes.


### Automation & Configuration

- **`automation.sh`**
Expand Down Expand Up @@ -92,6 +88,7 @@ The scripts generate:
- Parsed node datasets (CSV, JSON)
- Geolocation-enriched data
- Plots and charts in PNG
- Computed metrics in `output_organizations_*.csv` and `output_countries_*.csv` files

---

Expand All @@ -100,15 +97,13 @@ The scripts generate:
```
bitcoin/
├── analyze.py
├── automation.sh
├── cleanup_dead_nodes.py
├── collect_geodata.py
├── collect_osdata.py
├── crawl.py
├── distribution.py
├── parse.py
├── plot.py
├── compute_metrics.py
├── config.yaml
├── requirements.txt
Expand All @@ -121,7 +116,12 @@ bitcoin/
│ ├── collect.py
│ ├── constants.py
│ ├── helper.py
│ └── protocol.py
│ ├── protocol.py
│ └── metrics/
│ ├── concentration_ratio.py
│ ├── entropy.py
│ ├── herfindahl_hirschman_index.py
│ └── nakamoto_coefficient.py
└── seed_info/
├── bitcoin.json
Expand Down
60 changes: 0 additions & 60 deletions bitcoin/analyze.py

This file was deleted.

5 changes: 2 additions & 3 deletions bitcoin/automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ do
python3 crawl.py # comment this line if new data must not be gathered
python3 cleanup_dead_nodes.py
python3 collect_geodata.py
#python3 collect_osdata.py # not in use
python3 parse.py
python3 distribution.py
python3 plot.py
python3 compute_metrics.py

# The following 2 lines create a folder and move all png and csv files to it
mkdir output/"$(date +%Y-%m-%d)"
mv -t output/"$(date +%Y-%m-%d)" output/*.png output/*.csv
mv -t output/"$(date +%Y-%m-%d)" output/{clients,countries,protocols,organizations,ip,discovery,peerstore}*.csv output/response_length.json output/*.png 2>/dev/null || true

sleep 7d # will repeat the whole process every X days

Expand Down
30 changes: 0 additions & 30 deletions bitcoin/collect_osdata.py

This file was deleted.

Loading