CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-web3

A Python library for interacting with Ethereum blockchain

Overall
score

88%

Evaluation88%

1.01x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-5/

Node Sync Status Checker

A utility to check if an Ethereum node is synchronized with the blockchain network.

Capabilities

Check Node Synchronization Status

Build a function that queries whether an Ethereum node is currently synchronizing with the network and returns detailed synchronization information when available.

  • Returns False when the node is fully synchronized @test
  • Returns a dictionary with sync details (starting block, current block, highest block) when the node is actively syncing @test
  • Handles connection errors gracefully by returning None @test

Format Sync Progress

Create a function that takes synchronization data and formats it into a human-readable progress report.

  • Returns "Node is fully synchronized" when sync status is False @test
  • Returns formatted string showing progress percentage and block numbers when syncing @test
  • Returns "Unable to determine sync status" when sync data is None @test

Implementation

@generates

API

from typing import Union, Dict, Any, Optional

def get_sync_status(provider_uri: str) -> Union[bool, Dict[str, Any], None]:
    """
    Query the synchronization status of an Ethereum node.

    Args:
        provider_uri: The URI of the Ethereum node provider (e.g., HTTP endpoint)

    Returns:
        - False if the node is fully synchronized
        - Dict with keys 'startingBlock', 'currentBlock', 'highestBlock' if syncing
        - None if unable to connect or query the node
    """
    pass

def format_sync_progress(sync_status: Union[bool, Dict[str, Any], None]) -> str:
    """
    Format synchronization status into a human-readable message.

    Args:
        sync_status: The sync status returned from get_sync_status()

    Returns:
        A formatted string describing the sync status
    """
    pass

Dependencies { .dependencies }

web3 { .dependency }

Provides Python interface for interacting with Ethereum blockchain nodes.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-web3

tile.json