# MEV Bot Scripts Directory This directory contains all operational, utility, and development scripts for the MEV Bot project. ## Core Scripts ### Build & Runtime - **build.sh** - Universal Go build script with configurable options - **run.sh** - Main MEV bot execution script with production environment loading - **test.sh** - Basic test runner ### Log Management - **log-manager.sh** ⭐ Production-grade log management system - Real-time analysis and health monitoring - Performance tracking with MEV metrics - Corruption detection and alerting - Background daemon and dashboard generation - See: `./scripts/log-manager.sh --help` ## CI/CD & Quality Assurance ### Primary CI Pipeline - **../harness/local-ci-pipeline.sh** - Comprehensive CI/CD pipeline - **ci-precommit.sh** - Fast pre-commit validation (10-30s) - **ci-quick.sh** - Quick CI pipeline (30-60s) - **ci-dev.sh** - Development CI pipeline (1-2min) - **ci-full.sh** - Full CI pipeline (3-5min) - **ci-container.sh** - Containerized CI execution - **ci-watch.sh** - Watch mode for continuous validation ### Testing - **test-runner.sh** - Configurable test execution (levels: basic, unit, integration, comprehensive, audit) - **run_audit_suite.sh** - Mathematical correctness audit - **security-validation.sh** - Comprehensive security validation - **quick-test.sh** - Quick fix validation (30s) - **run-stress-tests.sh** - Stress testing - **run-fork-tests.sh** - Blockchain fork testing ## Deployment & Production ### Contract Deployment - **deploy-contracts.sh** - Deploy smart contracts to Arbitrum - **verify-contracts.sh** - Verify contracts on Arbiscan - **deploy-staging.sh** - Staging environment deployment - **deploy-production.sh** - Full production deployment with Docker Compose ### Production Operations - **production-start.sh** - Start production MEV bot - **production-validation.sh** - Pre-deployment validation checks - **pre-run-validation.sh** - Environment validation before startup ## Wallet Management - **setup-keystore.sh** - Encrypt and securely store private keys (AES-256-CBC) - **fund-bot-wallet.sh** - Fund MEV bot wallet using Foundry cast - **check-wallet-balance.sh** - Check wallet balance on Arbitrum One ## Monitoring & Analysis - **watch-live.sh** - Real-time MEV bot activity monitor - **analyze.sh** - Comprehensive system analysis (tests, benchmarks, coverage, static analysis) - **performance-profile.sh** - Performance profiling with pprof ## Development Utilities ### Environment Setup - **setup-env.sh** - Environment variable setup - **setup-dev.sh** - Development environment setup - **fix-rpc-config.sh** - Fix RPC configuration issues ### Git Workflow - **git-hooks-setup.sh** - Install git hooks - **git-enhanced.sh** - Enhanced git workflow commands - **git-local-server.sh** - Local git server simulation ### Data & Code Generation - **fetch_arbiscan_tx.sh** - Fetch transaction data from Arbiscan - **extract_multicall_fixture.sh** - Extract multicall fixtures for testing - **refresh-mev-datasets.sh** - Update MEV research datasets - **generate-bindings.sh** - Generate Go bindings for smart contracts ### Other Utilities - **kill-bot.sh** - Stop running MEV bot processes - **dependency-scan.sh** - Scan for dependency vulnerabilities - **verify-organization.sh** - Verify project organization - **24h-validation-test.sh** - 24-hour validation test ## Special Directories ### deprecated/ Contains scripts that have been superseded by better alternatives. See `deprecated/README.md` for migration guide. **Replaced by log-manager.sh:** - archive-logs.sh - quick-archive.sh - view-latest-archive.sh - rotate-logs.sh - setup-log-rotation.sh ### demos/ Contains demonstration and example scripts for testing purposes only. Not for production use. ## Quick Reference ### Development Workflow ```bash # Setup ./scripts/setup-dev.sh # Quick validation ./scripts/ci-precommit.sh # Run tests ./scripts/test-runner.sh --level comprehensive --coverage # Security check ./scripts/security-validation.sh # Math audit ./scripts/run_audit_suite.sh ``` ### Production Deployment ```bash # Validate environment ./scripts/production-validation.sh # Deploy contracts ./scripts/deploy-contracts.sh # Setup wallet ./scripts/setup-keystore.sh ./scripts/check-wallet-balance.sh # Deploy and start ./scripts/deploy-production.sh ./scripts/run.sh ``` ### Monitoring ```bash # Live activity monitor ./scripts/watch-live.sh # Log management ./scripts/log-manager.sh analyze ./scripts/log-manager.sh health ./scripts/log-manager.sh dashboard # Performance profiling ./scripts/performance-profile.sh ``` ## Documentation For detailed script analysis and recommendations, see: - **docs/SCRIPT_ANALYSIS_REPORT.md** - Comprehensive script analysis - **Makefile** - Build automation targets and workflows ## Contributing When adding new scripts: 1. Make scripts executable: `chmod +x script-name.sh` 2. Add shebang: `#!/bin/bash` or `#!/usr/bin/env bash` 3. Use set -e for error handling 4. Add descriptive comments 5. Update this README 6. Add help text (use --help flag) --- **Total Scripts:** 80+ **Active Scripts:** 50+ **Deprecated Scripts:** 5 **Demo Scripts:** 1