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
Metadata
Release files for llamachain 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llamachain-0.1.0.tar.gz | 91.8 kB | Without provenance | Details for llamachain-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llamachain-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llamachain-0.1.0-py3-none-any.whl |
Total release size: 204.9 kB
Release files / llamachain-0.1.0.tar.gz
| Download URL | llamachain-0.1.0.tar.gz |
|---|---|
| Size | 91.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84821555fcaf1a9df8b52aeb04a72ce0d142d0b1f84bc5423ee47888d94e3bfa
|
|
BLAKE2b-256 checksum How to use checksums |
534d4cf289223da97d2fedb68fd8240fbaa91239d3039e8d4ea48b80ca0ba5d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Release files / llamachain-0.1.0-py3-none-any.whl
| Download URL | llamachain-0.1.0-py3-none-any.whl |
|---|---|
| Size | 113.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35a2af0af9ed09fc61c9b1ff45a1fc63fc33952f1c5aacf9e5335216d48561fb
|
|
BLAKE2b-256 checksum How to use checksums |
a66189d55ba8a57ac2ea980fe2c4aaf940880d134c4d0b9ed35f865dea7645c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Security for llamachain 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.