Giúp dịch trang này

🌏

Bạn đang xem trang này bằng tiếng Anh vì chúng tôi chưa dịch trang này. Giúp chúng tôi dịch nội dung này.

This page is incomplete and we'd love your help. Edit this page and add anything that you think might be useful to others.

Nodes and clients

Last edit: , Invalid DateTime
Edit page

Ethereum is a distributed network of computers running software (known as nodes) that can verify blocks and transaction data. You need an application, known as a client, on your computer to "run" a node.

Prerequisites

You should understand the concept of a peer-to-peer network and the basics of the EVM before diving deeper and running your own instance of an Ethereum client. Take a look at our introduction to Ethereum.

What are nodes and clients?

"Node" refers to a running piece of client software. A client is an implementation of Ethereum that verifies all transactions in each block, keeping the network secure and the data accurate.

You can see a real-time view of the Ethereum network by looking at this map of nodes.

Many Ethereum clients exist, in a variety of programming languages such as Go, Rust, JavaScript, Python, C# .NET and Java. What these implementations have in common is they all follow a formal specification (originally the Ethereum Yellow Paper). This specification dictates how the Ethereum network and blockchain functions.

Eth1x client Simplified diagram of what Ethereum client features.

Node types

If you want to run your own node, you should understand that there are different types of node that consume data differently. In fact, clients can run 3 different types of node - light, full and archive. There are also options of different sync strategies which enables faster synchronization time. Synchronization refers to how quickly it can get the most up-to-date information on Ethereum's state.

Full node

  • Stores full blockchain data.
  • Participates in block validation, verifies all blocks and states.
  • All states can be derived from a full node.
  • Serves the network and provides data on request.

Light node

  • Stores the header chain and requests everything else.
  • Can verify the validity of the data against the state roots in the block headers.
  • Useful for low capacity devices, such as embedded devices or mobile phones, which can't afford to store gigabytes of blockchain data.

Archive node

  • Stores everything kept in the full node and builds an archive of historical states. Needed if you want to query something like an account balance at block #4,000,000, or simply and reliably test your own transactions set without mining them using OpenEthereum.
  • These data represent units of terabytes which makes archive nodes less attractive for average users but can be handy for services like block explorers, wallet vendors, and chain analytics.

Syncing clients in any mode other than archive will result in pruned blockchain data. This means, there is no archive of all historical states but the full node is able to build them on demand.

Why should I run an Ethereum node?

Running a node allows you to trustlessly and privately use Ethereum while supporting the ecosystem.

Benefits to you

Running your own node enables you to use Ethereum in a truly private, self-sufficient and trustless manner. You don't need to trust the network because you can verify the data yourself with your client. "Don't trust, verify" is a popular blockchain mantra.

  • Your node verifies all the transactions and blocks against consensus rules by itself. This means you don’t have to rely on any other nodes in the network or fully trust them.
  • You won't have to leak your addresses and balances to random nodes. Everything can be checked with your own client.
  • Your dapp can be more secure and private if you use your own node. Metamask, MyEtherWallet and some other wallets can be easily pointed to your own local node.
  • You can program your own custom RPC endpoints.
  • You can connect to your node using Inter-process Communications (IPC) or rewrite the node to load your program as a plugin. This grants low latency, which is required to replace your transactions as fast as possible (i.e. frontrunning).

How you access Ethereum via your application and nodes

Network benefits

A diverse set of nodes is important for Ethereum’s health, security and operational resiliency.

  • They provide access to blockchain data for lightweight clients that depend on it. In high peaks of usage, there need to be enough full nodes to help light nodes sync. Light nodes don't store the whole blockchain, instead they verify data via the state roots in block headers. They can request more information from blocks if they need it.
  • Full nodes enforce the proof-of-work consensus rules so they can’t be tricked into accepting blocks that don't follow them. This provides extra security in the network because if all the nodes were light nodes, which don't do full verification, miners could attack the network and, for example, create blocks with higher rewards.

If you run a full node, the whole Ethereum network benefits from it.

Running your own node

Interested in running your own Ethereum client? Learn how to spin up your own node!

Projects

Select a client and follow their instructions

ethnode - Run an Ethereum node (Geth or OpenEthereum) for local development.

DAppNode - An operating system GUI for running Web3 nodes, including Ethereum and the beacon chain, on a dedicated machine.

Resources

Alternatives

Running your own node can be difficult and you don’t always need to run your own instance. In this case, you can use a third party API provider like Infura, Alchemy, or QuikNode. Alternatively ArchiveNode is a community-funded Archive node that hopes to bring archive data on the Ethereum blockchain to independent developers who otherwise couldn't afford it. For an overview of using these services, check out nodes as a services.

If somebody runs an Ethereum node with a public API in your community, you can point your light wallets (like MetaMask) to a community node via Custom RPC and gain more privacy than with some random trusted third party.

On the other hand, if you run a client, you can share it with your friends who might need it.

Clients

The Ethereum community maintains multiple open-source clients, developed by different teams using different programming languages. This makes the network stronger and more diverse. The ideal goal is to achieve diversity without any client dominating to reduce any single points of failure.

This table summarizes the different clients. All of them are actively worked on and pass client tests.

ClientLanguageOperating systemsNetworksSync strategiesState pruning
GethGoLinux, Windows, macOSMainnet, Görli, Rinkeby, RopstenFast, FullArchive, Pruned
OpenEthereumRustLinux, Windows, macOSMainnet, Kovan, Ropsten, and moreWarp, FullArchive, Pruned
NethermindC#, .NETLinux, Windows, macOSMainnet, Görli, Ropsten, Rinkeby, and moreFast, FullArchive, Pruned
BesuJavaLinux, Windows, macOSMainnet, Rinkeby, Ropsten, and GörliFast, FullArchive, Pruned
ErigonGoLinux, Windows, macOSMainnet, Görli, Rinkeby, RopstenFast, FullArchive, Pruned

For more on supported networks, read up on Ethereum networks.

Advantages of different implementations

Each client has unique use cases and advantages, so you should choose one based on your own preferences. Diversity allows implementations to be focused on different features and user audiences. You may want to choose a client based on features, support, programming language, or licences.

Go Ethereum

Go Ethereum (Geth for short) is one of the original implementations of the Ethereum protocol. Currently, it is the most widespread client with the biggest user base and variety of tooling for users and developers. It is written in Go, fully open source and licensed under the GNU LGPL v3.

OpenEthereum

OpenEthereum is a fast, feature-rich and advanced CLI-based Ethereum client. It's built to provide the essential infrastructure for speedy and reliable services which require fast synchronisation and maximum up-time. OpenEthereum’s goal is to be the fastest, lightest, and most secure Ethereum client. It provides a clean, modular codebase for:

  • easy customisation.
  • light integration into services or products.
  • minimal memory and storage footprint.

OpenEthereum is developed using the cutting-edge Rust programming language and licensed under the GPLv3.

Nethermind

Nethermind is an Ethereum implementation created with the C# .NET tech stack, running on all major platforms including ARM. It offers great performance with:

  • an optimized virtual machine
  • state access
  • networking and rich features like Prometheus/Grafana dashboards, seq enterprise logging support, JSON RPC tracing, and analytics plugins.

Nethermind also has detailed documentation, strong dev support, an online community and 24/7 support available for premium users.

Besu

Hyperledger Besu is an enterprise-grade Ethereum client for public and permissioned networks. It runs all of the Ethereum Mainnet features, from tracing to GraphQL, has extensive monitoring and is supported by ConsenSys, both in open community channels and through commercial SLAs for enterprises. It is written in Java and is Apache 2.0 licensed.

Erigon

Erigon, formerly known as Turbo‐Geth, is a fork of Go Ethereum oriented toward speed and disk‐space efficiency. Erigon is a completely re-architected implementation of Ethereum, currently written in Go but with implementations in other languages planned. Erigon's goal is to provide a faster, more modular, and more optimized implementation of Ethereum. It can perform a full archive node sync using less than 2TB of disk space, in under 3 days

Sync modes

  • Full – downloads all blocks (including headers, transactions and receipts) and generates the state of the blockchain incrementally by executing every block.
  • Fast (Default) – downloads all blocks (including headers, transactions and receipts), verifies all headers, and downloads the state and verifies it against the headers.
  • Light – downloads all block headers, block data, and verifies some randomly.
  • Warp sync – Every 5,000 blocks, nodes will take a consensus-critical snapshot of that block’s state. Any node can fetch these snapshots over the network, enabling a fast sync. More on Warp
  • Beam sync – A sync mode that allows you to get going faster. It doesn't require long waits to sync, instead it back-fills data over time. More on Beam
  • Header sync – you can use a trusted checkpoint to start syncing from a more recent header and then leave it up to a background process to fill the gaps eventually

You define the type of sync when you get set up, like so:

Setting up light sync in GETH or ERIGON

geth --syncmode "light"

For further details check the tutorial on running Geth light node.

Setting up full sync with archive in Besu

besu --sync-mode=FULL

Like any other configuration, it can be defined with the startup flag or in the config file. Another example is Nethermind which prompts you to choose sync mode during first initialization and creates config.

Hardware

Hardware requirements differ by client but generally are not that high since the node just needs to stay synced. Don't confuse it with mining which requires much more computing power. Sync time and performance do improve with more powerful hardware however. Depending on your needs and wants, Ethereum can be run on your computer, home server, single-board computers or virtual private servers in the cloud.

An easy way to run your own node is using 'plug and play' boxes like DAppNode. It provides hardware for running clients and applications that depend on them with a simple user interface.

Requirements

Before installing any client, please ensure your computer has enough resources to run it. Minimum and recommended requirements can be found below, however the key part is the disk space. Syncing the Ethereum blockchain is very input/output intensive. It is best to have a solid-state drive (SSD). To run an Ethereum client on HDD, you will need at least 8GB of RAM to use as a cache.

  • CPU with 2+ cores
  • 4 GB RAM minimum with an SSD, 8 GB+ if you have an HDD
  • 8 MBit/s bandwidth
  • Fast CPU with 4+ cores
  • 16 GB+ RAM
  • Fast SSD with at least 500 GB free space
  • 25+ MBit/s bandwidth

The sync mode you choose will affect space requirements but we've estimated the disk space you'll need for each client below.

ClientDisk size (fast sync)Disk size (full archive)
Geth400GB+6TB+
OpenEthereum280GB+6TB+
Nethermind200GB+5TB+
Besu750GB+5TB+
ErigonN/A1TB+
  • Note: Erigon does not Fast Sync, but Full Pruning is possible (~500GB)

A chart showing that GB needed for a full sync is trending up

A chart showing that GB needed for an archive sync is trending up

These charts show how storage requirements are always changing. For the most up-to-date data for Geth and OpenEthereum, see the full sync data and archive sync data.

Ethereum on a single-board computer

The most convenient and cheap way of running Ethereum node is to use a single board computer with ARM architecture like Raspberry Pi. Ethereum on ARM provides images of Geth, OpenEthereum, Nethermind, and Besu clients. Here's a simple tutorial on how to build and setup an ARM client.

Small, affordable and efficient devices like these are ideal for running a node at home.

Eth2 clients

There are new clients to support the Eth2 upgrades. They will run the Beacon Chain and support the new proof-of-stake consensus mechanism.

View Eth2 clients.

Further reading

There is a lot of instructions and information about Ethereum clients on the internet, here are few that might be helpful.

👈
PreviousGas