Toolverse
All skills

get-block-number

by tradingstrategy-ai

Get the latest block number for a blockchain using Web3.py and JSON-RPC environment variables

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Category
Testing
Views
1

About this skill

Get the latest block number for a blockchain using Web3.py and JSON-RPC environment variables

How to use

  1. Upewnij się, że masz skonfigurowane zmienne środowiskowe JSON-RPC dla wybranego blockchainu. Zmienna powinna mieć format JSON_RPC_{CHAIN}, gdzie {CHAIN} to nazwa sieci w uppercase (np. JSON_RPC_ETHEREUM, JSON_RPC_ARBITRUM).

  2. Przygotuj skrypt Python, który zaimportuje Web3 i funkcję create_multi_provider_web3 z biblioteki eth_defi. Skrypt powinien pobrać URL z odpowiedniej zmiennej środowiskowej i wyrzucić błąd, jeśli zmienna nie jest ustawiona.

  3. Utwórz instancję Web3 za pomocą create_multi_provider_web3, przekazując pobrany URL JSON-RPC.

  4. Pobierz numer bloku, odwołując się do web3.eth.block_number — ta operacja zawsze zwraca najnowszy numer z sieci, nigdy nie polegaj na danych historycznych.

  5. Wyświetl wynik użytkownikowi w przejrzystym formacie, zawierającym nazwę blockchainu i numer bloku.

  6. Uruchom skrypt z linii poleceń za pomocą poetry, najpierw ładując zmienne środowiskowe z pliku .local-test.env — użyj komendy source .local-test.env && poetry run python, a następnie ścieżkę do skryptu.

Related skills

nextjs-developer

by zenobi-us

Expert Next.js developer mastering Next.js 14+ with App Router and full-stack features. Specializes in server components, server actions, performance optimization, and production deployment with focus on building fast, SEO-friendly applications.

Testing
166226

differential-review

by trailofbits

Performs security-focused differential review of code changes (PRs, commits, diffs). Adapts analysis depth to codebase size, uses git history for context, calculates blast radius, checks test coverage, and generates comprehensive markdown reports. Automatically detects and

Testing
2510

playwright-cli

by microsoft

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

Testing
45103

hono

by openstatusHQ

Efficiently develop Hono applications using Hono CLI. Supports documentation search, API reference lookup, request testing, and bundle optimization.

Testing
1257

go-dev-guidelines

by jumppad-labs

This skill should be used when writing, refactoring, or testing Go code. It provides idiomatic Go development patterns, TDD-based workflows, project structure conventions, and testing best practices using testify/require and mockery. Activate this skill when creating new Go

Testing
1190

creating-financial-models

by anthropics

This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

Testing
25137