This guide covers all installation methods for BlockGuardian components.
- Prerequisites
- Installation Methods
- Platform-Specific Instructions
- Component Setup
- Verification
- Next Steps
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 4 GB | 8+ GB |
| Disk Space | 10 GB | 50+ GB |
| OS | Linux, macOS, Windows 10+ | Ubuntu 20.04+, macOS 12+ |
| Software | Version | Purpose |
|---|---|---|
| Docker | 20.10+ | Container runtime |
| Docker Compose | 2.0+ | Multi-container orchestration |
| Node.js | 16+ | Frontend and blockchain tooling |
| Python | 3.9+ | Backend services |
| Go | 1.18+ | Performance-critical services |
| Git | 2.30+ | Version control |
| Software | Version | Purpose |
|---|---|---|
| Rust | Latest stable | High-performance modules |
| PostgreSQL | 13+ | Production database (if not using Docker) |
| Redis | 6+ | Caching and sessions (if not using Docker) |
The fastest way to get started. This script handles all dependencies and configuration.
# Clone repository
git clone https://github.com/quantsingularity/BlockGuardian.git
cd BlockGuardian
# Run automated setup
./scripts/setup_blockguardian_env.sh
# Start all services
./scripts/run_blockguardian.shWhat this does:
- Checks system prerequisites
- Installs missing dependencies
- Sets up virtual environments
- Creates default configuration files
- Initializes databases
- Starts all services
Best for production deployments and consistent environments.
# Clone repository
git clone https://github.com/quantsingularity/BlockGuardian.git
cd BlockGuardian
# Start all services with Docker
docker-compose up --build
# Run in background (detached mode)
docker-compose up -d --buildServices started:
- Backend API (port 5000)
- Web Frontend (port 3000)
- PostgreSQL database
- Redis cache
For development and customization.
See Component Setup section below for detailed manual installation.
| Step | Command | Notes |
|---|---|---|
| 1. Update system | sudo apt update && sudo apt upgrade -y |
Updates package lists |
| 2. Install Docker | curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh |
Official Docker installation |
| 3. Add user to docker group | sudo usermod -aG docker $USER |
Allows non-root Docker usage |
| 4. Install Node.js | curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && sudo apt install -y nodejs |
Node 18 LTS |
| 5. Install Python | sudo apt install -y python3.9 python3-pip python3-venv |
Python 3.9+ |
| 6. Install Git | sudo apt install -y git |
Version control |
| 7. Clone BlockGuardian | git clone https://github.com/quantsingularity/BlockGuardian.git |
Get source code |
| 8. Run setup | cd BlockGuardian && ./scripts/setup_blockguardian_env.sh |
Automated setup |
| Step | Command | Notes |
|---|---|---|
| 1. Install Homebrew | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
Package manager |
| 2. Install Docker Desktop | Download from https://www.docker.com/products/docker-desktop | GUI installer |
| 3. Install Node.js | brew install node@18 |
Node 18 LTS |
| 4. Install Python | brew install python@3.9 |
Python 3.9+ |
| 5. Install Git | brew install git |
Version control |
| 6. Clone BlockGuardian | git clone https://github.com/quantsingularity/BlockGuardian.git |
Get source code |
| 7. Run setup | cd BlockGuardian && ./scripts/setup_blockguardian_env.sh |
Automated setup |
| Step | Command/Action | Notes |
|---|---|---|
| 1. Install WSL2 | wsl --install in PowerShell (Admin) |
Windows Subsystem for Linux |
| 2. Install Ubuntu | wsl --install -d Ubuntu-22.04 |
Ubuntu distribution |
| 3. Install Docker Desktop | Download from https://www.docker.com/products/docker-desktop | Enable WSL2 backend |
| 4. Open WSL2 terminal | Launch Ubuntu from Start menu | Use WSL2 for all commands |
| 5. Follow Linux instructions | See Linux table above | Continue from step 2 |
Windows Alternative: Use Docker Desktop with WSL2 integration and follow Linux instructions inside WSL2 terminal.
cd code/backend
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Initialize database
python src/database/init_db.py
# Run development server
python src/main.pyVerify: Visit http://localhost:5000/health
cd code/blockchain
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Add your Ethereum node URL and private keys
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Deploy to local network
npx hardhat node # Terminal 1
npx hardhat run scripts/deploy.js --network localhost # Terminal 2
# Deploy to testnet (e.g., Sepolia)
npx hardhat run scripts/deploy.js --network sepoliaVerify: Check deployment output for contract addresses.
cd web-frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env.local
# Set NEXT_PUBLIC_API_URL=http://localhost:5000
# Run development server
npm run dev
# Build for production
npm run build
npm run startVerify: Visit http://localhost:3000
cd mobile-frontend
# Install dependencies
npm install
# or
yarn install
# Start Metro bundler
npm start
# Run on Android (separate terminal)
npm run android
# Run on iOS (macOS only)
npm run iosRequirements:
- Android: Android Studio with SDK 29+
- iOS: Xcode 13+ (macOS only)
cd code/data-analysis
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start Jupyter
jupyter notebook
# Run analysis scripts
python scripts/load_preprocess.py# Backend health
curl http://localhost:5000/health
# Backend API info
curl http://localhost:5000/api/info
# Web frontend
curl http://localhost:3000
# Docker containers (if using Docker)
docker-compose psBackend Health Check:
{
"status": "healthy",
"timestamp": "2025-12-30T10:00:00.000Z",
"version": "1.0.0",
"environment": "development",
"services": {
"database": "healthy",
"redis": "healthy"
}
}Docker Services:
NAME STATUS PORTS
blockguardian_backend Up 0.0.0.0:5000->5000/tcp
blockguardian_web_frontend Up 0.0.0.0:3000->3000/tcp
After installation, configure your environment:
-
Backend Configuration: Edit
code/backend/.env- Set database credentials
- Configure JWT secrets
- Set external API keys
-
Frontend Configuration: Edit
web-frontend/.env.local- Set backend API URL
- Configure blockchain provider URLs
-
Blockchain Configuration: Edit
code/blockchain/.env- Set Ethereum node URLs (Infura, Alchemy)
- Configure deployer private keys (testnet only)
See Configuration Guide for detailed options.
| Issue | Solution |
|---|---|
| Port already in use | Change port in .env or stop conflicting service |
| Docker permission denied | Add user to docker group: sudo usermod -aG docker $USER |
| Python module not found | Activate virtual environment: source venv/bin/activate |
| npm install fails | Clear cache: npm cache clean --force and retry |
| Database connection error | Check PostgreSQL is running: docker-compose ps |
| Redis connection error | Check Redis is running: docker-compose ps |
For more issues, see Troubleshooting Guide.
- Configuration: Review Configuration Guide
- Usage: See Usage Guide for common workflows
- API Integration: Check API Documentation
- Examples: Explore Example Projects
# Stop all services
docker-compose down
# Remove containers and volumes
docker-compose down -v
# Remove cloned repository
cd ..
rm -rf BlockGuardian