LoginSignup
0
0

More than 1 year has passed since last update.

Web3.pyでThe field extraData is 97 bytes, but should be 32

Posted at

どうやら、ミドルウェアをインストールしなければならない。

add
from web3.middleware import geth_poa_middleware
self.web3.middleware_onion.inject(geth_poa_middleware, layer=0)
sample.py
from web3 import Web3
from web3.middleware import geth_poa_middleware

url = "https://sample.com" #Infura、Alchemy、QuickNodeなどから取得
web3 = Web3(Web3.HTTPProvider(url))
web3.middleware_onion.inject(geth_poa_middleware, layer=0)
print(web3.eth.get_block('latest'))

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0