Why so much infrastructure is Go
Go compiles to a single static binary, has cheap concurrency and a large standard library — a good fit for long-running network daemons. go-ethereum (geth) is a reference Ethereum client, and the Cosmos SDK with CometBFT/Tendermint lets teams build application-specific chains in Go.
- •geth: execution client, JSON-RPC server, devnet tooling.
- •Cosmos SDK: modules, staking, IBC — chains as Go applications.
- •Most indexers, relayers and monitoring bots are Go services.
Concurrency you actually use
A goroutine is a cheap managed thread started with the go keyword; channels pass values between them. Peer connections, block subscriptions and worker pools map naturally onto this model, and context.Context propagates cancellation and deadlines through the whole call tree.
- •One goroutine per subscription or peer is normal.
- •Use channels or mutexes to share state — never unsynchronised writes.
- •Always pass a context so shutdown is clean.
Reading a chain from Go
With go-ethereum's ethclient you dial an RPC endpoint and call typed methods: HeaderByNumber, BalanceAt, FilterLogs. abigen generates a Go binding from an ABI, giving compile-time-checked contract calls — the server-side counterpart of ethers.js in the browser.
Contract or service?
Put rules that must be trustless and enforced on-chain in the contract. Put anything needing history, aggregation, scheduling or secrets in a Go service that reads events and stores derived data. Backfilling logs and handling reorgs is indexer work, not contract work.
