A comprehensive platform that combines Lava Network, SUI blockchain indexing, SUI Full Node, Lava Provider, and Supabase database services in a unified Docker Compose setup.
MasterProject/
├── docker-compose.yml # Main compose file with service integrations
├── lava/
│ ├── config.yml # Lava node configuration
│ └── docker/
│ └── state-sync/
│ └── docker-compose.yml # Lava node services definition
├── lava-provider/ # Lava Provider configuration
│ └── docker-compose.yml # Lava provider services definition
├── sui-fullnode/ # SUI Full Node directory
│ ├── fullnode.yaml # SUI Full Node configuration
│ └── docker-compose.yml # SUI Full Node services definition
├── sui-sender-indexer/
│ └── docker-compose.yml # SUI indexer services definition
└── supabase/
└── docker/
└── docker-compose.yml # Supabase services definition
Provides blockchain node services for the Lava Network. Includes state synchronization capabilities for fast bootstrapping.
Acts as a relay for blockchain data requests. Serves RPC requests to the SUI Full Node and leverages auto-generated REST endpoints from Supabase.
Serves as the primary data source for the SUI blockchain. Provides RPC endpoints that the Lava Provider relays to clients.
Processes SUI blockchain data from the SUI Full Node and stores it in the Supabase database. Depends on both the Supabase database and SUI Full Node being available.
Provides PostgreSQL database services and auto-generates REST endpoints from the database schema, which are used by the Lava Provider to serve indexed data.
┌───────────────┐
│ SUI Full Node│
└───────┬───────┘
│
┌────────────────┴────────────────┐
│ │
▼ ▼
┌────────────┐ feeds ┌────────────┐ serves RPC ┌────────────┐
│ SUI Indexer │◄──────────┤ Blockchain │───────────────►│Lava Provider│
└──────┬─────┘ data │ Data │ └──────┬─────┘
│ └────────────┘ │
│ stores │
▼ │
┌─────────────┐ auto-generates ┌────────────────┐ │
│ Supabase DB │─────────────────►│ REST Endpoints │◄─────────┘
└─────┬───────┘ └────────────────┘ serves REST
│
│ provides
▼
┌────────────────┐ ┌────────────┐
│ Data Storage │◄─────────────┤ Lava Node │
│ & API Services│ └────────────┘
└────────────────┘
| Service Name | Description | Ports |
|---|---|---|
| lava-node | Lava blockchain node | 1317, 9090, 9091, 26656, 26657 |
| lava-node-init | Initializes the Lava node | - |
| lava-node-config | Configures the Lava node | - |
| lava-provider | Lava Provider for relaying blockchain requests | 7777 |
| sui-fullnode | SUI blockchain full node | 9000, 9184 |
| sui-indexer | Indexes SUI blockchain data | (depends on implementation) |
| supabase-db | PostgreSQL database | 5432 |
| supabase-kong | API Gateway | 8000 |
| supabase-auth | Authentication service | - |
| supabase-rest | RESTful API service | 3000 |
| supabase-studio | Admin UI | 3001 |
| supabase-storage | File storage | - |
| supabase-realtime | Real-time subscriptions | - |
| supabase-vector | Vector embeddings | - |
| supabase-supavisor | Connection pooler | - |
- Docker and Docker Compose v2+ installed
- At least 16GB RAM available for all services
- At least 200GB storage space (SUI Full Node requires significant storage)
-
Clone the repository:
git clone <repository-url> MasterProject cd MasterProject
-
Configure your environment:
- Review and modify
lava/config.ymlas needed - Configure
sui-fullnode/fullnode.yamlwith appropriate network settings - Configure
lava-provider/config.ymlto point to SUI Full Node and Supabase endpoints - Check any environment variables in the individual docker-compose files
- Review and modify
-
Update the main docker-compose file:
# MasterProject/docker-compose.yml include: - path: ./lava/docker/state-sync/docker-compose.yml project_directory: ./lava/docker/state-sync name: lava - path: ./lava-provider/docker-compose.yml project_directory: ./lava-provider name: lava-provider - path: ./sui-fullnode/docker-compose.yml project_directory: ./sui-fullnode name: sui-fullnode - path: ./sui-sender-indexer/docker-compose.yml project_directory: ./sui-sender-indexer name: sui - path: ./supabase/docker/docker-compose.yml project_directory: ./supabase/docker name: supabase
-
Start all services:
docker compose up -d
-
Check service status:
docker compose ps
The system is designed with the following dependency chain:
- Supabase DB starts first and waits until healthy
- SUI Full Node starts independently
- SUI Indexer starts after both Supabase DB is healthy and SUI Full Node is available
- Lava Provider starts after both SUI Full Node and Supabase REST services are available
- Lava Node runs independently but connects to the Lava Provider
To set up these dependencies in docker-compose.yml:
# Update services in docker-compose.yml
sui-indexer:
depends_on:
supabase-db:
condition: service_healthy
sui-fullnode:
condition: service_healthy
lava-provider:
depends_on:
sui-fullnode:
condition: service_healthy
supabase-rest:
condition: service_healthySupabase automatically generates RESTful API endpoints from your database tables. These endpoints are leveraged by the Lava Provider to serve indexed blockchain data.
- The SUI Indexer stores blockchain data in structured tables within Supabase
- Supabase's
postgrestservice generates REST endpoints for each table - The Lava Provider is configured to proxy specific API requests to these endpoints
- External applications access this data through the Lava Network
- Create appropriate database schemas in Supabase
- Configure proper roles and permissions for API access
- Use the Supabase Studio interface to manage and test endpoints
Example configuration in the Lava Provider to use Supabase REST endpoint:
endpoints:
- name: sui_getTransactionsByAddress
target: http://supabase-rest:3000/rest/v1/transactions?address=eq.{{.address}}&limit={{.limit}}
method: GET
headers:
apikey: ${SUPABASE_ANON_KEY}docker compose up -ddocker compose downdocker compose restart <service-name>docker compose logsdocker compose logs -f <service-name>docker stats- SUI Blockchain → SUI Full Node: The Full Node syncs with the SUI blockchain network.
- SUI Full Node → SUI Indexer: The indexer retrieves data from the local SUI Full Node.
- SUI Indexer → Supabase DB: Processed blockchain data is stored in the Supabase PostgreSQL database.
- Supabase DB → REST Endpoints: Supabase automatically generates REST APIs from the database schema.
- External Applications → Lava Network → Lava Provider: Applications make requests through the Lava Network.
- Lava Provider → SUI Full Node: Direct RPC requests are forwarded to the SUI Full Node.
- Lava Provider → Supabase REST: Indexed data requests are forwarded to Supabase's auto-generated REST endpoints.
The setup maintains persistent data through Docker volumes:
lava_data: Stores blockchain data for the Lava nodesui_fullnode_data: Stores the SUI blockchain data for the Full Node- Supabase-related volumes for database, storage, etc.
The SUI Full Node requires specific configuration:
-
Download the appropriate genesis blob for your network:
# For mainnet curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/mainnet/genesis.blob -
Configure the fullnode.yaml file:
# Basic configuration for SUI Full Node p2p-config: seed-peers: # Add appropriate seed peers for your network - address: /dns/sui-mainnet-seed-0.mysten.io/udp/8084 peer-id: [peer-id] genesis: genesis-file-location: "/sui/genesis.blob" db-path: "/sui/db" metrics-address: "0.0.0.0:9184" json-rpc-address: "0.0.0.0:9000"
The Lava Provider serves as a gateway between client applications and blockchain data sources:
-
Configure the Lava Provider to connect to the Lava Network:
# lava-provider/config.yml provider: chain: sui network: mainnet moniker: "my-sui-provider" # Lava staking details stake: "5000000000ulava"
-
Set up endpoints mapping:
# Simple RPC endpoints forwarded to SUI Full Node endpoints: - name: sui_getObject target: http://sui-fullnode:9000 method: POST # REST endpoints from Supabase - name: sui_getIndexedBlocks target: http://supabase-rest:3000/rest/v1/sui_blocks method: GET headers: apikey: ${SUPABASE_ANON_KEY}
If the Lava Provider cannot connect to data sources:
- Check if both SUI Full Node and Supabase services are running
- Verify network connectivity between containers
- Confirm endpoint configurations in the Lava Provider
If the SUI Full Node is not synchronizing:
- Check if the Full Node is syncing:
docker compose logs sui-fullnode - Verify the genesis blob is correct for your network
- Check the fullnode.yaml configuration
- Ensure enough disk space is available for blockchain data
If the SUI Indexer cannot connect to the database:
- Check if the Supabase DB container is healthy:
docker compose ps - Verify network connectivity between containers
- Ensure database credentials are correct
If the auto-generated REST endpoints aren't working:
- Check Supabase REST service logs:
docker compose logs supabase-rest - Verify database schema and permissions
- Test endpoints directly using the Supabase Studio interface
# Restart all services
docker compose down && docker compose up -d
# Check container logs
docker compose logs -f
# Inspect a specific container
docker inspect <container-id># Pull latest images
docker compose pull
# Restart with new images
docker compose down && docker compose up -d# Backup Supabase database
docker compose exec supabase-db pg_dump -U postgres -d postgres > backup.sql
# Backup SUI configuration (not blockchain data)
cp sui-fullnode/fullnode.yaml sui-fullnode/fullnode.yaml.backup# Check SUI Full Node sync status
curl -s -X POST http://localhost:9000 -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"sui_getLatestCheckpointSequenceNumber","params":[]}'
# Check Supabase REST endpoint
curl -s http://localhost:3000/rest/v1/health