Skip to main content
The go-ethereum project is published as an importable Go module. You can embed a full Ethereum client, talk to any node over JSON-RPC, sign transactions, decode ABI data, and more — all from a regular Go program.

Module path

github.com/ethereum/go-ethereum

Installation

go get github.com/ethereum/go-ethereum
go-ethereum library code is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0). You can link it into proprietary software, but modifications to the library itself must be released under the same license.

Key packages

PackageDescription
ethclientTyped RPC client — connect to any Ethereum node over HTTP, WebSocket, or IPC
ethclient/simulatedIn-memory blockchain for unit tests; no external node required
accounts/abiABI encoding, decoding, and event parsing
accounts/keystoreEncrypted key storage (Web3 Secret Storage format)
core/typesCanonical types: Block, Transaction, Receipt, Log, Header
rpcLow-level JSON-RPC client; use when ethclient does not expose the method you need
cryptoEthereum cryptography: keccak256, ECDSA key generation and signing
commoncommon.Address (20 bytes) and common.Hash (32 bytes)

Quick orientation

import (
    "github.com/ethereum/go-ethereum/ethclient"
    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/core/types"
    "github.com/ethereum/go-ethereum/accounts/abi"
    "github.com/ethereum/go-ethereum/accounts/keystore"
    "github.com/ethereum/go-ethereum/rpc"
    "github.com/ethereum/go-ethereum/crypto"
)

Typical workflow

  1. Connect to a node with ethclient.Dial (or use ethclient/simulated in tests).
  2. Read chain state — block numbers, balances, storage — via ethclient.Client methods.
  3. Encode calls with accounts/abi and build typed transactions using core/types.
  4. Sign transactions with types.SignTx and a private key, or via accounts/keystore.
  5. Submit with ethclient.Client.SendTransaction.
  6. Drop down to the raw rpc.Client when you need Geth-specific or admin methods.

Subpages

ethclient

Connect to a node, read blocks, send transactions, subscribe to events.

accounts/abi and keystore

ABI encoding/decoding and encrypted key management.

core/types

Block, Transaction, Receipt, Log, and Header types.

rpc client

Low-level JSON-RPC client for custom and Geth-specific methods.

Build docs developers (and LLMs) love