feat: scaffold deterministic replayable indexer architecture with core pipeline, models and docker
This commit is contained in:
+22
@@ -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())
|
||||
Reference in New Issue
Block a user