Build from Source

Prerequisites

Important

Hyperledger Besu requires Java 11+ to compile; earlier versions are not supported.

Running Locally

Running On Virtual Machine

Installation on Linux / Unix / Mac OS X

Clone the Besu Repository

Clone the Hyperledger/besu repo to your home directory (/home/<user>):

git clone --recursive https://github.com/hyperledger/besu.git

Build Besu

After cloning, go to the besu directory.

Build Besu with the Gradle wrapper gradlew, omitting tests as follows:

./gradlew build -x test

Go to the distribution directory:

cd build/distributions/

Expand the distribution archive:

tar -xzf besu-<version>.tar.gz

Move to the expanded folder and display the Besu help to confirm installation.

cd besu-<version>/
bin/besu --help

Linux Open File Limit

If synchronizing to MainNet on Linux or other chains with large data requirements, increase the maximum number of open files allowed using ulimit. If the open files limit is not high enough, a Too many open files RocksDB exception occurs.

Continue with Starting Besu.

Installation on Windows

Note

Besu is currently supported only on 64-bit versions of Windows, and requires a 64-bit version of JDK/JRE. We recommend that you also remove any 32-bit JDK/JRE installations.

Install Besu

In Git bash, go to your working directory for repositories. Clone the Hyperledger/besu repo into this directory:

git clone --recursive https://github.com/hyperledger/besu

Build Besu

Go to the besu directory:

cd besu

Open a Windows command prompt. Build Besu with the Gradle wrapper gradlew, omitting tests as follows:

.\gradlew build -x test

Note

To run gradlew, you must have the JAVA_HOME system variable set to the Java installation directory. For example: JAVA_HOME = C:\Program Files\Java\jdk1.8.0_181.

Go to the distribution directory:

cd build\distributions

Expand the distribution archive:

tar -xzf besu-<version>.tar.gz

Move to the expanded folder and display the Besu help to confirm installation.

cd besu-<version>
bin\besu --help

Continue with Starting Besu.

Installation on VM

You can run Besu on a virtual machine (VM) on a cloud service such as AWS or Azure, or locally using a VM manager such as VirtualBox.

If you set up your own VM locally using a VM manager such as VirtualBox, there are a few considerations:

  • Make sure that Intel Virtualization Technology (VTx) and Virtualization Technology for Directed I/O (VT-d) are enabled in BIOS settings.

  • On Windows, you might need to disable Hyper-V in the Windows Feature list.

It is recommended that you create a VM with the following attributes:

  • Memory Size: Set to 4096 (recommended)

  • Create a virtual hard disk with at least 10 GB; 20 GB is recommended

  • Virtual hard disk file type: VDI (if you need to share it with other apps, use VHD)

  • (Optional) You can create a shared directory in order to copy block files or genesis files from the host computer to the VM. For details on how to create a shared directory, see “Share Folders” in Oracle VirtualBox documentation.