Convert Figma logo to code with AI

hyperledger logobesu

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

1,493
818
1,493
397

Top Related Projects

4,676

A permissioned implementation of Ethereum supporting data privacy

Go implementation of the Ethereum protocol

Substrate: The platform for blockchain innovators

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

DEPRECATED! Java implementation of the Ethereum yellowpaper. For JSON-RPC and other client features check Ethereum Harmony

Quick Overview

Hyperledger Besu is an open-source Ethereum client developed under the Hyperledger umbrella. It's designed for both public and private permissioned network use cases, offering a robust, modular, and extensible platform for enterprise-grade blockchain applications.

Pros

  • Supports both public and private networks, providing flexibility for various use cases
  • Implements multiple consensus algorithms, including PoW, PoA, and IBFT 2.0
  • Offers comprehensive privacy features, including private transactions and permissioning
  • Provides extensive APIs and monitoring tools for easy integration and management

Cons

  • May have a steeper learning curve compared to some other Ethereum clients
  • Performance in high-throughput scenarios might not match specialized private blockchain solutions
  • Requires significant resources for full node operation, especially for public network participation
  • Documentation can be complex for newcomers to blockchain technology

Code Examples

  1. Starting a Besu node:
besu --network=mainnet --data-path=/path/to/data --rpc-http-enabled --rpc-http-api=ETH,NET,WEB3

This command starts a Besu node connected to the Ethereum mainnet with HTTP RPC enabled.

  1. Creating a private network genesis file:
{
  "config": {
    "chainId": 2018,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0
  },
  "nonce": "0x0000000000000042",
  "timestamp": "0x0",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x8000000",
  "difficulty": "0x400",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {}
}

This JSON defines a genesis file for a private Ethereum network using Besu.

  1. Enabling privacy features:
besu --privacy-enabled --privacy-url=http://127.0.0.1:8888 --privacy-public-key-file=Orion/nodeKey.pub

This command starts Besu with privacy features enabled, connecting to a privacy manager (e.g., Orion) for handling private transactions.

Getting Started

To get started with Hyperledger Besu:

  1. Install Besu:

    sudo apt-get update && sudo apt-get install -y besu
    
  2. Start a node on the Goerli testnet:

    besu --network=goerli --data-path=/path/to/data --sync-mode=FAST
    
  3. Enable JSON-RPC API:

    besu --network=goerli --data-path=/path/to/data --rpc-http-enabled --rpc-http-api=ETH,NET,WEB3
    
  4. Connect to the node using Web3.js or other Ethereum libraries to interact with the network.

Competitor Comparisons

4,676

A permissioned implementation of Ethereum supporting data privacy

Pros of Quorum

  • More established and widely adopted in enterprise blockchain solutions
  • Offers built-in privacy features for permissioned networks
  • Supports both Raft and IBFT consensus algorithms

Cons of Quorum

  • Less active development and community support compared to Besu
  • Limited compatibility with public Ethereum networks
  • Slower to adopt new Ethereum features and upgrades

Code Comparison

Besu (Java):

public class BesuController {
    private final Blockchain blockchain;
    private final ProtocolSchedule protocolSchedule;
    private final EthProtocolManager ethProtocolManager;
    // ...
}

Quorum (Go):

type QuorumEthService struct {
    blockchain      *core.BlockChain
    protocolManager *ProtocolManager
    txPool          *core.TxPool
    // ...
}

Both projects implement Ethereum-compatible clients, but Besu is written in Java while Quorum is in Go. Besu offers broader compatibility with public and private networks, while Quorum focuses on enterprise-grade privacy features. Besu has seen more active development recently, with faster adoption of Ethereum upgrades. Quorum, however, has a longer history in enterprise blockchain solutions and offers specific features for permissioned networks.

Go implementation of the Ethereum protocol

Pros of go-ethereum

  • Longer history and larger community support
  • More extensive documentation and resources
  • Better performance for high-throughput applications

Cons of go-ethereum

  • Less modular architecture, making customization more challenging
  • Higher resource requirements for running nodes
  • Limited support for enterprise features out-of-the-box

Code Comparison

go-ethereum (Geth):

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

Besu:

public void start() {
    synchronizerExecutor.execute(
        () -> {
            setupState();
            initializeBlockchain();
        });
}

The code snippets show different approaches to starting the Ethereum client. Geth uses a more straightforward error-handling approach, while Besu employs a separate executor for initialization tasks.

Both repositories are actively maintained and offer robust Ethereum client implementations. go-ethereum is more suitable for public network deployments, while Besu provides better support for enterprise use cases and private networks. The choice between them depends on specific project requirements and the desired level of customization.

Substrate: The platform for blockchain innovators

Pros of Substrate

  • More flexible and customizable blockchain framework
  • Supports multiple consensus mechanisms out-of-the-box
  • Designed for easy upgrades and forkless runtime upgrades

Cons of Substrate

  • Steeper learning curve due to its modular architecture
  • Smaller ecosystem compared to Ethereum-based solutions
  • Requires more development effort for custom implementations

Code Comparison

Substrate (Rust):

#[pallet::call]
impl<T: Config> Pallet<T> {
    #[pallet::weight(10_000)]
    pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
        let who = ensure_signed(origin)?;
        // Function logic here
        Ok(())
    }
}

Besu (Java):

public class MyPlugin implements BesuPlugin {
    @Override
    public void register(BesuContext context) {
        // Plugin logic here
    }
}

Both repositories offer blockchain development solutions, but Substrate provides a more flexible framework for building custom blockchains, while Besu focuses on Ethereum compatibility and enterprise features. Substrate uses Rust, offering better performance and safety, while Besu is written in Java, which may be more familiar to enterprise developers. Substrate's modular design allows for greater customization, but Besu's Ethereum compatibility may be advantageous for projects requiring immediate integration with the Ethereum ecosystem.

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

Pros of OpenEthereum

  • More established project with a longer history in the Ethereum ecosystem
  • Supports a wider range of Ethereum network types (mainnet, testnets, private networks)
  • Offers more extensive customization options for advanced users

Cons of OpenEthereum

  • Less active development and maintenance compared to Besu
  • Lacks some enterprise-focused features that Besu provides
  • May have a steeper learning curve for newcomers to Ethereum development

Code Comparison

OpenEthereum (Rust):

pub fn execute_transaction(
    &mut self,
    t: &SignedTransaction,
    header: &Header,
    last_hashes: &LastHashes,
    engine: &Engine,
) -> Result<Executed, Error> {
    // Transaction execution logic
}

Besu (Java):

public abstract class AbstractWorldUpdater<W, A> implements WorldUpdater {
  protected final W world;
  protected final Map<Address, A> updatedAccounts = new HashMap<>();
  // World state update logic
}

Both codebases implement Ethereum protocol functionality, but OpenEthereum uses Rust for performance, while Besu uses Java for enterprise compatibility and ease of integration with existing systems.

DEPRECATED! Java implementation of the Ethereum yellowpaper. For JSON-RPC and other client features check Ethereum Harmony

Pros of EthereumJ

  • Written in Java, providing better integration with existing Java ecosystems
  • Longer history and more established codebase
  • Supports light client functionality

Cons of EthereumJ

  • Less actively maintained compared to Besu
  • Limited enterprise features and permissioning options
  • Slower sync times and higher resource consumption

Code Comparison

EthereumJ (Transaction processing):

public void processTx(Transaction tx) throws Exception {
    TransactionExecutor executor = new TransactionExecutor(tx, track, blockStore, programInvokeFactory, block, listener, 0)
    executor.init();
    executor.execute();
    executor.go();
    executor.finalization();
}

Besu (Transaction processing):

public abstract class AbstractMessageProcessor implements MessageProcessor {
  @Override
  public void processMessage(final MessageContext messageContext) {
    messageContext.getMessage().execute(messageContext);
  }
}

Both repositories implement Ethereum clients, but Besu is more actively maintained and offers better enterprise features. EthereumJ provides better integration with Java ecosystems but has slower performance. Besu's code tends to be more modular and follows newer Java practices, while EthereumJ's codebase is older and may be more complex in certain areas.

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

Besu Ethereum Client

CircleCI Documentation CII Best Practices License Discord Twitter Follow

Download

Besu is an Apache 2.0 licensed, MainNet compatible, Ethereum client written in Java.

Useful Links

Issues

Besu issues are tracked in the github issues tab. See our guidelines for more details on searching and creating issues.

If you have any questions, queries or comments, Besu channel on Discord is the place to find us.

Besu Users

To install the Besu binary, follow these instructions.

Besu Developers

Development

Instructions for how to get started with developing on the Besu codebase. Please also read the wiki for more details on how to submit a pull request (PR).

Release Notes

Release Notes

Special thanks

YourKit for providing us with a free profiler open source license.

YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of YourKit Java Profiler, YourKit .NET Profiler, and YourKit YouMonitor.

YourKit Logo