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
+22
View File
@@ -0,0 +1,22 @@
import asyncio
from src.config import indexer_settings
async def run_indexer_pipeline():
"""
可重放的确定性流水线:
Fetcher (拉块) -> Decoder (规范化) -> Processor (业务处理) -> Projection (确定性视图落盘)
"""
print(f"Starting WTFX Indexer for Chain [{indexer_settings.CHAIN_ID}]...")
print(f"Target RPC: {indexer_settings.RPC_URL}")
current_block = indexer_settings.START_BLOCK
while True:
# 1. 抓取安全区间块日志 (Fetcher)
# 2. 解码并生成 NormalizedEvent (Decoder)
# 3. 幂等去重检查 (Idempotency Check)
# 4. 业务处理与 Projection 视图更新 (Processor & Projection)
# 5. 更新 Checkpoint
await asyncio.sleep(indexer_settings.POLL_INTERVAL_SECONDS)
if __name__ == "__main__":
asyncio.run(run_indexer_pipeline())