当前位置:网站首页>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
边栏推荐
- Address book (linked list implementation)
- 通讯录(链表实现)
- Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications
- jasypt配置文件加密|快速入门|实战
- Write API documents first or code first?
- Don't know these four caching modes, dare you say you understand caching?
- Lb10s-asemi rectifier bridge lb10s
- Network security HSRP protocol
- 运筹说 第68期|2022年最新影响因子正式发布 快看管科领域期刊的变化
- [public class preview]: basis and practice of video quality evaluation
猜你喜欢

面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?

记录一下在深度学习-一些bug处理

Idea remote debugging agent

Idea设置方法注释和类注释

TortoiseSVN使用情形、安装与使用
![[server data recovery] a case of RAID5 data recovery stored in a brand of server](/img/04/c9bcf883d45a1de616c4e1b19885a5.png)
[server data recovery] a case of RAID5 data recovery stored in a brand of server

Could not set property ‘id‘ of ‘class XX‘ with value ‘XX‘ argument type mismatch 解决办法

stm32逆向入门

“百度杯”CTF比赛 九月场,Web:SQL

南理工在线交流群
随机推荐
APICloud Studio3 WiFi真机同步和WiFi真机预览使用说明
[深度学习论文笔记]使用多模态MR成像分割脑肿瘤的HNF-Netv2
Don't know these four caching modes, dare you say you understand caching?
leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
The "Baidu Cup" CTF competition was held in February 2017, Web: explosion-2
【MySQL 使用秘籍】一网打尽 MySQL 时间和日期类型与相关操作函数(三)
Idea set method annotation and class annotation
leetcode 10. Regular expression matching regular expression matching (difficult)
Binder communication process and servicemanager creation process
Nantong online communication group
Intranet penetration tool NetApp
ELFK部署
Basic characteristics and isolation level of transactions
French scholars: the explicability of counter attack under optimal transmission theory
Wonderful express | Tencent cloud database June issue
时钟周期
“百度杯”CTF比赛 九月场,Web:SQL
Flutter 3.0更新后如何应用到小程序开发中
嵌入式软件架构设计-消息交互
leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)