Skip to content

Commit

Permalink
Validator Vesting gRPC Endpoints (#1832)
Browse files Browse the repository at this point in the history
* Add validator-vesting grpc

* Update validator REST API endpoints to use grpc

* Update validator-vesting cli to use grpc

* Update changelog for added grpc changes

* Add grpc query tests
  • Loading branch information
DracoLi authored Feb 27, 2024
1 parent 11d3ba3 commit 1d944d5
Show file tree
Hide file tree
Showing 11 changed files with 3,932 additions and 258 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (cdp) [#1818] Add module param and logic for running x/cdp begin blocker every `n` blocks
- (cli) [#1804] Add `rocksdb compact` command for manual DB compaction of state or blockstore.
- (cosmos-sdk) [#1811] Upgrades app to cosmos-sdk v0.47.7
- (validator-vesting) [#1832] Add grpc query service to replace removed legacy querier.

## [v0.25.0]

Expand Down Expand Up @@ -324,6 +325,7 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md).
- [#257](https://github.com/Kava-Labs/kava/pulls/257) Include scripts to run
large-scale simulations remotely using aws-batch

[#1832]: https://github.com/Kava-Labs/kava/pull/1832
[#1811]: https://github.com/Kava-Labs/kava/pull/1811
[#1804]: https://github.com/Kava-Labs/kava/pull/1804
[#1785]: https://github.com/Kava-Labs/kava/pull/1785
Expand Down
225 changes: 225 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,24 @@

- [Msg](#kava.swap.v1beta1.Msg)

- [kava/validatorvesting/v1beta1/query.proto](#kava/validatorvesting/v1beta1/query.proto)
- [QueryCirculatingSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDRequest)
- [QueryCirculatingSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDResponse)
- [QueryCirculatingSupplyRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyRequest)
- [QueryCirculatingSupplyResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyResponse)
- [QueryCirculatingSupplySWPRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPRequest)
- [QueryCirculatingSupplySWPResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPResponse)
- [QueryCirculatingSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXRequest)
- [QueryCirculatingSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXResponse)
- [QueryTotalSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDRequest)
- [QueryTotalSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDResponse)
- [QueryTotalSupplyRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyRequest)
- [QueryTotalSupplyResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyResponse)
- [QueryTotalSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXRequest)
- [QueryTotalSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXResponse)

- [Query](#kava.validatorvesting.v1beta1.Query)

- [Scalar Value Types](#scalar-value-types)


Expand Down Expand Up @@ -7861,6 +7879,213 @@ Msg defines the swap Msg service.



<a name="kava/validatorvesting/v1beta1/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## kava/validatorvesting/v1beta1/query.proto



<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDRequest"></a>

### QueryCirculatingSupplyHARDRequest
QueryCirculatingSupplyHARDRequest is the request type for the Query/CirculatingSupplyHARD RPC method






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDResponse"></a>

### QueryCirculatingSupplyHARDResponse
QueryCirculatingSupplyHARDResponse is the response type for the Query/CirculatingSupplyHARD RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplyRequest"></a>

### QueryCirculatingSupplyRequest
QueryCirculatingSupplyRequest is the request type for the Query/CirculatingSupply RPC method






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplyResponse"></a>

### QueryCirculatingSupplyResponse
QueryCirculatingSupplyResponse is the response type for the Query/CirculatingSupply RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPRequest"></a>

### QueryCirculatingSupplySWPRequest
QueryCirculatingSupplySWPRequest is the request type for the Query/CirculatingSupplySWP RPC method






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPResponse"></a>

### QueryCirculatingSupplySWPResponse
QueryCirculatingSupplySWPResponse is the response type for the Query/CirculatingSupplySWP RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXRequest"></a>

### QueryCirculatingSupplyUSDXRequest
QueryCirculatingSupplyUSDXRequest is the request type for the Query/CirculatingSupplyUSDX RPC method






<a name="kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXResponse"></a>

### QueryCirculatingSupplyUSDXResponse
QueryCirculatingSupplyUSDXResponse is the response type for the Query/CirculatingSupplyUSDX RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |






<a name="kava.validatorvesting.v1beta1.QueryTotalSupplyHARDRequest"></a>

### QueryTotalSupplyHARDRequest
QueryTotalSupplyHARDRequest is the request type for the Query/TotalSupplyHARD RPC method






<a name="kava.validatorvesting.v1beta1.QueryTotalSupplyHARDResponse"></a>

### QueryTotalSupplyHARDResponse
QueryTotalSupplyHARDResponse is the response type for the Query/TotalSupplyHARD RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |






<a name="kava.validatorvesting.v1beta1.QueryTotalSupplyRequest"></a>

### QueryTotalSupplyRequest
QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method






<a name="kava.validatorvesting.v1beta1.QueryTotalSupplyResponse"></a>

### QueryTotalSupplyResponse
QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |






<a name="kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXRequest"></a>

### QueryTotalSupplyUSDXRequest
QueryTotalSupplyUSDXRequest is the request type for the Query/TotalSupplyUSDX RPC method






<a name="kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXResponse"></a>

### QueryTotalSupplyUSDXResponse
QueryTotalSupplyUSDXResponse is the response type for the Query/TotalSupplyUSDX RPC method


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [string](#string) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->


<a name="kava.validatorvesting.v1beta1.Query"></a>

### Query
Query defines the gRPC querier service for validator-vesting module

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `CirculatingSupply` | [QueryCirculatingSupplyRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyRequest) | [QueryCirculatingSupplyResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyResponse) | CirculatingSupply returns the total amount of kava tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply|
| `TotalSupply` | [QueryTotalSupplyRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyRequest) | [QueryTotalSupplyResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyResponse) | TotalSupply returns the total amount of kava tokens | GET|/kava/validator-vesting/v1beta1/total_supply|
| `CirculatingSupplyHARD` | [QueryCirculatingSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDRequest) | [QueryCirculatingSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDResponse) | CirculatingSupplyHARD returns the total amount of hard tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply_hard|
| `CirculatingSupplyUSDX` | [QueryCirculatingSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXRequest) | [QueryCirculatingSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXResponse) | CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply_usdx|
| `CirculatingSupplySWP` | [QueryCirculatingSupplySWPRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPRequest) | [QueryCirculatingSupplySWPResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPResponse) | CirculatingSupplySWP returns the total amount of swp tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply_swp|
| `TotalSupplyHARD` | [QueryTotalSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDRequest) | [QueryTotalSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDResponse) | TotalSupplyHARD returns the total amount of hard tokens | GET|/kava/validator-vesting/v1beta1/total_supply_hard|
| `TotalSupplyUSDX` | [QueryTotalSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXRequest) | [QueryTotalSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXResponse) | TotalSupplyUSDX returns the total amount of usdx tokens | GET|/kava/validator-vesting/v1beta1/total_supply_usdx|

<!-- end services -->



## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
Expand Down
131 changes: 131 additions & 0 deletions proto/kava/validatorvesting/v1beta1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
syntax = "proto3";
package kava.validatorvesting.v1beta1;

import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/kava-labs/kava/x/validator-vesting/types";
option (gogoproto.goproto_getters_all) = false;

// Query defines the gRPC querier service for validator-vesting module
service Query {
// CirculatingSupply returns the total amount of kava tokens in circulation
rpc CirculatingSupply(QueryCirculatingSupplyRequest) returns (QueryCirculatingSupplyResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply";
}

// TotalSupply returns the total amount of kava tokens
rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/total_supply";
}

// CirculatingSupplyHARD returns the total amount of hard tokens in circulation
rpc CirculatingSupplyHARD(QueryCirculatingSupplyHARDRequest) returns (QueryCirculatingSupplyHARDResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply_hard";
}

// CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation
rpc CirculatingSupplyUSDX(QueryCirculatingSupplyUSDXRequest) returns (QueryCirculatingSupplyUSDXResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply_usdx";
}

// CirculatingSupplySWP returns the total amount of swp tokens in circulation
rpc CirculatingSupplySWP(QueryCirculatingSupplySWPRequest) returns (QueryCirculatingSupplySWPResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply_swp";
}

// TotalSupplyHARD returns the total amount of hard tokens
rpc TotalSupplyHARD(QueryTotalSupplyHARDRequest) returns (QueryTotalSupplyHARDResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/total_supply_hard";
}

// TotalSupplyUSDX returns the total amount of usdx tokens
rpc TotalSupplyUSDX(QueryTotalSupplyUSDXRequest) returns (QueryTotalSupplyUSDXResponse) {
option (google.api.http).get = "/kava/validator-vesting/v1beta1/total_supply_usdx";
}
}

// QueryCirculatingSupplyRequest is the request type for the Query/CirculatingSupply RPC method
message QueryCirculatingSupplyRequest {}

// QueryCirculatingSupplyResponse is the response type for the Query/CirculatingSupply RPC method
message QueryCirculatingSupplyResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method
message QueryTotalSupplyRequest {}

// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method
message QueryTotalSupplyResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryCirculatingSupplyHARDRequest is the request type for the Query/CirculatingSupplyHARD RPC method
message QueryCirculatingSupplyHARDRequest {}

// QueryCirculatingSupplyHARDResponse is the response type for the Query/CirculatingSupplyHARD RPC method
message QueryCirculatingSupplyHARDResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryCirculatingSupplyUSDXRequest is the request type for the Query/CirculatingSupplyUSDX RPC method
message QueryCirculatingSupplyUSDXRequest {}

// QueryCirculatingSupplyUSDXResponse is the response type for the Query/CirculatingSupplyUSDX RPC method
message QueryCirculatingSupplyUSDXResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryCirculatingSupplySWPRequest is the request type for the Query/CirculatingSupplySWP RPC method
message QueryCirculatingSupplySWPRequest {}

// QueryCirculatingSupplySWPResponse is the response type for the Query/CirculatingSupplySWP RPC method
message QueryCirculatingSupplySWPResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryTotalSupplyHARDRequest is the request type for the Query/TotalSupplyHARD RPC method
message QueryTotalSupplyHARDRequest {}

// QueryTotalSupplyHARDResponse is the response type for the Query/TotalSupplyHARD RPC method
message QueryTotalSupplyHARDResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryTotalSupplyUSDXRequest is the request type for the Query/TotalSupplyUSDX RPC method
message QueryTotalSupplyUSDXRequest {}

// QueryTotalSupplyUSDXResponse is the response type for the Query/TotalSupplyUSDX RPC method
message QueryTotalSupplyUSDXResponse {
string amount = 1 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}
Loading

0 comments on commit 1d944d5

Please sign in to comment.