Skip to content

Commit b847e09

Browse files
committed
feat: add performer apis
1 parent 903121c commit b847e09

File tree

12 files changed

+664
-18
lines changed

12 files changed

+664
-18
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ PROTO_OPTS=--proto_path=protos --go_out=paths=source_relative:protos
77

88
all: build
99

10-
deps: deps/go
10+
.PHONY: deps
11+
deps: deps/dev deps/go
1112
./scripts/installDeps.sh
13+
${GO} install github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts@latest
14+
cd protos && buf dep update
1215

1316
.PHONY: deps/dev
14-
deps/dev:
15-
${GO} get github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts
16-
cd protos && buf dep update
17+
deps/dev: pre-build
1718

18-
.PHONY: deps
19+
.PHONY: deps/go
1920
deps/go:
2021
${GO} mod tidy
2122
npm install

buf-plugin-openapi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BUILD_DIR=./bin
1010
GO_BUILD_FLAGS=-v
1111

1212
# Installation directory (this should be in your PATH)
13-
INSTALL_DIR=$(HOME)/.gvm/pkgsets/go1.23.6/global/bin
13+
INSTALL_DIR=$(GOPATH)/bin
1414

1515
# Ensure build directory exists
1616
$(BUILD_DIR):

buf.gen.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ plugins:
1919
# https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizing_openapi_output/#merging-output
2020
- plugin: grpc-gateway-ts
2121
out: gen/api-ts
22-
- name: gateway-client
23-
path: protoc-gen-grpc-gateway-client
24-
out: gen/protos
25-
opt:
26-
- paths=source_relative
22+
# - name: gateway-client
23+
# path: protoc-gen-grpc-gateway-client
24+
# out: gen/protos
25+
# opt:
26+
# - paths=source_relative
2727
- plugin: buf-plugin-openapi
2828
out: gen/openapi
2929
strategy: all
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
/*
4+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5+
*/
6+
7+
import * as fm from "../../../../fetch.pb"
8+
export type Task = {
9+
taskId?: string
10+
metadata?: Uint8Array
11+
payload?: Uint8Array
12+
}
13+
14+
export type TaskResult = {
15+
taskId?: string
16+
result?: Uint8Array
17+
}
18+
19+
export type HealthRequest = {
20+
}
21+
22+
export type HealthResponse = {
23+
status?: string
24+
}
25+
26+
export class PerformerService {
27+
static ExecuteTask(req: Task, initReq?: fm.InitReq): Promise<TaskResult> {
28+
return fm.fetchReq<Task, TaskResult>(`/eigenlayer.hourglass.v1.performer.PerformerService/ExecuteTask`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
29+
}
30+
static Health(req: HealthRequest, initReq?: fm.InitReq): Promise<HealthResponse> {
31+
return fm.fetchReq<HealthRequest, HealthResponse>(`/eigenlayer.hourglass.v1.performer.PerformerService/Health`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
32+
}
33+
}

gen/openapi/api.public.swagger.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,17 @@
18611861
}
18621862
}
18631863
},
1864+
"HealthRequest": {
1865+
"type": "object"
1866+
},
1867+
"HealthResponse": {
1868+
"type": "object",
1869+
"properties": {
1870+
"status": {
1871+
"type": "string"
1872+
}
1873+
}
1874+
},
18641875
"HistoricalReward": {
18651876
"type": "object",
18661877
"properties": {
@@ -2916,6 +2927,34 @@
29162927
}
29172928
}
29182929
},
2930+
"Task": {
2931+
"type": "object",
2932+
"properties": {
2933+
"metadata": {
2934+
"type": "string",
2935+
"format": "byte"
2936+
},
2937+
"payload": {
2938+
"type": "string",
2939+
"format": "byte"
2940+
},
2941+
"taskId": {
2942+
"type": "string"
2943+
}
2944+
}
2945+
},
2946+
"TaskResult": {
2947+
"type": "object",
2948+
"properties": {
2949+
"result": {
2950+
"type": "string",
2951+
"format": "byte"
2952+
},
2953+
"taskId": {
2954+
"type": "string"
2955+
}
2956+
}
2957+
},
29192958
"TokenLeaf": {
29202959
"type": "object",
29212960
"properties": {

gen/openapi/api.swagger.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,6 +2944,17 @@
29442944
}
29452945
}
29462946
},
2947+
"HealthRequest": {
2948+
"type": "object"
2949+
},
2950+
"HealthResponse": {
2951+
"type": "object",
2952+
"properties": {
2953+
"status": {
2954+
"type": "string"
2955+
}
2956+
}
2957+
},
29472958
"HistoricalReward": {
29482959
"type": "object",
29492960
"properties": {
@@ -3999,6 +4010,34 @@
39994010
}
40004011
}
40014012
},
4013+
"Task": {
4014+
"type": "object",
4015+
"properties": {
4016+
"metadata": {
4017+
"type": "string",
4018+
"format": "byte"
4019+
},
4020+
"payload": {
4021+
"type": "string",
4022+
"format": "byte"
4023+
},
4024+
"taskId": {
4025+
"type": "string"
4026+
}
4027+
}
4028+
},
4029+
"TaskResult": {
4030+
"type": "object",
4031+
"properties": {
4032+
"result": {
4033+
"type": "string",
4034+
"format": "byte"
4035+
},
4036+
"taskId": {
4037+
"type": "string"
4038+
}
4039+
}
4040+
},
40024041
"TokenLeaf": {
40034042
"type": "object",
40044043
"properties": {

gen/openapiv2/apidocs.swagger.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"title": "eigenlayer/pds/v1/aprs.proto",
4+
"title": "eigenlayer/hourglass/v1/performer/performer.proto",
55
"version": "version not set"
66
},
77
"tags": [
8+
{
9+
"name": "PerformerService"
10+
},
811
{
912
"name": "Aprs"
1013
},
@@ -2348,6 +2351,26 @@
23482351
}
23492352
}
23502353
},
2354+
"performerHealthResponse": {
2355+
"type": "object",
2356+
"properties": {
2357+
"status": {
2358+
"type": "string"
2359+
}
2360+
}
2361+
},
2362+
"performerTaskResult": {
2363+
"type": "object",
2364+
"properties": {
2365+
"taskId": {
2366+
"type": "string"
2367+
},
2368+
"result": {
2369+
"type": "string",
2370+
"format": "byte"
2371+
}
2372+
}
2373+
},
23512374
"protobufAny": {
23522375
"type": "object",
23532376
"properties": {

0 commit comments

Comments
 (0)