Besu

Installing and configuring Hyperledger Besu as a systemd service.

Besu

Hyperledger Besu is an Ethereum client designed with enterprise-grade use cases in mind. It is developed under the Hyperledger umbrella and is written in Java, making it the most mature choice for corporate environments familiar with the JVM (Java Virtual Machine).

🛡️ Role: Besu is an excellent choice for Client Diversity. It implements unique storage features like "Bonsai Tries," which optimize data storage and access speeds significantly compared to older archive node structures.


1. Install Dependencies (Java)

Besu requires a Java Runtime Environment (JRE). We recommend Java 21 LTS for the best performance and compatibility with recent Besu releases.

Bash

# Update repositories
sudo apt update

# Install OpenJDK 21
sudo apt install -y openjdk-21-jre-headless

# Verify Java installation
java -version

2. Download & Install

We will download the latest binary release from the official Hyperledger repository.

A. Create the Application Directory

Bash

B. Set Permissions Ensure the ethereum user owns the directory.

Bash


3. Configure Systemd Service

We will configure Besu to run as a background service.

Create the service file:

Bash

Paste the following configuration:

Ini, TOML

🔍 Flag Explanation:

  • --data-storage-format=BONSAI: Enables Besu's optimized storage format (Essential for performance).

  • --sync-mode=X_SNAP: Uses Snap Sync to download the state quickly.

  • JAVA_OPTS=-Xmx8g: Limits Java to 8GB of Heap RAM. Adjust this based on your total system RAM (keep it to ~50% of available RAM).


4. Start the Service

Reload the systemd daemon and start the node.

Bash


5. Verify Status

Check the logs to ensure Besu is initializing correctly.

Bash

Expected Output:

  1. Bonsai: You should see logs referencing Bonsai storage initialization.

  2. Engine API: Look for WebSocketService or JsonRpcHttpService starting on ports 8551/8545.

  3. Waiting: Similar to other clients, it will wait for the Consensus Client to begin the sync process.

Last updated