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.1.0.tar.gz (33.0 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.1.0-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for json_rpc_scan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 99cd2cfc72fa401957dc7f0f9bc7ab6b6791e9e8188febb5b4effeafe4da6bdc
MD5 0b20be3cfb5acdce18be8a85de58d4e1
BLAKE2b-256 f69c57fd34b1d4d674c92424f5e453134c206ce99b1de83deb08b8f59cef715a

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_rpc_scan-0.1.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.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for json_rpc_scan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 211d08c4f1b0bb8eadfe188d05cefa259a57067cdcc764f9024b311907b9d793
MD5 dcf6c64021b71958f83b2550ade7cc4e
BLAKE2b-256 90ad8bb0ee038244089074ba2a87844655cc841233ebe04016880f3c0b2ee5d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_rpc_scan-0.1.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