Geth (Go Ethereum) is an execution client, not a dapp framework, so "building code off of Geth" means using its JSON-RPC endpoints, its Go libraries, or its developer mode as the Ethereum node your application talks to. The practical path is: run a Geth node you control, connect with a standard library like ethers.js, web3.py, or go-ethereum's ethclient, then deploy and call contracts against it. Everything below assumes you're wiring that stack deliberately instead of just pointing at a public RPC and hoping.
The key condition is that Geth gives you the chain and the API surface. Your dapp logic—contracts, indexers, wallets, UI—lives in another layer that speaks JSON-RPC or uses Geth's Go packages directly. Confusing the two is the most common reason people stall.
Decide Which Geth Surface You Actually Need
Geth exposes several distinct integration surfaces, and picking the right one early saves a rewrite later.
The JSON-RPC API is the universal path. Any language with an HTTP or WebSocket client can call eth_call, eth_sendRawTransaction, eth_getLogs, and the rest. This is what MetaMask, ethers.js, viem, and web3.py all consume underneath. If you're building a typical web dapp, this is your integration point.
The ethclient Go package inside the go-ethereum repository gives Go programs typed access to the same RPC methods. You get bind.Bind-generated contract wrappers via abigen, so a Solidity contract becomes a Go struct with methods. This matters if you're writing a backend service, a bot, or anything that benefits from Go's concurrency model and static typing.
In-process embedding lets a Go program import Geth's node packages and run a full node inside the same process. That's powerful for tooling and testing but couples your binary to Geth's internals and upgrade cadence. Most dapps should not do this.
Developer mode (--dev) spins up a single-node chain with instant sealing and a pre-funded account, which is the fastest way to test contract deployment without running a separate testnet.
The decision rule: browser or mobile frontend → JSON-RPC. Go backend or CLI → ethclient plus abigen. Local contract iteration → dev mode. Embedded node → only when you're building infrastructure.
Prerequisites Before You Write Integration Code
Get these in place first; skipping them produces confusing errors later.
Geth installed. Download a release binary or build from source with Go. The binary is geth; check with geth version. A data directory you control. Geth stores chain data under a --datadir path. Pick one explicitly so you don't collide with other nodes. An execution-layer consensus setup for real networks. Since Ethereum's Merge, a standalone Geth node needs a consensus client (Prysm, Lighthouse, Teku, Nimbus) connected over the Engine API to follow mainnet or a public testnet. Geth alone will not sync proof-of-stake chains. On dev mode or a private chain you skip this. Solidity tooling. Foundry or Hardhat for compiling and deploying contracts. Geth doesn't compile Solidity. A client library. ethers.js v6, viem, web3.py, or go-ethereum's ethclient, depending on language. A funded account on whatever chain you target. For dev mode, Geth pre-funds a developer account; for testnets, use a faucet.
The consensus client point trips up a lot of people who remember pre-Merge Geth. It's not optional for mainnet.
Run a Geth Node for Development
Start with dev mode because it removes every external dependency.
This launches an ephemeral chain, enables the HTTP JSON-RPC server (default ), and exposes the eth, web3, net, and debug namespaces. The --dev flag also prints a pre-funded account and its private key to the console. Copy them; you'll need them for deployment scripts.
To confirm success, call the node:
You should get a JSON response with a result field. If you get a connection refused error, the HTTP server isn't running; if you get a method-not-found error, the namespace isn't enabled. Both are reversible checks before you touch application code.
For a persistent local chain that survives restarts, use --dev.period 1 (seal a block every second) or drop --dev and configure a private network with a genesis file. Dev mode resets state when you restart, which is fine for iteration but useless for anything you want to keep.
Connect Your Application over JSON-RPC
With the node running, point a client library at it. Here's the shape in ethers.js v6:
And in web3.py:
Both should return a number that matches what eth_blockNumber reports via curl. That agreement is your success check: the library and the node are talking.
For anything involving events or pending transactions, switch to WebSocket transport (ws://127.0.0.1:8546 with --ws enabled) because HTTP polling for subscriptions is clumsy and slow. WebSocket subscriptions (eth_subscribe) deliver new blocks and logs as they arrive.
If you're writing Go, import github.com/ethereum/go-ethereum/ethclient and dial the same URL:
That single call covers headers, blocks, transactions, receipts, and contract calls through typed methods.
Deploy a Contract to Your Geth Chain
Contracts are the reason you're here, so get one deployed against your own node before building anything around it.
1: Write and compile the contract. A minimal storage contract works: one uint with a setter and getter. Compile with solc, Foundry (forge build), or Hardhat. You need the ABI and bytecode. 2: Fund the deploying account. In dev mode it's already funded. On a testnet, request from a faucet. 3: Deploy using your library. In ethers.js, new ContractFactory(abi, bytecode, signer).deploy() sends the deployment transaction. Wait for the receipt; the receipt's contractAddress is your instance address. 4: Verify the code is present. Call eth_getCode with that address via curl. You should get non-empty hex. If it returns 0x, your deployment transaction either failed or hasn't been mined. 5: Read and write. The getter works through eth_call (free, no transaction). The setter needs a signed transaction and gas.
For the Go path, abigen generates a binding from the ABI and bytecode, and you deploy through bind.DeployContract. The same sequence applies: deploy, wait for receipt, check code at the address.
The success check across languages is consistent: eth_getCode returns bytecode, and a getter call returns the value you set. If either fails, inspect the transaction receipt's status field—0x0 means the transaction reverted.
Build the Backend Layer That Reads Geth
Most dapps need more than a provider: they need indexed state, event processing, and reliable reads that don't hammer the node.
Logs and events come from eth_getLogs. Filter by address and topic to pull contract events. This is the foundation of any indexer. Run it over a block range, deduplicate by transaction hash and log index, and store into Postgres or SQLite. Geth returns logs only for blocks it has, so range queries must respect your node's sync state.
Reads that need historical state require an archive node or a node with state pruning tuned appropriately. eth_call with a blockTag lets you query balances or storage at a past block, but a pruned node won't have the state to answer. On dev mode, state is small enough that this rarely bites.
Reorg handling is the part people skip. A block you indexed can disappear during a reorg. Track the last N blocks as provisional, confirm them after a depth threshold (12 blocks is a conventional conservative choice on mainnet), and reprocess on reorg. Use eth_getBlockByNumber to walk back and detect when a parent hash doesn't match what you stored.
Rate and load discipline: batch requests where the client supports it, cache immutable data (like transaction receipts for confirmed blocks), and use subscriptions rather than tight polling loops. A single Geth node can serve meaningful traffic but is not a public RPC provider.
Write Go Code Directly Against Geth
If you're in Go, the go-ethereum repository is your SDK, and abigen is the bridge from Solidity to typed Go.
Install abigen from the go-ethereum source tree, then generate a binding:
This produces a Go file with a DeployMyContract function, a NewMyContract constructor for an existing address, and a method per contract function. Methods that read state accept a *bind.CallOpts; methods that write accept a *bind.TransactOpts with a signer.
The signer is where wallet management enters. bind.NewKeyedTransactorWithChainID wraps a private key and chain ID into a signer for local keys. In production you'd likely favor hardware wallets, KMS, or a smart-account setup, but for local development a keyed transactor is fine.
Two things to watch. First, the generated code reflects the chain ID of the transaction, so passing the wrong chain ID causes signature failures that read as opaque. Second, abigen output changes with the go-ethereum version, so pin your dependency version and regenerate after upgrades rather than assuming compatibility.
Test and Troubleshoot Without Losing Time
Distinguish symptoms from causes before changing code.
Symptom: connection refused. Likely cause: the HTTP or WebSocket server wasn't enabled. Fix: add --http or --ws, and confirm the port.
Symptom: method not found. Likely cause: the RPC namespace isn't in --http.api. Fix: add eth, net, web3, and any other namespaces you use, then restart.
Symptom: insufficient funds for gas. Likely cause: deploying account isn't funded or the gas price exceeds balance. Fix: fund it, or on dev mode re-read the printed account.
Symptom: transaction hash returned but receipt status 0x0. Likely cause: the transaction reverted. Fix: call the same function via eth_call first; you'll get a revert reason without spending gas.
Symptom: syncing stalls on mainnet. Likely cause: no consensus client connected, or the Engine API endpoint is misconfigured. Fix: confirm the consensus client is running and reachable, and check eth_syncing output.
Symptom: event subscription never fires. Likely cause: HTTP transport used instead of WebSocket, or the filter address/topic is wrong. Fix: switch to WebSocket and recheck the filter.
Stop condition: if you're fighting consensus-client configuration beyond a first testnet, or if state corruption keeps returning after a clean re-sync, that's a point to bring in someone experienced with node operations rather than iterating in production.
Testing should happen in layers. Unit-test contract logic against a local dev chain. Integration-test the client layer against a Dockerized Geth in CI. Only then point at a public testnet.
Costs, Limits, and What Geth Won't Do for You
Running your own node is a resource commitment. Geth's mainnet data directory grows into the hundreds of gigabytes even with state pruning, and syncing from scratch takes substantial time and bandwidth. An archive node is much larger. A consensus client runs alongside it with its own storage.
Geth provides execution and the RPC surface. It does not provide hosted RPC, wallet UI, contract verification on block explorers, fiat on-ramps, or managed indexing. Teams that choose self-hosting typically pair it with their own backend and frontend rather than expecting the node to be the product.
If you're building on a rollup or an alternative EVM chain, the same JSON-RPC and ethclient patterns apply, but check the chain's RPC method support and its consensus model. Geth may not be the relevant client, and some methods (like debug tracing) behave differently.
As of late 2026, Ethereum's client diversity and RPC standards have stabilized around the patterns above, and the tooling—ethers v6, viem, web3.py, go-ethereum's bindings—all speak the same JSON-RPC vocabulary. The stable principles: choose the surface that fits your language, keep a node you control for development and indexing, deploy through a funded account, verify with eth_getCode, and handle reorgs explicitly. The specifics of a given network's RPC methods, sync requirements, and version compatibility are what you check against that network's current documentation.