使用python的Binance智能链上出现Web3 ExtraDataLength错误

2024-04-27 17:04:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图提取在特定区块发生的交易,但我被困在这里:

from web3 import Web3

bsc = "https://bsc-dataseed.binance.org/"
web3 = Web3(Web3.HTTPProvider(bsc))

block = web3.eth.get_block('latest')

web3.exceptions.ExtraDataLengthError: The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer to http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details.

我想获得某个钱包地址所涉及的交易,我不知道为什么web3不允许我从bsc节点获取这些交易

多谢各位


Tags: tofromhttpsorgimportisbinance交易