Marketplace has launched, further enabling blockchain developers! Learn more

How to run a Hyperledger Besu node

September 09, 2022

Overview

As the Ethereum network continues to grow, the need for an enterprise-ready Ethereum client arises. Hyperledger Besu is an enterprise-friendly Ethereum client that can implement both public and private permissioned networks. This guide will cover the requirements to run Hyperledger Besu and explain how to run Hyperledger Besu.

What is an Ethereum client?

An Ethereum client is an implementation of Ethereum’s technical specifications for a specific use case and in a particular programming language. Ethereum clients can be different from each other in several ways; still, they all have the same set of fundamental features. Each is capable of joining the peer-to-peer Ethereum blockchain, synchronizing a local copy of the blockchain, broadcasting a transaction over the blockchain network, and creating and managing accounts. Users interact with the blockchain through client interfaces, and code libraries JSON API does the same. 

The following are the most popular and Widely used Ethereum clients.

  • Geth - Go implementation.
  • OpenEthereum - Rust implementation.
  • Nethermind - C#, .NET implementation.
  • Besu - Java implementation.
  • Trinity - Python implementation.

What is Hyperledger Besu?

Hyperledger Besu is an Ethereum client which is built for enterprise use. Besu is a Java-open-source-based client created under Apache 2.0 license. Just like other clients, Besu is compliant with Ethereum Yellow Paper. It can run on the Ethereum mainnet or a private permissioned network. It also has support for testnets such as Rinkeby, Ropsten, and Görli. Besu includes several consensus algorithms including PoW, PoA, and has comprehensive permissioning schemes explicitly designed for consortium environment uses. As it is implemented in Java, it has a robust codebase. Besu helps enterprises make secure and high transaction processing applications on a private network. 

Following are some notable features of Hyperledger Besu:
  • Storage: It uses RocksDB key-value database to store chain data locally.
  • Monitoring: Node and Network performance monitoring.
  • Permissioning: Besu is a permissioned network that allows only specific nodes and accounts to participate by enabling account permissioning and/or node permissioning on the network.
  • EVM (Ethereum Virtual Machine)

Hardware & Software requirements

System requirements for Besu differ on the type of network we are willing to sync to.

The first and foremost requirement is Disk space, Fast synchronization, which has pruning enabled, requires 750GB of disk space, and full synchronization, which has pruning disabled by default, requires approximately 3TB of disk space.

VM (Virtual Machine) requirements:
If you set up a virtual machine using a VM manager such as VirtualBox, the following are the recommended attributes to create VM.

  • Memory Size: 4096 MB (recommended)
  • Virtual hard disk at least 10 GB (20 GB recommended)
  • Virtual hard disk file type: VDI (if you need to share it with other apps, use VHD)

Java JDK: Besu requires Java 11+ installed on the system.

Note: For Windows, Besu is currently only supported on 64-bit versions of windows and requires the 64-bit version of JDK/JRE. 

Running Besu node

The first step here would be to Install the Besu client on your system.

To Install Besu on:

macOS: Using Homebrew.

sh 
$ brew tap hyperledger/besu

sh 
$ brew install hyperledger/besu/besu

Note: macOS High Sierra 10.13 or later versions required.

Linux/Windows: Download the latest binary release and run the binary after unpacking the binary.

The binary is located in 

sh 
$besu-<release>/bin/besu

You can check if it’s installed correctly by checking the version. 

sh 
$ besu --version

You can start your mainnet node by simply typing 

running besu node

Copy
$ besu

The node will start syncing the blockchain and it may take a while depending on the internet connection.

You can specify a network type by using --network flag

For example, if you want to run a ropsten node

running besu node

Copy
$ besu --network=ropsten

--network=dev for local blockchain like ganache

Note: The state of the blockchain will be saved in the same directory where you ran besu, so when you switch network it will overwrite the previous state, you can run besu in different directory for a different network.

Additional flag configuration

Here are some helpful flags you can run your Besu node with, based on the requirement.

  • To see other flags and some useful commands:

additional flag configuration

Copy
$ besu --help

  • To run the node with JSON RPC HTTP service enabled:

additional flag configuration

Copy
$ besu --rpc-http-enabled

  • To run the node with JSON RPC WebSocket service enabled:

additional flag configuration

Copy
$ besu --rpc-ws-enabled

  • To enable mining on the node (set FALSE by default):

additional flag configuration

Copy
$ besu --miner-enabled

  • To specify number of blocks to be considered for eth_gasPrice (default is set to 100):

additional flag configuration

Copy
$ besu --api-gas-price-blocks

  • To enable legacy Eth/64 fork id (default is set to false):

additional flag configuration

Copy
$ besu --compatibility-eth64-forkid-enabled

  • To start GraphQL HTTP service:

additional flag configuration

Copy
$ besu --graphql-http-enabled

  • To set Logging verbosity level  (Logging verbosity levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL):

additional flag configuration

Copy
$ besu --logging=<LOG VERBOSITY LEVEL>

  • To set the minimum gas price in Wei for a transaction to be included in the block:

additional flag configuration

Copy
$ besu --min-gas-price=<minTransactionGasPrice>

  • To enable pruning that removes the old state (default is false):

additional flag configuration

Copy
$ besu --pruning-enabled

  • To set the sync mode as FAST or FULL (default is FAST if a --network  is supplied and privacy is enabled. FULL otherwise):

additional flag configuration

Copy
$ besu  --sync-mode=<MODE>

  • To set the maximum number of pending transaction hashes that will be kept in the transaction pool (default is set to 4096):

additional flag configuration

Copy
$ besu   --tx-pool-haes-max-size=<INTEGER>

  • To specify a maximum number of pending transactions that will be kept in the transaction pool:

additional flag configuration

Copy
$ besu  --tx-pool-max-size=<INTEGER>

Conclusion

Congratulations on launching your very own Hyperledger Besu node! You can refer to Hyperledger Besu’s official documentation for further details.

Subscribe to our newsletter for more articles and guides on Ethereum. If you have any feedback, feel free to reach out to us via Twitter, or on our Discord community server, featuring some of the coolest developers you'll ever meet :) 

Related articles 11

Ethereum Full Node vs Archive Node
Published: Apr 8, 2021
Updated: Sep 20, 2022

Ethereum runs on a network of computers (also known as nodes) that verify transactions based on a consensus protocol and ledger, which make up the blockchain. In this guide, you will learn...

Continue reading
How to setup a Chainlink node
Published: Jul 6, 2020
Updated: Sep 21, 2022

Smart-contracts are the heart and soul of all the development happening on the Ethereum blockchain, and as more and more people develop on Ethereum, smart contracts are becoming more...

Continue reading
Introduction to Ethereum Rollups
Published: Dec 28, 2021
Updated: Sep 9, 2022

Ethereum, the most popular blockchain, has seen scaling issues for quite a long time now. With high gas fees due to congestion being the primary pain point. With the increasing cost to use the...

Continue reading
How to Run a Binance Smart Chain Node
Published: Jul 2, 2021
Updated: Oct 11, 2022

Binance Smart Chain, BSC for short, is a blockchain that seeks to provide both an alternative and extension to the Ethereum Blockchain. It has done this through several clever implementations...

Continue reading
How to install and run a Geth node
Published: Apr 5, 2020
Updated: Sep 12, 2022

Ethereum nodes are computers participating in Ethereum blockchain network. These nodes are actual computers running software that verifies, stores, and sometimes creates blocks. The actual...

Continue reading
How to run Nethermind node
Published: May 18, 2021
Updated: Nov 18, 2022

To run an Ethereum node without any problems, it is essential to choose a good node client. Nethermind is one of the oldest and most trusted Ethereum node clients. In this guide, let’s see how...

Continue reading
How to Install and Run a Stacks Node
Published: Aug 26, 2022
Updated: Sep 9, 2022

Stacks 2.0 is an open-source layer-1 blockchain that allows developers to build smart contracts and decentralized blockchain applications. This guide will demonstrate how to install the Stacks...

Continue reading
How to Use Laika with QuickNode
Published: Apr 22, 2022
Updated: Sep 9, 2022

Developers spend most of their time writing code, testing, and fixing bugs. A lot of the time spent with these tasks can be simplified by using a tool like Laika. Laika is a Web3 development...

Continue reading