Skip to content

Instantly share code, notes, and snippets.

@SmaugPool
Last active August 26, 2024 06:19
Show Gist options
  • Save SmaugPool/9219477a9bb9f093536e0be5e4697855 to your computer and use it in GitHub Desktop.
Save SmaugPool/9219477a9bb9f093536e0be5e4697855 to your computer and use it in GitHub Desktop.
Python script to get Solana size
#!/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