How kaiachain/kaia works
Kaia is a Go implementation of a blockchain, with node binaries that participate in consensus and expose network access. The principal user workflow is an application sending requests through an Endpoint Node’s RPC gateway; node services handle network communication and the worker executes and commits blockchain work against persistent state. Consensus and data-sync features provide distinct supporting branches, alongside developer-facing contract bindings and Service Chain bridging. Edges are limited to relationships shown in the README or source index; unsampled implementation details are not inferred.
Main entry points: worker.go Block Worker · blockchain.go Blockchain · engine.go Istanbul Backend · kaia_client.go Kaia Client
Components 21
Node Access
- Kaia Client
client/kaia_client.go - RPC Server
networks/rpc/server.go - Node Service
node/service.go - P2P Server
networks/p2p/server.go - Peer Discovery
networks/p2p/discover/table_storage.go
Chain Runtime
- Block Worker
work/worker.go - Blockchain
blockchain/blockchain.go - Virtual Machine
blockchain/vm/evm.go - Blob Storage
blockchain/blob_storage.go
Consensus
- Engine Selector
consensus/engine/engine.go - Istanbul Backend
consensus/istanbul/backend/engine.go - Istanbul Core
consensus/istanbul/core/handler.go
Persistence and Sync
- Database Manager
storage/database/db_manager.go - State Database
storage/statedb/database.go - DB Syncer
datasync/dbsyncer/query_engine.go - Trace Repository
datasync/chaindatafetcher/kas/repository_traces.go
Extensions
- Binding Generator
cmd/abigen/main.go - Contract Bindings
contracts/bindings/kip247/GaslessSwapRouter.go - Service Chain Bridge
node/sc/bridge_manager.go - Validator Ranking
kaiax/vrank/impl/handler.go
Other components
- Application
Connections 21
- Application → RPC Server: sends RPC
- RPC Server → Node Service: serves requests
- Node Service → P2P Server: starts networking
node/service.go - P2P Server → Peer Discovery: uses discovery
networks/p2p/server.go - Kaia Client → RPC Server: calls RPC
client/kaia_client.go - Kaia Client → Blockchain: uses types
client/kaia_client.go - Kaia Client → Istanbul Backend: uses auction
client/kaia_client.go - Block Worker → Blockchain: uses chain
work/worker.go - Block Worker → Virtual Machine: uses VM
work/worker.go - Block Worker → State Database: uses state
work/worker.go - Block Worker → Database Manager: uses storage
work/worker.go - Block Worker → Istanbul Backend: uses consensus
work/worker.go - Engine Selector → Istanbul Backend: creates backend
consensus/engine/engine.go - Istanbul Backend → Istanbul Core: starts core
consensus/istanbul/backend/engine.go - DB Syncer → Database Manager: writes rows
datasync/dbsyncer/query_engine.go - Trace Repository → Blockchain: uses chain data
datasync/chaindatafetcher/kas/repository_traces.go - Binding Generator → Contract Bindings: generates bindings
cmd/abigen/main.go - Service Chain Bridge → Database Manager: uses storage
node/sc/bridge_manager.go - Service Chain Bridge → Contract Bindings: uses bridge binding
node/sc/bridge_manager.go - Validator Ranking → Istanbul Core: uses consensus messages
kaiax/vrank/impl/handler.go - Blockchain → Blob Storage: supports blob sidecars