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
service Query {
  // Params queries a specific parameter of a module, given its subspace and
  // key.
  rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
    option (google.api.http).get = "/cosmos/params/v1beta1/params";
  }

  // Subspaces queries for all registered subspaces and all keys for a subspace.
  rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) {
    option (google.api.http).get = "/cosmos/params/v1beta1/subspaces";
  }
}

QueryParamsRequest

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

query.proto
message QueryParamsRequest {
  // subspace defines the module to query the parameter for.
  string subspace = 1;

  // key defines the key of the parameter in the subspace.
  string key = 2;
}

QueryParamsResponse

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

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

QuerySubspacesRequest

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

query.proto
message QuerySubspacesRequest {}

QuerySubspacesResponse

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

query.proto
message QuerySubspacesResponse {
  repeated Subspace subspaces = 1;
}