config: add island federation and NAT traversal support for federated mesh architecture
Some checks failed
CLI Tests / test-cli (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Some checks failed
CLI Tests / test-cli (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
- Add island configuration fields (island_id, island_name, is_hub, island_chain_id, hub_discovery_url, bridge_islands) - Add NAT traversal configuration (STUN/TURN servers and credentials) - Add DEFAULT_ISLAND_ID using UUID for new installations - Extend PeerNode with public_address, public_port, island_id, island_chain_id, and is_hub fields - Update DiscoveryMessage to include island metadata and public endpoint
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
import uuid
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
@@ -15,6 +16,9 @@ class ProposerConfig(BaseModel):
|
||||
max_block_size_bytes: int
|
||||
max_txs_per_block: int
|
||||
|
||||
# Default island ID for new installations
|
||||
DEFAULT_ISLAND_ID = str(uuid.uuid4())
|
||||
|
||||
class ChainSettings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file="/etc/aitbc/.env", env_file_encoding="utf-8", case_sensitive=False, extra="ignore")
|
||||
|
||||
@@ -67,6 +71,20 @@ class ChainSettings(BaseSettings):
|
||||
gossip_backend: str = "memory"
|
||||
gossip_broadcast_url: Optional[str] = None
|
||||
|
||||
# NAT Traversal (STUN/TURN)
|
||||
stun_servers: str = "" # Comma-separated STUN server addresses (e.g., "stun.l.google.com:19302,jitsi.example.com:3478")
|
||||
turn_server: Optional[str] = None # TURN server address (future support)
|
||||
turn_username: Optional[str] = None # TURN username (future support)
|
||||
turn_password: Optional[str] = None # TURN password (future support)
|
||||
|
||||
# Island Configuration (Federated Mesh)
|
||||
island_id: str = DEFAULT_ISLAND_ID # UUID-based island identifier
|
||||
island_name: str = "default" # Human-readable island name
|
||||
is_hub: bool = False # This node acts as a hub
|
||||
island_chain_id: str = "" # Separate chain_id per island (empty = use default chain_id)
|
||||
hub_discovery_url: str = "hub.aitbc.bubuit.net" # Hub discovery DNS
|
||||
bridge_islands: str = "" # Comma-separated list of islands to bridge (optional)
|
||||
|
||||
# Keystore for proposer private key (future block signing)
|
||||
keystore_path: Path = Path("/var/lib/aitbc/keystore")
|
||||
keystore_password_file: Path = Path("/var/lib/aitbc/keystore/.password")
|
||||
|
||||
Reference in New Issue
Block a user