> loading_
# --- Tempo T4 Hardfork & Consensus Metadata: Developer Walkthrough ---
# 1. Check your node's chain spec for T4 support.
# If you're running a Tempo node, pull the latest source and verify
# that your chain spec includes the T4 hardfork definition.
# This ensures your node will recognize T4 activation when it lands.
# $ git pull origin main
# $ grep -r 'T4' chain/spec.go # or the relevant chain spec file
# You should see something like:
# TempoHardfork::T4 => { activation_block: ... }
# 2. Inspect the new block structure with consensus metadata.
# After syncing to a T4-enabled testnet (when available), fetch a
# recent block and examine the new consensus metadata field.
# import tempo_sdk
# client = tempo_sdk.Client("https://testnet-rpc.tempo.network")
# block = client.get_block("latest")
#
# # The block envelope now includes embedded consensus metadata
# print(block.consensus_metadata)
# # Expected: a structured object with validator set info, TIP references,
# # or other consensus-layer attestations
# 3. Update your block deserialization logic.
# If you have a custom indexer or parser, the block schema has changed.
# Make sure your decoder handles the new field gracefully.
# import json
# raw_block = client.get_raw_block("latest")
# decoded = json.loads(raw_block)
#
# # Old path (may break):
# # header = decoded["header"]
# # tx_root = header["transactions_root"]
#
# # New path — account for consensus_metadata:
# header = decoded["header"]
# consensus_meta = header.get("consensus_metadata", None)
# if consensus_meta is None:
# print("WARNING: Running against a pre-T4 block or outdated node")
# else:
# print(f"Consensus metadata version: {consensus_meta['version']}")
# print(f"Validator set hash: {consensus_meta['validator_set_hash']}")
# 4. Pin your node version and set up upgrade monitoring.
# T4 activation will require a coordinated node upgrade.
# Set an alert for the activation block height once announced.
# $ tempo version
# # Ensure this returns a version that includes T4 chain spec support
# # If not, upgrade before the activation block height