Skip to content

Commit

Permalink
chore: added description for validator api
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Aug 13, 2024
1 parent 3e78702 commit ea024ec
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 55 deletions.
125 changes: 73 additions & 52 deletions p2p/gen/go/validatorapi/v1/validatorapi.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions p2p/gen/openapi/validatorapi/v1/validatorapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ paths:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: epoch
description: Epoch number for which to get the validators
in: query
required: false
type: string
Expand All @@ -52,11 +53,19 @@ definitions:
additionalProperties: {}
v1GetValidatorsResponse:
type: object
example:
items:
"1":
BLSKey: "0x1234567890abcdef"
isOptedIn: true
properties:
items:
type: object
additionalProperties:
$ref: '#/definitions/v1SlotInfo'
description: Map of slots numbers to validator bls key and isOptedIn boolean value
description: Response for GetValidators
title: GetValidatorsResponse
v1SlotInfo:
type: object
properties:
Expand Down
17 changes: 14 additions & 3 deletions p2p/rpc/validatorapi/v1/validatorapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ message GetValidatorsRequest {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
title: "GetValidatorsRequest";
description: "Request for GetValidators";
description: "Request for GetValidators to get info if the mev-commit validators will propose a block for a given epoch";
}
};
uint64 epoch = 1;
uint64 epoch = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "Epoch number for which to get the validators"
}];
}

message SlotInfo {
Expand All @@ -42,5 +44,14 @@ message SlotInfo {
}

message GetValidatorsResponse {
map<uint64, SlotInfo> items = 1;
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
title: "GetValidatorsResponse";
description: "Response for GetValidators";
}
example: "{\"items\": {\"1\": {\"BLSKey\": \"0x1234567890abcdef\", \"isOptedIn\": true}}}"
};
map<uint64, SlotInfo> items = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "Map of slots numbers to validator bls key and isOptedIn boolean value"
}];
}

0 comments on commit ea024ec

Please sign in to comment.