feat: scaffold deterministic replayable indexer architecture with core pipeline, models and docker

This commit is contained in:
Bot
2026-08-31 00:03:33 +08:00
parent b9bed788d7
commit fae49b2b1e
15 changed files with 165 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from pydantic import BaseModel, Field
from typing import Dict, Any, Optional
class NormalizedEvent(BaseModel):
"""跨链与跨合约的标准归一化事件 (Layer 2)"""
chain_id: int
block_number: int
tx_hash: str
log_index: int
event_type: str = Field(description="e.g. MARKET_CREATED, MINT_COLLATERAL, REDEEM_OT, RESOLVE_OUTCOME, CLAIM")
contract_address: str
payload: Dict[str, Any]
timestamp: int
@property
def event_id(self) -> str:
"""全局唯一幂等标识 (Idempotency Key)"""
return f"{self.chain_id}:{self.tx_hash}:{self.log_index}"