How to run a Hyperledger Besu node

December 29, 2021

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 9

How to run a OpenEthereum (ex-parity client) Node
Dec 29, 2021

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 software is called a "client" and it allows us to interact with the blockchain...

Continue reading
Introduction to Ethereum Rollups
Dec 29, 2021

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 network, a plethora of scaling solutions have emerged. Today in this guide, we...

Continue reading
How to install and run a Prysm Beacon node
Dec 29, 2021

Even if you're a newbie, rookie, or a pro in Ethereum it really excites all of us to see these developments in Ethereum. Whether it's all the hard forks like Istanbul, Atlantis, etc. or the development of Ethereum 2.0 - there is a lot to keep up with.In this...

Continue reading
How to run Expedition Block Explorer
Apr 12, 2022

In this article, we will talk about how to install and run the Expedition Ethereum Block explorer. While playing with the Ethereum blockchain network one might need to look up transactions, tokens, addresses, or prices. To accomplish these...

Continue reading
How to run Nethermind node
Dec 29, 2021

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 we can launch a Nethermind node.

Continue reading
How to Run a Binance Smart Chain Node
Dec 29, 2021

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 that took place during the building of the platform. This guide will walk you...

Continue reading
How to install and run a Geth node
Mar 23, 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 software is called a "client," and it allows us to interact with the blockchain...

Continue reading
Ethereum full node vs archive node
Apr 12, 2022

If the Ethereum network is to be seen as a globally distributed computer, then nodes provide computational power and resources to this computer. In this guide, we’ll understand more about Ethereum full nodes and archive nodes then explore the difference between them.

Continue reading
How to Use Laika with QuickNode
Apr 22, 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 tool that aims to improve the developer experience when interacting with the...

Continue reading