当前位置:网站首页>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
边栏推荐
- Go array and slice
- "Baidu Cup" CTF competition in September, web:sql
- Summit review | baowanda - an integrated data security protection system driven by compliance and security
- Binder communication process and servicemanager creation process
- Android本地Sqlite数据库的备份和还原
- [public class preview]: basis and practice of video quality evaluation
- 不知道这4种缓存模式,敢说懂缓存吗?
- 运筹说 第68期|2022年最新影响因子正式发布 快看管科领域期刊的变化
- 法国学者:最优传输理论下对抗攻击可解释性探讨
- ELK 企业级日志分析系统
猜你喜欢

FPGA learning notes: vivado 2019.1 add IP MicroBlaze
![[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
![[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging](/img/52/5e85743b1817de96a52e02b92fd08c.png)
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging

Write API documents first or code first?

jenkins安装

Solve the problem of invalid uni app configuration page and tabbar

stm32逆向入门

爱可生SQLe审核工具顺利完成信通院‘SQL质量管理平台分级能力’评测

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

面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
随机推荐
Binder通信过程及ServiceManager创建过程
Summit review | baowanda - an integrated data security protection system driven by compliance and security
js判断数组中是否存在某个元素(四种方法)
stm32逆向入门
ETCD数据库源码分析——rawnode简单封装
jenkins安装
go 数组与切片
Laravel框架运行报错:No application encryption key has been specified
APICloud Studio3 WiFi真机同步和WiFi真机预览使用说明
Idea设置方法注释和类注释
Could not set property ‘id‘ of ‘class XX‘ with value ‘XX‘ argument type mismatch 解决办法
Godson 2nd generation burn PMON and reload system
南理工在线交流群
Solve the problem of invalid uni app configuration page and tabbar
Backup and restore of Android local SQLite database
redis6数据类型及操作总结
DataPipeline双料入选中国信通院2022数智化图谱、数据库发展报告
Redis6 master-slave replication and clustering
What are the private addresses
STM32 reverse entry