Umee
Search…
Queries
An overview of how to perform queries in Umee
There are multiple ways to perform queries within the Umee network such as using the CLI, Tendermint's RPC, and the application's gRPC and API instances. Note, this guide is not a comprehensive overview of all the possible queries and how to invoke them.

CLI

Like all Cosmos SDK based applications, operators can invoke queries against a running umeed process. By convention, queries are performed under a module sub-command.
For example, to query for the balance of an account:
1
$ umeed q bank balances umee17lu4h5nh28ctv9y6ldt0apqz7dxm8arvttx5xc
2
balances:
3
- amount: "5500000000000"
4
denom: uumee
5
pagination:
6
next_key: null
7
total: "0"
Copied!
By default, the umeed process will query against localhost. If you wish to query against an external node, you must provide the --node flag.
To avoid having to provide the same flags over and over again such as --chain-id and --node, you can populate a client.toml file with these values in the config directory. For example:
$HOME/.umee/config/client.toml
1
chain-id = "<chain-id>"
2
output = "text"
3
broadcast-mode = "sync"
Copied!
See $ umeed --help for all modules and query commands.

API and gRPC

If enabled, an umeed node can expose a gRPC and gRPC Gateway API. By default, the gRPC server runs on port 9090 and the gRPC Gateway API server runs on port 1317 -- both of these ports are configurable in app.toml.
For example, to query for the balance of an account:
1
$ curl http://localhost:1317/cosmos/bank/v1beta1/balances/umee17lu4h5nh28ctv9y6ldt0apqz7dxm8arvttx5xc
2
{
3
"balances": [
4
{
5
"denom": "uumee",
6
"amount": "5500000000000"
7
}
8
],
9
"pagination": {
10
"next_key": null,
11
"total": "1"
12
}
13
}
Copied!
We recommend using the gRPC Gateway API routes instead of the deprecated legacy routes. The deprecated legacy API routes will be removed entirely in a future Cosmos SDK release. All gRPC Gateway API routes contain the Protobuf version, e.g. v1beta1.
By default, the gRPC Gateway API queries for state against the current block height. It also supports queries at previous heights via the x-cosmos-block-height header:
1
$ curl -H "x-cosmos-block-height: 400" http://localhost:1317/cosmos/bank/v1beta1/balances/umee17lu4h5nh28ctv9y6ldt0apqz7dxm8arvttx5xc
2
{
3
"balances": [
4
{
5
"denom": "uumee",
6
"amount": "350000000011"
7
}
8
],
9
"pagination": {
10
"next_key": null,
11
"total": "1"
12
}
13
}
Copied!
You can also invoke direct gRPC queries against the gRPC server. We recommend using the grpcurl tool.
For example, to query for the balance of an account:
1
$ grpcurl -d '{"address": "umee17lu4h5nh28ctv9y6ldt0apqz7dxm8arvttx5xc"}' --plaintext 0.0.0.0:9090 cosmos.bank.v1beta1.Query/AllBalances
2
{
3
"balances": [
4
{
5
"denom": "uumee",
6
"amount": "5500000000000"
7
}
8
],
9
"pagination": {
10
"total": "1"
11
}
12
}
Copied!
Last modified 3mo ago
Copy link