LinuxCommandLibrary

geth

Run an Ethereum node

TLDR

Connect to the main Ethereum network and automatically download the full node

$ geth
copy

Connect to the Ropsten test network
$ geth --testnet
copy

Create a new account
$ geth account new
copy

Enable mining
$ geth --mine
copy

SYNOPSIS

geth [options] [command [command options]]
Invokes Ethereum node, subcommands, or flags for config

PARAMETERS

--datadir <dir>
    Blockchain and keystore data directory

--syncmode <mode>
    Sync mode: snap (default), full, light

--http
    Enable HTTP-RPC JSON-RPC server

--http.addr <ip>
    HTTP-RPC server listening interface

--http.port <port>
    HTTP-RPC server listening port

--http.api <apis>
    APIs to expose via HTTP-RPC (eth,net,web3)

--http.corsdomain <origins>
    Comma-separated HTTP access origins

--ws
    Enable WebSocket RPC server

--ws.addr <ip>
    WebSocket RPC listening interface

--ws.port <port>
    WebSocket RPC listening port

--ipcpath <path>
    IPC socket path for RPC

--port <port>
    Network listening port (30303 default)

--bootnodes <nodes>
    Comma-separated enode URLs for P2P discovery

--networkid <id>
    Network identifier (1=mainnet)

--nodiscover
    Disable P2P node discovery

--maxpeers <max>
    Maximum number of network peers

--mine
    Enable mining (deprecated post-Merge)

--miner.threads <threads>
    Mining threads (pre-Merge)

--unlock <address>
    Unlock accounts for mining/signer

--password <file>
    Password file for unlocked accounts

--allow-insecure-unlock
    Allow insecure account unlocking

--verbosity <level>
    Logging verbosity (0-5)

--help
    Print help and exit

--version
    Print version and exit

DESCRIPTION

Geth, short for Go Ethereum, is the official command-line client for the Ethereum blockchain written in Go. It enables users to run full Ethereum nodes, light clients, or perform administrative tasks. Key functions include syncing the blockchain, mining Ether, deploying and interacting with smart contracts via JSON-RPC, and managing accounts/keystores.

Geth supports multiple sync modes: full (downloads entire state), fast (snapshots + state), and light (headers only). It offers extensive networking options, RPC APIs (HTTP, WS, IPC), and tools for developers like JavaScript console (geth console). Widely used for dApps, validators, and research, it requires substantial resources for mainnet operation. Geth is actively maintained by the Ethereum Foundation and community.

CAVEATS

Full mainnet sync requires 1-2TB SSD, 16GB+ RAM, high bandwidth; prune regularly. Post-Merge (2022), mining disabled. RPC exposure risky without auth/firewall. Light mode limited functionality. Testnet flags: --sepolia, --holesky.

SUBCOMMANDS

account: Manage accounts
attach: Interactive JS env
console: JS REPL
init: Initialize genesis
import/export: Chain data
db: Low-level DB access
snapshot: Manage snapshots

RESOURCE USAGE

Mainnet full node: ~500GB pruned, 1.5TB archive. CPU-intensive during sync. Use --syncmode snap for faster initial sync.

INSTALLATION

Download from geth.ethereum.org. Linux: Add to PATH, verify checksums. Snap/Flatpak unofficial.

HISTORY

First released July 2014 by Jeffrey Wilcke for Ethereum Frontier launch. Rewritten in Go by Péter Szilágyi. Key milestones: Constantinople (2019), Beacon Chain integration (2020), The Merge (2022 PoS). Active development for Dencun, Pectra upgrades.

SEE ALSO

ipfs(1)

Copied to clipboard