Skip to main content

Scans Ethereum (EVM) Blocks via JSON-RPC and looks for client diffs

Project description

json-rpc-scan

CI PyPI version Python 3.13+ License: MIT Code style: black Ruff Checked with mypy

Scans Ethereum (EVM) Blocks via JSON-RPC and looks for client diffs.

Features

  • ๐Ÿ” Compare JSON-RPC responses across multiple Ethereum clients
  • ๐Ÿš€ Asynchronous requests for high performance
  • ๐Ÿ“Š Visual diff reporting (human-readable and machine-readable)
  • ๐Ÿณ Docker support for easy deployment
  • โšก Built with modern Python (3.13+)

Requirements

  • Python 3.13 or higher
  • uv (recommended) or pip

Installation

Using uv (Recommended)

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/MysticRyuujin/json-rpc-scan.git
cd json-rpc-scan

# Create virtual environment and install dependencies
uv sync

Using pip

pip install json-rpc-scan

Using Docker

docker pull ghcr.io/MysticRyuujin/json-rpc-scan:latest

# Run with Docker
docker run --rm ghcr.io/MysticRyuujin/json-rpc-scan:latest --help

Development Setup

Prerequisites

  • Python 3.13+
  • pyenv (optional, for Python version management)
  • uv (modern Python package manager)
  • direnv (optional, for automatic environment activation)

Quick Start

# Clone the repository
git clone https://github.com/MysticRyuujin/json-rpc-scan.git
cd json-rpc-scan

# If using pyenv + direnv (recommended)
direnv allow

# Or manually set up with uv
uv venv --python 3.13
source .venv/bin/activate
uv sync --all-extras

# Install pre-commit hooks
pre-commit install
pre-commit install --hook-type commit-msg

# Run tests
pytest

# Run linting
ruff check src/
ruff format --check src/
mypy src/

Using pyenv

# Install Python 3.13
pyenv install 3.13

# Set local Python version (creates .python-version)
pyenv local 3.13

Using direnv

The project includes a .envrc file that automatically:

  • Activates the correct Python version via pyenv
  • Creates and activates a virtual environment
  • Watches for dependency changes
# Allow direnv to manage the environment
direnv allow

Configuration

Create a config.yaml file (copy from config.example.yaml):

endpoints:
  - name: Geth
    url: http://localhost:8545
  - name: Nethermind
    url: http://localhost:8546

Usage

# Run the scanner
json-rpc-scan --help

# Or using Python module
python -m json_rpc_scan --help

Project Structure

json-rpc-scan/
โ”œโ”€โ”€ .github/
โ”‚   โ”œโ”€โ”€ workflows/           # GitHub Actions workflows
โ”‚   โ”‚   โ”œโ”€โ”€ ci.yml          # Continuous Integration
โ”‚   โ”‚   โ”œโ”€โ”€ release.yml     # Release automation
โ”‚   โ”‚   โ””โ”€โ”€ release-please.yml
โ”‚   โ”œโ”€โ”€ dependabot.yml      # Dependency updates
โ”‚   โ””โ”€โ”€ release-please-*.json
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ json_rpc_scan/      # Main package
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ __main__.py     # CLI entry point
โ”‚       โ”œโ”€โ”€ __version__.py  # Version info
โ”‚       โ””โ”€โ”€ py.typed        # PEP 561 marker
โ”œโ”€โ”€ tests/                   # Test suite
โ”œโ”€โ”€ .envrc                   # direnv configuration
โ”œโ”€โ”€ .pre-commit-config.yaml  # Pre-commit hooks
โ”œโ”€โ”€ .python-version          # pyenv Python version
โ”œโ”€โ”€ Dockerfile               # Docker build
โ”œโ”€โ”€ pyproject.toml           # Project configuration
โ””โ”€โ”€ README.md

Code Quality

This project uses several tools to maintain code quality:

Tool Purpose
black Code formatting
ruff Linting and import sorting
mypy Static type checking
pytest Testing framework
pre-commit Git hooks
bandit Security scanning

Running Checks Locally

# Format code
ruff format src/ tests/

# Lint code
ruff check src/ tests/

# Type check
mypy src/

# Run tests
pytest

# Run all pre-commit hooks
pre-commit run --all-files

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Make your changes
  4. Run the test suite (pytest)
  5. Run linting (pre-commit run --all-files)
  6. Commit your changes using conventional commits
  7. Push to your branch (git push origin feat/amazing-feature)
  8. Open a Pull Request

Commit Message Format

This project follows Conventional Commits:

<type>(<scope>): <description>

[optional body]

[optional footer(s)]

Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore

Release Process

This project uses release-please for automated releases:

  1. Commits to main are analyzed for conventional commit messages
  2. Release PRs are automatically created/updated
  3. Merging a release PR triggers:
    • PyPI package publication
    • Docker image build and push to GHCR
    • GitHub release creation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by the need for better Ethereum client compatibility testing
  • Built with modern Python tooling from the Astral ecosystem

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json_rpc_scan-0.2.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

json_rpc_scan-0.2.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file json_rpc_scan-0.2.0.tar.gz.

File metadata

  • Download URL: json_rpc_scan-0.2.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for json_rpc_scan-0.2.0.tar.gz
Algorithm Hash digest
SHA256 87b308a28aa5018d8a950554485a9686e196ab30ba86ef7a7682ff6fe68af328
MD5 f9fc1be18b46a83bdf03969fc21365b9
BLAKE2b-256 e2e4aad4dd78e888c3ed9afbdf45b64c9e15d6d945c5f575090f6b6ed0443079

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_rpc_scan-0.2.0.tar.gz:

Publisher: release.yml on MysticRyuujin/json-rpc-scan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file json_rpc_scan-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: json_rpc_scan-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for json_rpc_scan-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2da1e095f1d0416651fc33c130e5e200e726e667982bf61dd12405d5d61b2d0a
MD5 fe167705bb43b169d34b965c40479860
BLAKE2b-256 b0cd7f73d4860e1559adeedc77fb026d6d65fc9ff83d174fee5aa0b7aae5d232

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_rpc_scan-0.2.0-py3-none-any.whl:

Publisher: release.yml on MysticRyuujin/json-rpc-scan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page