Scans Ethereum (EVM) Blocks via JSON-RPC and looks for client diffs
Project description
json-rpc-scan
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
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Make your changes
- Run the test suite (
pytest) - Run linting (
pre-commit run --all-files) - Commit your changes using conventional commits
- Push to your branch (
git push origin feat/amazing-feature) - 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:
- Commits to
mainare analyzed for conventional commit messages - Release PRs are automatically created/updated
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87b308a28aa5018d8a950554485a9686e196ab30ba86ef7a7682ff6fe68af328
|
|
| MD5 |
f9fc1be18b46a83bdf03969fc21365b9
|
|
| BLAKE2b-256 |
e2e4aad4dd78e888c3ed9afbdf45b64c9e15d6d945c5f575090f6b6ed0443079
|
Provenance
The following attestation bundles were made for json_rpc_scan-0.2.0.tar.gz:
Publisher:
release.yml on MysticRyuujin/json-rpc-scan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
json_rpc_scan-0.2.0.tar.gz -
Subject digest:
87b308a28aa5018d8a950554485a9686e196ab30ba86ef7a7682ff6fe68af328 - Sigstore transparency entry: 1287233815
- Sigstore integration time:
-
Permalink:
MysticRyuujin/json-rpc-scan@4471916ee2bcb191b761df0fd1d91537ae8478a7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/MysticRyuujin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4471916ee2bcb191b761df0fd1d91537ae8478a7 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2da1e095f1d0416651fc33c130e5e200e726e667982bf61dd12405d5d61b2d0a
|
|
| MD5 |
fe167705bb43b169d34b965c40479860
|
|
| BLAKE2b-256 |
b0cd7f73d4860e1559adeedc77fb026d6d65fc9ff83d174fee5aa0b7aae5d232
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
json_rpc_scan-0.2.0-py3-none-any.whl -
Subject digest:
2da1e095f1d0416651fc33c130e5e200e726e667982bf61dd12405d5d61b2d0a - Sigstore transparency entry: 1287233910
- Sigstore integration time:
-
Permalink:
MysticRyuujin/json-rpc-scan@4471916ee2bcb191b761df0fd1d91537ae8478a7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/MysticRyuujin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4471916ee2bcb191b761df0fd1d91537ae8478a7 -
Trigger Event:
push
-
Statement type: