> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cosmos.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Store

> gRPC queries and transaction messages defined by the store module in Cosmos SDK v0.55 (unreleased).

<Info>
  Generated from [`cosmos/cosmos-sdk@c1126e4e5460`](https://github.com/cosmos/cosmos-sdk/tree/c1126e4e5460571378bf9bd9c49cce476b0791e2/proto) on ref `main`.
</Info>

## Queries

A node exposes only the services its application registers:

* gRPC on port 9090
* REST on port 1317, if the method has an HTTP binding

Run `grpcurl -plaintext localhost:9090 list` to see what a node serves.

Queries are read-only and never pass through consensus. See [Queries](/sdk/next/learn/concepts/transactions#queries).

Replace `<string>` placeholders with real values and omit unused filters. Payloads use protobuf JSON, and some `string` fields accept enum constants listed under Types. Field tables give the encoding each value takes.

Examples assume a local node. For TLS endpoints, use port 443 and omit `-plaintext`. See [gRPC services](/sdk/next/api-reference/grpc/index) for reflection, address formats, and decimal encoding.

### ListenCommit

ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit

|      |                                                                |
| ---- | -------------------------------------------------------------- |
| gRPC | `cosmos.store.streaming.abci.ABCIListenerService/ListenCommit` |

Request `ListenCommitRequest`:

| Field          | Type                                                  | Description                                                                  |
| -------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------- |
| `block_height` | `int64`                                               | explicitly pass in block height as ResponseCommit does not contain this info |
| `res`          | `ResponseCommit`                                      |                                                                              |
| `change_set`   | [`StoreKVPair`](#cosmos-store-v1beta1-storekvpair)\[] |                                                                              |

Response `ListenCommitResponse`:

This message has no fields.

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"block_height":"1","res":{"retain_height":"1"},"change_set":[{"store_key":"<string>","delete":false,"key":"","value":""}]}' \
  localhost:9090 cosmos.store.streaming.abci.ABCIListenerService/ListenCommit
```

### ListenFinalizeBlock

ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock

|      |                                                                       |
| ---- | --------------------------------------------------------------------- |
| gRPC | `cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock` |

Request `ListenFinalizeBlockRequest`:

| Field | Type                    | Description |
| ----- | ----------------------- | ----------- |
| `req` | `RequestFinalizeBlock`  |             |
| `res` | `ResponseFinalizeBlock` |             |

Response `ListenFinalizeBlockResponse`:

This message has no fields.

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"req":{"txs":[""],"decided_last_commit":{"round":0,"votes":[{"validator":{"address":"","power":"1"},"block_id_flag":"BLOCK_ID_FLAG_UNKNOWN"}]},"misbehavior":[{"type":"UNKNOWN","validator":{"address":"","power":"1"},"height":"1","time":"<RFC 3339 timestamp>","total_voting_power":"1"}],"hash":"","height":"1","time":"<RFC 3339 timestamp>","next_validators_hash":"","proposer_address":""},"res":{"events":[{"type":"NEW","attributes":[{"key":"<string>","value":"<string>","index":false}]}],"tx_results":[{"code":0,"data":"","log":"<string>","info":"<string>","gas_wanted":"1","gas_used":"1","events":[{"type":"NEW","attributes":[{"key":"<string>","value":"<string>","index":false}]}],"codespace":"<string>"}],"validator_updates":[{"pub_key":{"ed25519":""},"power":"1"}],"consensus_param_updates":{"block":{"max_bytes":"1","max_gas":"1"},"evidence":{"max_age_num_blocks":"1","max_age_duration":"0s","max_bytes":"1"},"validator":{"pub_key_types":["<string>"]},"version":{"app":"1"},"abci":{"vote_extensions_enable_height":"1"},"authority":{"authority":"<string>"}},"app_hash":""}}' \
  localhost:9090 cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock
```

## Types

Messages referenced by the fields above. Protocol buffers version 3 has no required fields, so every field is optional on the wire, and a `[]` suffix marks a repeated field.

### cosmos.store.v1beta1.StoreKVPair

StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and Deletes

| Field       | Type     | Description |
| ----------- | -------- | ----------- |
| `store_key` | `string` |             |
| `delete`    | `bool`   |             |
| `key`       | `bytes`  |             |
| `value`     | `bytes`  |             |
