Last active
August 26, 2024 06:19
-
-
Save SmaugPool/9219477a9bb9f093536e0be5e4697855 to your computer and use it in GitHub Desktop.
Python script to get Solana size
This file contains hidden or 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
#!/usr/bin/env python3 | |
import requests, itertools | |
total = 0 | |
for epoch in itertools.count(1): | |
response = requests.head(f"https://files.old-faithful.net/{epoch}/epoch-{epoch}.car") | |
if response.status_code == 200: | |
bytes = int(response.headers["Content-Length"]) | |
total += bytes | |
else: | |
print(f"epoch {epoch} not found") | |
break | |
print(f"Epoch {epoch}: {bytes/1e9:.2f} GB, Total: {total/1e12:.2f} TB") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment