Cointime

Download App
iOS & Android

How To Configure Ethereum Node?

Validated Project

In a previous blog, we discussed the concept of nodes in the blockchain. In this blog, I will guide you through configuring an Ethereum node.

Ethereum Node

A node in Ethereum consists of two components: execution client and consensus client.

The execution client (Execution Engine, previously called Eth1 client) listens to new transactions broadcasted in the network, executes them in EVM, and holds the latest state and database of all Ethereum data. Geth, Nethermind, Hyperledger Besu and Erigon are currently available execution clients.

The consensus client (Beacon Node / CL client, previously called Eth2 client) implements the proof-of-stake consensus algorithm, which enables the network to achieve agreement based on validated data from the execution client. Lighthouse, Lodestar, Nimbus, Prysm and Teku are some of the available consensus clients.

Prior to the merge Ethereum nodes consisted of only the execution layer which took care of Proof of Work consensus also. The merge finalized the transition of consensus from proof of work(PoW) to proof of stake(PoS). The PoS consensus-related tasks were managed by the consensus client, and deprecated the PoW functionality in the execution client.

In this short tutorial, I will demonstrate how to configure an Ethereum client in Ubuntu 20.04.4. We will use Hyperledger Besu as the execution client and Lighthouse as the consensus client. You may use any combination of execution and consensus clients.

Installation

Java Installation

Since besu is based on Java, ensure you have Java installed. If not, update and install Java using the below commands.

sudo apt update
sudo apt install openjdk-17-jdk

Ensure that Java has been installed successfully by doing a version check.

java --version

Besu Installation

Download the latest version of binaries from https://github.com/hyperledger/besu/releases. Here I am using Hyperledger Besu 23.1.2.

wget https://hyperledger.jfrog.io/hyperledger/besu-binaries/besu/23.1.2/besu-23.1.2.zip

The above command will download the compressed folder. Once the download is complete, unzip the contents into a new folder named besu.

If you do not have unzip command, install using apt install unzip

unzip besu-23.1.2.zip -d besu

Switch to the besu folder and list the files to confirm the installation.

cd besu
ls

Switch to the besu subfolder and confirm the besu version using the command.

./bin/besu --version

To change the command from ./bin/besu to besu, we should provide the full path of besu’s bin directory in the environment file. First, use the below command to display the full path of besu (present working directory) and copy it.

pwd

Next, open the environment file using the command

sudo nano /etc/environment

and append the copied path(including the bin folder) at the end of the current data.

Note: Editing the environment variable can also be done by the command:

echo ‘export PATH=$PATH:/root/besu-23.1.2/bin’ >> ~/.bashrc

Now restart the system.

Can’t wait till your system restarts? Just give the command

source /etc/environment in the terminal, it will refresh the system environment only for the open terminal.

Confirm the changes are complete by checking the version.

Install Lighthouse

Download the latest version from this link, extract the contents, or use the commands below.

wget https://github.com/sigp/lighthouse/releases/download/v4.0.1/lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
tar -xvf lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz 

To change the command from ./lighthouse to lighthouse, edit the environment file as described previously.

JWT Token Generation

The execution and consensus clients authenticate each other using a 32-byte hexadecimal value called JSON Web Token (JWT secret). Before configuring the clients, let’s create the token.

You may also create it using any generator like seanwasere generator. Some clients have an inbuilt facility for token generation. You can also create a random number yourself.

I am using OpenSSL, a toolkit for cryptographic functions, to generate the token. It will be available by default in most Linux versions. If you do not have OpenSSL, please check this link for installation guidelines: https://www.openssl.org/source/.

openssl rand -hex 32 | tr -d "\n" > jwtsecret.hex

The secret code will be available in the file jwtsecret.hex.

Starting the execution client

To start the execution client, we need to specify some configuration attributes. For this, create a config.toml and copy the below content.

network="MAINNET"
data-path="./data"
rpc-http-enabled=true
rpc-http-host="0.0.0.0"
rpc-http-cors-origins=["*"]
rpc-ws-enabled=true
rpc-ws-host="0.0.0.0"
host-allowlist=["*"]
engine-host-allowlist=["*"]
engine-rpc-enabled=true
engine-jwt-secret="./jwtsecret.hex"

The configuration specifies the path to store synced data, enables HTTP and web socket communications from external sources and allows engine API services (intercommunication between execution and consensus layers).

Use the below command to start besu.

Make sure that you are in the folder containing config.toml.

besu --Xlauncher

From the terminal information, note the Engine port (8551). Next, we can configure the consensus client to connect with this execution client.

Starting the consensus client

Open a new terminal in the same location and use the below command.

lighthouse bn 
  --network mainnet 
  --execution-endpoint http://localhost:8551 
  --execution-jwt ./jwtsecret.hex 
  --checkpoint-sync-url https://sync-mainnet.beaconcha.in/  
  --disable-deposit-contract-sync 
  --http 
  --purge-db

It will instruct the lighthouse to try to connect with the present execution client, running at port number 8551. The checkpoint sync endpoints are available here. You may use any endpoints for syncing. The deposit contract syncing is disabled since we are not participating in staking. If the consensus client is stopped and restarted, there can be some errors with checkpoint syncing; the purge-db flag is used to deal with this situation.

According to the network, the time taken for syncing will be different. You can use the testnets goerli or sepolia, where the sync times are shorter. To switch to test networks, update the network parameter and checkpoint-sync-endpoints.

Within a short time, Besu and Lighthouse can connect. The clients will try to sync with the other peers in the network. The updates will be visible in the terminal.

Output Terminal of Besu
Output Terminal of Teku

Can you identify the sync mode which we are using? Running a full node can be heavy since the hardware/software requirements to manage it effectively can only be met with effort.

There are various methods to interact with the running node. Application Programming Interfaces (APIs) define methods to query a node. This will be covered in the next blog. Stay tuned.

References

[1] https://lighthouse-book.sigmaprime.io/intro.html

[2] https://besu.hyperledger.org/en/stable/

[3] https://ethereum.org/en/developers/docs/nodes-and-clients/#why-should-i-run-an-ethereum-node

(By Sumi Maria Abraham, Research & Development Engineer, Kerala Blockchain Academy)

Read more: https://kbaiiitmk.medium.com/how-to-configure-ethereum-node-152436897536

Comments

All Comments

Recommended for you

  • Amazon Shares Surge 15.2%, Biggest Gain Since 2012

    On July 31, Amazon shares surged 15.2% to $271.255 per share, marking their biggest gain since 2012, with a total market value of $2.92 trillion.

  • US Treasury Secretary Bessent Vows to Track Down Iranian Assets Globally for Terror Victims

    US Treasury Secretary Bessent said the US will actively track down Iranian assets worldwide to ensure compensation funds for victims of Iran-backed terrorist activities. Bessent stated that the US government's military and economic blockade measures against the Iranian regime will continue and will not be relaxed. (Jinshi)

  • Apple Plunges Nearly 10%, Q4 Revenue Guidance Misses Expectations

    On July 31, Apple (AAPL.US) plunged nearly 10% to $300.33, marking its biggest drop since April 2025. In terms of fundamentals, Apple's third-fiscal-quarter revenue rose approximately 16% year-over-year to $109.42 billion, slightly above analyst expectations. Among the details, product revenue came in at $78.68 billion, beating the expected $77.25 billion. However, services revenue—a key driver of its valuation re-rating in recent years—totaled $30.74 billion, missing the consensus estimate of $31.36 billion. Additionally, Greater China revenue reached $18.82 billion, with year-over-year growth slowing to 22%, also below analysts' forecast of $19.58 billion. During the earnings call, Apple guided fourth-fiscal-quarter revenue growth in the range of 9% to 11%, overall below the 12.1% analysts had expected. CFO Parekh noted that component supply constraints would impact iPhone, Mac, and iPad businesses in the fourth fiscal quarter, with currency fluctuations also constraining growth.

  • Three Fed Officials Back Rate Hike, Hawkish Pressure Builds

    On July 31, three Federal Reserve policymakers said that dissenting votes in favor of a rate hike this week stemmed from stubborn inflationary pressures, highlighting rising internal pressure on Fed Chair Warsh to act. In statements released Friday morning, Hammack and Kashkari said they worry that although the current round of price increases may stem from short-term factors such as President Trump's tariff policies and the Iran war, the inflation situation already warrants Fed action. Logan also joined in, saying that even if inflation cools, if the Fed does not raise rates, inflation is unlikely to fully fall back to the Fed's 2% target; without any policy constraints, inflation could continue to run above target until an unexpected shock occurs. Kashkari said that if inflation remains persistently stubborn, he might support a series of rate hikes, not just a single increase, to prevent inflation from becoming further entrenched. He said: "A series of small policy adjustments may be preferable to waiting for developments to unfold and ultimately having to take more forceful action." Hammack said that if the Fed does not tighten policy, price increases could continue to accelerate. She said: "Inflation has been stubbornly above 2% for more than five years, and I have no confidence that it will return to our target on its own." (Jin Shi)

  • US 10-Year Treasury Yield Rises to 4.7388%, Highest Since January 2025

    On July 31, the US 10-year Treasury yield rose to 4.7388%, the highest level since January 2025.

  • Spot Gold Intraday Decline Widens to 2%, at $4,021.08 per Ounce

    On July 31, spot gold's intraday decline widened to 2%, reported at $4,021.08 per ounce.

  • BTC Falls Below $63,000

    Market数据显示,BTC has fallen below $63,000, currently reported at $62,985.99, with a 24-hour decline of 2.99%. Market volatility is significant, please exercise risk control.

  • Fed's Logan: Leaning Toward 25 Basis Point Rate Hike

    On July 31, Federal Reserve Governor Logan said she leans toward a 25 basis point rate hike, believing inflation has not yet entered a sustainable path back to the Fed's 2% target. Logan stated that taking moderate action now would reduce the risk of needing more aggressive tightening in the future, while emphasizing that the Fed cannot rely on unexpected shocks to achieve its inflation target.

  • Fed's Logan: Taking Modest Actions Now Reduces Likelihood of Needing Stronger Action Later

    On July 31, Dallas Fed President Lorie Logan said that taking modest actions in the near term would reduce the likelihood of needing to take stronger action in the future.

  • Philadelphia Semiconductor Index Erases 5% Gain, Turns Lower

    On July 31, U.S. chip and semiconductor stocks rapidly weakened, with the Philadelphia Semiconductor Index wiping out a 5% gain and turning lower. Micron Technology, which had risen 6%, is now down 4.2%. SanDisk, which had gained nearly 10%, is now down over 6%. SK Hynix and Seagate Technology, which had risen over 8%, are now down 2%. TSMC, which had gained 4%, is now down nearly 1%.