How to run your own Ethereum light node

Charlie Taylor

Ethereum is a distributed network of computers running specific software that verifies transactions in a block, this software being known as a client. A “node” is a computer that runs an Ethereum client. Until Merge, only one piece of software is needed to run a full node (or a light node, in our case). After the Merge, in addition to an execution client, it will also be necessary to run a consensus client to maintain a node. Unlike Bitcoin, where there is only one client software (Bitcoin Core), there are several Ethereum clients written in different programming languages ​​like Go, Rust, JavaScript, TypeScript, Python, C#, etc. What all these clients have in common are the specifications on how the Ethereum blockchain works, defined in the yellow paper. In this tutorial we will learn how to run a light node using Geth, an Ethereum client written in Go. A light node, unlike a full node, does not download the full history of the blockchain. In fact, a light node only downloads the block headers, resulting in a big difference in storage space required. While full nodes need 2TB or more of free space, light nodes need ~400MB, making it much easier for the average user to run on their personal machine. In theory you could run any Ethereum client, however, the only one that currently supports light nodes is Geth.

Installing Geth

geth is available for almost any operating system, and you can compile the program from source if you wish. In the link below you can check the installation process of Geth:Check out more installation details: Installing GethIn my case, I will be using a Linux distribution based on Arch. To install geth, open the terminal and type the following command:sudo pacman -S gethand press enter. Ready! After entering your administrator password and confirming the installation, the process should start and end quickly.Port information used by Geth’s HTTP server.

Running your light node

Now, with Geth installed, just run the following command in your terminal:geth –syncmode light –httpPort information used by Geth’s HTTP server. With Geth running, the software will look for peers from which it can download block headers. Peers are other users of the software that are running full nodes and share data with light nodes. As soon as Geth finds a peer it will start importing block headers.Port information used by Geth’s HTTP server.

Why run your own light node

In the past, there have been problems using Dapps due to flaws in the RPC used by the metamask, Infura. More recently, hackers have taken control of popular RPCs from Fantom and Polygon, causing users to lose funds in the process. By running your own light node, you no longer have to trust third parties, such as the companies that maintain the most used RPCs, and has a way to communicate directly with the full nodes on the network, making the experience more secure and private.

Using your node

Great, now you’re running your own light node, but how do you use it? If you’re like 99% of DeFi users, you use MetaMask as your wallet. In this part of the tutorial, we will learn how to configure our light node so that we can use it to interact with the Ethereum blockchain. do we start the Geth? This option allows us to easily connect our MetaMask wallet to our light node. First, open the settings in your MetaMask walletMetaMask wallet screenshotSelect the “Networks” tabMetaMask Wallet ScreenshotClick “Localhost 8545”Screenshot MetaMask wallet Now check if your node is running on the correct port. In my case, Geth was already running on port 8545, so I just need to adjust the “Chain ID” in the settings. Change the value of “Chain ID” to 1 and save.Port information used by Geth’s HTTP serverMetaMask Wallet Screenshot Now select the “Localhost 8545” in your MetaMask network selection screen. If the option does not appear in the list, you need to enable test networks in the settings under Settings > Advanced > Show test networks.MetaMask Wallet ScreenshotReady! you can now transact and interact with smart contracts using your own light node! Congratulations! It’s important to remember that to have maximum privacy and decentralization, the ideal is to run your own full node. Geth is by far the most used execution client today. If you want to contribute to the decentralization of Ethereum by running your own full node, I suggest that you run other clients, such as OpenEthereum, Nethermind, Besu and Erigon. author.

About the author

Lucca Benedetti is a bachelor’s student with an emphasis in Chemical Engineering at the University of São Paulo. She works as a Research Analyst at Bitcoin Market.

\r\n window.uolads.push({id: \”banner-970×250-area-1\” });\r\n \r\n

\r\n\t”,”elementid”:”port-4dc22f1ecedecb9ad7f9339d064849a0″,”args”:{“inject_by”:”pro_custom_element”,”pro_custom_element”:”div.jeg_main.jeg_double_sidebar > div.jeg_container > div.jeg_content. jeg_singlepage”,”pro_custom_position”:”insertBefore”,”container_id”:”#ce19a1137d1a9fb4ce5fc580296f6e57a”,”ad_label”:”default”,”placement_position”:””,”placement_conditions”:{“visitors”:[{“type”:”mobile”,”operator”:”is_not”}]},”placement”:{“type”:”custom_position”},”previous_method”:”placement”,”previous_id”:”before-title”,”id”:74177,”method”:”id”,”post “:{“id”:130198,”author”:”63″,”post_type”:”post”},”wp_the_query”:{“term_id”:””,”taxonomy”:””,”is_main_query”:true ,”is_rest_api”:false,”page”:1,”numpages”:1,”is_archive”:false,”is_search”:false,”is_home”:false,”is_404″:false,”is_attachment”:false,” is_singular”:true,”is_front_page”:false,”is_feed”:false},”url_parameter”:”\/how-to-run-your-own-light-node-of-ethereum\/”,”placement_type”:”custom_position “,”output”:{“class”:[“porta-antes-titulo”],”placement_id”:”before-title”},”change-ad”:{“visitors”:[{“type”:”mobile”,”operator”:”is_not”,”connector”:”and”}]},”cache_busting_elementid”:”port-4dc22f1ecedecb9ad7f9339d064849a0″},”has_js_items”:[{“id”:74177,”type”:”ad”,”title”:”970×250 topo”,”blog_id”:1}],”inject_before”:[“”]}];( window.advanced_ads_ready || jQuery( document ).ready ).call( null, function(){if ( !window.advanced_ads_pro ){console.log(“Advanced Ads Pro: cache-busting can not be initialized” );}});} catch (error){console.log(‘PSE’, error);} try {window.addEventListener(‘load’, async() => {let cmp = document.createElement(‘script’) );cmp.src=””;cmp.async = true;document.head.appendChild( cmp);}, {once: true});} catch (error){console.log(‘PSE’, error);}

Click to rate this post!
[Total: 0 Average: 0]
Next Post

Review: This is how the investment giants' holdings have fared on the reporting days

New sustainability requirements – a challenge for many companies Published: July 4, 2022, 7:00 a.m. Updated: July 8, 2022, 3:52 p.m.In step with digitization and the green transition, sustainability issues are getting higher on the agenda. This applies to several industries, and not least within the universe of capital – […]
Review: This is how the investment giants' holdings have fared on the reporting days

Subscribe US Now