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

# Client

> A user can query and interact with the 08-wasm module using the CLI. Use the --help flag to discover the available commands:

## CLI

A user can query and interact with the `08-wasm` module using the CLI. Use the `--help` flag to discover the available commands:

### Transactions

The `tx` commands allow users to interact with the `08-wasm` submodule.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd tx ibc-wasm --help
```

#### `store-code`

The `store-code` command allows users to submit a governance proposal with a `MsgStoreCode` to store the byte code of a Wasm light client contract.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd tx ibc-wasm store-code [path/to/wasm-file] [flags]
```

`path/to/wasm-file` is the path to the `.wasm` or `.wasm.gz` file.

#### `migrate-contract`

The `migrate-contract` command allows users to broadcast a transaction with a `MsgMigrateContract` to migrate the contract for a given light client to a new byte code denoted by the given checksum.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd tx ibc-wasm migrate-contract [client-id] [checksum] [migrate-msg]
```

The migrate message must not be emptied and is expected to be a JSON-encoded string.

### Query

The `query` commands allow users to query `08-wasm` state.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd query ibc-wasm --help
```

#### `checksums`

The `checksums` command allows users to query the list of checksums of Wasm light client contracts stored in the Wasm VM via the `MsgStoreCode`. The checksums are hex-encoded.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd query ibc-wasm checksums [flags]
```

Example:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd query ibc-wasm checksums
```

Example Output:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
checksums:
- c64f75091a6195b036f472cd8c9f19a56780b9eac3c3de7ced0ec2e29e985b64
pagination:
  next_key: null
  total: "1"
```

#### `code`

The `code` command allows users to query the Wasm byte code of a light client contract given the provided input checksum.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
./simd q ibc-wasm code
```

Example:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
simd query ibc-wasm code c64f75091a6195b036f472cd8c9f19a56780b9eac3c3de7ced0ec2e29e985b64
```

Example Output:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
code: AGFzb...AqBBE=
```

## gRPC

A user can query the `08-wasm` module using gRPC endpoints.

### `Checksums`

The `Checksums` endpoint allows users to query the list of checksums of Wasm light client contracts stored in the Wasm VM via the `MsgStoreCode`.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
ibc.lightclients.wasm.v1.Query/Checksums
```

Example:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext \
  -d '{}' \
  localhost:9090 \
  ibc.lightclients.wasm.v1.Query/Checksums
```

Example output:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "checksums": [
    "c64f75091a6195b036f472cd8c9f19a56780b9eac3c3de7ced0ec2e29e985b64"
  ],
  "pagination": {
    "total": "1"
  }
}
```

### `Code`

The `Code` endpoint allows users to query the Wasm byte code of a light client contract given the provided input checksum.

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
ibc.lightclients.wasm.v1.Query/Code
```

Example:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext \
  -d '{"checksum":"c64f75091a6195b036f472cd8c9f19a56780b9eac3c3de7ced0ec2e29e985b64"}' \
  localhost:9090 \
  ibc.lightclients.wasm.v1.Query/Code
```

Example output:

```shell theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "code": AGFzb...AqBBE=
}
```
