devchain

Runs an in-process Ethereum node in .NET for local development and integration testing.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill devchain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: devchain
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/devchain
Command: npx skills add https://github.com/Nethereum/Nethereum --skill devchain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up a local Ethereum environment for development and testing typically requires external tools like Hardhat, Anvil, Geth, or Docker containers, adding friction to .NET workflows. This Skill provides a complete in-process Ethereum node that runs the full EVM (up to Prague), mines blocks instantly, and needs no external dependencies.

Core Features & Use Cases

  • In-Process Ethereum Node: Run a full EVM node directly inside your .NET application or test suite with pre-funded accounts and instant block mining.
  • Test Isolation & State Control: Use snapshot/revert, time manipulation, and direct state manipulation (balances, nonces, code, storage slots) to build deterministic integration tests.
  • Forking & Debugging: Fork mainnet or L2 networks at a specific block, impersonate accounts, and trace transactions at the opcode level with debug_traceTransaction.
  • Use Case: Replace Hardhat or Anvil in a C# project by spinning up a DevChainNode in an xUnit fixture, taking a snapshot before each test, and reverting after — existing Hardhat test scripts work unchanged thanks to compatible RPC methods, chain ID 31337, and the same default mnemonic.

Quick Start

Ask the assistant to set up a Nethereum DevChain in-process node with a pre-funded account and write an integration test that transfers ETH and verifies the balance.

Frequently Asked Questions about devchain

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

FAQPage Schema
How do I run a local Ethereum node in .NET for testing?

Install the Nethereum.DevChain package, create a DevChainNode, and call StartAsync with an account to get a pre-funded in-process node. It mines blocks instantly and works with standard Nethereum Web3 APIs without HTTP or external processes.

Can Nethereum DevChain replace Hardhat or Anvil?

Yes, DevChain supports the same default mnemonic, derivation path, chain ID 31337 via presets, and compatible RPC methods like hardhat_setBalance and anvil_mine. Existing Hardhat or Anvil test scripts work without changes.

How do I isolate Ethereum integration tests with snapshots?

Call TakeSnapshotAsync before each test and RevertToSnapshotAsync afterward to undo all state changes. This pattern works well inside an xUnit fixture where the node is shared across tests.

Does DevChain support forking mainnet or L2 networks?

Yes, set ForkUrl and optionally ForkBlockNumber in DevChainConfig to fork a remote network at a specific block. You can also fork from the CLI using nethereum-devchain with the -f flag.

Can I debug transactions at the opcode level with DevChain?

Yes, use TraceTransactionAsync with an OpcodeTraceConfig to control memory, stack, and storage capture. The node also exposes debug_traceTransaction and debug_traceCall over RPC.

Does DevChain require Docker, Geth, or other external dependencies?

No, DevChain runs entirely in-process within your .NET application with no external dependencies. An optional HTTP JSON-RPC server is available via the Nethereum.DevChain.Server package or the nethereum-devchain CLI.