simapp, the SDK’s reference implementation.
Prerequisites
Before you begin, ensure you have:- Go 1.21 or later installed
- Git installed
- Basic command-line knowledge
- At least 2GB of available disk space
If you haven’t installed the Cosmos SDK yet, check out the installation guide first.
Initialize your chain
Build the simapp binary
Build the Verify the installation:You should see the SDK version output.
simd binary which is the blockchain daemon:Initialize the chain
Initialize your chain with a moniker (node name) and chain ID:This creates the default configuration files in
~/.simapp/:config/app.toml- Application configurationconfig/config.toml- CometBFT configurationconfig/genesis.json- Genesis statedata/- Blockchain data directory
View initialization output
View initialization output
Create a key pair
Create a key that will be used for your validator and test account:The output will show:
Add genesis account
Add your key as a genesis account with initial tokens:This adds alice to the genesis file with 100,000,000 stake tokens.
Create genesis transaction
Create a genesis transaction that makes your account a validator:This creates a validator with 1,000,000 stake tokens delegated to it.
Collect genesis transactions
Collect all genesis transactions (in this case, just one):This finalizes the genesis file.
Interact with your chain
Once your chain is running, open a new terminal to interact with it:Query account balance
Send tokens
Create another account and send tokens:Query transaction
Query block
Configuration
The default configuration is suitable for testing, but you can customize:Application configuration (~/.simapp/config/app.toml)
Key settings:
minimum-gas-prices- Minimum gas price for transactionspruning- State pruning strategyapi.enable- Enable REST API servergrpc.enable- Enable gRPC server
CometBFT configuration (~/.simapp/config/config.toml)
Key settings:
moniker- Node nameproxy_app- ABCI application addressrpc.laddr- RPC server listen addressp2p.laddr- P2P listen addressp2p.seeds- Seed nodes for discovery
Troubleshooting
Port already in use
Port already in use
If you see
bind: address already in use, another process is using the default ports (26656, 26657).Stop other Cosmos SDK chains or change the ports in config.toml:Genesis transaction failed
Genesis transaction failed
If
gentx fails, ensure:- The account exists in genesis:
simd genesis add-genesis-account - The chain-id matches: Use the same
--chain-ideverywhere - The keyring backend matches: Use
--keyring-backend testconsistently
Reset the chain
Reset the chain
To start fresh:Then repeat the initialization steps.
Next steps
Architecture
Learn how Cosmos SDK applications are structured
Building chains
Create your own custom blockchain application
Modules
Explore available modules for your chain
API reference
Dive into the SDK’s core APIs
Using the quick initialization script
For rapid testing, use the built-in initialization script:- Builds the binary
- Initializes the chain
- Creates test accounts (alice and bob)
- Adds genesis accounts
- Creates a genesis validator
- Starts the chain
scripts/init-simapp.sh and is perfect for quick testing iterations.