Convert Figma logo to code with AI

NethermindEth logonethermind

A robust execution client for Ethereum node operators.

1,216
425
1,216
527

Top Related Projects

Go implementation of the Ethereum protocol

1,474

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu

3,090

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io

(deprecated) The fast, light, and robust client for the Ethereum mainnet.

Ethereum consensus client in Rust

Quick Overview

Nethermind is an open-source Ethereum client implemented in .NET Core. It is designed to be a high-performance, highly configurable, and feature-rich Ethereum node that can be used for running validators, syncing the blockchain, and interacting with the Ethereum network.

Pros

  • High performance and scalability due to its efficient implementation in .NET Core
  • Extensive feature set, including support for various network types (mainnet, testnets, private networks)
  • Active development and regular updates from a dedicated team
  • Strong focus on security and robustness

Cons

  • Smaller community compared to some other Ethereum clients
  • Steeper learning curve for developers not familiar with .NET ecosystem
  • Limited documentation for advanced use cases
  • May require more system resources compared to some lightweight clients

Code Examples

// Example 1: Connecting to Nethermind JSON-RPC API
using Nethermind.JsonRpc.Client;

var client = new JsonRpcClient("http://localhost:8545");
var blockNumber = await client.eth_blockNumber();
Console.WriteLine($"Current block number: {blockNumber}");
// Example 2: Sending a transaction using Nethermind
using Nethermind.Core;
using Nethermind.Crypto;

var privateKey = new PrivateKey("0x...");
var transaction = new Transaction
{
    To = Address.FromString("0x..."),
    Value = 1.Ether(),
    GasPrice = 20.GWei(),
    GasLimit = 21000
};

var signedTx = transaction.Sign(privateKey);
await client.eth_sendRawTransaction(signedTx.ToHex());
// Example 3: Subscribing to new block headers
using Nethermind.JsonRpc.Client;

var subscription = await client.eth_subscribe("newHeads");
subscription.OnDataReceived += (sender, blockHeader) =>
{
    Console.WriteLine($"New block: {blockHeader.Number}");
};

Getting Started

  1. Install .NET Core SDK (version 6.0 or later)
  2. Clone the Nethermind repository:
    git clone https://github.com/NethermindEth/nethermind.git
    
  3. Build the project:
    cd nethermind
    dotnet build src/Nethermind/Nethermind.sln
    
  4. Run Nethermind:
    cd src/Nethermind/Nethermind.Runner
    dotnet run -c Release -- --config mainnet
    

For more detailed instructions and configuration options, refer to the official Nethermind documentation.

Competitor Comparisons

Go implementation of the Ethereum protocol

Pros of go-ethereum

  • More established and widely adopted in the Ethereum ecosystem
  • Extensive documentation and community support
  • Better performance for certain operations, especially in resource-constrained environments

Cons of go-ethereum

  • Written in Go, which may be less familiar to some developers compared to C#
  • Can be more resource-intensive for full node operation
  • Slower sync times for initial blockchain synchronization

Code Comparison

go-ethereum (Geth):

func (s *Ethereum) Start() error {
    if err := s.startEthService(); err != nil {
        return err
    }
    return nil
}

Nethermind:

public async Task Start()
{
    await _blockchainProcessor.Start();
    await _syncManager.Start();
}

Key Differences

  • Language: go-ethereum is written in Go, while Nethermind is written in C#
  • Performance: Nethermind often offers faster sync times and lower resource usage
  • Features: Nethermind includes built-in support for advanced features like pruning and JSON-RPC tracing
  • Community: go-ethereum has a larger community and more third-party tooling support
  • Development: Nethermind tends to implement new EIPs and features more quickly

Both clients are actively maintained and offer robust Ethereum node implementations, with the choice often depending on specific use cases and developer preferences.

1,474

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu

Pros of Besu

  • Written in Java, offering better enterprise integration and wider developer pool
  • Part of Hyperledger, providing strong community support and enterprise-grade features
  • Supports both public and private network deployments

Cons of Besu

  • Generally slower performance compared to Nethermind
  • Higher resource consumption, especially memory usage
  • Less frequent updates and releases

Code Comparison

Nethermind (C#):

public async Task<Block> FindBlock(Keccak blockHash)
{
    Block block = await _blockTree.FindBlock(blockHash);
    return block;
}

Besu (Java):

public Optional<Block> getBlockByHash(final Hash hash) {
    return blockchain.getBlockByHash(hash);
}

Both implementations provide methods to retrieve a block by its hash, but Nethermind uses async/await pattern while Besu uses Java's Optional for null safety.

3,090

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io

Pros of Erigon

  • Faster synchronization and lower disk space requirements due to its optimized architecture
  • Better performance for JSON-RPC calls, especially for historical data queries
  • More efficient state storage using a flat database structure

Cons of Erigon

  • Less mature and potentially less stable compared to Nethermind
  • Smaller community and ecosystem support
  • May have fewer features and integrations available

Code Comparison

Nethermind (C#):

public async Task<Block> FindBlock(Keccak blockHash)
{
    Block block = await _blockTree.FindBlock(blockHash);
    return block;
}

Erigon (Go):

func (api *BlockChainAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error) {
    block, err := api.db.BlockByHash(ctx, hash)
    if err != nil {
        return nil, err
    }
    return api.rpcMarshalBlock(block, true, fullTx)
}

Both repositories implement Ethereum clients, but with different approaches and programming languages. Nethermind is written in C# and focuses on modularity and extensibility, while Erigon is written in Go and prioritizes performance optimizations. The code snippets demonstrate how each project handles block retrieval, showcasing their respective language choices and slightly different API designs.

(deprecated) The fast, light, and robust client for the Ethereum mainnet.

Pros of OpenEthereum

  • More established project with longer history in the Ethereum ecosystem
  • Larger community and wider adoption among Ethereum node operators
  • Written in Rust, which offers memory safety and concurrency benefits

Cons of OpenEthereum

  • Development has been discontinued, with no active maintenance
  • Lacks support for newer Ethereum upgrades and features
  • Performance may be slower compared to Nethermind for certain operations

Code Comparison

Nethermind (C#):

public async Task<Block> FindBlock(Keccak blockHash)
{
    Block block = await _blockTree.FindBlock(blockHash);
    return block;
}

OpenEthereum (Rust):

pub fn block(&self, id: BlockId) -> Option<encoded::Block> {
    let block = self.block_header(id)?;
    Some(encoded::Block::new(block.into_inner()))
}

Both implementations provide methods to retrieve blocks, but Nethermind uses async/await pattern in C#, while OpenEthereum uses Rust's Option type for error handling. Nethermind's approach may be more suitable for handling concurrent requests, while OpenEthereum's implementation is more idiomatic Rust code.

Ethereum consensus client in Rust

Pros of Lighthouse

  • Written in Rust, offering memory safety and performance benefits
  • Supports light clients, enabling more accessible Ethereum participation
  • Extensive documentation and user guides for easier setup and operation

Cons of Lighthouse

  • Smaller development team compared to Nethermind
  • Less focus on enterprise-level features and customization options

Code Comparison

Lighthouse (Rust):

pub fn process_attestation(
    state: &mut BeaconState<T>,
    attestation: &Attestation<T>,
    verify_signatures: bool,
) -> Result<(), AttestationProcessingError> {
    // Implementation details
}

Nethermind (C#):

public void ProcessAttestation(
    BeaconState state,
    Attestation attestation,
    bool verifySignature = true)
{
    // Implementation details
}

Both repositories implement Ethereum consensus clients, but with different approaches:

  • Lighthouse focuses on efficiency and security through Rust
  • Nethermind offers more flexibility and enterprise features with C#
  • Lighthouse has a simpler codebase, while Nethermind provides more extensive customization options
  • Both projects actively contribute to Ethereum's development and maintain high-quality codebases

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Nethermind

Nethermind Ethereum client

Tests Chat on Discord Follow us on Twitter Ask on Discourse GitPOAPs

Nethermind is a high-performance, highly configurable Ethereum execution client built on .NET that runs on Linux, Windows, and macOS and supports Clique, Aura, and Ethash. With breakneck sync speeds and support for external plugins, it provides reliable access to rich on-chain data thanks to a high-performance JSON-RPC interface and node health monitoring with Grafana and Seq.

Documentation

Nethermind documentation is available at docs.nethermind.io.

Supported networks

Mainnet Goerli Sepolia Holesky Gnosis (xDai) Chiado Energy Web Volta

Download and run

Release builds are available on the Releases page and at downloads.nethermind.io.

On Linux

Install using PPA

  1. sudo add-apt-repository ppa:nethermindeth/nethermind
    If command not found: sudo apt-get install software-properties-common
  2. sudo apt-get install nethermind
  3. nethermind -c mainnet

On Windows

Prerequisites

In some cases, Visual C++ Redistributable may need an update:

winget install Microsoft.VCRedist.2015+.x64

Install using Windows Package Manager

  1. winget install nethermind
  2. nethermind -c mainnet

On macOS

Install using Homebrew

  1. brew tap nethermindeth/nethermind
  2. brew install nethermind
  3. nethermind -c mainnet

Docker image

The official Docker images of Nethermind are available on Docker Hub.

Get the digest of the Docker image

In case of any Docker image need to be updated in the repository, you can update the digest of these images as follows:

docker inspect --format='{{index .RepoDigests 0}}' <image_name>

The output should show the image digest, and then you can copy that to the FROM tag in the Dockerfile.

Building from source

Prerequisites

Install .NET SDK.

Clone the repository

git clone --recursive https://github.com/nethermindeth/nethermind.git

Build and run

cd nethermind/src/Nethermind/Nethermind.Runner
dotnet run -c release -- -c mainnet

Test

cd nethermind/src/Nethermind

# Run Nethermind tests:
dotnet test Nethermind.sln -c release

# Run Ethereum Foundation tests:
dotnet test EthereumTests.sln -c release

Contributing

BEFORE you start work on a feature or fix, please read and follow our contribution guide to help avoid any wasted or duplicate effort.

Security

If you believe you have found a security vulnerability in our code, please report it to us as described in our security policy.

License

Nethermind is an open-source software licensed under the LGPL-3.0.