I use Infura as a provider of HTTP.
But Infura does not allow you to make a filter.
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: https://ropsten.infura.io/
Cannot create filter on Infura via web3.py
But it's very, very long to sort through the transactions of the whole network with this code:
from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('https://ropsten.infura.io/',
request_kwargs={'timeout': 60}))
def get_transaction_details(transaction):
return w3.eth.getTransaction(transaction)
def get_address_transactions(address):
i = 0
while i < w3.eth.blockNumber:
block = w3.eth.getBlock(i)
for transaction in block.transactions:
detail = get_transaction_details(transaction)
print(detail)
i += 1
How do I get all address transactions?