Fun with Python: A Countdown to Hive's 100 Millionth Block

@thecrazygm · 2025-09-06 09:47 · Synergy Builders

Hey everyone,

I was working on some minor fixes for hive.micro this morning and was waiting for my development copy to sync up with the production chain. While watching the blocks fly by, it dawned on me that we are really close to a major milestone for the Hive blockchain. It may not be a critical event, but I thought it was a cool bit of trivia to share.


Block 100,000,000 is Coming

We are rapidly approaching our 100 millionth block! It's a huge number that speaks to the longevity and resilience of our chain. While it's true that 41,818,753 of those blocks were from the Steem era, the majority have been produced right here on Hive.

This got me curious: when exactly will this milestone happen? So, naturally, I wrote a quick Python script to find out.


Fun with Python

The script is simple. It uses my hive-nectar library to get the current block number, calculates the number of blocks remaining until the target, and then estimates the date and time based on the 3-second block interval.

#!/usr/bin/env -S uv run --quiet --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "hive-nectar",
# ]
#
# ///

from datetime import timedelta

from nectar.blockchain import Blockchain


def fmt(td: timedelta) -> str:
    total = int(td.total_seconds())
    sign = "-" if total < 0 else ""
    total = abs(total)

    days, rem = divmod(total, 86400)
    hours, rem = divmod(rem, 3600)
    minutes, seconds = divmod(rem, 60)

    parts = []
    if days:
        parts.append(f"{days}d")
    if hours:
        parts.append(f"{hours}h")
    if minutes:
        parts.append(f"{minutes}m")
    if seconds or not parts:
        parts.append(f"{seconds}s")

    return sign + " ".join(parts)


blockchain = Blockchain()
current_block = blockchain.get_current_block()
current_block_num = current_block.block_num
current_time = current_block.time()

target_block = 100_000_000
blocks_remaining = target_block - current_block_num
block_interval = blockchain.block_interval  # seconds per block

difference = timedelta(seconds=blocks_remaining * block_interval)
estimated_time = current_time + difference

print(f"Target Block: {target_block:,}")
print(f"Current Block: {current_block_num:,}")
print(f"Blocks Remaining: {blocks_remaining:,}")
print(f"Block Interval: {block_interval} s")
print(f"Estimated Time: {estimated_time.strftime('%Y-%m-%d %H:%M:%S %Z')}")
print(f"Time Remaining: {fmt(difference)}")

The script gives a nice, simple output.

screenshot-20250906-053236.png

Based on the current block height, it looks like it's going to happen on October 4th, at around 15:04 UTC.

Of course, I couldn't leave it at that. I had to make a prettier version using the rich library too.

screenshot-20250906-053247.png

As always, Michael Garcia a.k.a. TheCrazyGM

#dev #python #archon #tribes #pimp #proofofbrain
Payout: 8.879 HBD
Votes: 224
More interactions (upvote, reblog, reply) coming soon.