OpenStore is a decentralized application store built on blockchain technology. This repository contains the core node infrastructure that powers the OpenStore ecosystem.
The OpenStore node consists of several specialized components working together to provide a complete decentralized app store experience:
- Client System: Synchronizes blockchain data and provides API access
- Oracle Service: Validates external data sources against on-chain contracts
- Validator Service: Verifies application artifacts for security and compliance
- Statistics Service: Collects and processes usage analytics
The project provides 4 main executable binaries:
Location: exec/client/
Binary: api-client
REST API server that provides access to synchronized blockchain data. Serves endpoints for applications, categories, search, reviews, and reports.
Usage:
cargo run --bin api-clientLocation: exec/client/
Binary: daemon-client
Background daemon that continuously synchronizes data from the blockchain and stores it in the database. Monitors blockchain events and updates the local database with the latest information.
Usage:
cargo run --bin daemon-clientLocation: exec/oracle/
Binary: oracle
Oracle service that observes on-chain requests and compares well-known/assetlink.json data with data defined in smart contracts. Acts as a bridge between external data sources and the blockchain.
Usage:
cargo run --bin oracleLocation: exec/validator/
Binary: validator
Validator service responsible for validating application artifacts such as APK files. Performs comprehensive verification of mobile applications to ensure they meet security and quality standards.
Usage:
cargo run --bin validatorOpenStore provides comprehensive deployment tools and configurations in the deploy/ folder for easy setup and management of all services.
-
Clone the repository:
git clone <repository-url> cd node/deploy
-
Generate environment configurations:
# Interactive configuration setup python3 envgen.py # Or use a specific profile (bsctest/localhost) python3 envgen.py --profile bsctest
-
Sync service binaries:
# Download from GitHub releases python3 sync.py # Enter release version (e.g., v1.0.0) or "local" for local build
-
Start all services:
# Build and start all services docker compose up --build -d # View logs docker compose logs -f # Stop services docker compose down
The Docker Compose setup includes:
- api-client: REST API server (internal port 8080)
- daemon-client: Blockchain synchronization daemon
- oracle: External data validation service
- validator: Application artifact validation service
- postgres: PostgreSQL database (port 5432)
- redis: Redis cache (port 6379)
- nginx: Reverse proxy with SSL termination (ports 80/443)
- certbot: SSL certificate management
- admin: Management container with build tools
Use envgen.py to generate service-specific environment files:
# List available profiles
python3 envgen.py --list-profiles
# List available services
python3 envgen.py --list-services
# Generate for specific service
python3 envgen.py --service oracle --profile bsctestSupported Profiles:
- bsctest: BSC Testnet deployment with predefined contracts
- localhost: Local development environment
Generated Configuration Structure:
deploy/.config/
├── api-client/.env
├── daemon-client/.env
├── oracle/.env
├── validator/.env
└── postgres/.env
Use sync.py to manage service binaries:
# Download from GitHub releases
python3 sync.py
# Enter version: v1.0.0
# Use local build
python3 sync.py
# Enter version: localBinaries are organized in deploy/.shared/:
deploy/.shared/
├── api-client/
├── daemon-client/
├── oracle/
├── validator/
├── postgres/
├── redis/
└── sqlite/
For production deployment with SSL certificates:
-
Set environment variables:
export DOMAIN_NAME=api.yourdomain.com export [email protected]
-
Run SSL setup script:
./setup-ssl.sh
This will:
- Configure nginx with HTTP-only template initially
- Obtain SSL certificates via Let's Encrypt
- Switch to HTTPS configuration
- Set up automatic certificate renewal
Manual Template Management:
# Switch to HTTP-only template
./nginx-template.sh initial
# Switch to HTTPS template (after SSL setup)
./nginx-template.sh ssl
# Restart nginx to apply changes
docker compose restart nginxFollow the deployment workflow in deploy/DEPLOY.md:
- Create and tag release
- Build release binaries via GitHub Actions
- Connect to production server
- Sync repository and generate environment configs
- Apply database migrations
- Download and deploy service binaries
- Configure SSL certificates (if needed)
- Restart all services
-
Clone the repository:
git clone <repository-url> cd node
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Build all binaries:
cargo build --release
-
Run individual services:
# Start the daemon to sync blockchain data cargo run --bin daemon-client # Start the API server (in another terminal) cargo run --bin api-client # Start oracle service (in another terminal) cargo run --bin oracle # Start validator service (in another terminal) cargo run --bin validator
├── deploy/ # Deployment configurations and tools
│ ├── .config/ # Generated environment configurations
│ ├── .shared/ # Service binaries and shared data
│ ├── envgen.py # Environment configuration generator
│ ├── sync.py # Binary synchronization tool
│ ├── docker-compose.yml # Multi-service Docker setup
│ ├── Dockerfile.admin # Admin container for builds
│ ├── Dockerfile.service # Service container template
│ ├── DEPLOY.md # Deployment workflow guide
│ └── ENV.md # Environment configuration reference
├── exec/ # Executable services
│ ├── client/ # API and daemon services
│ ├── oracle/ # Oracle validation service
│ ├── validator/ # Application validation service
│ └── stat/ # Statistics collection service
├── data/ # Data access layers
├── core/ # Core utilities and libraries
├── net/ # Network clients and utilities
├── codegen/ # Code generation tools
└── tools/ # Build and development tools
- Docker & Docker Compose (for containerized setup)
- Rust 1.70+ (for native development)
- PostgreSQL (for native setup only)
- Redis (for native setup only)
- ClickHouse (for statistics, native setup only)
tools/build_release.sh- Build optimized release binariestools/codegen.sh- Generate code from protobuf definitions
cargo testEach service has its own detailed documentation:
- Client Service - API and daemon components
- Oracle Service - Data validation oracle
- Validator Service - Application artifact validation
Comprehensive deployment guides and tools:
- Deployment Guide - Production deployment workflow
- Environment Configuration - Environment variables reference
- Docker Compose Setup - Multi-service container orchestration
This project is licensed under the GNU General Public License v3.0 - see the LICENCE file for details.
OpenStore is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.