Interfaces
How they relate
Modules usually define two protobuf services:- A
Queryservice for reading application state - A
Msgservice describing the state changes transactions can request
Queries
Query methods are callable through gRPC on port 9090. Methods with agoogle.api.http binding are also available through REST on port 1317.
For example, these calls reach the same query handler:
Transaction messages
Msg methods are not callable endpoints. They define messages that are encoded into transactions, signed, and broadcast through a transaction service:
CLI
The CLI is a client. Query commands call the application’s query services. Transaction commands construct and sign module messages, then broadcast the resulting transaction. See Using the CLI for worked examples, and CLI for how it fits with the other interfaces. Most commands are not written by hand:autocli generates one per gRPC service method, which is why a command and a grpcurl call usually take the same arguments.
Examples in this reference use simd, but each chain normally provides its own application-specific binary.
CometBFT RPC
CometBFT RPC is separate from the application APIs. It belongs to the consensus engine beneath the Cosmos SDK and exposes blocks, validators, consensus data, the mempool, transaction broadcasting, and event subscriptions. See the CometBFT RPC reference.What this section covers
Each module page includes both kinds of declaration. For example, the
bank page documents Query/AllBalances and MsgSend.
To list the gRPC services registered by a running node:
Enable the interfaces
gRPC is enabled by default. Enable REST inapp.toml:
config.toml: