How to Run a Full ETH Node on Windows
ETHKL
0xc8F1
September 7th, 2022

From soon 🔜, to very soon to now, the Ethereum Merge has finally been estimated to happen on September 16th, a coming-of-age upgrade to transition to Proof of Stake, reducing Ethereum’s energy consumption by ~99%.

Running a node now consists of 2 separate software for the execution layer and consensus layer, hence the adorable panda meme.

This is a Windows aimed guide, using Geth for execution and Lighthouse as consensus.

The Fine Print

At least according to Ethereum.org :

Recommended specifications

  • Fast CPU with 4+ cores

  • 16 GB+ RAM

  • Fast SSD with 1+TB

  • 25+ MBit/s bandwidth

It also goes without saying that there will be some command line involved, so being technical as in having written “hello world” in any language is a nice-have.

Housekeeping

To keep layers and data locations organized, we’ll create a folder named ethereum in any directory such as the C:// drive.

Inside of it, create 2 folders namely execution and consensus, your final folder structure looks like this.

Execution Layer

Good ol’ Go Ethereum ( Geth ) remains a popular choice, due to extensive documentation and community support.

Head over to the downloads page, and get the 64-bit archive which you can then paste into your execution folder.

Start Geth on mainnet using the following command.

geth --datadir "C:\ethereum\execution\mainnet" --http --authrpc.jwtsecret jwtsecret

The flags used are as follows, there is definitely much more you can nitpick on performance :

  • --datadir : the location to store chain data, placed in the same folder for easy tracking

  • --http : enable the HTTP server, which can be used for connections to apps such as Metamask

  • --authrpc.jwtsecret : generates a new password file called jwtsecret for connecting with the consensus client later

A green hacker matrix starts to fill the command prompt, and as long as you see that you’ve started on “mainnet” and you’re “importing new chain segments”, your node is starting to sync.

You can periodically check its sync status by opening another command prompt and connecting to the Geth JavaScript console.

geth attach http://localhost:8545

You can then run any of the JSON-RPC commands such as to check an address’s ETH balance, get the current block number, or in this case check if your node has synced.

eth.syncing

A response of false indicates that your node is in sync, and any other response indicates that you’re still syncing, and how many blocks you have to go.

In this case, we’re 53,292 blocks away with the currentBlock being 15399219 and the highestBlock being 15452511, referencing Etherscan.

Consensus Layer

The pairing we’ve chosen for consensus would be Lighthouse, which you can download the x86_64-windows.tar.gz and paste it into your consensus folder.

Extract the zipped executable using any tool such as 7zip or Winrar.

The connection between the execution and consensus layer nodes are password protected by something called a jwtsecret, which we’ve generated from Geth earlier.

Copy that file over into your consensus folder, which should leave you with the lighouse.exe application and the jwtsecret file.

Begin syncing your consensus node with the following command.

lighthouse beacon_node --datadir "C:\ethereum\consensus\mainnet" --http --execution-endpoint http://localhost:8551 --execution-jwt jwtsecret --checkpoint-sync-url "https://beaconstate.ethstaker.cc"

An explanation of the flags used :

  • --datadir : the location to store chain data, similar concept as above

  • --http : enable the HTTP server

  • --execution-endpoint : the password-protected endpoint for your consensus node to connect to the execution node

  • --execution-jwt : the password for the endpoint, it has to be the same across both nodes

  • --checkpoint-sync-url : optionally, perform the initial sync using checkpoint-sync to a fully synced consensus node such as from EthStaker.

You can check if your consensus node has synced and all other API methods by opening a new command prompt and using this command.

curl "http://localhost:5052/lighthouse/syncing"

A message of false indicates that your node has synced, anything other than that such as BackFillSyncing indicates that you are still syncing.

In this case, using checkpoint sync we have the latest block information, and currently backfilling historical blocks, referencing Beaconscan.

{
   "data":{
      "BackFillSyncing":{
         "completed":2237056,
         "remaining":2404672
      }
   }
}

Wrapping Up

Treat yourself to a collection of this post’s NFT if you’ve made it this far!

Though it may seem daunting to have to manage 2 different clients now, running your own node is the best way to safeguard against censorship, protect your privacy and contribute to the network’s decentralisation.

As for what comes next you might want to look at ways of using and interacting with your node!

Subscribe to ETHKL
Receive the latest updates directly to your inbox.
Nft graphic
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from ETHKL

Skeleton

Skeleton

Skeleton