Sign inSign up

fiftysix/besu

By fiftysix

Updated 13 days ago

Hyperledger Besu execution client for Ethereum nodes written in Java.

Image
0

4.2K

fiftysix/besu repository overview

Fiftysix Besu Docker Image

Maintainer: [email protected]

Overview

This Docker image provides a fully functional Besu (Hyperledger Besu) client built using the Fiftysix base image. Besu is an Ethereum execution engine that processes transactions, executes smart contracts, and maintains the Ethereum state. It is ideal for developers, blockchain enthusiasts, and institutions looking to participate in the Ethereum network. The code can be viewed on the Fiftysix Github.

Tags
  • latest: Points to the latest version of Besu.
  • <version>: Points to a specific version of Besu. For example, 24.7.1.
What is Besu?

Besu is an Ethereum client implemented in Java and part of the Hyperledger project. It functions as an execution engine in Ethereum's Proof of Stake (PoS) network, processing transactions, executing smart contracts, and maintaining the blockchain state. Besu is designed to work in conjunction with Ethereum consensus clients to manage the blockchain's consensus mechanism, especially post-Merge when Ethereum transitioned away from Proof of Work (PoW).

Usage
Prerequisites

To run Besu effectively as an execution engine, you’ll need a system with sufficient storage and memory to handle the Ethereum blockchain. Besu is designed to work alongside Ethereum consensus clients, such as Lighthouse, Prysm, Teku, Lodestar, and Nimbus, to form a complete Ethereum node.

Basic Usage

To run a Besu node:

docker pull fiftysix/besu
docker run --name besu -d fiftysix/besu

This command will start the Besu container, exposing the default RPC and P2P ports.

Note: Besu requires an Ethereum consensus client alongside, such as Lighthouse, Prysm, Teku, Lodestar, or Nimbus, to properly sync. Example Besu compose files can be found here.

Directory Structure

In this Docker image, the following directories are used:

  • Data Directory (/node/besu/data): This is where Besu stores the Ethereum blockchain data and other related files. This directory is specified in the Dockerfile and should be mounted if you want to persist data across container restarts.
  • Config Directory (/node/besu/configs): This directory is used for storing configuration files for Besu. The Dockerfile copies a default config.toml configuration file here, which can be customized.
  • Scripts Directory (/node/besu/scripts): This directory contains the entrypoint script (besu-entrypoint.sh) and any other scripts that may be needed for starting or managing Besu.
Mounting Directories

You can mount host directories to the container’s data, config, and scripts directories to customize the behavior of the Besu software.

Mounting the Data Directory: To persist Besu data across container restarts, you can mount a host directory to the container's data directory:

docker run --name besu -v /path/to/local/data:/node/besu/data -d fiftysix/besu

This command mounts the /path/to/local/data directory on your host to /node/besu/data in the container, ensuring that blockchain data is preserved between container instances.

Mounting a Config File: To use a custom Besu configuration file, mount your configuration file to the container’s config directory and specify it using the --config-file flag:

docker run --name besu -v /path/to/local/config.toml:/node/besu/configs/config.toml -d fiftysix/besu \
  --config-file="/node/besu/configs/config.toml"

This command mounts your custom config.toml file to the container’s config directory and instructs Besu to use it.

Mounting the Scripts Directory: If you have custom scripts you want to include, you can mount them to the scripts directory. For example, to replace the entrypoint script:

docker run --name besu -v /path/to/local/scripts:/node/besu/scripts -d fiftysix/besu

This command mounts your local scripts directory to /node/besu/scripts in the container, allowing you to customize the startup behavior.

Logging Besu
docker logs besu --tail 100
Using Besu
Starting Besu with Custom Options

To start Besu with custom options, such as enabling RPC or specifying network parameters, you can pass additional flags to the besu command:

docker run --name besu -d \
  -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp \
  fiftysix/besu \
  --rpc-http-enabled --rpc-http-host="0.0.0.0" --rpc-http-port=8545 --rpc-http-cors-origins="*" --rpc-http-api="ETH,NET,WEB3" \
  --sync-mode="FAST" --network=mainnet

This command starts Besu with the HTTP RPC server enabled, listening on port 8545, with fast synchronization mode and connected to the Ethereum mainnet.

Exposing Ports

The following ports are commonly used by Besu and are exposed in this Docker image:

  • 8545: HTTP-RPC server
  • 8546: WebSocket-RPC server
  • 8551: Engine API server (used for communication between the execution engine and consensus client)
  • 30303: P2P communication (TCP and UDP)
Docker Compose

Besu can also be run using Docker Compose. Various Docker Compose files are available to run Besu as the execution engine alongside different Ethereum consensus clients, such as Lighthouse, Prysm, Teku, Lodestar, and Nimbus. These setups enable a complete Ethereum node configuration, with Besu handling execution and the chosen client managing consensus. Examples of these Docker Compose files can be found on the Fiftysix Github.

Support

For support, please contact [email protected].

About Fiftysix

Fiftysix is committed to making blockchain technology accessible, efficient, and reliable through robust decentralization. Learn more at fiftysix.xyz.

Tag summary

Content type

Image

Digest

sha256:51fb0176e

Size

516.3 MB

Last updated

13 days ago

docker pull fiftysix/besu