当前位置:网站首页>web3.eth. Filter related
web3.eth. Filter related
2022-07-05 13:41:00 【[email protected]】
web3.eth.filter This is mainly used to monitor , The following code block shows , Is to monitor the information of each new block
from web3 import Web3
import time
import json
bsc = "https://bsc-dataseed.binance.org/"
web3 = Web3(Web3.HTTPProvider(bsc))
def handle_event(event):
jsonEventContents = json.loads(Web3.toJSON(event))
print(jsonEventContents)
def log_loop(event_filter, poll_interval):
while True:
for event in event_filter.get_new_entries():
handle_event(event)
time.sleep(poll_interval)
def main():
block_filter = web3.eth.filter("latest")
log_loop(block_filter, 2)
if __name__ == '__main__':
main()
If you use “latest" ,"pengding" To listen to , Back to hx value , If filter by condition , The entire log object will be returned
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140524137083.html
边栏推荐
- Record in-depth learning - some bug handling
- 华为推送服务内容,阅读笔记
- 百度杯”CTF比赛 2017 二月场,Web:爆破-2
- Shandong University Summer Training - 20220620
- “百度杯”CTF比赛 九月场,Web:SQL
- ELK 企业级日志分析系统
- Backup and restore of Android local SQLite database
- ETCD数据库源码分析——rawnode简单封装
- Wonderful express | Tencent cloud database June issue
- kafaka 日志收集
猜你喜欢
Interviewer soul torture: why does the code specification require SQL statements not to have too many joins?
Laravel框架运行报错:No application encryption key has been specified
A detailed explanation of ASCII code, Unicode and UTF-8
CAN和CAN FD
Binder通信过程及ServiceManager创建过程
Operational research 68 | the latest impact factors in 2022 were officially released. Changes in journals in the field of rapid care
南理工在线交流群
TortoiseSVN使用情形、安装与使用
Laravel framework operation error: no application encryption key has been specified
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging
随机推荐
Talking about fake demand from takeout order
Prefix, infix, suffix expression "recommended collection"
ETCD数据库源码分析——rawnode简单封装
Can and can FD
Go array and slice
使用Dom4j解析XML
zabbix 监控
真正的缓存之王,Google Guava 只是弟弟
Address book (linked list implementation)
What is a network port
leetcode 10. Regular expression matching regular expression matching (difficult)
ELK 企业级日志分析系统
jenkins安装
Data Lake (VII): Iceberg concept and review what is a data Lake
49. 字母异位词分组:给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。 字母异位词 是由重新排列源单词的字母得到的一个新单词,所有源单词中的字母通常恰好只用一次。
Binder communication process and servicemanager creation process
My colleague didn't understand selenium for half a month, so I figured it out for him in half an hour! Easily showed a wave of operations of climbing Taobao [easy to understand]
面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
Go pointer
go 数组与切片