Blockchain intelligence and analytics platform
Project description
LlamaChain
A comprehensive blockchain analytics and security platform for on-chain data analysis and smart contract security auditing.
๐ Features
- Blockchain Data Access: Connect to multiple blockchains (Ethereum, Solana) and access on-chain data.
- Analytics Dashboard: View and analyze blockchain data through interactive visualizations.
- Security Auditing: Analyze smart contracts for vulnerabilities and security issues.
- Monitoring & Alerts: Monitor addresses, contracts, and transactions with real-time alerts.
- Background Workers: Process blockchain data asynchronously for analytics and monitoring.
- API: Access blockchain data and analytics through a RESTful API.
- CLI: Command-line interface for interacting with the platform.
๐ Getting Started
Prerequisites
- Python 3.8+
- PostgreSQL (optional if using Docker)
- Docker & Docker Compose (optional)
Installation
- Clone the repository:
git clone https://github.com/yourusername/llamachain.git
cd llamachain
- Set up a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
Copy the example .env file and modify as needed:
cp .env.example .env
Using the Startup Script
LlamaChain includes a convenient startup script to manage the application:
# Make the script executable
chmod +x llamachain-script.sh
# Start all services
./llamachain-script.sh start
# Start only the API
./llamachain-script.sh api
# Start only the worker
./llamachain-script.sh worker
# Run CLI commands
./llamachain-script.sh cli blockchain list
# Get help
./llamachain-script.sh --help
# Use Docker if available
./llamachain-script.sh --docker start
Running with Docker
- Build and start services:
docker-compose up -d
-
Access the API at http://localhost:8000
-
Run CLI commands:
docker-compose run --rm api python -m llamachain cli <command>
๐ง Usage
API Examples
The API documentation is available at http://localhost:8000/docs when running the server.
Example Endpoints:
GET /dashboard/summary: Get a summary of blockchain statisticsGET /dashboard/network/stats/{chain}: Get statistics for a specific blockchainGET /dashboard/transactions/recent/{chain}: Get recent transactionsGET /dashboard/security/alerts: Get security alerts
CLI Examples
# List available blockchains
python -m llamachain cli blockchain list
# Get blockchain information
python -m llamachain cli blockchain info ethereum
# Get block information
python -m llamachain cli blockchain block ethereum 12345678
# Get transaction information
python -m llamachain cli blockchain tx ethereum 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
# Run security analysis
python -m llamachain cli security audit ethereum 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
# View configuration
python -m llamachain cli config list
๐ Dashboard
The dashboard provides visualizations and analytics for blockchain data:
- Network statistics
- Transaction volume
- Gas prices
- Security alerts
- Address analytics
- Contract analysis
๐ Security Features
- Smart contract vulnerability detection
- Transaction anomaly detection
- Security alerts and notifications
- Address and contract risk scoring
๐ Project Structure
llamachain/
โโโ analytics/ # Analytics and data processing
โโโ api/ # API server and endpoints
โ โโโ app.py # FastAPI application
โ โโโ endpoints/ # API route handlers
โโโ blockchain/ # Blockchain connectors
โ โโโ base.py # Base blockchain interface
โ โโโ ethereum/ # Ethereum implementation
โ โโโ solana/ # Solana implementation
โโโ cli/ # Command-line interface
โโโ db/ # Database models and session
โโโ worker/ # Background worker processes
โโโ __main__.py # Entry point for the application
โโโ config.py # Configuration settings
โโโ log.py # Logging utilities
๐ป Development
Running Tests
pytest
Linting
flake8 llamachain
black llamachain
Database Migrations
alembic revision --autogenerate -m "description"
alembic upgrade head
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on how to contribute.
๐ข Acknowledgements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llamachain-0.1.0.tar.gz.
File metadata
- Download URL: llamachain-0.1.0.tar.gz
- Upload date:
- Size: 91.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84821555fcaf1a9df8b52aeb04a72ce0d142d0b1f84bc5423ee47888d94e3bfa
|
|
| MD5 |
8e6b7a885d6d492e5b6631f57fa52be2
|
|
| BLAKE2b-256 |
534d4cf289223da97d2fedb68fd8240fbaa91239d3039e8d4ea48b80ca0ba5d0
|
File details
Details for the file llamachain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llamachain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 113.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35a2af0af9ed09fc61c9b1ff45a1fc63fc33952f1c5aacf9e5335216d48561fb
|
|
| MD5 |
8fe5a13129fa6f040a50d9cbb622a4d5
|
|
| BLAKE2b-256 |
a66189d55ba8a57ac2ea980fe2c4aaf940880d134c4d0b9ed35f865dea7645c9
|