Geth Documentation

website·Indexed 19 days ago

https://geth.ethereum.org/

Official documentation for Geth, a Go-Ethereum client. Includes guides on installation, node synchronization modes, database and history pruning, and monitoring via InfluxDB, Grafana, and Ethstats. Detailed technical references for JSON-RPC namespaces (eth, net, admin, txpool, etc.), GraphQL server, and tools such as Clef for secure account management and Abigen for Go binding generation.

Tokens
72.3K
Snippets
418
Records
547
Agent score
98%

What's inside Geth

  1. Overview of Geth Real-time Events (PubSub)

    Geth (v1.4+) supports a publish/subscribe model using JSON-RPC notifications. This allows clients to subscribe to specific events and receive notifications containing relevant data and a subscription ID, eliminating the need for polling.

    Key Constraints:

    • Connection Type: Requires a full-duplex connection, such as WebSockets or IPC (enabled by default).
    • Lifecycle: Subscriptions are tied to the connection; if the connection closes, all associated subscriptions are removed.
    • Data Scope: Notifications are sent for current events only, not historical events.
    • Buffer Limits: Notifications are stored in an internal buffer. If the client cannot keep up and the buffer reaches the limit (currently 10k), the connection is closed.
  2. Overview of Clique signing with Clef

    In Clique proof-of-authority networks, authorized signers create new blocks. Traditionally, Geth uses the --unlock flag to allow nodes to sign blocks without manual password entry, but this is a security risk as any attacker with RPC access can sign arbitrary transactions. Clef provides a secure alternative by managing keystore passwords and automating block approval decisions, removing the need for the --unlock flag. Note: Clique has been deprecated since geth v1.14.
  3. Overview of blsync beacon light client

    blsync is a beacon chain light client integrated within Geth. It eliminates the need to run a separate consensus client, offering low resource requirements and fast synchronization (within seconds). It is intended for use-cases that do not require full validation capabilities.

    Critical Constraints:

    • Not for Validators: blsync is not suitable for running a validator.
    • Security Warning: It is not recommended for nodes handling significant funds or for production settings due to lower security guarantees compared to a full consensus client.
  4. Overview of the clique RPC namespace

    The clique API provides access to the state of the Clique consensus engine. It is primarily used to manage signer votes and monitor the health of a private network.

    ⚠️ Deprecation Notice: The clique namespace has been deprecated since Geth v1.14.

  5. Overview of Custom EVM Tracers in Geth

    Geth allows developers to write custom tracers that hook into EVM events to process and return transaction data in a specific format. Tracers can be implemented in two ways:

    1. JavaScript Tracers: Ideal for quick prototyping, experimentation, and less intensive applications. They are passed as arguments to the API.
    2. Go Tracers: High-performance native tracers. They must be compiled together with the Geth source code and are invoked by name via the API.
  6. Overview of Clef

    Clef is a secure local environment tool for signing Ethereum transactions and data. It decouples key management from the Ethereum node (such as Geth), allowing it to function as a standalone signing application or as an integrated component. Because signing happens locally, Clef can be used safely with remote or untrusted nodes. It can be run as a daemon on the same machine as the client, on a secure USB device (e.g., USB armory), or within a separate VM (e.g., QubesOS).
  7. Overview of the les Namespace

    The les API is used for managing Light Ethereum Client Sub-protocol (LES) server settings. This includes managing client parameters, payment settings for prioritized clients, and querying checkpoint information in both server and client modes.
  8. Overview of Geth Live Tracing

    Introduced in Geth v1.14.0, live tracing allows developers to stream observable blockchain data in real-time as Geth syncs and processes blocks. This is primarily used for building data indexing solutions. Available events include:

    • Initialization: Chain configuration (hard forks, chain ID) and the genesis block.
    • Block Processing: The next block to be processed and any associated errors.
    • Transaction Processing: The next transaction to be processed and its post-execution receipt.
    • EVM Events: Call frame level events, opcode level events, logs, and gas changes (with reasons).
    • State Modifications: Changes to accounts, including balance changes with reasons.

    Performance Warning: Live tracers run synchronously within the sync process and can impact node performance. Tracer code should be kept minimal, focusing on extracting raw data and deferring heavy post-processing to a separate stage.

    Reorg Handling: Because this is a real-time stream, indexing solutions must handle chain reorgs by checking the chain of processed hashes upon receiving OnBlock events and unrolling invalidated internal state.

  9. Overview of Geth (go-ethereum)

    Geth (go-ethereum) is a Go implementation of the Ethereum protocol. It serves as an Ethereum execution client, meaning it is responsible for handling transactions, deploying and executing smart contracts, and managing the Ethereum Virtual Machine (EVM). To operate a full Ethereum node, Geth must be run alongside a compatible consensus client.
  10. Overview of Ethstats monitoring

    Ethstats is a monitoring service that provides real-time and historical statistics for individual Ethereum nodes and the network as a whole.

    Individual node metrics include: last received block, block time, propagation time, connected peers, and latency. Network metrics include: total number of nodes, average block times, node geolocation, and transaction counts.

    Ethstats consists of three components:

    1. Server: Consumes data from nodes and generates statistics.
    2. Client: Queries a node and forwards data to the server.
    3. Dashboard: A web-based interface to visualize the statistics.

    Note: Ethstats is not a comprehensive source for the entire network because data submission is voluntary and must be configured by each node operator.

  11. Overview of go-ethereum (Geth)

    Go-ethereum, commonly known as Geth, is a popular Ethereum client implemented in the Go programming language. It allows users to interact with the Ethereum network by providing the necessary software to download, install, and run a node.