erigon-test-rpc

Run JSON-RPC integration tests comparing rpcdaemon responses against golden expected outputs.

3.6k|1.5k|Updated May 27, 2019
One-click install
npx skills add https://github.com/erigontech/erigon --skill erigon-test-rpc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erigon-test-rpc
Source: https://github.com/erigontech/erigon/tree/main/.claude/skills/erigon-test-rpc
Command: npx skills add https://github.com/erigontech/erigon --skill erigon-test-rpc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Verifying that Erigon's rpcdaemon returns correct JSON-RPC responses requires a synced mainnet datadir, careful database protection during migrations, and manual comparison against expected results, which is tedious and error-prone to set up by hand.

Core Features & Use Cases

  • Local RPC Test Execution: Runs rpcdaemon against a synced Erigon datadir and compares JSON-RPC responses with golden outputs from the erigontech/rpc-tests repository.
  • Database Protection Workflow: Backs up chaindata before running migrations and restores it afterward so the reference datadir is not permanently modified.
  • Targeted Debugging: Supports running a single test or API group with diff output and full response dumps to investigate failures.
  • Remote CI Dispatch: Triggers the same test suites remotely via GitHub Actions workflows for mainnet, latest blocks, and Gnosis chain.
  • Use Case: After modifying an eth_getBlockByNumber handler in rpcdaemon, run the integration tests locally against your synced datadir to confirm responses still match the expected golden files before opening a pull request.

Quick Start

Set ERIGON_REFERENCE_DATA_DIR to my synced mainnet datadir and run the RPC integration tests, then show me any failing tests with their diffs.

Frequently Asked Questions about erigon-test-rpc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Erigon RPC integration tests locally?

Set ERIGON_REFERENCE_DATA_DIR to a synced mainnet datadir, build rpcdaemon and integration binaries, run migrations, start rpcdaemon on port 8545, then execute run_rpc_tests_ethereum.sh. Back up chaindata first since migrations write to the database.

How do I run a single Erigon RPC test instead of the full suite?

Clone the erigontech/rpc-tests repository, install its Python requirements, and run run_tests.py with --include-api-list pointing to a specific test file like eth_getBlockByNumber/test_1.json. Add --display-only-fail and --json-diff to see differences.

Can I run Erigon RPC tests without a synced mainnet node?

No, the tests require a synced mainnet datadir because they assert on specific blocks up to roughly block 24.3M. You can sync with --prune.mode=minimal, which takes about 2-4 days on NVMe, or request a reference datadir snapshot from the team.

Why do Erigon RPC tests need a chaindata backup before running?

The integration run_migrations step writes to the database, which would permanently modify the reference datadir. The workflow copies chaindata to a backup location first and restores it after the tests finish to keep the datadir pristine.

How do I trigger Erigon RPC integration tests on GitHub Actions?

Use gh workflow run with the workflow name, for example "QA - RPC Integration Tests" for mainnet, "QA - RPC Integration Tests Remote" for latest blocks, or the Gnosis variant, passing --ref with your branch name.

Why are some Erigon RPC tests disabled in CI?

Engine API tests are disabled because they require an active Erigon engine rather than just rpcdaemon, and tests like net_peerCount or admin_peers depend on live peer state. Some tests are also disabled due to known open issues.