Skip to content

Instantly share code, notes, and snippets.

@mauhcs
Created July 11, 2020 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauhcs/d07f3e71626e646f1609f471b0fb5fdd to your computer and use it in GitHub Desktop.
Save mauhcs/d07f3e71626e646f1609f471b0fb5fdd to your computer and use it in GitHub Desktop.
# pip install trezor
import subprocess
# wake up
get_ith_address(0)
def get_ith_address(i):
bashCommand = ["trezorctl", "eth", "get-address", "-n", "m/44'/60'/0'/0/"+f"{i}"]
process = subprocess.Popen(bashCommand, stdout=subprocess.PIPE)
output, error = process.communicate()
address = output.decode()
return address
address_zero = get_ith_address(0)
print(f"See logs with tail -f {address_zero}.log")
for i in range(0,100):
address = get_ith_address(i)
with open(f"{address_zero}.log", "a") as f:
f.write(f"{i},{address}")
print("Done...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment