From ba2140b11f2bb9a1c796a4b2977a041408071d0f Mon Sep 17 00:00:00 2001 From: 17ms Date: Sun, 14 Jul 2024 18:57:59 +0300 Subject: [PATCH] fix: switch to confirmed -> pending txs to level the instream --- src/const.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/const.py b/src/const.py index fb8a640..a2434f9 100644 --- a/src/const.py +++ b/src/const.py @@ -3,8 +3,10 @@ import json DEFAULT_MODE = "production" WS_ADDR = "wss://ws.blockchain.info/coins" -SUB_MSG = json.dumps({"coin": "eth", "command": "subscribe", "entity": "confirmed_transaction"}) +# Optionally `confirmed_transaction` can be used (bursts of data instead of a steady stream, which is worse for the overall performance) +SUB_MSG = json.dumps({"coin": "eth", "command": "subscribe", "entity": "pending_transaction"}) WS_RECONNECT_PAUSE = 2 # Seconds +WS_INTERMSG_TIMEOUT = 1 # Seconds DEFAULT_EXPORT_PATH = "./data/export.json" DEFAULT_EXPORT_INTERVAL = 10800 # 3 hours