Created
March 22, 2023 17:16
-
-
Save LarryRuane/2c52467afe0090432a2a0ed592054d72 to your computer and use it in GitHub Desktop.
calculate total amount of chain witness data
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 | |
from bitcoinrpc.authproxy import AuthServiceProxy | |
api = AuthServiceProxy("http://lmr:[email protected]:8332") | |
info = api.getblockchaininfo() | |
tip_height = info['blocks'] | |
print("tip height", tip_height) | |
witness = 0 | |
for i in range(0, tip_height+1): | |
blockhash = api.getblockhash(i) | |
b = api.getblock(blockhash) | |
witness += b['size']-b['strippedsize'] | |
print("witness bytes", witness) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment