# mvaleev/rkn-checker architecture

> Architecture diagram of the GitHub repository mvaleev/rkn-checker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mvaleev/rkn-checker
- Repository: https://github.com/mvaleev/rkn-checker

## Overview

rkn-checker is a small command-line utility with two user-facing workflows: download the RKN CSV dump, then check an IP against it. The checker extracts IPv4 strings from the supplied file, indexes them in a Patricia trie, and prints whether the requested IP is present. The downloader fetches the published dump and saves it locally. The graph reflects only the sampled scripts and README; no additional runtime subsystems are indicated.

Main entry points: [`ipcheck.py`](https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py) (IP checker), [`download_dump.py`](https://github.com/mvaleev/rkn-checker/blob/main/download_dump.py) (Dump downloader)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_downloader["Dump downloader<br/>[download_dump.py]"]
node_source["Dump service"]
node_dump["CSV dump"]
node_checker["IP checker<br/>[ipcheck.py]"]
node_extractor["IPv4 extractor<br/>[ipcheck.py]"]
node_trie["IP trie<br/>[ipcheck.py]"]
node_result["Check result"]

node_user -->|"runs download"| node_downloader
node_downloader -->|"fetches dump"| node_source
node_downloader -->|"writes file"| node_dump
node_user -->|"runs check"| node_checker
node_checker -->|"reads file"| node_dump
node_checker -->|"extracts addresses"| node_extractor
node_checker -->|"populates and queries"| node_trie
node_checker -->|"prints status"| node_result

click node_downloader "https://github.com/mvaleev/rkn-checker/blob/main/download_dump.py"
click node_checker "https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py"
click node_extractor "https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py"
click node_trie "https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_downloader,node_checker,node_extractor,node_trie toneTeal
class node_source,node_dump,node_result toneIndigo
```

## Components

### Other components

- **User**
- [Dump downloader](https://github.com/mvaleev/rkn-checker/blob/main/download_dump.py): `download_dump.py`
- **Dump service**
- **CSV dump**
- [IP checker](https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py): `ipcheck.py`
- [IPv4 extractor](https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py): `ipcheck.py`
- [IP trie](https://github.com/mvaleev/rkn-checker/blob/main/ipcheck.py): `ipcheck.py`
- **Check result**

## Connections

- User → Dump downloader: runs download (evidence: `README.md`)
- Dump downloader → Dump service: fetches dump (evidence: `download_dump.py`)
- Dump downloader → CSV dump: writes file (evidence: `download_dump.py`)
- User → IP checker: runs check (evidence: `README.md`)
- IP checker → CSV dump: reads file (evidence: `ipcheck.py`)
- IP checker → IPv4 extractor: extracts addresses (evidence: `ipcheck.py`)
- IP checker → IP trie: populates and queries (evidence: `ipcheck.py`)
- IP checker → Check result: prints status (evidence: `ipcheck.py`)
