How ursisterbtw/hash_hunter works
Project Type and Purpose
• This is an open-source, dual-language (Rust & Python) CLI tool for generating Ethereum vanity addresses.
• It includes a proof-of-concept core generator, helper utilities (scoring, notifications, linting), an orchestration layer, cloud deployment recipes, and CI/CD pipelines.
File Structure Analysis
• Top-level implementations:
• src/main.rs (Rust CLI entrypoint)
• src/main.py (Python CLI entrypoint)
• Core utility modules:
• wallet_scoring.py (rarity scoring)
• notifications.py (alerts, e.g., email/webhook)
• linter.py (pattern validation or code checks)
• orchestrator.py (task dispatching, multi-node support)
• Config & Deployment:
• cloud_methods/docker_swarm & /railway (Docker Swarm & Railway deployment scripts)
• Dockerfile, docker-compose.yml, .devcontainer (local container dev)
• wasm/ (WebAssembly spec & containerization)
• CI/CD & Testing:
• .github/workflows (Rust, Python, Docker build & test jobs)
• benchmark.rs, rust_tests.rs, test_python.py
• Project metadata:
• Cargo.toml, requirements.txt, README.md
Key README Insights
• Two parallel implementations maximize CPU utilization and support multi-threading/multi-processing.
• Features include pattern‐based search, checksum support, entropy & crack‐time estimation, file output on match.
• Encourages cloud deployment and contributions; MIT license.
Components
a. Core Components
1. Rust CLI Module (main.rs + salty_sailor crate)
2. Python CLI Module (main.py + Cython binding in main.pyx)
3. Pattern Matching Engine (shared concept; implemented independently in each)
4. Utility Services:
– Wallet Scoring Service
– Notification Service
– Lint/Validation Service
5. Orchestrator Service (task distribution, pooling, cloud coordination)
6. WASM Component (spec.rs, container for browser or FaaS)
b. Infrastructure & Deployment
1. Local Containers (.devcontainer, Dockerfile, docker-compose.yml)
2. Cloud Deployments (Docker Swarm, Railway scripts & configs)
3. CI/CD Pipelines (GitHub Actions)
c. External Systems
1. Docker Registry
2. Railway Cloud Platform
3. Docker Swarm Managers & Workers
4. (Optional) Notification Endpoints (Slack, Email, Webhook)
Relationships & Interactions
• CLI Module → invokes Pattern Matching Engine → calls Wallet Scoring → on match invokes Notification Service → writes wallet file to disk.
• Orchestrator Service ↔ CLI Module: spawns multiple CLI instances across containers or cloud nodes.
• Orchestrator Service → uses cloud_methods scripts to spin up Docker Swarm or Railway instances.
• WASM Component can be invoked by Orchestrator or embedded in FaaS for browser‐side proof‐of‐concept.
• CI/CD ← monitors repo commits, builds Docker images, runs Rust & Python tests/benchmarks.
Architectural Patterns & Principles
• Separation of Concerns: distinct modules for generation, scoring, notifications, orchestration.
• Polyglot Implementation: two parallel codepaths in Rust & Python for performance vs ergonomics.
• Modular Deployment: containerize each component, deploy on diverse environments.
• Extensibility Points: utility services and orchestrator can be replaced or extended (e.g., new notification channels).
Detailed Elements to Capture
• Both Rust and Python entrypoints as separate yet functionally equivalent components.
• Utility modules as shared services behind the engine.
• The orchestrator’s ability to scale horizontally via Docker Swarm or Railway.
• WASM component as a tertiary delivery mechanism.
• CI/CD pipelines and devcontainer workflows feeding into container builds and deployments.