Skip to content

Commit 9958064

Browse files
authored
Merge pull request #7 from Layr-Labs/sm-pythonGen
Generate python client
2 parents 6a7bda0 + 083d9a7 commit 9958064

20 files changed

+1443
-0
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ deps/go:
2222

2323
.PHONY: proto
2424
proto:
25+
rm -rf gen/python || true
26+
rm -rf gen/pre-python || true
2527
buf generate protos
28+
./scripts/generatePipModule.sh
2629

buf.gen.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ plugins:
1515
out: gen/openapiv2
1616
- plugin: grpc-gateway-ts
1717
out: gen/api-ts
18+
- plugin: buf.build/protocolbuffers/python
19+
out: gen/pre-python
20+
- plugin: buf.build/grpc/python
21+
out: gen/pre-python

gen/python/eigenlabs-protocol-apis/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "eigenlabs-protocol-apis"
7+
version = "0.1.0"
8+
description = "Eigenlabs Protocol APIs grpc clients"
9+
requires-python = ">=3.7"
10+
dependencies = [
11+
"grpcio>=1.32.0",
12+
"protobuf>=3.15.0",
13+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from setuptools import setup, find_namespace_packages
2+
3+
setup(
4+
name="eigenlabs-protocol-apis",
5+
version="0.1.0",
6+
packages=find_namespace_packages(include=['eigenlabs.*']),
7+
package_dir={'': 'src'},
8+
install_requires=[
9+
"grpcio>=1.32.0",
10+
"protobuf>=3.15.0",
11+
],
12+
)

gen/python/eigenlabs-protocol-apis/src/__init__.py

Whitespace-only changes.

gen/python/eigenlabs-protocol-apis/src/eigenlayer/__init__.py

Whitespace-only changes.

gen/python/eigenlabs-protocol-apis/src/eigenlayer/pds/__init__.py

Whitespace-only changes.

gen/python/eigenlabs-protocol-apis/src/eigenlayer/pds/v1/__init__.py

Whitespace-only changes.

gen/python/eigenlabs-protocol-apis/src/eigenlayer/pds/v1/aprs_pb2.py

+52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2+
"""Client and server classes corresponding to protobuf-defined services."""
3+
import grpc
4+
5+
from eigenlayer.pds.v1 import aprs_pb2 as eigenlayer_dot_pds_dot_v1_dot_aprs__pb2
6+
7+
8+
class AprsStub(object):
9+
"""Missing associated documentation comment in .proto file."""
10+
11+
def __init__(self, channel):
12+
"""Constructor.
13+
14+
Args:
15+
channel: A grpc.Channel.
16+
"""
17+
self.GetDailyOperatorStrategyAprs = channel.unary_unary(
18+
'/eigenlayer.pds.aprs.v1.Aprs/GetDailyOperatorStrategyAprs',
19+
request_serializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyOperatorStrategyAprsRequest.SerializeToString,
20+
response_deserializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyOperatorStrategyAprsResponse.FromString,
21+
_registered_method=True)
22+
self.GetDailyAprForEarnerStrategy = channel.unary_unary(
23+
'/eigenlayer.pds.aprs.v1.Aprs/GetDailyAprForEarnerStrategy',
24+
request_serializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyAprForEarnerStrategyRequest.SerializeToString,
25+
response_deserializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyAprForEarnerStrategyResponse.FromString,
26+
_registered_method=True)
27+
28+
29+
class AprsServicer(object):
30+
"""Missing associated documentation comment in .proto file."""
31+
32+
def GetDailyOperatorStrategyAprs(self, request, context):
33+
"""Missing associated documentation comment in .proto file."""
34+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
35+
context.set_details('Method not implemented!')
36+
raise NotImplementedError('Method not implemented!')
37+
38+
def GetDailyAprForEarnerStrategy(self, request, context):
39+
"""Missing associated documentation comment in .proto file."""
40+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
41+
context.set_details('Method not implemented!')
42+
raise NotImplementedError('Method not implemented!')
43+
44+
45+
def add_AprsServicer_to_server(servicer, server):
46+
rpc_method_handlers = {
47+
'GetDailyOperatorStrategyAprs': grpc.unary_unary_rpc_method_handler(
48+
servicer.GetDailyOperatorStrategyAprs,
49+
request_deserializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyOperatorStrategyAprsRequest.FromString,
50+
response_serializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyOperatorStrategyAprsResponse.SerializeToString,
51+
),
52+
'GetDailyAprForEarnerStrategy': grpc.unary_unary_rpc_method_handler(
53+
servicer.GetDailyAprForEarnerStrategy,
54+
request_deserializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyAprForEarnerStrategyRequest.FromString,
55+
response_serializer=eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyAprForEarnerStrategyResponse.SerializeToString,
56+
),
57+
}
58+
generic_handler = grpc.method_handlers_generic_handler(
59+
'eigenlayer.pds.aprs.v1.Aprs', rpc_method_handlers)
60+
server.add_generic_rpc_handlers((generic_handler,))
61+
server.add_registered_method_handlers('eigenlayer.pds.aprs.v1.Aprs', rpc_method_handlers)
62+
63+
64+
# This class is part of an EXPERIMENTAL API.
65+
class Aprs(object):
66+
"""Missing associated documentation comment in .proto file."""
67+
68+
@staticmethod
69+
def GetDailyOperatorStrategyAprs(request,
70+
target,
71+
options=(),
72+
channel_credentials=None,
73+
call_credentials=None,
74+
insecure=False,
75+
compression=None,
76+
wait_for_ready=None,
77+
timeout=None,
78+
metadata=None):
79+
return grpc.experimental.unary_unary(
80+
request,
81+
target,
82+
'/eigenlayer.pds.aprs.v1.Aprs/GetDailyOperatorStrategyAprs',
83+
eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyOperatorStrategyAprsRequest.SerializeToString,
84+
eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyOperatorStrategyAprsResponse.FromString,
85+
options,
86+
channel_credentials,
87+
insecure,
88+
call_credentials,
89+
compression,
90+
wait_for_ready,
91+
timeout,
92+
metadata,
93+
_registered_method=True)
94+
95+
@staticmethod
96+
def GetDailyAprForEarnerStrategy(request,
97+
target,
98+
options=(),
99+
channel_credentials=None,
100+
call_credentials=None,
101+
insecure=False,
102+
compression=None,
103+
wait_for_ready=None,
104+
timeout=None,
105+
metadata=None):
106+
return grpc.experimental.unary_unary(
107+
request,
108+
target,
109+
'/eigenlayer.pds.aprs.v1.Aprs/GetDailyAprForEarnerStrategy',
110+
eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyAprForEarnerStrategyRequest.SerializeToString,
111+
eigenlayer_dot_pds_dot_v1_dot_aprs__pb2.GetDailyAprForEarnerStrategyResponse.FromString,
112+
options,
113+
channel_credentials,
114+
insecure,
115+
call_credentials,
116+
compression,
117+
wait_for_ready,
118+
timeout,
119+
metadata,
120+
_registered_method=True)

gen/python/eigenlabs-protocol-apis/src/eigenlayer/sidecar/__init__.py

Whitespace-only changes.

gen/python/eigenlabs-protocol-apis/src/eigenlayer/sidecar/v1/__init__.py

Whitespace-only changes.

gen/python/eigenlabs-protocol-apis/src/eigenlayer/sidecar/v1/api_pb2.py

+50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2+
"""Client and server classes corresponding to protobuf-defined services."""
3+
import grpc
4+
5+
from eigenlayer.sidecar.v1 import api_pb2 as eigenlayer_dot_sidecar_dot_v1_dot_api__pb2
6+
7+
8+
class RpcStub(object):
9+
"""Missing associated documentation comment in .proto file."""
10+
11+
def __init__(self, channel):
12+
"""Constructor.
13+
14+
Args:
15+
channel: A grpc.Channel.
16+
"""
17+
self.GetBlockHeight = channel.unary_unary(
18+
'/eigenlayer.sidecar.api.v1.Rpc/GetBlockHeight',
19+
request_serializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetBlockHeightRequest.SerializeToString,
20+
response_deserializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetBlockHeightResponse.FromString,
21+
_registered_method=True)
22+
self.GetStateRoot = channel.unary_unary(
23+
'/eigenlayer.sidecar.api.v1.Rpc/GetStateRoot',
24+
request_serializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetStateRootRequest.SerializeToString,
25+
response_deserializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetStateRootResponse.FromString,
26+
_registered_method=True)
27+
28+
29+
class RpcServicer(object):
30+
"""Missing associated documentation comment in .proto file."""
31+
32+
def GetBlockHeight(self, request, context):
33+
"""Missing associated documentation comment in .proto file."""
34+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
35+
context.set_details('Method not implemented!')
36+
raise NotImplementedError('Method not implemented!')
37+
38+
def GetStateRoot(self, request, context):
39+
"""Missing associated documentation comment in .proto file."""
40+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
41+
context.set_details('Method not implemented!')
42+
raise NotImplementedError('Method not implemented!')
43+
44+
45+
def add_RpcServicer_to_server(servicer, server):
46+
rpc_method_handlers = {
47+
'GetBlockHeight': grpc.unary_unary_rpc_method_handler(
48+
servicer.GetBlockHeight,
49+
request_deserializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetBlockHeightRequest.FromString,
50+
response_serializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetBlockHeightResponse.SerializeToString,
51+
),
52+
'GetStateRoot': grpc.unary_unary_rpc_method_handler(
53+
servicer.GetStateRoot,
54+
request_deserializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetStateRootRequest.FromString,
55+
response_serializer=eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetStateRootResponse.SerializeToString,
56+
),
57+
}
58+
generic_handler = grpc.method_handlers_generic_handler(
59+
'eigenlayer.sidecar.api.v1.Rpc', rpc_method_handlers)
60+
server.add_generic_rpc_handlers((generic_handler,))
61+
server.add_registered_method_handlers('eigenlayer.sidecar.api.v1.Rpc', rpc_method_handlers)
62+
63+
64+
# This class is part of an EXPERIMENTAL API.
65+
class Rpc(object):
66+
"""Missing associated documentation comment in .proto file."""
67+
68+
@staticmethod
69+
def GetBlockHeight(request,
70+
target,
71+
options=(),
72+
channel_credentials=None,
73+
call_credentials=None,
74+
insecure=False,
75+
compression=None,
76+
wait_for_ready=None,
77+
timeout=None,
78+
metadata=None):
79+
return grpc.experimental.unary_unary(
80+
request,
81+
target,
82+
'/eigenlayer.sidecar.api.v1.Rpc/GetBlockHeight',
83+
eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetBlockHeightRequest.SerializeToString,
84+
eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetBlockHeightResponse.FromString,
85+
options,
86+
channel_credentials,
87+
insecure,
88+
call_credentials,
89+
compression,
90+
wait_for_ready,
91+
timeout,
92+
metadata,
93+
_registered_method=True)
94+
95+
@staticmethod
96+
def GetStateRoot(request,
97+
target,
98+
options=(),
99+
channel_credentials=None,
100+
call_credentials=None,
101+
insecure=False,
102+
compression=None,
103+
wait_for_ready=None,
104+
timeout=None,
105+
metadata=None):
106+
return grpc.experimental.unary_unary(
107+
request,
108+
target,
109+
'/eigenlayer.sidecar.api.v1.Rpc/GetStateRoot',
110+
eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetStateRootRequest.SerializeToString,
111+
eigenlayer_dot_sidecar_dot_v1_dot_api__pb2.GetStateRootResponse.FromString,
112+
options,
113+
channel_credentials,
114+
insecure,
115+
call_credentials,
116+
compression,
117+
wait_for_ready,
118+
timeout,
119+
metadata,
120+
_registered_method=True)

0 commit comments

Comments
 (0)