Last active
February 3, 2021 06:07
-
-
Save Bitatlas/88a4061e6c466c37537695ab5004d7fb to your computer and use it in GitHub Desktop.
Python geth eth code to find address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find(addr): | |
for i in range(999000, 1000000): #here we define a range of blocks to search | |
txLen = len(w3.eth.getBlock(i).transactions) #to get the transactions and lenght of the transactions | |
for j in range(txLen): #this loop will go through all the transactions to check the transactions in the blocks | |
print("Block: %d/%d --- Transaction: %d/%d" % (i, highestBlock, j, txLen)) #will print the transaction in the block | |
if addr == w3.eth.getBlock(i, True).transactions[j]["from"]: #if we get a transaction with the adress that we are looking for, it will print the transaction hash | |
print("FOUND BABIBlock: %d\nTX: %s" % (i, w3.eth.getBlock(i).transactions[j].hex())) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment