Skip to main content
logo

params

The params module is responsible for providing a globally available parameter store. There are two main types, Keeper and Subspace. Subspace is an isolated namespace for a paramstore, where keys are prefixed by preconfigured spacename. Keeper has a permission to access all existing spaces.

Subspace can be used by the individual keepers, which need a private parameter store that the other keepers cannot modify. The params Keeper can be used to add a route to x/gov router in order to modify any parameter in case a proposal passes.

For more information, visit https://docs.cosmos.network/main/modules/params/

Queries

Query defines the gRPC querier service.

query.proto
Copy

_12
service Query {
_12
// Params queries a specific parameter of a module, given its subspace and
_12
// key.
_12
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
_12
option (google.api.http).get = "/cosmos/params/v1beta1/params";
_12
}
_12
_12
// Subspaces queries for all registered subspaces and all keys for a subspace.
_12
rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) {
_12
option (google.api.http).get = "/cosmos/params/v1beta1/subspaces";
_12
}
_12
}

QueryParamsRequest

QueryParamsRequest is request type for the Query/Params RPC method.

query.proto
Copy

_7
message QueryParamsRequest {
_7
// subspace defines the module to query the parameter for.
_7
string subspace = 1;
_7
_7
// key defines the key of the parameter in the subspace.
_7
string key = 2;
_7
}

QueryParamsResponse

QueryParamsResponse is response type for the Query/Params RPC method.

query.proto
Copy

_4
message QueryParamsResponse {
_4
// param defines the queried parameter.
_4
ParamChange param = 1 [(gogoproto.nullable) = false];
_4
}

QuerySubspacesRequest

QuerySubspacesRequest defines a request type for querying for all registered subspaces and all keys for a subspace.

query.proto
Copy

_1
message QuerySubspacesRequest {}

QuerySubspacesResponse

QuerySubspacesResponse defines the response types for querying for all registered subspaces and all keys for a subspace.

query.proto
Copy

_3
message QuerySubspacesResponse {
_3
repeated Subspace subspaces = 1;
_3
}