Sign inSign up

fiftysix/geth

By fiftysix

Updated 22 days ago

Go Ethereum execution client for Ethereum nodes.

Image
0

3.4K

fiftysix/geth repository overview

Fiftysix Geth Docker Image

Maintainer: [email protected]

Overview

This Docker image provides a fully functional Geth (Go Ethereum) client built using the Fiftysix base image. Geth serves as the execution engine in the Ethereum network, responsible for processing transactions, executing smart contracts, and maintaining the Ethereum state. This image is ideal for developers, blockchain enthusiasts, and institutions looking to participate in the Ethereum network. The code can be viewed on the Fiftysix Github.

Tags
  • latest: Points to the latest version of Geth.
  • <version>: Points to a specific version of Geth. For example, 1.14.6, 1.14.7.
What is Geth?

Geth is the official Go implementation of the Ethereum protocol and operates as the execution engine in Ethereum's Proof of Stake (PoS) network. Following the merge, Geth no longer handles mining but is instead responsible for transaction processing, smart contract execution, and maintaining the state of the Ethereum blockchain. Execution engines like Geth work in tandem with consensus clients to manage the blockchain's consensus mechanism.

Usage
Prerequisites

To run Geth effectively as an execution engine, you'll need a system with sufficient storage and memory to handle the Ethereum blockchain. Geth is designed to work alongside Ethereum consensus clients, such as Lighthouse, Prysm, Teku, Lodestar, and Nimbus, to form a complete Ethereum node.

Basic Usage

To run a Geth node:

docker pull fiftysix/geth
docker run --name geth -d fiftysix/geth

This command will start the Geth container, exposing the default RPC and P2P ports.

Note: Geth requires an Ethereum consensus client alongside, such as Lighthouse, Prysm, Teku, Lodestar, and Nimbus, to properly sync. Example Geth compose files can be found here.

Directory Structure

In this Docker image, the following directories are used:

  • Data Directory (/node/geth/data): This is where Geth stores the Ethereum blockchain data and other related files. This directory is specified in the Dockerfile and should be mounted if you want to persist data across container restarts.
  • Config Directory (/node/geth/configs): This directory is used for storing configuration files for Geth. The Dockerfile copies a default config.toml configuration file here, which can be customized.
  • Scripts Directory (/node/geth/scripts): This directory contains the entrypoint script (geth-entrypoint.sh) and any other scripts that may be needed for starting or managing Geth.
Mounting Directories

You can mount host directories to the container’s data, config, and scripts directories to customize the behavior of the Geth software.

Mounting the Data Directory: To persist Geth data across container restarts, you can mount a host directory to the container's data directory:

docker run --name geth -v /path/to/local/data:/node/geth/data -d fiftysix/geth

This command mounts the /path/to/local/data directory on your host to /node/geth/data in the container, ensuring that blockchain data is preserved between container instances.

Mounting a Config File: To use a custom Geth configuration file, mount your configuration file to the container’s config directory and specify it using the --config flag:

docker run --name geth -v /path/to/local/config.toml:/node/geth/configs/config.toml -d fiftysix/geth \
  --config="/node/geth/configs/config.toml"

This command mounts your custom config.toml file to the container’s config directory and instructs Geth to use it.

Mounting the Scripts Directory: If you have custom scripts you want to include, you can mount them to the scripts directory. For example, to replace the entrypoint script:

docker run --name geth -v /path/to/local/scripts:/node/geth/scripts -d fiftysix/geth

This command mounts your local scripts directory to /node/geth/scripts in the container, allowing you to customize the startup behavior.

Logging Geth
docker logs geth --tail 100
Using Geth
Starting Geth with Custom Options

To start Geth with custom options, such as enabling RPC or specifying network parameters, you can pass additional flags to the geth command:

docker run --name geth -d \
  -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp \
  fiftysix/geth \
  --http --http.addr "0.0.0.0" --http.port 8545 --http.corsdomain "*" --http.api "eth,net,web3" \
  --syncmode "fast" --networkid 1

This command starts Geth with the HTTP RPC server enabled, listening on port 8545, with fast synchronization mode and connected to the Ethereum mainnet.

Exposing Ports

The following ports are commonly used by Geth and are exposed in this Docker image:

  • 8545: HTTP-RPC server
  • 8546: WebSocket-RPC server
  • 8551: Engine API server (used for communication between the execution engine and consensus client)
  • 30303: P2P communication (TCP and UDP)
Docker Compose

Geth can also be run using Docker Compose. Various Docker Compose files are available to run Geth as the execution engine alongside different Ethereum consensus clients, such as Lighthouse, Prysm, Teku, Lodestar, and Nimbus. These setups enable a complete Ethereum node configuration, with Geth handling execution and the chosen client managing consensus. Examples of these Docker Compose files can be found on the Fiftysix Github.

Support

For support, please contact [email protected].

About Fiftysix

Fiftysix is committed to making blockchain technology accessible, efficient, and reliable through robust decentralization. Learn more at fiftysix.xyz.

Tag summary

Content type

Image

Digest

sha256:2e98d1e55

Size

898 MB

Last updated

22 days ago

docker pull fiftysix/geth