Overview
BaseApp is the foundational ABCI application implementation in Cosmos SDK. It implements the ABCI interface for communication with CometBFT consensus engine and manages the application lifecycle, including transaction execution, state management, and block processing.Core Types
BaseApp Structure
baseapp/baseapp.go:86-190
StoreLoader
baseapp/baseapp.go:50
Constructor
NewBaseApp
baseapp/baseapp.go:195-259
Example:
ABCI Lifecycle Methods
InitChain
baseapp/abci.go:53-154
Key Operations:
- Sets initial height and chain ID
- Initializes finalizeState and checkState
- Stores consensus parameters
- Calls application’s InitChainer handler
Info
baseapp/abci.go:156-166
Query
baseapp/abci.go:170-200
Execution Modes
baseapp/baseapp.go:53-62
Key Methods
MountStores
baseapp/baseapp.go:292-300
SetAnteHandler
SetPostHandler
MsgServiceRouter
baseapp/baseapp.go:287
GRPCQueryRouter
baseapp/baseapp.go:290
Store Management
LoadLatestVersion
LoadVersion
LastCommitID
Configuration Options
BaseApp supports functional options for configuration:Usage in Application
Related Types
- Context - Request context passed through handlers
- Store - State storage interfaces
- MsgServiceRouter - Message routing
- Module Manager - Module lifecycle coordination