AI-powered blockchain node log analyzer that detects sync failures, peer connectivity issues, and infrastructure bottlenecks.
- Detects peer connection failures
- Identifies blockchain sync stalls
- Flags disk space warnings
- Provides technical remediation suggestions
- Returns structured JSON output with severity levels
Install dependencies:
pip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your_api_key_hereTested on Windows with Git and Python installed.
-
Clone the repository:
git clone https://github.com/CMZS4/ai-node-analyzer.git cd ai-node-analyzer -
(Optional) Create a virtual environment:
python -m venv .venv .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create
.envand add your OpenAI API key:OPENAI_API_KEY=your_api_key_here
-
Run:
python app.py
Place your node log file as:
node_log.txt (or use the sample in examples/node_log.sample.txt)Run the analyzer:
python app.pyResults are saved to:
analysis_result.json- Python
- OpenAI API
- python-dotenv
- CLI arguments (
--input,--output) - Improved error handling
- Web dashboard (Streamlit)
- Docker support
Sample files are included in the examples/ directory:
examples/node_log.sample.txtexamples/analysis_result.sample.json
Run with default paths:
python app.py
Run with a custom input file:
python app.py --input examples/node_log.sample.txt
Run with a custom output file:
python app.py --input examples/node_log.sample.txt --output examples/custom_result.json
Troubleshooting
OPENAI_API_KEY is missing
Create a .env file in the project root and add:
OPENAI_API_KEY=your_api_key_here
Log file not found
Make sure the input path exists, or use:
python app.py --input path/to/your/node_log.txt
JSON parsing failed
Sometimes model output may not be valid JSON. In that case, the raw response is saved to:
raw_model_output.txt
You can inspect it and retry with a shorter or cleaner log input.