Introduction of Hyperledeger BESU

Kritank sharma
6 min readNov 30, 2020

Hyperledger is a global enterprise blockchain project that offers the necessary framework,standards, guidelines and tools, to build open source blockchains and related applications for use across various industries.

Hyperledger Besu​ is an Ethereum client designed to be enterprise-friendly for both public and private permissioned network use cases. It can be run both on the Ethereum public network or on private permissioned networks and test networks such as Rinkeby, Gorli, and Ropsten.

What Hyperledger Besu Supports?

Besu supports ​​Ethereum ​ functionalities such as smart contract and DApp development,deployment, and operational use cases. The tools that enable these activities are Remix, Truffle,and web3j. The Ethereum client implements standard JSON-RPC APIs. This simplifies integration with ecosystem tooling. Besu includes a command-line interface and HTTP and Websocket-based APIs for running, monitoring, and maintaining nodes on an Ethereum blockchain.

Besu does not support key management owing to security issues. Instead, for managing private keys, you can use any Ethereum-compatible wallet or EthSigner.

Besu supports account permissioning and smart-contract and local-configuration-based nodes.Private transactions are also made available in the client through zero-knowledge methods.

With Hyperledger Besu we can do following things like :

Smart contract development.

Ether mining.

Decentralized application (DApp) development.

Architecture

Besu​ represents the growing interest of enterprises to build both permissioned and public network use cases for their applications. The project’s design and ​architecture​ decisions have been aimed at clean interfaces and modularity, with the goal of making Hyperledger Besu​ a platform for open development and deployment.

Storage-

​In a storage setup, the data is divided into a few sub-categories, such as:

Blockchain- ​This consists of ‘block headers’ that form the chain of data that is used to verify the blockchain state cryptographically. Block bodies contain the list of ordered transactions that are included in each block. Transaction receipts contain metadata related to transaction execution, and this includes transaction logs.

World state-​ Every block header references a world state through a state Root hash.World state refers to a mapping from addresses to accounts. An Ether balance is maintained by externally owned accounts. Smart contract accounts additionally contain executable code and storage.

P2P networking-

Besu implements Ethereum’s devp2p network protocols for inter-client communication and a sub-protocol for IBFT2:

Discovery- ​A UDP-based protocol to find users on the network.

RLPx- ​A TCP-based protocol that is used for communication between peers through sub-protocols. They are the ETH sub-protocol (Ethereum Wire Protocol) that is used to synchronize the blockchain state across the network and propagate new transactions and the IBF sub-protocol that is used by IBFT2 consensus protocol to facilitate consensus decisions.

User-facing APIs-

​Besu provides mainnet Ethereum and JSON-RPC APIs over HTTP and WebSocket protocols and the GraphQL API.

JSON-RPC.

Features of Hyperledger Besu

An introduction to Hyperledger Besu primarily refers to its features. It presently operates according to the Enterprise ​Ethereum Alliance (EEA)​ standard. EEA specification is a standard benchmark for the creation of common interfaces between different closed and open source projects in the Ethereum landscape.

EVM (Ethereum Virtual Machine )

Ethereum Virtual Machine in the Hyperledger Besu is a Turing complete virtual machine,which supports deploying and executing smart contracts through transactions in Ethereum Blockchain.

Consensus Mechanisms

Hyperledger Besu facilitates different consensus mechanisms in the form of two distinct algorithms. The consensus algorithms help in the implementation of different consensus algorithms related to block production, block validation and transaction validation.

The two prominent consensus algorithms are Proof of Authority and Proof of Work. The Proof of Authority protocols is ideal in cases where the participants in transactions know each other. The Proof of Work(or Ethash)is suitable for use cases that focus on mining activities related to the mainnet Ethereum.

Privacy & P2P Networking

Privacy has a prominent place. Privacy primarily refers to maintaining the privacy of transactions between the only parties involved in the transaction.

Besu uses a private transaction manager, Orion, to implement privacy. Each Besu node sending or receiving private transactions requires an associated Orion node.

Hyperledger Besu leverages the devp2p network protocols of Ethereum for enabling communication between clients. It also provides a sub-protocol tailored specifically for IBFT2.

Permissioning

Users can enable account permissioning or node permissioning on the network according to their preferences. In addition, users also get the benefit of local as well as on-chain permissioning with Hyperledger Besu.

Local permissioning utilizes configuration files for permissioning at the node level. On the other hand, on-chain permissioning involves the use of smart contracts at the network level.

Use node permissioning to restrict access to known participants only.

Use account permissioning to:

  1. Enforce on boarding or identity requirements
  2. Suspend accounts
  3. Deny list broken contracts
  4. Restrict the actions an account can perform.

Get Started with Besu

We have two options getting started with besu

  • Run Besu from Docker Images
  • Install Binary Distribution

Run Besu from Docker Images

Besu provides a Docker image to run a Besu node in a Docker container. We can use Docker image to run a single Besu node without installing Besu.

Note- The Docker image does not run on Windows.

Use following command in terminal to run a Besu node in a container connected to the Ethereum MainNet:

docker run hyperledger/besu:latest

Note- https://hub.docker.com/r/hyperledger/besu/tags lists the available tags for the image.

Expose ports for P2P peer discovery, GraphQL, metrics, and HTTP and WebSockets JSON-RPC.

Now we can also test the node on Rinkeby Testnet & Ethereum MainNet with the HTTP JSON-RPC service.

When done running nodes, you can shut down the node container without deleting resources or you can delete the container after stopping it using following command.

docker stop <container-name> (stop a container )

docker rm <container-name> ( delete a container )

Install Binary Distribution

We can Run Besu on a local machine using Homebrew & JDK but we need Java 11+ to compile. Earlier versions are not supported .

Install Besu using Homebrew:

Using the following command to install Besu using Homebrew ..

brew tap hyperledger/besu

brew install hyperledger/besu/besu

We can check the Version of Besu using following command

besu — version

Note- We can also install Besu from packaged binaries but need JDk 11+

Download the Besu packaged binaries.

Unpack the downloaded files and change into the besu-<release> directory.

Display Besu command line help to confirm installation:

bin/besu — help

--

--