> ## 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.

# Counter

> gRPC queries and transaction messages defined by the counter module in Cosmos SDK v0.55.

<Info>
  Generated from [`cosmos/cosmos-sdk@2086680ff8b0`](https://github.com/cosmos/cosmos-sdk/tree/2086680ff8b08fd269ee653e087ea577bab79534/proto) on ref `release/v0.55.x`.
</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/latest/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/latest/api-reference/grpc/index) for reflection, address formats, and decimal encoding.

### GetCount

GetCount queries the parameters of x/Counter module.

|      |                                    |
| ---- | ---------------------------------- |
| gRPC | `cosmos.counter.v1.Query/GetCount` |

Request `QueryGetCountRequest`:

This message has no fields.

Response `QueryGetCountResponse`:

| Field         | Type    | Description |
| ------------- | ------- | ----------- |
| `total_count` | `int64` |             |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext localhost:9090 cosmos.counter.v1.Query/GetCount
```

## Transaction messages

These messages are included in signed transactions, not called as endpoints. See [Transactions](/sdk/latest/learn/concepts/transactions#transactions) for the execution model, and [Sending transactions](/sdk/latest/api-reference/transactions) for the envelope they go into.

Examples use CLI transaction JSON. Decimal fields use values such as `"0.05"`, even when their proto type is `bytes`. The gRPC `TxEncode` method instead requires the scaled value `"50000000000000000"`. See [scalar encodings](/sdk/latest/api-reference/grpc/index#scalar-encodings).

* Handler: Generated client method
* Signer: Account that must sign
* Amino name: Legacy identifier used by hardware wallets and other Amino signers

### IncreaseCount

IncreaseCount increments the counter by the specified amount.

|            |                                         |
| ---------- | --------------------------------------- |
| Type URL   | `/cosmos.counter.v1.MsgIncreaseCounter` |
| Handler    | `cosmos.counter.v1.Msg/IncreaseCount`   |
| Signer     | `signer`                                |
| Amino name | `cosmos-sdk/increase_counter`           |

| Field    | Type     | Description                                                                                                             |
| -------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `signer` | `string` | signer is the address that controls the module (defaults to x/gov unless overwritten). Encoded as cosmos.AddressString. |
| `count`  | `int64`  | count is the number of times to increment the counter.                                                                  |

In a transaction:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "@type": "/cosmos.counter.v1.MsgIncreaseCounter",
  "signer": "<string>",
  "count": "1"
}
```

Response `MsgIncreaseCountResponse`:

| Field       | Type    | Description                                                    |
| ----------- | ------- | -------------------------------------------------------------- |
| `new_count` | `int64` | new\_count is the number of times the counter was incremented. |
