Skip to main content

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.

LlamaChain Banner

๐ŸŒŸ 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

  1. Clone the repository:
git clone https://github.com/yourusername/llamachain.git
cd llamachain
  1. Set up a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. 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

  1. Build and start services:
docker-compose up -d
  1. Access the API at http://localhost:8000

  2. 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 statistics
  • GET /dashboard/network/stats/{chain}: Get statistics for a specific blockchain
  • GET /dashboard/transactions/recent/{chain}: Get recent transactions
  • GET /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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llamachain-0.1.0.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llamachain-0.1.0-py3-none-any.whl (113.0 kB view details)

Uploaded Python 3

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

Hashes for llamachain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 84821555fcaf1a9df8b52aeb04a72ce0d142d0b1f84bc5423ee47888d94e3bfa
MD5 8e6b7a885d6d492e5b6631f57fa52be2
BLAKE2b-256 534d4cf289223da97d2fedb68fd8240fbaa91239d3039e8d4ea48b80ca0ba5d0

See more details on using hashes here.

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

Hashes for llamachain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35a2af0af9ed09fc61c9b1ff45a1fc63fc33952f1c5aacf9e5335216d48561fb
MD5 8fe5a13129fa6f040a50d9cbb622a4d5
BLAKE2b-256 a66189d55ba8a57ac2ea980fe2c4aaf940880d134c4d0b9ed35f865dea7645c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page