How realaskaer/attackmachine works
Project Type and Purpose
• This is a powerful, fully automated Python tool designed for managing and executing financial operations (swaps, bridges, deposit/withdrawal tasks, NFT minting, etc.) across multiple blockchain networks.
• Its purpose is to automate routing “attacks” (or operations) over a large number of cryptocurrency accounts, handling tasks such as fund transfers, liquidity management, and interfacing with both centralized exchanges (CEXs) and decentralized bridges/exchanges.
• The project is structured to load account data (from Excel and JSON), apply a complex set of configuration rules (in settings.py and config.py), and execute a series of modular operations (as defined in the “modules” subfolders).
Analyzing the File Structure
• Top-Level Files and Configurations:
• main.py: Acts as the primary entry point for launching the automated workflow.
• config.py, general_settings.py, settings.py: Handle configuration options like API keys, network settings, and module-specific parameters.
• version.py: Likely used to track software versioning.
• Data Directory:
• data/accounts_data.xlsx and various JSON files provide input data and service configurations.
• data/logs folder indicates that logging is organized by date, hinting at a runtime monitoring/logging component.
• Modules Directory:
• Contains subfolders for different areas: blockchains, bridges, centralized exchanges (cexs), landings, onmichain operations, and other specialized modules (swaps, miscellaneous utilities, and transactional checks).
• Each subdirectory has an __init__.py and various Python files for specific functionalities (e.g., “evm.py” for blockchain operations, “across.py” and “bungee.py” under bridges, and multiple swap modules).
• This structure suggests the use of a plugin or modular interface design, where each module can be independently developed and executed.
• Utils Directory:
• Includes specialized tools such as route generators, network configurations, and signature utilities.
• The presence of functions.py, modules_runner.py, and an assortment of additional helper scripts points to a layered architecture that separates core workflow control from domain-specific modules.
a. Main Components:
• Core Engine:
• Represented by main.py, which orchestrates the entire operation.
• Includes components for asynchronous task execution (as indicated by “Асинхронный ООП код” in the README).
• Configuration/Settings Manager:
• Encompasses settings.py, config.py, and general_settings.py.
• Responsible for reading parameters, API keys, network configurations, and module behaviors.
• Data Input and Logging:
• Data ingestion from Excel and JSON files in the data/ folder, including account details and service configuration.
• Logging system using daily logs stored under data/logs.
• Module Plugins:
• Interfaces in the modules folder; divide these into submodules such as:
– Blockchains (modules/blockchains)
– Bridges (modules/bridges)
– CEX Handling (modules/cexs)
– Swaps (modules/swaps)
– NFT/misc. operations (modules/landings, modules/onmichain, modules/others)
– Transaction Checkers (modules/txchecker.py)
• Each module performs a specific financial operation or API call as per the settings provided.
• Utilities:
• Supportive utility functions (network configuration, signature creation, route generation) from the utils folder.
• External Service Integration:
• Interaction with Google Sheets (for route generation and progress updates as described) and possibly other external APIs.
• Google Cloud API and proxy checks as noted in the README.
b. Relationships and Interactions:
• The Core Engine (main.py) interacts with the Configuration Manager at startup to load all settings.
• It then reads account data from the data directory to prepare the workflow.
• Using a module runner (from utils/modules_runner.py), the engine sequentially or in parallel invokes the different modules (bridges, swaps, etc.) based on the provided configuration.
• Data flows from input (Excel/JSON files) into the modules, with output and progress being logged into files and optionally sent as Telegram notifications.
• Utilities (in utils/) support modules by providing network routes, generating transaction documents, and handling cryptographic tasks.
c. Architectural Patterns and Design Principles:
• Modular/Plugin Architecture: Each major asset (bridges, CEX operations, swaps, NFT minting) is encapsulated in its own Python module. This encourages separation of concerns and facilitates easy updates or extension of functionalities.
• Asynchronous Execution: Noted in the README (“Асинхронный ООП код”), suggesting that parallel task handling is a key design element (supported via the ACCOUNTS_IN_STREAM setting).
d. Relevant Technologies, Frameworks, and Libraries:
• Python 3.10.11 is the required version.
• Usage of asynchronous programming (possibly with asyncio) for parallel execution.
• Excel file handling for account data, likely through a library like openpyxl or pandas.
• JSON handling for configurations.
• Libraries used for networking, HTTP requests, and possibly cryptographic operations (e.g., in utils/stark_signature).
Instructing the Principal Software Engineer
• Component Labels: Clearly mark each major module/component (Core Engine, Configuration Manager, Data Loader, each plugin category, Utilities, Logging System, and External Integrations).
• Detail each interaction: Describe relationships such as how account data moves from input files to the modules, and how modules feed back progress/status to the logging system.