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
Installation
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
| Package | Description |
|---|---|
ethclient | Typed RPC client — connect to any Ethereum node over HTTP, WebSocket, or IPC |
ethclient/simulated | In-memory blockchain for unit tests; no external node required |
accounts/abi | ABI encoding, decoding, and event parsing |
accounts/keystore | Encrypted key storage (Web3 Secret Storage format) |
core/types | Canonical types: Block, Transaction, Receipt, Log, Header |
rpc | Low-level JSON-RPC client; use when ethclient does not expose the method you need |
crypto | Ethereum cryptography: keccak256, ECDSA key generation and signing |
common | common.Address (20 bytes) and common.Hash (32 bytes) |
Quick orientation
Typical workflow
- Connect to a node with
ethclient.Dial(or useethclient/simulatedin tests). - Read chain state — block numbers, balances, storage — via
ethclient.Clientmethods. - Encode calls with
accounts/abiand build typed transactions usingcore/types. - Sign transactions with
types.SignTxand a private key, or viaaccounts/keystore. - Submit with
ethclient.Client.SendTransaction. - Drop down to the raw
rpc.Clientwhen 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.
