Should You run your own Ethereum node?

Should You run your own Ethereum node?

TLDR: In most cases, you should not host your Ethereum node, but it depends.

Recently, I had the opportunity to refactor a somewhat big Dapp in the Ethereum network and I got my hands dirty into the matter of going through the trouble of keeping hosting your node or just going with the KISS architecture (Keep it Simple, Stupid) and just use a trusted party service.

Table of Contents

  1. Why do you need a Ethereum node?
  2. Advantages of hosting your Ethereum node
  3. Advantages of using a trusted party Ethereum service
  4. Price comparison

1. Why do you need a Ethereum node?

If you are a dapp developer you probably need some off-chain infrastructure, to either run cronjob tasks or to automatically manage private keys, etc.

The single best way to programmatically interact with the Ethereum network is by using the API that Geth gives you, which allows you to separate your off-chain logic from the logic that signs transactions and the way networks sync and communicate.

2. Advantages of hosting your Ethereum node

Hosting your node, give you more:

These are 3 top advantages from my point of view, but there are surely others that you will find out if you decide to go this way.

3. Advantages of using a trusted party Ethereum service

The first thing to consider here is to decide which provider you should pick, there are a ton of them and as time goes on more are going to appear.

The top providers I can think of are Infura, Alchemy, and more recently Etherscan.

I picked Etherscan for the project I worked on, because of the additional endpoints they have besides the usual Geth ones, and secondly, I was already using their website to track the project wallets and contracts, so it made a lot of sense to just use their API as well.

Some of the advantages of using a trusted party service are:

One of the main disadvantages to using a trusted party is that you will be missing the feature to let Geth manage your private keys and transaction signing, so you need to consider that while developing your integration with the blockchain.

4. Price comparison

The chapter you have been waiting for, a cost comparison between self-host and trusted party.

Just to give a little more context, our eth contract had well-defined events that made it much easier crawling the network.

All I had to do was call the eth_getLogs endpoint with our contract address and it returned a maximum of 1000 events for as many blocks as I wanted.

I made some calculations and in the most extreme case, we could only crawl 25 blocks per call, which would give us about 40 events per block, which is more than enough for our usage.

Our cost of running our node in AWS was the following:

After the migration to Etherscan API, which completely removed the EFS storage and downgraded the instance to 1/4, ended up saving about 450$ per month in the AWS bill.

In the new Etherscan API we were able to just keep using the free tier indefinitely because we had such optimized requests.

In short, every case is different. But starting out with using a trusted party for the first steps of any project is always advantageous, and later you can reconsider upgrading to a self-hosted node.