import websocket
import _thread
import time
import rel
import json
rel.safe_read()
def on_message(ws, message):
message_json = json.loads(message)
if "projected-block-transactions" in message_json.keys():
projected_block_transactions = message_json["projected-block-transactions"]
delta = projected_block_transactions["delta"]
added = delta["added"]
removed = delta["removed"]
changed = delta["changed"]
print(len(added), len(removed), len(changed))
# print(json.loads(message))
def on_error(ws, error):
print(error)
def on_close(ws, close_status_code, close_msg):
print("### closed ###")
def on_open(ws):
mempool 内存池监控
最新推荐文章于 2024-08-30 12:42:13 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)