- Add multi-chain support with ait-devnet, ait-testnet, ait-mainnet - Add chain selector dropdown in explorer UI - Add /api/chains endpoint to list supported chains - Update all API endpoints to accept optional chain_id parameter - Update RPC URL configuration to support multiple chains per network - Change default port from 3001 to 8016 (enhanced services range) - Update coordinator database path to ./
22 lines
572 B
Python
Executable File
22 lines
572 B
Python
Executable File
"""Database configuration for the coordinator API."""
|
|
|
|
from sqlmodel import create_engine, SQLModel
|
|
from sqlalchemy import StaticPool
|
|
|
|
# Create in-memory SQLite database for now
|
|
engine = create_engine(
|
|
"sqlite:///./data/coordinator.db",
|
|
connect_args={"check_same_thread": False},
|
|
poolclass=StaticPool,
|
|
echo=True # Enable SQL logging for debugging
|
|
)
|
|
|
|
|
|
def create_db_and_tables():
|
|
"""Create database and tables"""
|
|
SQLModel.metadata.create_all(engine)
|
|
|
|
async def init_db():
|
|
"""Initialize database by creating tables"""
|
|
create_db_and_tables()
|