-
Notifications
You must be signed in to change notification settings - Fork 6
/
beacon_chain_pb2_grpc.py
896 lines (824 loc) · 42.4 KB
/
beacon_chain_pb2_grpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import attestation_pb2 as attestation__pb2
import beacon_block_pb2 as beacon__block__pb2
import beacon_chain_pb2 as beacon__chain__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
import validator_pb2 as validator__pb2
class BeaconChainStub(object):
"""Beacon chain API
The beacon chain API can be used to access data relevant to the Ethereum 2.0
phase 0 beacon chain.
TODO(preston): Batch requests?
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ListAttestations = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListAttestations',
request_serializer=beacon__chain__pb2.ListAttestationsRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ListAttestationsResponse.FromString,
)
self.ListIndexedAttestations = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations',
request_serializer=beacon__chain__pb2.ListIndexedAttestationsRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ListIndexedAttestationsResponse.FromString,
)
self.StreamAttestations = channel.unary_stream(
'/ethereum.eth.v1alpha1.BeaconChain/StreamAttestations',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=attestation__pb2.Attestation.FromString,
)
self.StreamIndexedAttestations = channel.unary_stream(
'/ethereum.eth.v1alpha1.BeaconChain/StreamIndexedAttestations',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=beacon__block__pb2.IndexedAttestation.FromString,
)
self.AttestationPool = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/AttestationPool',
request_serializer=beacon__chain__pb2.AttestationPoolRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.AttestationPoolResponse.FromString,
)
self.ListBlocks = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListBlocks',
request_serializer=beacon__chain__pb2.ListBlocksRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ListBlocksResponse.FromString,
)
self.StreamBlocks = channel.unary_stream(
'/ethereum.eth.v1alpha1.BeaconChain/StreamBlocks',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=beacon__block__pb2.SignedBeaconBlock.FromString,
)
self.StreamChainHead = channel.unary_stream(
'/ethereum.eth.v1alpha1.BeaconChain/StreamChainHead',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=beacon__chain__pb2.ChainHead.FromString,
)
self.GetChainHead = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetChainHead',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=beacon__chain__pb2.ChainHead.FromString,
)
self.ListBeaconCommittees = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees',
request_serializer=beacon__chain__pb2.ListCommitteesRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.BeaconCommittees.FromString,
)
self.ListValidatorBalances = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances',
request_serializer=beacon__chain__pb2.ListValidatorBalancesRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ValidatorBalances.FromString,
)
self.ListValidators = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListValidators',
request_serializer=beacon__chain__pb2.ListValidatorsRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.Validators.FromString,
)
self.GetValidator = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetValidator',
request_serializer=beacon__chain__pb2.GetValidatorRequest.SerializeToString,
response_deserializer=validator__pb2.Validator.FromString,
)
self.GetValidatorActiveSetChanges = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges',
request_serializer=beacon__chain__pb2.GetValidatorActiveSetChangesRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ActiveSetChanges.FromString,
)
self.GetValidatorQueue = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=beacon__chain__pb2.ValidatorQueue.FromString,
)
self.GetValidatorPerformance = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance',
request_serializer=beacon__chain__pb2.ValidatorPerformanceRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ValidatorPerformanceResponse.FromString,
)
self.ListValidatorAssignments = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments',
request_serializer=beacon__chain__pb2.ListValidatorAssignmentsRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ValidatorAssignments.FromString,
)
self.GetValidatorParticipation = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation',
request_serializer=beacon__chain__pb2.GetValidatorParticipationRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.ValidatorParticipationResponse.FromString,
)
self.GetBeaconConfig = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=beacon__chain__pb2.BeaconConfig.FromString,
)
self.StreamValidatorsInfo = channel.stream_stream(
'/ethereum.eth.v1alpha1.BeaconChain/StreamValidatorsInfo',
request_serializer=beacon__chain__pb2.ValidatorChangeSet.SerializeToString,
response_deserializer=validator__pb2.ValidatorInfo.FromString,
)
self.SubmitAttesterSlashing = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing',
request_serializer=beacon__block__pb2.AttesterSlashing.SerializeToString,
response_deserializer=beacon__chain__pb2.SubmitSlashingResponse.FromString,
)
self.SubmitProposerSlashing = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing',
request_serializer=beacon__block__pb2.ProposerSlashing.SerializeToString,
response_deserializer=beacon__chain__pb2.SubmitSlashingResponse.FromString,
)
self.GetIndividualVotes = channel.unary_unary(
'/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes',
request_serializer=beacon__chain__pb2.IndividualVotesRequest.SerializeToString,
response_deserializer=beacon__chain__pb2.IndividualVotesRespond.FromString,
)
class BeaconChainServicer(object):
"""Beacon chain API
The beacon chain API can be used to access data relevant to the Ethereum 2.0
phase 0 beacon chain.
TODO(preston): Batch requests?
"""
def ListAttestations(self, request, context):
"""Retrieve attestations by block root, slot, or epoch.
The server may return an empty list when no attestations match the given
filter criteria. This RPC should not return NOT_FOUND. Only one filter
criteria should be used. This endpoint allows for retrieval of genesis
information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListIndexedAttestations(self, request, context):
"""Retrieve indexed attestations by block root, slot, or epoch.
The server may return an empty list when no indexed attestations match the given
filter criteria. This RPC should not return NOT_FOUND. Only one filter
criteria should be used. This endpoint allows for retrieval of genesis
information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def StreamAttestations(self, request, context):
"""Server-side stream of attestations as they are received by
the beacon chain node.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def StreamIndexedAttestations(self, request, context):
"""Server-side stream of indexed attestations as they are received by
the beacon chain node.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def AttestationPool(self, request, context):
"""Retrieve attestations from pool.
The server returns a list of attestations that have been seen but not
yet processed. Pool attestations eventually expire as the slot
advances, so an attestation missing from this request does not imply
that it was included in a block. The attestation may have expired.
Refer to the ethereum 2.0 specification for more details on how
attestations are processed and when they are no longer valid.
https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListBlocks(self, request, context):
"""Retrieve blocks by root, slot, or epoch.
The server may return multiple blocks in the case that a slot or epoch is
provided as the filter criteria. The server may return an empty list when
no blocks in their database match the filter criteria. This RPC should
not return NOT_FOUND. Only one filter criteria should be used. This endpoint
allows for retrieval of genesis information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def StreamBlocks(self, request, context):
"""Server-side stream of all signed blocks as they are received by
the beacon chain node.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def StreamChainHead(self, request, context):
"""Server-side stream of information about the head of the beacon chain
from the view of the beacon chain node.
This includes the head block slot and root as well as information about
the most recent finalized and justified slots.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetChainHead(self, request, context):
"""Retrieve information about the head of the beacon chain from the view of
the beacon chain node.
This includes the head block slot and root as well as information about
the most recent finalized and justified slots.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListBeaconCommittees(self, request, context):
"""Retrieve the beacon chain committees for a given epoch.
If no filter criteria is specified, the response returns
all beacon committees for the current epoch. The results are paginated by default.
This endpoint allows for retrieval of genesis information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListValidatorBalances(self, request, context):
"""Retrieve validator balances for a given set of public keys at a specific
epoch in time. This endpoint allows for retrieval of genesis information
via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListValidators(self, request, context):
"""Retrieve the current validator registry.
The request may include an optional historical epoch to retrieve a
specific validator set in time. This endpoint allows for retrieval of genesis
information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValidator(self, request, context):
"""Retrieve information about a specific validator in the registry.
This request may query by validator index or public key.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValidatorActiveSetChanges(self, request, context):
"""Retrieve the active set changes for a given epoch.
This data includes any activations, voluntary exits, and involuntary
ejections. This endpoint allows for retrieval of genesis
information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValidatorQueue(self, request, context):
"""Retrieve the current validator queue information.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValidatorPerformance(self, request, context):
"""GetValidatorPerformance reports a validator's latest balance along with other important
metrics on rewards and penalties throughout its lifecycle in the beacon chain.
The request takes in a list of validator public keys and returns a performance report
for all of them respectively.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListValidatorAssignments(self, request, context):
"""Retrieve the validator assignments for a given epoch.
This request may specify optional validator indices or public keys to
filter validator assignments. This endpoint allows for retrieval of genesis
information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetValidatorParticipation(self, request, context):
"""Retrieve the validator participation information for a given epoch.
This method returns information about the global participation of
validator attestations. This endpoint allows for retrieval of genesis
information via a boolean query filter.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetBeaconConfig(self, request, context):
"""Retrieve the current configuration parameters of the beacon chain.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def StreamValidatorsInfo(self, request_iterator, context):
"""Server-side stream of validator information at each epoch.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SubmitAttesterSlashing(self, request, context):
"""Submit an attester slashing object to the beacon node.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SubmitProposerSlashing(self, request, context):
"""Submit a proposer slashing object to the beacon node.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetIndividualVotes(self, request, context):
"""Returns a list of validators individual vote status of a given epoch.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_BeaconChainServicer_to_server(servicer, server):
rpc_method_handlers = {
'ListAttestations': grpc.unary_unary_rpc_method_handler(
servicer.ListAttestations,
request_deserializer=beacon__chain__pb2.ListAttestationsRequest.FromString,
response_serializer=beacon__chain__pb2.ListAttestationsResponse.SerializeToString,
),
'ListIndexedAttestations': grpc.unary_unary_rpc_method_handler(
servicer.ListIndexedAttestations,
request_deserializer=beacon__chain__pb2.ListIndexedAttestationsRequest.FromString,
response_serializer=beacon__chain__pb2.ListIndexedAttestationsResponse.SerializeToString,
),
'StreamAttestations': grpc.unary_stream_rpc_method_handler(
servicer.StreamAttestations,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=attestation__pb2.Attestation.SerializeToString,
),
'StreamIndexedAttestations': grpc.unary_stream_rpc_method_handler(
servicer.StreamIndexedAttestations,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=beacon__block__pb2.IndexedAttestation.SerializeToString,
),
'AttestationPool': grpc.unary_unary_rpc_method_handler(
servicer.AttestationPool,
request_deserializer=beacon__chain__pb2.AttestationPoolRequest.FromString,
response_serializer=beacon__chain__pb2.AttestationPoolResponse.SerializeToString,
),
'ListBlocks': grpc.unary_unary_rpc_method_handler(
servicer.ListBlocks,
request_deserializer=beacon__chain__pb2.ListBlocksRequest.FromString,
response_serializer=beacon__chain__pb2.ListBlocksResponse.SerializeToString,
),
'StreamBlocks': grpc.unary_stream_rpc_method_handler(
servicer.StreamBlocks,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=beacon__block__pb2.SignedBeaconBlock.SerializeToString,
),
'StreamChainHead': grpc.unary_stream_rpc_method_handler(
servicer.StreamChainHead,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=beacon__chain__pb2.ChainHead.SerializeToString,
),
'GetChainHead': grpc.unary_unary_rpc_method_handler(
servicer.GetChainHead,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=beacon__chain__pb2.ChainHead.SerializeToString,
),
'ListBeaconCommittees': grpc.unary_unary_rpc_method_handler(
servicer.ListBeaconCommittees,
request_deserializer=beacon__chain__pb2.ListCommitteesRequest.FromString,
response_serializer=beacon__chain__pb2.BeaconCommittees.SerializeToString,
),
'ListValidatorBalances': grpc.unary_unary_rpc_method_handler(
servicer.ListValidatorBalances,
request_deserializer=beacon__chain__pb2.ListValidatorBalancesRequest.FromString,
response_serializer=beacon__chain__pb2.ValidatorBalances.SerializeToString,
),
'ListValidators': grpc.unary_unary_rpc_method_handler(
servicer.ListValidators,
request_deserializer=beacon__chain__pb2.ListValidatorsRequest.FromString,
response_serializer=beacon__chain__pb2.Validators.SerializeToString,
),
'GetValidator': grpc.unary_unary_rpc_method_handler(
servicer.GetValidator,
request_deserializer=beacon__chain__pb2.GetValidatorRequest.FromString,
response_serializer=validator__pb2.Validator.SerializeToString,
),
'GetValidatorActiveSetChanges': grpc.unary_unary_rpc_method_handler(
servicer.GetValidatorActiveSetChanges,
request_deserializer=beacon__chain__pb2.GetValidatorActiveSetChangesRequest.FromString,
response_serializer=beacon__chain__pb2.ActiveSetChanges.SerializeToString,
),
'GetValidatorQueue': grpc.unary_unary_rpc_method_handler(
servicer.GetValidatorQueue,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=beacon__chain__pb2.ValidatorQueue.SerializeToString,
),
'GetValidatorPerformance': grpc.unary_unary_rpc_method_handler(
servicer.GetValidatorPerformance,
request_deserializer=beacon__chain__pb2.ValidatorPerformanceRequest.FromString,
response_serializer=beacon__chain__pb2.ValidatorPerformanceResponse.SerializeToString,
),
'ListValidatorAssignments': grpc.unary_unary_rpc_method_handler(
servicer.ListValidatorAssignments,
request_deserializer=beacon__chain__pb2.ListValidatorAssignmentsRequest.FromString,
response_serializer=beacon__chain__pb2.ValidatorAssignments.SerializeToString,
),
'GetValidatorParticipation': grpc.unary_unary_rpc_method_handler(
servicer.GetValidatorParticipation,
request_deserializer=beacon__chain__pb2.GetValidatorParticipationRequest.FromString,
response_serializer=beacon__chain__pb2.ValidatorParticipationResponse.SerializeToString,
),
'GetBeaconConfig': grpc.unary_unary_rpc_method_handler(
servicer.GetBeaconConfig,
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
response_serializer=beacon__chain__pb2.BeaconConfig.SerializeToString,
),
'StreamValidatorsInfo': grpc.stream_stream_rpc_method_handler(
servicer.StreamValidatorsInfo,
request_deserializer=beacon__chain__pb2.ValidatorChangeSet.FromString,
response_serializer=validator__pb2.ValidatorInfo.SerializeToString,
),
'SubmitAttesterSlashing': grpc.unary_unary_rpc_method_handler(
servicer.SubmitAttesterSlashing,
request_deserializer=beacon__block__pb2.AttesterSlashing.FromString,
response_serializer=beacon__chain__pb2.SubmitSlashingResponse.SerializeToString,
),
'SubmitProposerSlashing': grpc.unary_unary_rpc_method_handler(
servicer.SubmitProposerSlashing,
request_deserializer=beacon__block__pb2.ProposerSlashing.FromString,
response_serializer=beacon__chain__pb2.SubmitSlashingResponse.SerializeToString,
),
'GetIndividualVotes': grpc.unary_unary_rpc_method_handler(
servicer.GetIndividualVotes,
request_deserializer=beacon__chain__pb2.IndividualVotesRequest.FromString,
response_serializer=beacon__chain__pb2.IndividualVotesRespond.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'ethereum.eth.v1alpha1.BeaconChain', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class BeaconChain(object):
"""Beacon chain API
The beacon chain API can be used to access data relevant to the Ethereum 2.0
phase 0 beacon chain.
TODO(preston): Batch requests?
"""
@staticmethod
def ListAttestations(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListAttestations',
beacon__chain__pb2.ListAttestationsRequest.SerializeToString,
beacon__chain__pb2.ListAttestationsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListIndexedAttestations(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations',
beacon__chain__pb2.ListIndexedAttestationsRequest.SerializeToString,
beacon__chain__pb2.ListIndexedAttestationsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StreamAttestations(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamAttestations',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
attestation__pb2.Attestation.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StreamIndexedAttestations(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamIndexedAttestations',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
beacon__block__pb2.IndexedAttestation.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def AttestationPool(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/AttestationPool',
beacon__chain__pb2.AttestationPoolRequest.SerializeToString,
beacon__chain__pb2.AttestationPoolResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListBlocks(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListBlocks',
beacon__chain__pb2.ListBlocksRequest.SerializeToString,
beacon__chain__pb2.ListBlocksResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StreamBlocks(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamBlocks',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
beacon__block__pb2.SignedBeaconBlock.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StreamChainHead(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamChainHead',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
beacon__chain__pb2.ChainHead.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetChainHead(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetChainHead',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
beacon__chain__pb2.ChainHead.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListBeaconCommittees(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees',
beacon__chain__pb2.ListCommitteesRequest.SerializeToString,
beacon__chain__pb2.BeaconCommittees.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListValidatorBalances(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances',
beacon__chain__pb2.ListValidatorBalancesRequest.SerializeToString,
beacon__chain__pb2.ValidatorBalances.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListValidators(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListValidators',
beacon__chain__pb2.ListValidatorsRequest.SerializeToString,
beacon__chain__pb2.Validators.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValidator(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidator',
beacon__chain__pb2.GetValidatorRequest.SerializeToString,
validator__pb2.Validator.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValidatorActiveSetChanges(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges',
beacon__chain__pb2.GetValidatorActiveSetChangesRequest.SerializeToString,
beacon__chain__pb2.ActiveSetChanges.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValidatorQueue(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
beacon__chain__pb2.ValidatorQueue.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValidatorPerformance(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance',
beacon__chain__pb2.ValidatorPerformanceRequest.SerializeToString,
beacon__chain__pb2.ValidatorPerformanceResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListValidatorAssignments(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments',
beacon__chain__pb2.ListValidatorAssignmentsRequest.SerializeToString,
beacon__chain__pb2.ValidatorAssignments.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetValidatorParticipation(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation',
beacon__chain__pb2.GetValidatorParticipationRequest.SerializeToString,
beacon__chain__pb2.ValidatorParticipationResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetBeaconConfig(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig',
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
beacon__chain__pb2.BeaconConfig.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def StreamValidatorsInfo(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(request_iterator, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamValidatorsInfo',
beacon__chain__pb2.ValidatorChangeSet.SerializeToString,
validator__pb2.ValidatorInfo.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SubmitAttesterSlashing(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing',
beacon__block__pb2.AttesterSlashing.SerializeToString,
beacon__chain__pb2.SubmitSlashingResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SubmitProposerSlashing(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing',
beacon__block__pb2.ProposerSlashing.SerializeToString,
beacon__chain__pb2.SubmitSlashingResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetIndividualVotes(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes',
beacon__chain__pb2.IndividualVotesRequest.SerializeToString,
beacon__chain__pb2.IndividualVotesRespond.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)