├── .gitignore ├── .gitmodules ├── README.md ├── attestation_pb2.py ├── attestation_pb2_grpc.py ├── beacon_block_pb2.py ├── beacon_block_pb2_grpc.py ├── beacon_chain_pb2.py ├── beacon_chain_pb2_grpc.py ├── node_pb2.py ├── node_pb2_grpc.py ├── privkey_to_threshold.py ├── requirements.txt ├── run.sh ├── run_validator_clients.sh ├── ssv_node.py ├── ssv_pb2.py ├── ssv_pb2_grpc.py ├── validator_pb2.py ├── validator_pb2_grpc.py ├── venv.sh └── wait.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | # Directory for validator nodes 132 | validator/ 133 | 134 | # Protobuf files 135 | *.proto -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "python_ibft"] 2 | path = python_ibft 3 | url = https://github.com/dankrad/python-ibft 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-ssv 2 | Proof of concept of an Eth2 secret shared validator node 3 | 4 | # Requirements 5 | 6 | * Python 3.8. Use `venv.sh` to create a virtualenv with the required packages. 7 | * `python-ibft`: https://github.com/dankrad/python-ibft 8 | * Prysm beacon node and validator client, adapted for SSV node: `https://github.com/alonmuroch/ethereumapis/tree/feature/ssv` 9 | * `tmux` for demo scripts 10 | 11 | # Usage 12 | 13 | * You can split a validator private key into the threshold keys using `privkey_to_threshold.py`. 14 | * Then use `run.sh` to run all the SSV nodes in one tmux window 15 | * `run_validators.sh` needs to be copied into the `validator` directory of the prysm SSV node. Running it will launch the 4 VCs to connect to the SSV nodes in a tmux window -------------------------------------------------------------------------------- /attestation_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: attestation.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | 15 | 16 | DESCRIPTOR = _descriptor.FileDescriptor( 17 | name='attestation.proto', 18 | package='ethereum.eth.v1alpha1', 19 | syntax='proto3', 20 | serialized_options=b'\n\031org.ethereum.eth.v1alpha1B\020AttestationProtoP\001Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\252\002\025Ethereum.Eth.v1alpha1\312\002\025Ethereum\\Eth\\v1alpha1', 21 | create_key=_descriptor._internal_create_key, 22 | serialized_pb=b'\n\x11\x61ttestation.proto\x12\x15\x65thereum.eth.v1alpha1\"p\n\x0b\x41ttestation\x12\x18\n\x10\x61ggregation_bits\x18\x01 \x01(\x0c\x12\x34\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32&.ethereum.eth.v1alpha1.AttestationData\x12\x11\n\tsignature\x18\x03 \x01(\x0c\"\x88\x01\n\x1c\x41ggregateAttestationAndProof\x12\x18\n\x10\x61ggregator_index\x18\x01 \x01(\x04\x12\x35\n\taggregate\x18\x03 \x01(\x0b\x32\".ethereum.eth.v1alpha1.Attestation\x12\x17\n\x0fselection_proof\x18\x02 \x01(\x0c\"}\n\"SignedAggregateAttestationAndProof\x12\x44\n\x07message\x18\x01 \x01(\x0b\x32\x33.ethereum.eth.v1alpha1.AggregateAttestationAndProof\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xb9\x01\n\x0f\x41ttestationData\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x17\n\x0f\x63ommittee_index\x18\x02 \x01(\x04\x12\x19\n\x11\x62\x65\x61\x63on_block_root\x18\x03 \x01(\x0c\x12\x31\n\x06source\x18\x04 \x01(\x0b\x32!.ethereum.eth.v1alpha1.Checkpoint\x12\x31\n\x06target\x18\x05 \x01(\x0b\x32!.ethereum.eth.v1alpha1.Checkpoint\")\n\nCheckpoint\x12\r\n\x05\x65poch\x18\x01 \x01(\x04\x12\x0c\n\x04root\x18\x02 \x01(\x0c\x42\x97\x01\n\x19org.ethereum.eth.v1alpha1B\x10\x41ttestationProtoP\x01Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\xaa\x02\x15\x45thereum.Eth.v1alpha1\xca\x02\x15\x45thereum\\Eth\\v1alpha1b\x06proto3' 23 | ) 24 | 25 | 26 | 27 | 28 | _ATTESTATION = _descriptor.Descriptor( 29 | name='Attestation', 30 | full_name='ethereum.eth.v1alpha1.Attestation', 31 | filename=None, 32 | file=DESCRIPTOR, 33 | containing_type=None, 34 | create_key=_descriptor._internal_create_key, 35 | fields=[ 36 | _descriptor.FieldDescriptor( 37 | name='aggregation_bits', full_name='ethereum.eth.v1alpha1.Attestation.aggregation_bits', index=0, 38 | number=1, type=12, cpp_type=9, label=1, 39 | has_default_value=False, default_value=b"", 40 | message_type=None, enum_type=None, containing_type=None, 41 | is_extension=False, extension_scope=None, 42 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 43 | _descriptor.FieldDescriptor( 44 | name='data', full_name='ethereum.eth.v1alpha1.Attestation.data', index=1, 45 | number=2, type=11, cpp_type=10, label=1, 46 | has_default_value=False, default_value=None, 47 | message_type=None, enum_type=None, containing_type=None, 48 | is_extension=False, extension_scope=None, 49 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 50 | _descriptor.FieldDescriptor( 51 | name='signature', full_name='ethereum.eth.v1alpha1.Attestation.signature', index=2, 52 | number=3, type=12, cpp_type=9, label=1, 53 | has_default_value=False, default_value=b"", 54 | message_type=None, enum_type=None, containing_type=None, 55 | is_extension=False, extension_scope=None, 56 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 57 | ], 58 | extensions=[ 59 | ], 60 | nested_types=[], 61 | enum_types=[ 62 | ], 63 | serialized_options=None, 64 | is_extendable=False, 65 | syntax='proto3', 66 | extension_ranges=[], 67 | oneofs=[ 68 | ], 69 | serialized_start=44, 70 | serialized_end=156, 71 | ) 72 | 73 | 74 | _AGGREGATEATTESTATIONANDPROOF = _descriptor.Descriptor( 75 | name='AggregateAttestationAndProof', 76 | full_name='ethereum.eth.v1alpha1.AggregateAttestationAndProof', 77 | filename=None, 78 | file=DESCRIPTOR, 79 | containing_type=None, 80 | create_key=_descriptor._internal_create_key, 81 | fields=[ 82 | _descriptor.FieldDescriptor( 83 | name='aggregator_index', full_name='ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregator_index', index=0, 84 | number=1, type=4, cpp_type=4, label=1, 85 | has_default_value=False, default_value=0, 86 | message_type=None, enum_type=None, containing_type=None, 87 | is_extension=False, extension_scope=None, 88 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 89 | _descriptor.FieldDescriptor( 90 | name='aggregate', full_name='ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate', index=1, 91 | number=3, type=11, cpp_type=10, label=1, 92 | has_default_value=False, default_value=None, 93 | message_type=None, enum_type=None, containing_type=None, 94 | is_extension=False, extension_scope=None, 95 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 96 | _descriptor.FieldDescriptor( 97 | name='selection_proof', full_name='ethereum.eth.v1alpha1.AggregateAttestationAndProof.selection_proof', index=2, 98 | number=2, type=12, cpp_type=9, label=1, 99 | has_default_value=False, default_value=b"", 100 | message_type=None, enum_type=None, containing_type=None, 101 | is_extension=False, extension_scope=None, 102 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 103 | ], 104 | extensions=[ 105 | ], 106 | nested_types=[], 107 | enum_types=[ 108 | ], 109 | serialized_options=None, 110 | is_extendable=False, 111 | syntax='proto3', 112 | extension_ranges=[], 113 | oneofs=[ 114 | ], 115 | serialized_start=159, 116 | serialized_end=295, 117 | ) 118 | 119 | 120 | _SIGNEDAGGREGATEATTESTATIONANDPROOF = _descriptor.Descriptor( 121 | name='SignedAggregateAttestationAndProof', 122 | full_name='ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof', 123 | filename=None, 124 | file=DESCRIPTOR, 125 | containing_type=None, 126 | create_key=_descriptor._internal_create_key, 127 | fields=[ 128 | _descriptor.FieldDescriptor( 129 | name='message', full_name='ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message', index=0, 130 | number=1, type=11, cpp_type=10, label=1, 131 | has_default_value=False, default_value=None, 132 | message_type=None, enum_type=None, containing_type=None, 133 | is_extension=False, extension_scope=None, 134 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 135 | _descriptor.FieldDescriptor( 136 | name='signature', full_name='ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.signature', index=1, 137 | number=2, type=12, cpp_type=9, label=1, 138 | has_default_value=False, default_value=b"", 139 | message_type=None, enum_type=None, containing_type=None, 140 | is_extension=False, extension_scope=None, 141 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 142 | ], 143 | extensions=[ 144 | ], 145 | nested_types=[], 146 | enum_types=[ 147 | ], 148 | serialized_options=None, 149 | is_extendable=False, 150 | syntax='proto3', 151 | extension_ranges=[], 152 | oneofs=[ 153 | ], 154 | serialized_start=297, 155 | serialized_end=422, 156 | ) 157 | 158 | 159 | _ATTESTATIONDATA = _descriptor.Descriptor( 160 | name='AttestationData', 161 | full_name='ethereum.eth.v1alpha1.AttestationData', 162 | filename=None, 163 | file=DESCRIPTOR, 164 | containing_type=None, 165 | create_key=_descriptor._internal_create_key, 166 | fields=[ 167 | _descriptor.FieldDescriptor( 168 | name='slot', full_name='ethereum.eth.v1alpha1.AttestationData.slot', index=0, 169 | number=1, type=4, cpp_type=4, label=1, 170 | has_default_value=False, default_value=0, 171 | message_type=None, enum_type=None, containing_type=None, 172 | is_extension=False, extension_scope=None, 173 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 174 | _descriptor.FieldDescriptor( 175 | name='committee_index', full_name='ethereum.eth.v1alpha1.AttestationData.committee_index', index=1, 176 | number=2, type=4, cpp_type=4, label=1, 177 | has_default_value=False, default_value=0, 178 | message_type=None, enum_type=None, containing_type=None, 179 | is_extension=False, extension_scope=None, 180 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 181 | _descriptor.FieldDescriptor( 182 | name='beacon_block_root', full_name='ethereum.eth.v1alpha1.AttestationData.beacon_block_root', index=2, 183 | number=3, type=12, cpp_type=9, label=1, 184 | has_default_value=False, default_value=b"", 185 | message_type=None, enum_type=None, containing_type=None, 186 | is_extension=False, extension_scope=None, 187 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 188 | _descriptor.FieldDescriptor( 189 | name='source', full_name='ethereum.eth.v1alpha1.AttestationData.source', index=3, 190 | number=4, type=11, cpp_type=10, label=1, 191 | has_default_value=False, default_value=None, 192 | message_type=None, enum_type=None, containing_type=None, 193 | is_extension=False, extension_scope=None, 194 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 195 | _descriptor.FieldDescriptor( 196 | name='target', full_name='ethereum.eth.v1alpha1.AttestationData.target', index=4, 197 | number=5, type=11, cpp_type=10, label=1, 198 | has_default_value=False, default_value=None, 199 | message_type=None, enum_type=None, containing_type=None, 200 | is_extension=False, extension_scope=None, 201 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 202 | ], 203 | extensions=[ 204 | ], 205 | nested_types=[], 206 | enum_types=[ 207 | ], 208 | serialized_options=None, 209 | is_extendable=False, 210 | syntax='proto3', 211 | extension_ranges=[], 212 | oneofs=[ 213 | ], 214 | serialized_start=425, 215 | serialized_end=610, 216 | ) 217 | 218 | 219 | _CHECKPOINT = _descriptor.Descriptor( 220 | name='Checkpoint', 221 | full_name='ethereum.eth.v1alpha1.Checkpoint', 222 | filename=None, 223 | file=DESCRIPTOR, 224 | containing_type=None, 225 | create_key=_descriptor._internal_create_key, 226 | fields=[ 227 | _descriptor.FieldDescriptor( 228 | name='epoch', full_name='ethereum.eth.v1alpha1.Checkpoint.epoch', index=0, 229 | number=1, type=4, cpp_type=4, label=1, 230 | has_default_value=False, default_value=0, 231 | message_type=None, enum_type=None, containing_type=None, 232 | is_extension=False, extension_scope=None, 233 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 234 | _descriptor.FieldDescriptor( 235 | name='root', full_name='ethereum.eth.v1alpha1.Checkpoint.root', index=1, 236 | number=2, type=12, cpp_type=9, label=1, 237 | has_default_value=False, default_value=b"", 238 | message_type=None, enum_type=None, containing_type=None, 239 | is_extension=False, extension_scope=None, 240 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 241 | ], 242 | extensions=[ 243 | ], 244 | nested_types=[], 245 | enum_types=[ 246 | ], 247 | serialized_options=None, 248 | is_extendable=False, 249 | syntax='proto3', 250 | extension_ranges=[], 251 | oneofs=[ 252 | ], 253 | serialized_start=612, 254 | serialized_end=653, 255 | ) 256 | 257 | _ATTESTATION.fields_by_name['data'].message_type = _ATTESTATIONDATA 258 | _AGGREGATEATTESTATIONANDPROOF.fields_by_name['aggregate'].message_type = _ATTESTATION 259 | _SIGNEDAGGREGATEATTESTATIONANDPROOF.fields_by_name['message'].message_type = _AGGREGATEATTESTATIONANDPROOF 260 | _ATTESTATIONDATA.fields_by_name['source'].message_type = _CHECKPOINT 261 | _ATTESTATIONDATA.fields_by_name['target'].message_type = _CHECKPOINT 262 | DESCRIPTOR.message_types_by_name['Attestation'] = _ATTESTATION 263 | DESCRIPTOR.message_types_by_name['AggregateAttestationAndProof'] = _AGGREGATEATTESTATIONANDPROOF 264 | DESCRIPTOR.message_types_by_name['SignedAggregateAttestationAndProof'] = _SIGNEDAGGREGATEATTESTATIONANDPROOF 265 | DESCRIPTOR.message_types_by_name['AttestationData'] = _ATTESTATIONDATA 266 | DESCRIPTOR.message_types_by_name['Checkpoint'] = _CHECKPOINT 267 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 268 | 269 | Attestation = _reflection.GeneratedProtocolMessageType('Attestation', (_message.Message,), { 270 | 'DESCRIPTOR' : _ATTESTATION, 271 | '__module__' : 'attestation_pb2' 272 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Attestation) 273 | }) 274 | _sym_db.RegisterMessage(Attestation) 275 | 276 | AggregateAttestationAndProof = _reflection.GeneratedProtocolMessageType('AggregateAttestationAndProof', (_message.Message,), { 277 | 'DESCRIPTOR' : _AGGREGATEATTESTATIONANDPROOF, 278 | '__module__' : 'attestation_pb2' 279 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.AggregateAttestationAndProof) 280 | }) 281 | _sym_db.RegisterMessage(AggregateAttestationAndProof) 282 | 283 | SignedAggregateAttestationAndProof = _reflection.GeneratedProtocolMessageType('SignedAggregateAttestationAndProof', (_message.Message,), { 284 | 'DESCRIPTOR' : _SIGNEDAGGREGATEATTESTATIONANDPROOF, 285 | '__module__' : 'attestation_pb2' 286 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof) 287 | }) 288 | _sym_db.RegisterMessage(SignedAggregateAttestationAndProof) 289 | 290 | AttestationData = _reflection.GeneratedProtocolMessageType('AttestationData', (_message.Message,), { 291 | 'DESCRIPTOR' : _ATTESTATIONDATA, 292 | '__module__' : 'attestation_pb2' 293 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.AttestationData) 294 | }) 295 | _sym_db.RegisterMessage(AttestationData) 296 | 297 | Checkpoint = _reflection.GeneratedProtocolMessageType('Checkpoint', (_message.Message,), { 298 | 'DESCRIPTOR' : _CHECKPOINT, 299 | '__module__' : 'attestation_pb2' 300 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Checkpoint) 301 | }) 302 | _sym_db.RegisterMessage(Checkpoint) 303 | 304 | 305 | DESCRIPTOR._options = None 306 | # @@protoc_insertion_point(module_scope) 307 | -------------------------------------------------------------------------------- /attestation_pb2_grpc.py: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /beacon_block_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: beacon_block.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import attestation_pb2 as attestation__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor.FileDescriptor( 18 | name='beacon_block.proto', 19 | package='ethereum.eth.v1alpha1', 20 | syntax='proto3', 21 | serialized_options=b'\n\031org.ethereum.eth.v1alpha1B\020BeaconBlockProtoP\001Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\252\002\025Ethereum.Eth.v1alpha1\312\002\025Ethereum\\Eth\\v1alpha1', 22 | create_key=_descriptor._internal_create_key, 23 | serialized_pb=b'\n\x12\x62\x65\x61\x63on_block.proto\x12\x15\x65thereum.eth.v1alpha1\x1a\x11\x61ttestation.proto\"\x92\x01\n\x0b\x42\x65\x61\x63onBlock\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x16\n\x0eproposer_index\x18\x02 \x01(\x04\x12\x13\n\x0bparent_root\x18\x03 \x01(\x0c\x12\x12\n\nstate_root\x18\x04 \x01(\x0c\x12\x34\n\x04\x62ody\x18\x05 \x01(\x0b\x32&.ethereum.eth.v1alpha1.BeaconBlockBody\"Y\n\x11SignedBeaconBlock\x12\x31\n\x05\x62lock\x18\x01 \x01(\x0b\x32\".ethereum.eth.v1alpha1.BeaconBlock\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xa9\x03\n\x0f\x42\x65\x61\x63onBlockBody\x12\x15\n\rrandao_reveal\x18\x01 \x01(\x0c\x12\x32\n\teth1_data\x18\x02 \x01(\x0b\x32\x1f.ethereum.eth.v1alpha1.Eth1Data\x12\x10\n\x08graffiti\x18\x03 \x01(\x0c\x12\x43\n\x12proposer_slashings\x18\x04 \x03(\x0b\x32\'.ethereum.eth.v1alpha1.ProposerSlashing\x12\x43\n\x12\x61ttester_slashings\x18\x05 \x03(\x0b\x32\'.ethereum.eth.v1alpha1.AttesterSlashing\x12\x38\n\x0c\x61ttestations\x18\x06 \x03(\x0b\x32\".ethereum.eth.v1alpha1.Attestation\x12\x30\n\x08\x64\x65posits\x18\x07 \x03(\x0b\x32\x1e.ethereum.eth.v1alpha1.Deposit\x12\x43\n\x0fvoluntary_exits\x18\x08 \x03(\x0b\x32*.ethereum.eth.v1alpha1.SignedVoluntaryExit\"\x96\x01\n\x10ProposerSlashing\x12@\n\x08header_1\x18\x02 \x01(\x0b\x32..ethereum.eth.v1alpha1.SignedBeaconBlockHeader\x12@\n\x08header_2\x18\x03 \x01(\x0b\x32..ethereum.eth.v1alpha1.SignedBeaconBlockHeader\"\x96\x01\n\x10\x41ttesterSlashing\x12@\n\rattestation_1\x18\x01 \x01(\x0b\x32).ethereum.eth.v1alpha1.IndexedAttestation\x12@\n\rattestation_2\x18\x02 \x01(\x0b\x32).ethereum.eth.v1alpha1.IndexedAttestation\"\xaa\x01\n\x07\x44\x65posit\x12\r\n\x05proof\x18\x01 \x03(\x0c\x12\x31\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32#.ethereum.eth.v1alpha1.Deposit.Data\x1a]\n\x04\x44\x61ta\x12\x12\n\npublic_key\x18\x01 \x01(\x0c\x12\x1e\n\x16withdrawal_credentials\x18\x02 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x03 \x01(\x04\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"7\n\rVoluntaryExit\x12\r\n\x05\x65poch\x18\x01 \x01(\x04\x12\x17\n\x0fvalidator_index\x18\x02 \x01(\x04\"\\\n\x13SignedVoluntaryExit\x12\x32\n\x04\x65xit\x18\x01 \x01(\x0b\x32$.ethereum.eth.v1alpha1.VoluntaryExit\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"K\n\x08\x45th1Data\x12\x14\n\x0c\x64\x65posit_root\x18\x01 \x01(\x0c\x12\x15\n\rdeposit_count\x18\x02 \x01(\x04\x12\x12\n\nblock_hash\x18\x03 \x01(\x0c\"u\n\x11\x42\x65\x61\x63onBlockHeader\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x16\n\x0eproposer_index\x18\x02 \x01(\x04\x12\x13\n\x0bparent_root\x18\x03 \x01(\x0c\x12\x12\n\nstate_root\x18\x04 \x01(\x0c\x12\x11\n\tbody_root\x18\x05 \x01(\x0c\"f\n\x17SignedBeaconBlockHeader\x12\x38\n\x06header\x18\x01 \x01(\x0b\x32(.ethereum.eth.v1alpha1.BeaconBlockHeader\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"x\n\x12IndexedAttestation\x12\x19\n\x11\x61ttesting_indices\x18\x01 \x03(\x04\x12\x34\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32&.ethereum.eth.v1alpha1.AttestationData\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x42\x97\x01\n\x19org.ethereum.eth.v1alpha1B\x10\x42\x65\x61\x63onBlockProtoP\x01Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\xaa\x02\x15\x45thereum.Eth.v1alpha1\xca\x02\x15\x45thereum\\Eth\\v1alpha1b\x06proto3' 24 | , 25 | dependencies=[attestation__pb2.DESCRIPTOR,]) 26 | 27 | 28 | 29 | 30 | _BEACONBLOCK = _descriptor.Descriptor( 31 | name='BeaconBlock', 32 | full_name='ethereum.eth.v1alpha1.BeaconBlock', 33 | filename=None, 34 | file=DESCRIPTOR, 35 | containing_type=None, 36 | create_key=_descriptor._internal_create_key, 37 | fields=[ 38 | _descriptor.FieldDescriptor( 39 | name='slot', full_name='ethereum.eth.v1alpha1.BeaconBlock.slot', index=0, 40 | number=1, type=4, cpp_type=4, label=1, 41 | has_default_value=False, default_value=0, 42 | message_type=None, enum_type=None, containing_type=None, 43 | is_extension=False, extension_scope=None, 44 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 45 | _descriptor.FieldDescriptor( 46 | name='proposer_index', full_name='ethereum.eth.v1alpha1.BeaconBlock.proposer_index', index=1, 47 | number=2, type=4, cpp_type=4, label=1, 48 | has_default_value=False, default_value=0, 49 | message_type=None, enum_type=None, containing_type=None, 50 | is_extension=False, extension_scope=None, 51 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 52 | _descriptor.FieldDescriptor( 53 | name='parent_root', full_name='ethereum.eth.v1alpha1.BeaconBlock.parent_root', index=2, 54 | number=3, type=12, cpp_type=9, label=1, 55 | has_default_value=False, default_value=b"", 56 | message_type=None, enum_type=None, containing_type=None, 57 | is_extension=False, extension_scope=None, 58 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 59 | _descriptor.FieldDescriptor( 60 | name='state_root', full_name='ethereum.eth.v1alpha1.BeaconBlock.state_root', index=3, 61 | number=4, type=12, cpp_type=9, label=1, 62 | has_default_value=False, default_value=b"", 63 | message_type=None, enum_type=None, containing_type=None, 64 | is_extension=False, extension_scope=None, 65 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 66 | _descriptor.FieldDescriptor( 67 | name='body', full_name='ethereum.eth.v1alpha1.BeaconBlock.body', index=4, 68 | number=5, type=11, cpp_type=10, label=1, 69 | has_default_value=False, default_value=None, 70 | message_type=None, enum_type=None, containing_type=None, 71 | is_extension=False, extension_scope=None, 72 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 73 | ], 74 | extensions=[ 75 | ], 76 | nested_types=[], 77 | enum_types=[ 78 | ], 79 | serialized_options=None, 80 | is_extendable=False, 81 | syntax='proto3', 82 | extension_ranges=[], 83 | oneofs=[ 84 | ], 85 | serialized_start=65, 86 | serialized_end=211, 87 | ) 88 | 89 | 90 | _SIGNEDBEACONBLOCK = _descriptor.Descriptor( 91 | name='SignedBeaconBlock', 92 | full_name='ethereum.eth.v1alpha1.SignedBeaconBlock', 93 | filename=None, 94 | file=DESCRIPTOR, 95 | containing_type=None, 96 | create_key=_descriptor._internal_create_key, 97 | fields=[ 98 | _descriptor.FieldDescriptor( 99 | name='block', full_name='ethereum.eth.v1alpha1.SignedBeaconBlock.block', index=0, 100 | number=1, type=11, cpp_type=10, label=1, 101 | has_default_value=False, default_value=None, 102 | message_type=None, enum_type=None, containing_type=None, 103 | is_extension=False, extension_scope=None, 104 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 105 | _descriptor.FieldDescriptor( 106 | name='signature', full_name='ethereum.eth.v1alpha1.SignedBeaconBlock.signature', index=1, 107 | number=2, type=12, cpp_type=9, label=1, 108 | has_default_value=False, default_value=b"", 109 | message_type=None, enum_type=None, containing_type=None, 110 | is_extension=False, extension_scope=None, 111 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 112 | ], 113 | extensions=[ 114 | ], 115 | nested_types=[], 116 | enum_types=[ 117 | ], 118 | serialized_options=None, 119 | is_extendable=False, 120 | syntax='proto3', 121 | extension_ranges=[], 122 | oneofs=[ 123 | ], 124 | serialized_start=213, 125 | serialized_end=302, 126 | ) 127 | 128 | 129 | _BEACONBLOCKBODY = _descriptor.Descriptor( 130 | name='BeaconBlockBody', 131 | full_name='ethereum.eth.v1alpha1.BeaconBlockBody', 132 | filename=None, 133 | file=DESCRIPTOR, 134 | containing_type=None, 135 | create_key=_descriptor._internal_create_key, 136 | fields=[ 137 | _descriptor.FieldDescriptor( 138 | name='randao_reveal', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.randao_reveal', index=0, 139 | number=1, type=12, cpp_type=9, label=1, 140 | has_default_value=False, default_value=b"", 141 | message_type=None, enum_type=None, containing_type=None, 142 | is_extension=False, extension_scope=None, 143 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 144 | _descriptor.FieldDescriptor( 145 | name='eth1_data', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.eth1_data', index=1, 146 | number=2, type=11, cpp_type=10, label=1, 147 | has_default_value=False, default_value=None, 148 | message_type=None, enum_type=None, containing_type=None, 149 | is_extension=False, extension_scope=None, 150 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 151 | _descriptor.FieldDescriptor( 152 | name='graffiti', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.graffiti', index=2, 153 | number=3, type=12, cpp_type=9, label=1, 154 | has_default_value=False, default_value=b"", 155 | message_type=None, enum_type=None, containing_type=None, 156 | is_extension=False, extension_scope=None, 157 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 158 | _descriptor.FieldDescriptor( 159 | name='proposer_slashings', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.proposer_slashings', index=3, 160 | number=4, type=11, cpp_type=10, label=3, 161 | has_default_value=False, default_value=[], 162 | message_type=None, enum_type=None, containing_type=None, 163 | is_extension=False, extension_scope=None, 164 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 165 | _descriptor.FieldDescriptor( 166 | name='attester_slashings', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.attester_slashings', index=4, 167 | number=5, type=11, cpp_type=10, label=3, 168 | has_default_value=False, default_value=[], 169 | message_type=None, enum_type=None, containing_type=None, 170 | is_extension=False, extension_scope=None, 171 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 172 | _descriptor.FieldDescriptor( 173 | name='attestations', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.attestations', index=5, 174 | number=6, type=11, cpp_type=10, label=3, 175 | has_default_value=False, default_value=[], 176 | message_type=None, enum_type=None, containing_type=None, 177 | is_extension=False, extension_scope=None, 178 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 179 | _descriptor.FieldDescriptor( 180 | name='deposits', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.deposits', index=6, 181 | number=7, type=11, cpp_type=10, label=3, 182 | has_default_value=False, default_value=[], 183 | message_type=None, enum_type=None, containing_type=None, 184 | is_extension=False, extension_scope=None, 185 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 186 | _descriptor.FieldDescriptor( 187 | name='voluntary_exits', full_name='ethereum.eth.v1alpha1.BeaconBlockBody.voluntary_exits', index=7, 188 | number=8, type=11, cpp_type=10, label=3, 189 | has_default_value=False, default_value=[], 190 | message_type=None, enum_type=None, containing_type=None, 191 | is_extension=False, extension_scope=None, 192 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 193 | ], 194 | extensions=[ 195 | ], 196 | nested_types=[], 197 | enum_types=[ 198 | ], 199 | serialized_options=None, 200 | is_extendable=False, 201 | syntax='proto3', 202 | extension_ranges=[], 203 | oneofs=[ 204 | ], 205 | serialized_start=305, 206 | serialized_end=730, 207 | ) 208 | 209 | 210 | _PROPOSERSLASHING = _descriptor.Descriptor( 211 | name='ProposerSlashing', 212 | full_name='ethereum.eth.v1alpha1.ProposerSlashing', 213 | filename=None, 214 | file=DESCRIPTOR, 215 | containing_type=None, 216 | create_key=_descriptor._internal_create_key, 217 | fields=[ 218 | _descriptor.FieldDescriptor( 219 | name='header_1', full_name='ethereum.eth.v1alpha1.ProposerSlashing.header_1', index=0, 220 | number=2, type=11, cpp_type=10, label=1, 221 | has_default_value=False, default_value=None, 222 | message_type=None, enum_type=None, containing_type=None, 223 | is_extension=False, extension_scope=None, 224 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 225 | _descriptor.FieldDescriptor( 226 | name='header_2', full_name='ethereum.eth.v1alpha1.ProposerSlashing.header_2', index=1, 227 | number=3, type=11, cpp_type=10, label=1, 228 | has_default_value=False, default_value=None, 229 | message_type=None, enum_type=None, containing_type=None, 230 | is_extension=False, extension_scope=None, 231 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 232 | ], 233 | extensions=[ 234 | ], 235 | nested_types=[], 236 | enum_types=[ 237 | ], 238 | serialized_options=None, 239 | is_extendable=False, 240 | syntax='proto3', 241 | extension_ranges=[], 242 | oneofs=[ 243 | ], 244 | serialized_start=733, 245 | serialized_end=883, 246 | ) 247 | 248 | 249 | _ATTESTERSLASHING = _descriptor.Descriptor( 250 | name='AttesterSlashing', 251 | full_name='ethereum.eth.v1alpha1.AttesterSlashing', 252 | filename=None, 253 | file=DESCRIPTOR, 254 | containing_type=None, 255 | create_key=_descriptor._internal_create_key, 256 | fields=[ 257 | _descriptor.FieldDescriptor( 258 | name='attestation_1', full_name='ethereum.eth.v1alpha1.AttesterSlashing.attestation_1', index=0, 259 | number=1, type=11, cpp_type=10, label=1, 260 | has_default_value=False, default_value=None, 261 | message_type=None, enum_type=None, containing_type=None, 262 | is_extension=False, extension_scope=None, 263 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 264 | _descriptor.FieldDescriptor( 265 | name='attestation_2', full_name='ethereum.eth.v1alpha1.AttesterSlashing.attestation_2', index=1, 266 | number=2, type=11, cpp_type=10, label=1, 267 | has_default_value=False, default_value=None, 268 | message_type=None, enum_type=None, containing_type=None, 269 | is_extension=False, extension_scope=None, 270 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 271 | ], 272 | extensions=[ 273 | ], 274 | nested_types=[], 275 | enum_types=[ 276 | ], 277 | serialized_options=None, 278 | is_extendable=False, 279 | syntax='proto3', 280 | extension_ranges=[], 281 | oneofs=[ 282 | ], 283 | serialized_start=886, 284 | serialized_end=1036, 285 | ) 286 | 287 | 288 | _DEPOSIT_DATA = _descriptor.Descriptor( 289 | name='Data', 290 | full_name='ethereum.eth.v1alpha1.Deposit.Data', 291 | filename=None, 292 | file=DESCRIPTOR, 293 | containing_type=None, 294 | create_key=_descriptor._internal_create_key, 295 | fields=[ 296 | _descriptor.FieldDescriptor( 297 | name='public_key', full_name='ethereum.eth.v1alpha1.Deposit.Data.public_key', index=0, 298 | number=1, type=12, cpp_type=9, label=1, 299 | has_default_value=False, default_value=b"", 300 | message_type=None, enum_type=None, containing_type=None, 301 | is_extension=False, extension_scope=None, 302 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 303 | _descriptor.FieldDescriptor( 304 | name='withdrawal_credentials', full_name='ethereum.eth.v1alpha1.Deposit.Data.withdrawal_credentials', index=1, 305 | number=2, type=12, cpp_type=9, label=1, 306 | has_default_value=False, default_value=b"", 307 | message_type=None, enum_type=None, containing_type=None, 308 | is_extension=False, extension_scope=None, 309 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 310 | _descriptor.FieldDescriptor( 311 | name='amount', full_name='ethereum.eth.v1alpha1.Deposit.Data.amount', index=2, 312 | number=3, type=4, cpp_type=4, label=1, 313 | has_default_value=False, default_value=0, 314 | message_type=None, enum_type=None, containing_type=None, 315 | is_extension=False, extension_scope=None, 316 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 317 | _descriptor.FieldDescriptor( 318 | name='signature', full_name='ethereum.eth.v1alpha1.Deposit.Data.signature', index=3, 319 | number=4, type=12, cpp_type=9, label=1, 320 | has_default_value=False, default_value=b"", 321 | message_type=None, enum_type=None, containing_type=None, 322 | is_extension=False, extension_scope=None, 323 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 324 | ], 325 | extensions=[ 326 | ], 327 | nested_types=[], 328 | enum_types=[ 329 | ], 330 | serialized_options=None, 331 | is_extendable=False, 332 | syntax='proto3', 333 | extension_ranges=[], 334 | oneofs=[ 335 | ], 336 | serialized_start=1116, 337 | serialized_end=1209, 338 | ) 339 | 340 | _DEPOSIT = _descriptor.Descriptor( 341 | name='Deposit', 342 | full_name='ethereum.eth.v1alpha1.Deposit', 343 | filename=None, 344 | file=DESCRIPTOR, 345 | containing_type=None, 346 | create_key=_descriptor._internal_create_key, 347 | fields=[ 348 | _descriptor.FieldDescriptor( 349 | name='proof', full_name='ethereum.eth.v1alpha1.Deposit.proof', index=0, 350 | number=1, type=12, cpp_type=9, label=3, 351 | has_default_value=False, default_value=[], 352 | message_type=None, enum_type=None, containing_type=None, 353 | is_extension=False, extension_scope=None, 354 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 355 | _descriptor.FieldDescriptor( 356 | name='data', full_name='ethereum.eth.v1alpha1.Deposit.data', index=1, 357 | number=2, type=11, cpp_type=10, label=1, 358 | has_default_value=False, default_value=None, 359 | message_type=None, enum_type=None, containing_type=None, 360 | is_extension=False, extension_scope=None, 361 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 362 | ], 363 | extensions=[ 364 | ], 365 | nested_types=[_DEPOSIT_DATA, ], 366 | enum_types=[ 367 | ], 368 | serialized_options=None, 369 | is_extendable=False, 370 | syntax='proto3', 371 | extension_ranges=[], 372 | oneofs=[ 373 | ], 374 | serialized_start=1039, 375 | serialized_end=1209, 376 | ) 377 | 378 | 379 | _VOLUNTARYEXIT = _descriptor.Descriptor( 380 | name='VoluntaryExit', 381 | full_name='ethereum.eth.v1alpha1.VoluntaryExit', 382 | filename=None, 383 | file=DESCRIPTOR, 384 | containing_type=None, 385 | create_key=_descriptor._internal_create_key, 386 | fields=[ 387 | _descriptor.FieldDescriptor( 388 | name='epoch', full_name='ethereum.eth.v1alpha1.VoluntaryExit.epoch', index=0, 389 | number=1, type=4, cpp_type=4, label=1, 390 | has_default_value=False, default_value=0, 391 | message_type=None, enum_type=None, containing_type=None, 392 | is_extension=False, extension_scope=None, 393 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 394 | _descriptor.FieldDescriptor( 395 | name='validator_index', full_name='ethereum.eth.v1alpha1.VoluntaryExit.validator_index', index=1, 396 | number=2, type=4, cpp_type=4, label=1, 397 | has_default_value=False, default_value=0, 398 | message_type=None, enum_type=None, containing_type=None, 399 | is_extension=False, extension_scope=None, 400 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 401 | ], 402 | extensions=[ 403 | ], 404 | nested_types=[], 405 | enum_types=[ 406 | ], 407 | serialized_options=None, 408 | is_extendable=False, 409 | syntax='proto3', 410 | extension_ranges=[], 411 | oneofs=[ 412 | ], 413 | serialized_start=1211, 414 | serialized_end=1266, 415 | ) 416 | 417 | 418 | _SIGNEDVOLUNTARYEXIT = _descriptor.Descriptor( 419 | name='SignedVoluntaryExit', 420 | full_name='ethereum.eth.v1alpha1.SignedVoluntaryExit', 421 | filename=None, 422 | file=DESCRIPTOR, 423 | containing_type=None, 424 | create_key=_descriptor._internal_create_key, 425 | fields=[ 426 | _descriptor.FieldDescriptor( 427 | name='exit', full_name='ethereum.eth.v1alpha1.SignedVoluntaryExit.exit', index=0, 428 | number=1, type=11, cpp_type=10, label=1, 429 | has_default_value=False, default_value=None, 430 | message_type=None, enum_type=None, containing_type=None, 431 | is_extension=False, extension_scope=None, 432 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 433 | _descriptor.FieldDescriptor( 434 | name='signature', full_name='ethereum.eth.v1alpha1.SignedVoluntaryExit.signature', index=1, 435 | number=2, type=12, cpp_type=9, label=1, 436 | has_default_value=False, default_value=b"", 437 | message_type=None, enum_type=None, containing_type=None, 438 | is_extension=False, extension_scope=None, 439 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 440 | ], 441 | extensions=[ 442 | ], 443 | nested_types=[], 444 | enum_types=[ 445 | ], 446 | serialized_options=None, 447 | is_extendable=False, 448 | syntax='proto3', 449 | extension_ranges=[], 450 | oneofs=[ 451 | ], 452 | serialized_start=1268, 453 | serialized_end=1360, 454 | ) 455 | 456 | 457 | _ETH1DATA = _descriptor.Descriptor( 458 | name='Eth1Data', 459 | full_name='ethereum.eth.v1alpha1.Eth1Data', 460 | filename=None, 461 | file=DESCRIPTOR, 462 | containing_type=None, 463 | create_key=_descriptor._internal_create_key, 464 | fields=[ 465 | _descriptor.FieldDescriptor( 466 | name='deposit_root', full_name='ethereum.eth.v1alpha1.Eth1Data.deposit_root', index=0, 467 | number=1, type=12, cpp_type=9, label=1, 468 | has_default_value=False, default_value=b"", 469 | message_type=None, enum_type=None, containing_type=None, 470 | is_extension=False, extension_scope=None, 471 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 472 | _descriptor.FieldDescriptor( 473 | name='deposit_count', full_name='ethereum.eth.v1alpha1.Eth1Data.deposit_count', index=1, 474 | number=2, type=4, cpp_type=4, label=1, 475 | has_default_value=False, default_value=0, 476 | message_type=None, enum_type=None, containing_type=None, 477 | is_extension=False, extension_scope=None, 478 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 479 | _descriptor.FieldDescriptor( 480 | name='block_hash', full_name='ethereum.eth.v1alpha1.Eth1Data.block_hash', index=2, 481 | number=3, type=12, cpp_type=9, label=1, 482 | has_default_value=False, default_value=b"", 483 | message_type=None, enum_type=None, containing_type=None, 484 | is_extension=False, extension_scope=None, 485 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 486 | ], 487 | extensions=[ 488 | ], 489 | nested_types=[], 490 | enum_types=[ 491 | ], 492 | serialized_options=None, 493 | is_extendable=False, 494 | syntax='proto3', 495 | extension_ranges=[], 496 | oneofs=[ 497 | ], 498 | serialized_start=1362, 499 | serialized_end=1437, 500 | ) 501 | 502 | 503 | _BEACONBLOCKHEADER = _descriptor.Descriptor( 504 | name='BeaconBlockHeader', 505 | full_name='ethereum.eth.v1alpha1.BeaconBlockHeader', 506 | filename=None, 507 | file=DESCRIPTOR, 508 | containing_type=None, 509 | create_key=_descriptor._internal_create_key, 510 | fields=[ 511 | _descriptor.FieldDescriptor( 512 | name='slot', full_name='ethereum.eth.v1alpha1.BeaconBlockHeader.slot', index=0, 513 | number=1, type=4, cpp_type=4, label=1, 514 | has_default_value=False, default_value=0, 515 | message_type=None, enum_type=None, containing_type=None, 516 | is_extension=False, extension_scope=None, 517 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 518 | _descriptor.FieldDescriptor( 519 | name='proposer_index', full_name='ethereum.eth.v1alpha1.BeaconBlockHeader.proposer_index', index=1, 520 | number=2, type=4, cpp_type=4, label=1, 521 | has_default_value=False, default_value=0, 522 | message_type=None, enum_type=None, containing_type=None, 523 | is_extension=False, extension_scope=None, 524 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 525 | _descriptor.FieldDescriptor( 526 | name='parent_root', full_name='ethereum.eth.v1alpha1.BeaconBlockHeader.parent_root', index=2, 527 | number=3, type=12, cpp_type=9, label=1, 528 | has_default_value=False, default_value=b"", 529 | message_type=None, enum_type=None, containing_type=None, 530 | is_extension=False, extension_scope=None, 531 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 532 | _descriptor.FieldDescriptor( 533 | name='state_root', full_name='ethereum.eth.v1alpha1.BeaconBlockHeader.state_root', index=3, 534 | number=4, type=12, cpp_type=9, label=1, 535 | has_default_value=False, default_value=b"", 536 | message_type=None, enum_type=None, containing_type=None, 537 | is_extension=False, extension_scope=None, 538 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 539 | _descriptor.FieldDescriptor( 540 | name='body_root', full_name='ethereum.eth.v1alpha1.BeaconBlockHeader.body_root', index=4, 541 | number=5, type=12, cpp_type=9, label=1, 542 | has_default_value=False, default_value=b"", 543 | message_type=None, enum_type=None, containing_type=None, 544 | is_extension=False, extension_scope=None, 545 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 546 | ], 547 | extensions=[ 548 | ], 549 | nested_types=[], 550 | enum_types=[ 551 | ], 552 | serialized_options=None, 553 | is_extendable=False, 554 | syntax='proto3', 555 | extension_ranges=[], 556 | oneofs=[ 557 | ], 558 | serialized_start=1439, 559 | serialized_end=1556, 560 | ) 561 | 562 | 563 | _SIGNEDBEACONBLOCKHEADER = _descriptor.Descriptor( 564 | name='SignedBeaconBlockHeader', 565 | full_name='ethereum.eth.v1alpha1.SignedBeaconBlockHeader', 566 | filename=None, 567 | file=DESCRIPTOR, 568 | containing_type=None, 569 | create_key=_descriptor._internal_create_key, 570 | fields=[ 571 | _descriptor.FieldDescriptor( 572 | name='header', full_name='ethereum.eth.v1alpha1.SignedBeaconBlockHeader.header', index=0, 573 | number=1, type=11, cpp_type=10, label=1, 574 | has_default_value=False, default_value=None, 575 | message_type=None, enum_type=None, containing_type=None, 576 | is_extension=False, extension_scope=None, 577 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 578 | _descriptor.FieldDescriptor( 579 | name='signature', full_name='ethereum.eth.v1alpha1.SignedBeaconBlockHeader.signature', index=1, 580 | number=2, type=12, cpp_type=9, label=1, 581 | has_default_value=False, default_value=b"", 582 | message_type=None, enum_type=None, containing_type=None, 583 | is_extension=False, extension_scope=None, 584 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 585 | ], 586 | extensions=[ 587 | ], 588 | nested_types=[], 589 | enum_types=[ 590 | ], 591 | serialized_options=None, 592 | is_extendable=False, 593 | syntax='proto3', 594 | extension_ranges=[], 595 | oneofs=[ 596 | ], 597 | serialized_start=1558, 598 | serialized_end=1660, 599 | ) 600 | 601 | 602 | _INDEXEDATTESTATION = _descriptor.Descriptor( 603 | name='IndexedAttestation', 604 | full_name='ethereum.eth.v1alpha1.IndexedAttestation', 605 | filename=None, 606 | file=DESCRIPTOR, 607 | containing_type=None, 608 | create_key=_descriptor._internal_create_key, 609 | fields=[ 610 | _descriptor.FieldDescriptor( 611 | name='attesting_indices', full_name='ethereum.eth.v1alpha1.IndexedAttestation.attesting_indices', index=0, 612 | number=1, type=4, cpp_type=4, label=3, 613 | has_default_value=False, default_value=[], 614 | message_type=None, enum_type=None, containing_type=None, 615 | is_extension=False, extension_scope=None, 616 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 617 | _descriptor.FieldDescriptor( 618 | name='data', full_name='ethereum.eth.v1alpha1.IndexedAttestation.data', index=1, 619 | number=2, type=11, cpp_type=10, label=1, 620 | has_default_value=False, default_value=None, 621 | message_type=None, enum_type=None, containing_type=None, 622 | is_extension=False, extension_scope=None, 623 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 624 | _descriptor.FieldDescriptor( 625 | name='signature', full_name='ethereum.eth.v1alpha1.IndexedAttestation.signature', index=2, 626 | number=3, type=12, cpp_type=9, label=1, 627 | has_default_value=False, default_value=b"", 628 | message_type=None, enum_type=None, containing_type=None, 629 | is_extension=False, extension_scope=None, 630 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 631 | ], 632 | extensions=[ 633 | ], 634 | nested_types=[], 635 | enum_types=[ 636 | ], 637 | serialized_options=None, 638 | is_extendable=False, 639 | syntax='proto3', 640 | extension_ranges=[], 641 | oneofs=[ 642 | ], 643 | serialized_start=1662, 644 | serialized_end=1782, 645 | ) 646 | 647 | _BEACONBLOCK.fields_by_name['body'].message_type = _BEACONBLOCKBODY 648 | _SIGNEDBEACONBLOCK.fields_by_name['block'].message_type = _BEACONBLOCK 649 | _BEACONBLOCKBODY.fields_by_name['eth1_data'].message_type = _ETH1DATA 650 | _BEACONBLOCKBODY.fields_by_name['proposer_slashings'].message_type = _PROPOSERSLASHING 651 | _BEACONBLOCKBODY.fields_by_name['attester_slashings'].message_type = _ATTESTERSLASHING 652 | _BEACONBLOCKBODY.fields_by_name['attestations'].message_type = attestation__pb2._ATTESTATION 653 | _BEACONBLOCKBODY.fields_by_name['deposits'].message_type = _DEPOSIT 654 | _BEACONBLOCKBODY.fields_by_name['voluntary_exits'].message_type = _SIGNEDVOLUNTARYEXIT 655 | _PROPOSERSLASHING.fields_by_name['header_1'].message_type = _SIGNEDBEACONBLOCKHEADER 656 | _PROPOSERSLASHING.fields_by_name['header_2'].message_type = _SIGNEDBEACONBLOCKHEADER 657 | _ATTESTERSLASHING.fields_by_name['attestation_1'].message_type = _INDEXEDATTESTATION 658 | _ATTESTERSLASHING.fields_by_name['attestation_2'].message_type = _INDEXEDATTESTATION 659 | _DEPOSIT_DATA.containing_type = _DEPOSIT 660 | _DEPOSIT.fields_by_name['data'].message_type = _DEPOSIT_DATA 661 | _SIGNEDVOLUNTARYEXIT.fields_by_name['exit'].message_type = _VOLUNTARYEXIT 662 | _SIGNEDBEACONBLOCKHEADER.fields_by_name['header'].message_type = _BEACONBLOCKHEADER 663 | _INDEXEDATTESTATION.fields_by_name['data'].message_type = attestation__pb2._ATTESTATIONDATA 664 | DESCRIPTOR.message_types_by_name['BeaconBlock'] = _BEACONBLOCK 665 | DESCRIPTOR.message_types_by_name['SignedBeaconBlock'] = _SIGNEDBEACONBLOCK 666 | DESCRIPTOR.message_types_by_name['BeaconBlockBody'] = _BEACONBLOCKBODY 667 | DESCRIPTOR.message_types_by_name['ProposerSlashing'] = _PROPOSERSLASHING 668 | DESCRIPTOR.message_types_by_name['AttesterSlashing'] = _ATTESTERSLASHING 669 | DESCRIPTOR.message_types_by_name['Deposit'] = _DEPOSIT 670 | DESCRIPTOR.message_types_by_name['VoluntaryExit'] = _VOLUNTARYEXIT 671 | DESCRIPTOR.message_types_by_name['SignedVoluntaryExit'] = _SIGNEDVOLUNTARYEXIT 672 | DESCRIPTOR.message_types_by_name['Eth1Data'] = _ETH1DATA 673 | DESCRIPTOR.message_types_by_name['BeaconBlockHeader'] = _BEACONBLOCKHEADER 674 | DESCRIPTOR.message_types_by_name['SignedBeaconBlockHeader'] = _SIGNEDBEACONBLOCKHEADER 675 | DESCRIPTOR.message_types_by_name['IndexedAttestation'] = _INDEXEDATTESTATION 676 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 677 | 678 | BeaconBlock = _reflection.GeneratedProtocolMessageType('BeaconBlock', (_message.Message,), { 679 | 'DESCRIPTOR' : _BEACONBLOCK, 680 | '__module__' : 'beacon_block_pb2' 681 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.BeaconBlock) 682 | }) 683 | _sym_db.RegisterMessage(BeaconBlock) 684 | 685 | SignedBeaconBlock = _reflection.GeneratedProtocolMessageType('SignedBeaconBlock', (_message.Message,), { 686 | 'DESCRIPTOR' : _SIGNEDBEACONBLOCK, 687 | '__module__' : 'beacon_block_pb2' 688 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.SignedBeaconBlock) 689 | }) 690 | _sym_db.RegisterMessage(SignedBeaconBlock) 691 | 692 | BeaconBlockBody = _reflection.GeneratedProtocolMessageType('BeaconBlockBody', (_message.Message,), { 693 | 'DESCRIPTOR' : _BEACONBLOCKBODY, 694 | '__module__' : 'beacon_block_pb2' 695 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.BeaconBlockBody) 696 | }) 697 | _sym_db.RegisterMessage(BeaconBlockBody) 698 | 699 | ProposerSlashing = _reflection.GeneratedProtocolMessageType('ProposerSlashing', (_message.Message,), { 700 | 'DESCRIPTOR' : _PROPOSERSLASHING, 701 | '__module__' : 'beacon_block_pb2' 702 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.ProposerSlashing) 703 | }) 704 | _sym_db.RegisterMessage(ProposerSlashing) 705 | 706 | AttesterSlashing = _reflection.GeneratedProtocolMessageType('AttesterSlashing', (_message.Message,), { 707 | 'DESCRIPTOR' : _ATTESTERSLASHING, 708 | '__module__' : 'beacon_block_pb2' 709 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.AttesterSlashing) 710 | }) 711 | _sym_db.RegisterMessage(AttesterSlashing) 712 | 713 | Deposit = _reflection.GeneratedProtocolMessageType('Deposit', (_message.Message,), { 714 | 715 | 'Data' : _reflection.GeneratedProtocolMessageType('Data', (_message.Message,), { 716 | 'DESCRIPTOR' : _DEPOSIT_DATA, 717 | '__module__' : 'beacon_block_pb2' 718 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Deposit.Data) 719 | }) 720 | , 721 | 'DESCRIPTOR' : _DEPOSIT, 722 | '__module__' : 'beacon_block_pb2' 723 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Deposit) 724 | }) 725 | _sym_db.RegisterMessage(Deposit) 726 | _sym_db.RegisterMessage(Deposit.Data) 727 | 728 | VoluntaryExit = _reflection.GeneratedProtocolMessageType('VoluntaryExit', (_message.Message,), { 729 | 'DESCRIPTOR' : _VOLUNTARYEXIT, 730 | '__module__' : 'beacon_block_pb2' 731 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.VoluntaryExit) 732 | }) 733 | _sym_db.RegisterMessage(VoluntaryExit) 734 | 735 | SignedVoluntaryExit = _reflection.GeneratedProtocolMessageType('SignedVoluntaryExit', (_message.Message,), { 736 | 'DESCRIPTOR' : _SIGNEDVOLUNTARYEXIT, 737 | '__module__' : 'beacon_block_pb2' 738 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.SignedVoluntaryExit) 739 | }) 740 | _sym_db.RegisterMessage(SignedVoluntaryExit) 741 | 742 | Eth1Data = _reflection.GeneratedProtocolMessageType('Eth1Data', (_message.Message,), { 743 | 'DESCRIPTOR' : _ETH1DATA, 744 | '__module__' : 'beacon_block_pb2' 745 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Eth1Data) 746 | }) 747 | _sym_db.RegisterMessage(Eth1Data) 748 | 749 | BeaconBlockHeader = _reflection.GeneratedProtocolMessageType('BeaconBlockHeader', (_message.Message,), { 750 | 'DESCRIPTOR' : _BEACONBLOCKHEADER, 751 | '__module__' : 'beacon_block_pb2' 752 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.BeaconBlockHeader) 753 | }) 754 | _sym_db.RegisterMessage(BeaconBlockHeader) 755 | 756 | SignedBeaconBlockHeader = _reflection.GeneratedProtocolMessageType('SignedBeaconBlockHeader', (_message.Message,), { 757 | 'DESCRIPTOR' : _SIGNEDBEACONBLOCKHEADER, 758 | '__module__' : 'beacon_block_pb2' 759 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.SignedBeaconBlockHeader) 760 | }) 761 | _sym_db.RegisterMessage(SignedBeaconBlockHeader) 762 | 763 | IndexedAttestation = _reflection.GeneratedProtocolMessageType('IndexedAttestation', (_message.Message,), { 764 | 'DESCRIPTOR' : _INDEXEDATTESTATION, 765 | '__module__' : 'beacon_block_pb2' 766 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.IndexedAttestation) 767 | }) 768 | _sym_db.RegisterMessage(IndexedAttestation) 769 | 770 | 771 | DESCRIPTOR._options = None 772 | # @@protoc_insertion_point(module_scope) 773 | -------------------------------------------------------------------------------- /beacon_block_pb2_grpc.py: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /beacon_chain_pb2_grpc.py: -------------------------------------------------------------------------------- 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 | import attestation_pb2 as attestation__pb2 6 | import beacon_block_pb2 as beacon__block__pb2 7 | import beacon_chain_pb2 as beacon__chain__pb2 8 | from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 9 | import validator_pb2 as validator__pb2 10 | 11 | 12 | class BeaconChainStub(object): 13 | """Beacon chain API 14 | 15 | The beacon chain API can be used to access data relevant to the Ethereum 2.0 16 | phase 0 beacon chain. 17 | TODO(preston): Batch requests? 18 | """ 19 | 20 | def __init__(self, channel): 21 | """Constructor. 22 | 23 | Args: 24 | channel: A grpc.Channel. 25 | """ 26 | self.ListAttestations = channel.unary_unary( 27 | '/ethereum.eth.v1alpha1.BeaconChain/ListAttestations', 28 | request_serializer=beacon__chain__pb2.ListAttestationsRequest.SerializeToString, 29 | response_deserializer=beacon__chain__pb2.ListAttestationsResponse.FromString, 30 | ) 31 | self.ListIndexedAttestations = channel.unary_unary( 32 | '/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations', 33 | request_serializer=beacon__chain__pb2.ListIndexedAttestationsRequest.SerializeToString, 34 | response_deserializer=beacon__chain__pb2.ListIndexedAttestationsResponse.FromString, 35 | ) 36 | self.StreamAttestations = channel.unary_stream( 37 | '/ethereum.eth.v1alpha1.BeaconChain/StreamAttestations', 38 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 39 | response_deserializer=attestation__pb2.Attestation.FromString, 40 | ) 41 | self.StreamIndexedAttestations = channel.unary_stream( 42 | '/ethereum.eth.v1alpha1.BeaconChain/StreamIndexedAttestations', 43 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 44 | response_deserializer=beacon__block__pb2.IndexedAttestation.FromString, 45 | ) 46 | self.AttestationPool = channel.unary_unary( 47 | '/ethereum.eth.v1alpha1.BeaconChain/AttestationPool', 48 | request_serializer=beacon__chain__pb2.AttestationPoolRequest.SerializeToString, 49 | response_deserializer=beacon__chain__pb2.AttestationPoolResponse.FromString, 50 | ) 51 | self.ListBlocks = channel.unary_unary( 52 | '/ethereum.eth.v1alpha1.BeaconChain/ListBlocks', 53 | request_serializer=beacon__chain__pb2.ListBlocksRequest.SerializeToString, 54 | response_deserializer=beacon__chain__pb2.ListBlocksResponse.FromString, 55 | ) 56 | self.StreamBlocks = channel.unary_stream( 57 | '/ethereum.eth.v1alpha1.BeaconChain/StreamBlocks', 58 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 59 | response_deserializer=beacon__block__pb2.SignedBeaconBlock.FromString, 60 | ) 61 | self.StreamChainHead = channel.unary_stream( 62 | '/ethereum.eth.v1alpha1.BeaconChain/StreamChainHead', 63 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 64 | response_deserializer=beacon__chain__pb2.ChainHead.FromString, 65 | ) 66 | self.GetChainHead = channel.unary_unary( 67 | '/ethereum.eth.v1alpha1.BeaconChain/GetChainHead', 68 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 69 | response_deserializer=beacon__chain__pb2.ChainHead.FromString, 70 | ) 71 | self.ListBeaconCommittees = channel.unary_unary( 72 | '/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees', 73 | request_serializer=beacon__chain__pb2.ListCommitteesRequest.SerializeToString, 74 | response_deserializer=beacon__chain__pb2.BeaconCommittees.FromString, 75 | ) 76 | self.ListValidatorBalances = channel.unary_unary( 77 | '/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances', 78 | request_serializer=beacon__chain__pb2.ListValidatorBalancesRequest.SerializeToString, 79 | response_deserializer=beacon__chain__pb2.ValidatorBalances.FromString, 80 | ) 81 | self.ListValidators = channel.unary_unary( 82 | '/ethereum.eth.v1alpha1.BeaconChain/ListValidators', 83 | request_serializer=beacon__chain__pb2.ListValidatorsRequest.SerializeToString, 84 | response_deserializer=beacon__chain__pb2.Validators.FromString, 85 | ) 86 | self.GetValidator = channel.unary_unary( 87 | '/ethereum.eth.v1alpha1.BeaconChain/GetValidator', 88 | request_serializer=beacon__chain__pb2.GetValidatorRequest.SerializeToString, 89 | response_deserializer=validator__pb2.Validator.FromString, 90 | ) 91 | self.GetValidatorActiveSetChanges = channel.unary_unary( 92 | '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges', 93 | request_serializer=beacon__chain__pb2.GetValidatorActiveSetChangesRequest.SerializeToString, 94 | response_deserializer=beacon__chain__pb2.ActiveSetChanges.FromString, 95 | ) 96 | self.GetValidatorQueue = channel.unary_unary( 97 | '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue', 98 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 99 | response_deserializer=beacon__chain__pb2.ValidatorQueue.FromString, 100 | ) 101 | self.GetValidatorPerformance = channel.unary_unary( 102 | '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance', 103 | request_serializer=beacon__chain__pb2.ValidatorPerformanceRequest.SerializeToString, 104 | response_deserializer=beacon__chain__pb2.ValidatorPerformanceResponse.FromString, 105 | ) 106 | self.ListValidatorAssignments = channel.unary_unary( 107 | '/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments', 108 | request_serializer=beacon__chain__pb2.ListValidatorAssignmentsRequest.SerializeToString, 109 | response_deserializer=beacon__chain__pb2.ValidatorAssignments.FromString, 110 | ) 111 | self.GetValidatorParticipation = channel.unary_unary( 112 | '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation', 113 | request_serializer=beacon__chain__pb2.GetValidatorParticipationRequest.SerializeToString, 114 | response_deserializer=beacon__chain__pb2.ValidatorParticipationResponse.FromString, 115 | ) 116 | self.GetBeaconConfig = channel.unary_unary( 117 | '/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig', 118 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 119 | response_deserializer=beacon__chain__pb2.BeaconConfig.FromString, 120 | ) 121 | self.StreamValidatorsInfo = channel.stream_stream( 122 | '/ethereum.eth.v1alpha1.BeaconChain/StreamValidatorsInfo', 123 | request_serializer=beacon__chain__pb2.ValidatorChangeSet.SerializeToString, 124 | response_deserializer=validator__pb2.ValidatorInfo.FromString, 125 | ) 126 | self.SubmitAttesterSlashing = channel.unary_unary( 127 | '/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing', 128 | request_serializer=beacon__block__pb2.AttesterSlashing.SerializeToString, 129 | response_deserializer=beacon__chain__pb2.SubmitSlashingResponse.FromString, 130 | ) 131 | self.SubmitProposerSlashing = channel.unary_unary( 132 | '/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing', 133 | request_serializer=beacon__block__pb2.ProposerSlashing.SerializeToString, 134 | response_deserializer=beacon__chain__pb2.SubmitSlashingResponse.FromString, 135 | ) 136 | self.GetIndividualVotes = channel.unary_unary( 137 | '/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes', 138 | request_serializer=beacon__chain__pb2.IndividualVotesRequest.SerializeToString, 139 | response_deserializer=beacon__chain__pb2.IndividualVotesRespond.FromString, 140 | ) 141 | 142 | 143 | class BeaconChainServicer(object): 144 | """Beacon chain API 145 | 146 | The beacon chain API can be used to access data relevant to the Ethereum 2.0 147 | phase 0 beacon chain. 148 | TODO(preston): Batch requests? 149 | """ 150 | 151 | def ListAttestations(self, request, context): 152 | """Retrieve attestations by block root, slot, or epoch. 153 | 154 | The server may return an empty list when no attestations match the given 155 | filter criteria. This RPC should not return NOT_FOUND. Only one filter 156 | criteria should be used. This endpoint allows for retrieval of genesis 157 | information via a boolean query filter. 158 | """ 159 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 160 | context.set_details('Method not implemented!') 161 | raise NotImplementedError('Method not implemented!') 162 | 163 | def ListIndexedAttestations(self, request, context): 164 | """Retrieve indexed attestations by block root, slot, or epoch. 165 | 166 | The server may return an empty list when no indexed attestations match the given 167 | filter criteria. This RPC should not return NOT_FOUND. Only one filter 168 | criteria should be used. This endpoint allows for retrieval of genesis 169 | information via a boolean query filter. 170 | """ 171 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 172 | context.set_details('Method not implemented!') 173 | raise NotImplementedError('Method not implemented!') 174 | 175 | def StreamAttestations(self, request, context): 176 | """Server-side stream of attestations as they are received by 177 | the beacon chain node. 178 | """ 179 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 180 | context.set_details('Method not implemented!') 181 | raise NotImplementedError('Method not implemented!') 182 | 183 | def StreamIndexedAttestations(self, request, context): 184 | """Server-side stream of indexed attestations as they are received by 185 | the beacon chain node. 186 | """ 187 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 188 | context.set_details('Method not implemented!') 189 | raise NotImplementedError('Method not implemented!') 190 | 191 | def AttestationPool(self, request, context): 192 | """Retrieve attestations from pool. 193 | 194 | The server returns a list of attestations that have been seen but not 195 | yet processed. Pool attestations eventually expire as the slot 196 | advances, so an attestation missing from this request does not imply 197 | that it was included in a block. The attestation may have expired. 198 | Refer to the ethereum 2.0 specification for more details on how 199 | attestations are processed and when they are no longer valid. 200 | https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations 201 | """ 202 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 203 | context.set_details('Method not implemented!') 204 | raise NotImplementedError('Method not implemented!') 205 | 206 | def ListBlocks(self, request, context): 207 | """Retrieve blocks by root, slot, or epoch. 208 | 209 | The server may return multiple blocks in the case that a slot or epoch is 210 | provided as the filter criteria. The server may return an empty list when 211 | no blocks in their database match the filter criteria. This RPC should 212 | not return NOT_FOUND. Only one filter criteria should be used. This endpoint 213 | allows for retrieval of genesis information via a boolean query filter. 214 | """ 215 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 216 | context.set_details('Method not implemented!') 217 | raise NotImplementedError('Method not implemented!') 218 | 219 | def StreamBlocks(self, request, context): 220 | """Server-side stream of all signed blocks as they are received by 221 | the beacon chain node. 222 | """ 223 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 224 | context.set_details('Method not implemented!') 225 | raise NotImplementedError('Method not implemented!') 226 | 227 | def StreamChainHead(self, request, context): 228 | """Server-side stream of information about the head of the beacon chain 229 | from the view of the beacon chain node. 230 | 231 | This includes the head block slot and root as well as information about 232 | the most recent finalized and justified slots. 233 | """ 234 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 235 | context.set_details('Method not implemented!') 236 | raise NotImplementedError('Method not implemented!') 237 | 238 | def GetChainHead(self, request, context): 239 | """Retrieve information about the head of the beacon chain from the view of 240 | the beacon chain node. 241 | 242 | This includes the head block slot and root as well as information about 243 | the most recent finalized and justified slots. 244 | """ 245 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 246 | context.set_details('Method not implemented!') 247 | raise NotImplementedError('Method not implemented!') 248 | 249 | def ListBeaconCommittees(self, request, context): 250 | """Retrieve the beacon chain committees for a given epoch. 251 | 252 | If no filter criteria is specified, the response returns 253 | all beacon committees for the current epoch. The results are paginated by default. 254 | This endpoint allows for retrieval of genesis information via a boolean query filter. 255 | """ 256 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 257 | context.set_details('Method not implemented!') 258 | raise NotImplementedError('Method not implemented!') 259 | 260 | def ListValidatorBalances(self, request, context): 261 | """Retrieve validator balances for a given set of public keys at a specific 262 | epoch in time. This endpoint allows for retrieval of genesis information 263 | via a boolean query filter. 264 | """ 265 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 266 | context.set_details('Method not implemented!') 267 | raise NotImplementedError('Method not implemented!') 268 | 269 | def ListValidators(self, request, context): 270 | """Retrieve the current validator registry. 271 | 272 | The request may include an optional historical epoch to retrieve a 273 | specific validator set in time. This endpoint allows for retrieval of genesis 274 | information via a boolean query filter. 275 | """ 276 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 277 | context.set_details('Method not implemented!') 278 | raise NotImplementedError('Method not implemented!') 279 | 280 | def GetValidator(self, request, context): 281 | """Retrieve information about a specific validator in the registry. 282 | 283 | This request may query by validator index or public key. 284 | """ 285 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 286 | context.set_details('Method not implemented!') 287 | raise NotImplementedError('Method not implemented!') 288 | 289 | def GetValidatorActiveSetChanges(self, request, context): 290 | """Retrieve the active set changes for a given epoch. 291 | 292 | This data includes any activations, voluntary exits, and involuntary 293 | ejections. This endpoint allows for retrieval of genesis 294 | information via a boolean query filter. 295 | """ 296 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 297 | context.set_details('Method not implemented!') 298 | raise NotImplementedError('Method not implemented!') 299 | 300 | def GetValidatorQueue(self, request, context): 301 | """Retrieve the current validator queue information. 302 | """ 303 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 304 | context.set_details('Method not implemented!') 305 | raise NotImplementedError('Method not implemented!') 306 | 307 | def GetValidatorPerformance(self, request, context): 308 | """GetValidatorPerformance reports a validator's latest balance along with other important 309 | metrics on rewards and penalties throughout its lifecycle in the beacon chain. 310 | The request takes in a list of validator public keys and returns a performance report 311 | for all of them respectively. 312 | """ 313 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 314 | context.set_details('Method not implemented!') 315 | raise NotImplementedError('Method not implemented!') 316 | 317 | def ListValidatorAssignments(self, request, context): 318 | """Retrieve the validator assignments for a given epoch. 319 | 320 | This request may specify optional validator indices or public keys to 321 | filter validator assignments. This endpoint allows for retrieval of genesis 322 | information via a boolean query filter. 323 | """ 324 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 325 | context.set_details('Method not implemented!') 326 | raise NotImplementedError('Method not implemented!') 327 | 328 | def GetValidatorParticipation(self, request, context): 329 | """Retrieve the validator participation information for a given epoch. 330 | 331 | This method returns information about the global participation of 332 | validator attestations. This endpoint allows for retrieval of genesis 333 | information via a boolean query filter. 334 | """ 335 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 336 | context.set_details('Method not implemented!') 337 | raise NotImplementedError('Method not implemented!') 338 | 339 | def GetBeaconConfig(self, request, context): 340 | """Retrieve the current configuration parameters of the beacon chain. 341 | """ 342 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 343 | context.set_details('Method not implemented!') 344 | raise NotImplementedError('Method not implemented!') 345 | 346 | def StreamValidatorsInfo(self, request_iterator, context): 347 | """Server-side stream of validator information at each epoch. 348 | """ 349 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 350 | context.set_details('Method not implemented!') 351 | raise NotImplementedError('Method not implemented!') 352 | 353 | def SubmitAttesterSlashing(self, request, context): 354 | """Submit an attester slashing object to the beacon node. 355 | """ 356 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 357 | context.set_details('Method not implemented!') 358 | raise NotImplementedError('Method not implemented!') 359 | 360 | def SubmitProposerSlashing(self, request, context): 361 | """Submit a proposer slashing object to the beacon node. 362 | """ 363 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 364 | context.set_details('Method not implemented!') 365 | raise NotImplementedError('Method not implemented!') 366 | 367 | def GetIndividualVotes(self, request, context): 368 | """Returns a list of validators individual vote status of a given epoch. 369 | """ 370 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 371 | context.set_details('Method not implemented!') 372 | raise NotImplementedError('Method not implemented!') 373 | 374 | 375 | def add_BeaconChainServicer_to_server(servicer, server): 376 | rpc_method_handlers = { 377 | 'ListAttestations': grpc.unary_unary_rpc_method_handler( 378 | servicer.ListAttestations, 379 | request_deserializer=beacon__chain__pb2.ListAttestationsRequest.FromString, 380 | response_serializer=beacon__chain__pb2.ListAttestationsResponse.SerializeToString, 381 | ), 382 | 'ListIndexedAttestations': grpc.unary_unary_rpc_method_handler( 383 | servicer.ListIndexedAttestations, 384 | request_deserializer=beacon__chain__pb2.ListIndexedAttestationsRequest.FromString, 385 | response_serializer=beacon__chain__pb2.ListIndexedAttestationsResponse.SerializeToString, 386 | ), 387 | 'StreamAttestations': grpc.unary_stream_rpc_method_handler( 388 | servicer.StreamAttestations, 389 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 390 | response_serializer=attestation__pb2.Attestation.SerializeToString, 391 | ), 392 | 'StreamIndexedAttestations': grpc.unary_stream_rpc_method_handler( 393 | servicer.StreamIndexedAttestations, 394 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 395 | response_serializer=beacon__block__pb2.IndexedAttestation.SerializeToString, 396 | ), 397 | 'AttestationPool': grpc.unary_unary_rpc_method_handler( 398 | servicer.AttestationPool, 399 | request_deserializer=beacon__chain__pb2.AttestationPoolRequest.FromString, 400 | response_serializer=beacon__chain__pb2.AttestationPoolResponse.SerializeToString, 401 | ), 402 | 'ListBlocks': grpc.unary_unary_rpc_method_handler( 403 | servicer.ListBlocks, 404 | request_deserializer=beacon__chain__pb2.ListBlocksRequest.FromString, 405 | response_serializer=beacon__chain__pb2.ListBlocksResponse.SerializeToString, 406 | ), 407 | 'StreamBlocks': grpc.unary_stream_rpc_method_handler( 408 | servicer.StreamBlocks, 409 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 410 | response_serializer=beacon__block__pb2.SignedBeaconBlock.SerializeToString, 411 | ), 412 | 'StreamChainHead': grpc.unary_stream_rpc_method_handler( 413 | servicer.StreamChainHead, 414 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 415 | response_serializer=beacon__chain__pb2.ChainHead.SerializeToString, 416 | ), 417 | 'GetChainHead': grpc.unary_unary_rpc_method_handler( 418 | servicer.GetChainHead, 419 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 420 | response_serializer=beacon__chain__pb2.ChainHead.SerializeToString, 421 | ), 422 | 'ListBeaconCommittees': grpc.unary_unary_rpc_method_handler( 423 | servicer.ListBeaconCommittees, 424 | request_deserializer=beacon__chain__pb2.ListCommitteesRequest.FromString, 425 | response_serializer=beacon__chain__pb2.BeaconCommittees.SerializeToString, 426 | ), 427 | 'ListValidatorBalances': grpc.unary_unary_rpc_method_handler( 428 | servicer.ListValidatorBalances, 429 | request_deserializer=beacon__chain__pb2.ListValidatorBalancesRequest.FromString, 430 | response_serializer=beacon__chain__pb2.ValidatorBalances.SerializeToString, 431 | ), 432 | 'ListValidators': grpc.unary_unary_rpc_method_handler( 433 | servicer.ListValidators, 434 | request_deserializer=beacon__chain__pb2.ListValidatorsRequest.FromString, 435 | response_serializer=beacon__chain__pb2.Validators.SerializeToString, 436 | ), 437 | 'GetValidator': grpc.unary_unary_rpc_method_handler( 438 | servicer.GetValidator, 439 | request_deserializer=beacon__chain__pb2.GetValidatorRequest.FromString, 440 | response_serializer=validator__pb2.Validator.SerializeToString, 441 | ), 442 | 'GetValidatorActiveSetChanges': grpc.unary_unary_rpc_method_handler( 443 | servicer.GetValidatorActiveSetChanges, 444 | request_deserializer=beacon__chain__pb2.GetValidatorActiveSetChangesRequest.FromString, 445 | response_serializer=beacon__chain__pb2.ActiveSetChanges.SerializeToString, 446 | ), 447 | 'GetValidatorQueue': grpc.unary_unary_rpc_method_handler( 448 | servicer.GetValidatorQueue, 449 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 450 | response_serializer=beacon__chain__pb2.ValidatorQueue.SerializeToString, 451 | ), 452 | 'GetValidatorPerformance': grpc.unary_unary_rpc_method_handler( 453 | servicer.GetValidatorPerformance, 454 | request_deserializer=beacon__chain__pb2.ValidatorPerformanceRequest.FromString, 455 | response_serializer=beacon__chain__pb2.ValidatorPerformanceResponse.SerializeToString, 456 | ), 457 | 'ListValidatorAssignments': grpc.unary_unary_rpc_method_handler( 458 | servicer.ListValidatorAssignments, 459 | request_deserializer=beacon__chain__pb2.ListValidatorAssignmentsRequest.FromString, 460 | response_serializer=beacon__chain__pb2.ValidatorAssignments.SerializeToString, 461 | ), 462 | 'GetValidatorParticipation': grpc.unary_unary_rpc_method_handler( 463 | servicer.GetValidatorParticipation, 464 | request_deserializer=beacon__chain__pb2.GetValidatorParticipationRequest.FromString, 465 | response_serializer=beacon__chain__pb2.ValidatorParticipationResponse.SerializeToString, 466 | ), 467 | 'GetBeaconConfig': grpc.unary_unary_rpc_method_handler( 468 | servicer.GetBeaconConfig, 469 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 470 | response_serializer=beacon__chain__pb2.BeaconConfig.SerializeToString, 471 | ), 472 | 'StreamValidatorsInfo': grpc.stream_stream_rpc_method_handler( 473 | servicer.StreamValidatorsInfo, 474 | request_deserializer=beacon__chain__pb2.ValidatorChangeSet.FromString, 475 | response_serializer=validator__pb2.ValidatorInfo.SerializeToString, 476 | ), 477 | 'SubmitAttesterSlashing': grpc.unary_unary_rpc_method_handler( 478 | servicer.SubmitAttesterSlashing, 479 | request_deserializer=beacon__block__pb2.AttesterSlashing.FromString, 480 | response_serializer=beacon__chain__pb2.SubmitSlashingResponse.SerializeToString, 481 | ), 482 | 'SubmitProposerSlashing': grpc.unary_unary_rpc_method_handler( 483 | servicer.SubmitProposerSlashing, 484 | request_deserializer=beacon__block__pb2.ProposerSlashing.FromString, 485 | response_serializer=beacon__chain__pb2.SubmitSlashingResponse.SerializeToString, 486 | ), 487 | 'GetIndividualVotes': grpc.unary_unary_rpc_method_handler( 488 | servicer.GetIndividualVotes, 489 | request_deserializer=beacon__chain__pb2.IndividualVotesRequest.FromString, 490 | response_serializer=beacon__chain__pb2.IndividualVotesRespond.SerializeToString, 491 | ), 492 | } 493 | generic_handler = grpc.method_handlers_generic_handler( 494 | 'ethereum.eth.v1alpha1.BeaconChain', rpc_method_handlers) 495 | server.add_generic_rpc_handlers((generic_handler,)) 496 | 497 | 498 | # This class is part of an EXPERIMENTAL API. 499 | class BeaconChain(object): 500 | """Beacon chain API 501 | 502 | The beacon chain API can be used to access data relevant to the Ethereum 2.0 503 | phase 0 beacon chain. 504 | TODO(preston): Batch requests? 505 | """ 506 | 507 | @staticmethod 508 | def ListAttestations(request, 509 | target, 510 | options=(), 511 | channel_credentials=None, 512 | call_credentials=None, 513 | insecure=False, 514 | compression=None, 515 | wait_for_ready=None, 516 | timeout=None, 517 | metadata=None): 518 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListAttestations', 519 | beacon__chain__pb2.ListAttestationsRequest.SerializeToString, 520 | beacon__chain__pb2.ListAttestationsResponse.FromString, 521 | options, channel_credentials, 522 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 523 | 524 | @staticmethod 525 | def ListIndexedAttestations(request, 526 | target, 527 | options=(), 528 | channel_credentials=None, 529 | call_credentials=None, 530 | insecure=False, 531 | compression=None, 532 | wait_for_ready=None, 533 | timeout=None, 534 | metadata=None): 535 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations', 536 | beacon__chain__pb2.ListIndexedAttestationsRequest.SerializeToString, 537 | beacon__chain__pb2.ListIndexedAttestationsResponse.FromString, 538 | options, channel_credentials, 539 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 540 | 541 | @staticmethod 542 | def StreamAttestations(request, 543 | target, 544 | options=(), 545 | channel_credentials=None, 546 | call_credentials=None, 547 | insecure=False, 548 | compression=None, 549 | wait_for_ready=None, 550 | timeout=None, 551 | metadata=None): 552 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamAttestations', 553 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 554 | attestation__pb2.Attestation.FromString, 555 | options, channel_credentials, 556 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 557 | 558 | @staticmethod 559 | def StreamIndexedAttestations(request, 560 | target, 561 | options=(), 562 | channel_credentials=None, 563 | call_credentials=None, 564 | insecure=False, 565 | compression=None, 566 | wait_for_ready=None, 567 | timeout=None, 568 | metadata=None): 569 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamIndexedAttestations', 570 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 571 | beacon__block__pb2.IndexedAttestation.FromString, 572 | options, channel_credentials, 573 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 574 | 575 | @staticmethod 576 | def AttestationPool(request, 577 | target, 578 | options=(), 579 | channel_credentials=None, 580 | call_credentials=None, 581 | insecure=False, 582 | compression=None, 583 | wait_for_ready=None, 584 | timeout=None, 585 | metadata=None): 586 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/AttestationPool', 587 | beacon__chain__pb2.AttestationPoolRequest.SerializeToString, 588 | beacon__chain__pb2.AttestationPoolResponse.FromString, 589 | options, channel_credentials, 590 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 591 | 592 | @staticmethod 593 | def ListBlocks(request, 594 | target, 595 | options=(), 596 | channel_credentials=None, 597 | call_credentials=None, 598 | insecure=False, 599 | compression=None, 600 | wait_for_ready=None, 601 | timeout=None, 602 | metadata=None): 603 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListBlocks', 604 | beacon__chain__pb2.ListBlocksRequest.SerializeToString, 605 | beacon__chain__pb2.ListBlocksResponse.FromString, 606 | options, channel_credentials, 607 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 608 | 609 | @staticmethod 610 | def StreamBlocks(request, 611 | target, 612 | options=(), 613 | channel_credentials=None, 614 | call_credentials=None, 615 | insecure=False, 616 | compression=None, 617 | wait_for_ready=None, 618 | timeout=None, 619 | metadata=None): 620 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamBlocks', 621 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 622 | beacon__block__pb2.SignedBeaconBlock.FromString, 623 | options, channel_credentials, 624 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 625 | 626 | @staticmethod 627 | def StreamChainHead(request, 628 | target, 629 | options=(), 630 | channel_credentials=None, 631 | call_credentials=None, 632 | insecure=False, 633 | compression=None, 634 | wait_for_ready=None, 635 | timeout=None, 636 | metadata=None): 637 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamChainHead', 638 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 639 | beacon__chain__pb2.ChainHead.FromString, 640 | options, channel_credentials, 641 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 642 | 643 | @staticmethod 644 | def GetChainHead(request, 645 | target, 646 | options=(), 647 | channel_credentials=None, 648 | call_credentials=None, 649 | insecure=False, 650 | compression=None, 651 | wait_for_ready=None, 652 | timeout=None, 653 | metadata=None): 654 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetChainHead', 655 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 656 | beacon__chain__pb2.ChainHead.FromString, 657 | options, channel_credentials, 658 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 659 | 660 | @staticmethod 661 | def ListBeaconCommittees(request, 662 | target, 663 | options=(), 664 | channel_credentials=None, 665 | call_credentials=None, 666 | insecure=False, 667 | compression=None, 668 | wait_for_ready=None, 669 | timeout=None, 670 | metadata=None): 671 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees', 672 | beacon__chain__pb2.ListCommitteesRequest.SerializeToString, 673 | beacon__chain__pb2.BeaconCommittees.FromString, 674 | options, channel_credentials, 675 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 676 | 677 | @staticmethod 678 | def ListValidatorBalances(request, 679 | target, 680 | options=(), 681 | channel_credentials=None, 682 | call_credentials=None, 683 | insecure=False, 684 | compression=None, 685 | wait_for_ready=None, 686 | timeout=None, 687 | metadata=None): 688 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances', 689 | beacon__chain__pb2.ListValidatorBalancesRequest.SerializeToString, 690 | beacon__chain__pb2.ValidatorBalances.FromString, 691 | options, channel_credentials, 692 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 693 | 694 | @staticmethod 695 | def ListValidators(request, 696 | target, 697 | options=(), 698 | channel_credentials=None, 699 | call_credentials=None, 700 | insecure=False, 701 | compression=None, 702 | wait_for_ready=None, 703 | timeout=None, 704 | metadata=None): 705 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListValidators', 706 | beacon__chain__pb2.ListValidatorsRequest.SerializeToString, 707 | beacon__chain__pb2.Validators.FromString, 708 | options, channel_credentials, 709 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 710 | 711 | @staticmethod 712 | def GetValidator(request, 713 | target, 714 | options=(), 715 | channel_credentials=None, 716 | call_credentials=None, 717 | insecure=False, 718 | compression=None, 719 | wait_for_ready=None, 720 | timeout=None, 721 | metadata=None): 722 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidator', 723 | beacon__chain__pb2.GetValidatorRequest.SerializeToString, 724 | validator__pb2.Validator.FromString, 725 | options, channel_credentials, 726 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 727 | 728 | @staticmethod 729 | def GetValidatorActiveSetChanges(request, 730 | target, 731 | options=(), 732 | channel_credentials=None, 733 | call_credentials=None, 734 | insecure=False, 735 | compression=None, 736 | wait_for_ready=None, 737 | timeout=None, 738 | metadata=None): 739 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges', 740 | beacon__chain__pb2.GetValidatorActiveSetChangesRequest.SerializeToString, 741 | beacon__chain__pb2.ActiveSetChanges.FromString, 742 | options, channel_credentials, 743 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 744 | 745 | @staticmethod 746 | def GetValidatorQueue(request, 747 | target, 748 | options=(), 749 | channel_credentials=None, 750 | call_credentials=None, 751 | insecure=False, 752 | compression=None, 753 | wait_for_ready=None, 754 | timeout=None, 755 | metadata=None): 756 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue', 757 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 758 | beacon__chain__pb2.ValidatorQueue.FromString, 759 | options, channel_credentials, 760 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 761 | 762 | @staticmethod 763 | def GetValidatorPerformance(request, 764 | target, 765 | options=(), 766 | channel_credentials=None, 767 | call_credentials=None, 768 | insecure=False, 769 | compression=None, 770 | wait_for_ready=None, 771 | timeout=None, 772 | metadata=None): 773 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance', 774 | beacon__chain__pb2.ValidatorPerformanceRequest.SerializeToString, 775 | beacon__chain__pb2.ValidatorPerformanceResponse.FromString, 776 | options, channel_credentials, 777 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 778 | 779 | @staticmethod 780 | def ListValidatorAssignments(request, 781 | target, 782 | options=(), 783 | channel_credentials=None, 784 | call_credentials=None, 785 | insecure=False, 786 | compression=None, 787 | wait_for_ready=None, 788 | timeout=None, 789 | metadata=None): 790 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments', 791 | beacon__chain__pb2.ListValidatorAssignmentsRequest.SerializeToString, 792 | beacon__chain__pb2.ValidatorAssignments.FromString, 793 | options, channel_credentials, 794 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 795 | 796 | @staticmethod 797 | def GetValidatorParticipation(request, 798 | target, 799 | options=(), 800 | channel_credentials=None, 801 | call_credentials=None, 802 | insecure=False, 803 | compression=None, 804 | wait_for_ready=None, 805 | timeout=None, 806 | metadata=None): 807 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation', 808 | beacon__chain__pb2.GetValidatorParticipationRequest.SerializeToString, 809 | beacon__chain__pb2.ValidatorParticipationResponse.FromString, 810 | options, channel_credentials, 811 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 812 | 813 | @staticmethod 814 | def GetBeaconConfig(request, 815 | target, 816 | options=(), 817 | channel_credentials=None, 818 | call_credentials=None, 819 | insecure=False, 820 | compression=None, 821 | wait_for_ready=None, 822 | timeout=None, 823 | metadata=None): 824 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig', 825 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 826 | beacon__chain__pb2.BeaconConfig.FromString, 827 | options, channel_credentials, 828 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 829 | 830 | @staticmethod 831 | def StreamValidatorsInfo(request_iterator, 832 | target, 833 | options=(), 834 | channel_credentials=None, 835 | call_credentials=None, 836 | insecure=False, 837 | compression=None, 838 | wait_for_ready=None, 839 | timeout=None, 840 | metadata=None): 841 | return grpc.experimental.stream_stream(request_iterator, target, '/ethereum.eth.v1alpha1.BeaconChain/StreamValidatorsInfo', 842 | beacon__chain__pb2.ValidatorChangeSet.SerializeToString, 843 | validator__pb2.ValidatorInfo.FromString, 844 | options, channel_credentials, 845 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 846 | 847 | @staticmethod 848 | def SubmitAttesterSlashing(request, 849 | target, 850 | options=(), 851 | channel_credentials=None, 852 | call_credentials=None, 853 | insecure=False, 854 | compression=None, 855 | wait_for_ready=None, 856 | timeout=None, 857 | metadata=None): 858 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing', 859 | beacon__block__pb2.AttesterSlashing.SerializeToString, 860 | beacon__chain__pb2.SubmitSlashingResponse.FromString, 861 | options, channel_credentials, 862 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 863 | 864 | @staticmethod 865 | def SubmitProposerSlashing(request, 866 | target, 867 | options=(), 868 | channel_credentials=None, 869 | call_credentials=None, 870 | insecure=False, 871 | compression=None, 872 | wait_for_ready=None, 873 | timeout=None, 874 | metadata=None): 875 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing', 876 | beacon__block__pb2.ProposerSlashing.SerializeToString, 877 | beacon__chain__pb2.SubmitSlashingResponse.FromString, 878 | options, channel_credentials, 879 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 880 | 881 | @staticmethod 882 | def GetIndividualVotes(request, 883 | target, 884 | options=(), 885 | channel_credentials=None, 886 | call_credentials=None, 887 | insecure=False, 888 | compression=None, 889 | wait_for_ready=None, 890 | timeout=None, 891 | metadata=None): 892 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes', 893 | beacon__chain__pb2.IndividualVotesRequest.SerializeToString, 894 | beacon__chain__pb2.IndividualVotesRespond.FromString, 895 | options, channel_credentials, 896 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 897 | -------------------------------------------------------------------------------- /node_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: node.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import enum_type_wrapper 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import message as _message 8 | from google.protobuf import reflection as _reflection 9 | from google.protobuf import symbol_database as _symbol_database 10 | # @@protoc_insertion_point(imports) 11 | 12 | _sym_db = _symbol_database.Default() 13 | 14 | 15 | from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 16 | from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 17 | from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 18 | 19 | 20 | DESCRIPTOR = _descriptor.FileDescriptor( 21 | name='node.proto', 22 | package='ethereum.eth.v1alpha1', 23 | syntax='proto3', 24 | serialized_options=b'\n\031org.ethereum.eth.v1alpha1B\tNodeProtoP\001Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\252\002\025Ethereum.Eth.v1alpha1\312\002\025Ethereum\\Eth\\v1alpha1', 25 | create_key=_descriptor._internal_create_key, 26 | serialized_pb=b'\n\nnode.proto\x12\x15\x65thereum.eth.v1alpha1\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1d\n\nSyncStatus\x12\x0f\n\x07syncing\x18\x01 \x01(\x08\"~\n\x07Genesis\x12\x30\n\x0cgenesis_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12 \n\x18\x64\x65posit_contract_address\x18\x02 \x01(\x0c\x12\x1f\n\x17genesis_validators_root\x18\x03 \x01(\x0c\",\n\x07Version\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x10\n\x08metadata\x18\x02 \x01(\t\"\'\n\x13ImplementedServices\x12\x10\n\x08services\x18\x01 \x03(\t\"\x1e\n\x0bPeerRequest\x12\x0f\n\x07peer_id\x18\x01 \x01(\t\"3\n\x05Peers\x12*\n\x05peers\x18\x01 \x03(\x0b\x32\x1b.ethereum.eth.v1alpha1.Peer\"\xb0\x01\n\x04Peer\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x37\n\tdirection\x18\x02 \x01(\x0e\x32$.ethereum.eth.v1alpha1.PeerDirection\x12@\n\x10\x63onnection_state\x18\x03 \x01(\x0e\x32&.ethereum.eth.v1alpha1.ConnectionState\x12\x0f\n\x07peer_id\x18\x04 \x01(\t\x12\x0b\n\x03\x65nr\x18\x05 \x01(\t\";\n\x08HostData\x12\x11\n\taddresses\x18\x01 \x03(\t\x12\x0f\n\x07peer_id\x18\x02 \x01(\t\x12\x0b\n\x03\x65nr\x18\x03 \x01(\t*7\n\rPeerDirection\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07INBOUND\x10\x01\x12\x0c\n\x08OUTBOUND\x10\x02*U\n\x0f\x43onnectionState\x12\x10\n\x0c\x44ISCONNECTED\x10\x00\x12\x11\n\rDISCONNECTING\x10\x01\x12\r\n\tCONNECTED\x10\x02\x12\x0e\n\nCONNECTING\x10\x03\x32\x85\x06\n\x04Node\x12n\n\rGetSyncStatus\x12\x16.google.protobuf.Empty\x1a!.ethereum.eth.v1alpha1.SyncStatus\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/eth/v1alpha1/node/syncing\x12h\n\nGetGenesis\x12\x16.google.protobuf.Empty\x1a\x1e.ethereum.eth.v1alpha1.Genesis\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/eth/v1alpha1/node/genesis\x12h\n\nGetVersion\x12\x16.google.protobuf.Empty\x1a\x1e.ethereum.eth.v1alpha1.Version\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/eth/v1alpha1/node/version\x12\x82\x01\n\x17ListImplementedServices\x12\x16.google.protobuf.Empty\x1a*.ethereum.eth.v1alpha1.ImplementedServices\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/eth/v1alpha1/node/services\x12\x62\n\x07GetHost\x12\x16.google.protobuf.Empty\x1a\x1f.ethereum.eth.v1alpha1.HostData\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/eth/v1alpha1/node/p2p\x12k\n\x07GetPeer\x12\".ethereum.eth.v1alpha1.PeerRequest\x1a\x1b.ethereum.eth.v1alpha1.Peer\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/eth/v1alpha1/node/peer\x12\x63\n\tListPeers\x12\x16.google.protobuf.Empty\x1a\x1c.ethereum.eth.v1alpha1.Peers\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/eth/v1alpha1/node/peersB\x90\x01\n\x19org.ethereum.eth.v1alpha1B\tNodeProtoP\x01Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\xaa\x02\x15\x45thereum.Eth.v1alpha1\xca\x02\x15\x45thereum\\Eth\\v1alpha1b\x06proto3' 27 | , 28 | dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) 29 | 30 | _PEERDIRECTION = _descriptor.EnumDescriptor( 31 | name='PeerDirection', 32 | full_name='ethereum.eth.v1alpha1.PeerDirection', 33 | filename=None, 34 | file=DESCRIPTOR, 35 | create_key=_descriptor._internal_create_key, 36 | values=[ 37 | _descriptor.EnumValueDescriptor( 38 | name='UNKNOWN', index=0, number=0, 39 | serialized_options=None, 40 | type=None, 41 | create_key=_descriptor._internal_create_key), 42 | _descriptor.EnumValueDescriptor( 43 | name='INBOUND', index=1, number=1, 44 | serialized_options=None, 45 | type=None, 46 | create_key=_descriptor._internal_create_key), 47 | _descriptor.EnumValueDescriptor( 48 | name='OUTBOUND', index=2, number=2, 49 | serialized_options=None, 50 | type=None, 51 | create_key=_descriptor._internal_create_key), 52 | ], 53 | containing_type=None, 54 | serialized_options=None, 55 | serialized_start=700, 56 | serialized_end=755, 57 | ) 58 | _sym_db.RegisterEnumDescriptor(_PEERDIRECTION) 59 | 60 | PeerDirection = enum_type_wrapper.EnumTypeWrapper(_PEERDIRECTION) 61 | _CONNECTIONSTATE = _descriptor.EnumDescriptor( 62 | name='ConnectionState', 63 | full_name='ethereum.eth.v1alpha1.ConnectionState', 64 | filename=None, 65 | file=DESCRIPTOR, 66 | create_key=_descriptor._internal_create_key, 67 | values=[ 68 | _descriptor.EnumValueDescriptor( 69 | name='DISCONNECTED', index=0, number=0, 70 | serialized_options=None, 71 | type=None, 72 | create_key=_descriptor._internal_create_key), 73 | _descriptor.EnumValueDescriptor( 74 | name='DISCONNECTING', index=1, number=1, 75 | serialized_options=None, 76 | type=None, 77 | create_key=_descriptor._internal_create_key), 78 | _descriptor.EnumValueDescriptor( 79 | name='CONNECTED', index=2, number=2, 80 | serialized_options=None, 81 | type=None, 82 | create_key=_descriptor._internal_create_key), 83 | _descriptor.EnumValueDescriptor( 84 | name='CONNECTING', index=3, number=3, 85 | serialized_options=None, 86 | type=None, 87 | create_key=_descriptor._internal_create_key), 88 | ], 89 | containing_type=None, 90 | serialized_options=None, 91 | serialized_start=757, 92 | serialized_end=842, 93 | ) 94 | _sym_db.RegisterEnumDescriptor(_CONNECTIONSTATE) 95 | 96 | ConnectionState = enum_type_wrapper.EnumTypeWrapper(_CONNECTIONSTATE) 97 | UNKNOWN = 0 98 | INBOUND = 1 99 | OUTBOUND = 2 100 | DISCONNECTED = 0 101 | DISCONNECTING = 1 102 | CONNECTED = 2 103 | CONNECTING = 3 104 | 105 | 106 | 107 | _SYNCSTATUS = _descriptor.Descriptor( 108 | name='SyncStatus', 109 | full_name='ethereum.eth.v1alpha1.SyncStatus', 110 | filename=None, 111 | file=DESCRIPTOR, 112 | containing_type=None, 113 | create_key=_descriptor._internal_create_key, 114 | fields=[ 115 | _descriptor.FieldDescriptor( 116 | name='syncing', full_name='ethereum.eth.v1alpha1.SyncStatus.syncing', index=0, 117 | number=1, type=8, cpp_type=7, label=1, 118 | has_default_value=False, default_value=False, 119 | message_type=None, enum_type=None, containing_type=None, 120 | is_extension=False, extension_scope=None, 121 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 122 | ], 123 | extensions=[ 124 | ], 125 | nested_types=[], 126 | enum_types=[ 127 | ], 128 | serialized_options=None, 129 | is_extendable=False, 130 | syntax='proto3', 131 | extension_ranges=[], 132 | oneofs=[ 133 | ], 134 | serialized_start=129, 135 | serialized_end=158, 136 | ) 137 | 138 | 139 | _GENESIS = _descriptor.Descriptor( 140 | name='Genesis', 141 | full_name='ethereum.eth.v1alpha1.Genesis', 142 | filename=None, 143 | file=DESCRIPTOR, 144 | containing_type=None, 145 | create_key=_descriptor._internal_create_key, 146 | fields=[ 147 | _descriptor.FieldDescriptor( 148 | name='genesis_time', full_name='ethereum.eth.v1alpha1.Genesis.genesis_time', index=0, 149 | number=1, type=11, cpp_type=10, label=1, 150 | has_default_value=False, default_value=None, 151 | message_type=None, enum_type=None, containing_type=None, 152 | is_extension=False, extension_scope=None, 153 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 154 | _descriptor.FieldDescriptor( 155 | name='deposit_contract_address', full_name='ethereum.eth.v1alpha1.Genesis.deposit_contract_address', index=1, 156 | number=2, type=12, cpp_type=9, label=1, 157 | has_default_value=False, default_value=b"", 158 | message_type=None, enum_type=None, containing_type=None, 159 | is_extension=False, extension_scope=None, 160 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 161 | _descriptor.FieldDescriptor( 162 | name='genesis_validators_root', full_name='ethereum.eth.v1alpha1.Genesis.genesis_validators_root', index=2, 163 | number=3, type=12, cpp_type=9, label=1, 164 | has_default_value=False, default_value=b"", 165 | message_type=None, enum_type=None, containing_type=None, 166 | is_extension=False, extension_scope=None, 167 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 168 | ], 169 | extensions=[ 170 | ], 171 | nested_types=[], 172 | enum_types=[ 173 | ], 174 | serialized_options=None, 175 | is_extendable=False, 176 | syntax='proto3', 177 | extension_ranges=[], 178 | oneofs=[ 179 | ], 180 | serialized_start=160, 181 | serialized_end=286, 182 | ) 183 | 184 | 185 | _VERSION = _descriptor.Descriptor( 186 | name='Version', 187 | full_name='ethereum.eth.v1alpha1.Version', 188 | filename=None, 189 | file=DESCRIPTOR, 190 | containing_type=None, 191 | create_key=_descriptor._internal_create_key, 192 | fields=[ 193 | _descriptor.FieldDescriptor( 194 | name='version', full_name='ethereum.eth.v1alpha1.Version.version', index=0, 195 | number=1, type=9, cpp_type=9, label=1, 196 | has_default_value=False, default_value=b"".decode('utf-8'), 197 | message_type=None, enum_type=None, containing_type=None, 198 | is_extension=False, extension_scope=None, 199 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 200 | _descriptor.FieldDescriptor( 201 | name='metadata', full_name='ethereum.eth.v1alpha1.Version.metadata', index=1, 202 | number=2, type=9, cpp_type=9, label=1, 203 | has_default_value=False, default_value=b"".decode('utf-8'), 204 | message_type=None, enum_type=None, containing_type=None, 205 | is_extension=False, extension_scope=None, 206 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 207 | ], 208 | extensions=[ 209 | ], 210 | nested_types=[], 211 | enum_types=[ 212 | ], 213 | serialized_options=None, 214 | is_extendable=False, 215 | syntax='proto3', 216 | extension_ranges=[], 217 | oneofs=[ 218 | ], 219 | serialized_start=288, 220 | serialized_end=332, 221 | ) 222 | 223 | 224 | _IMPLEMENTEDSERVICES = _descriptor.Descriptor( 225 | name='ImplementedServices', 226 | full_name='ethereum.eth.v1alpha1.ImplementedServices', 227 | filename=None, 228 | file=DESCRIPTOR, 229 | containing_type=None, 230 | create_key=_descriptor._internal_create_key, 231 | fields=[ 232 | _descriptor.FieldDescriptor( 233 | name='services', full_name='ethereum.eth.v1alpha1.ImplementedServices.services', index=0, 234 | number=1, type=9, cpp_type=9, label=3, 235 | has_default_value=False, default_value=[], 236 | message_type=None, enum_type=None, containing_type=None, 237 | is_extension=False, extension_scope=None, 238 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 239 | ], 240 | extensions=[ 241 | ], 242 | nested_types=[], 243 | enum_types=[ 244 | ], 245 | serialized_options=None, 246 | is_extendable=False, 247 | syntax='proto3', 248 | extension_ranges=[], 249 | oneofs=[ 250 | ], 251 | serialized_start=334, 252 | serialized_end=373, 253 | ) 254 | 255 | 256 | _PEERREQUEST = _descriptor.Descriptor( 257 | name='PeerRequest', 258 | full_name='ethereum.eth.v1alpha1.PeerRequest', 259 | filename=None, 260 | file=DESCRIPTOR, 261 | containing_type=None, 262 | create_key=_descriptor._internal_create_key, 263 | fields=[ 264 | _descriptor.FieldDescriptor( 265 | name='peer_id', full_name='ethereum.eth.v1alpha1.PeerRequest.peer_id', index=0, 266 | number=1, type=9, cpp_type=9, label=1, 267 | has_default_value=False, default_value=b"".decode('utf-8'), 268 | message_type=None, enum_type=None, containing_type=None, 269 | is_extension=False, extension_scope=None, 270 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 271 | ], 272 | extensions=[ 273 | ], 274 | nested_types=[], 275 | enum_types=[ 276 | ], 277 | serialized_options=None, 278 | is_extendable=False, 279 | syntax='proto3', 280 | extension_ranges=[], 281 | oneofs=[ 282 | ], 283 | serialized_start=375, 284 | serialized_end=405, 285 | ) 286 | 287 | 288 | _PEERS = _descriptor.Descriptor( 289 | name='Peers', 290 | full_name='ethereum.eth.v1alpha1.Peers', 291 | filename=None, 292 | file=DESCRIPTOR, 293 | containing_type=None, 294 | create_key=_descriptor._internal_create_key, 295 | fields=[ 296 | _descriptor.FieldDescriptor( 297 | name='peers', full_name='ethereum.eth.v1alpha1.Peers.peers', index=0, 298 | number=1, type=11, cpp_type=10, label=3, 299 | has_default_value=False, default_value=[], 300 | message_type=None, enum_type=None, containing_type=None, 301 | is_extension=False, extension_scope=None, 302 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 303 | ], 304 | extensions=[ 305 | ], 306 | nested_types=[], 307 | enum_types=[ 308 | ], 309 | serialized_options=None, 310 | is_extendable=False, 311 | syntax='proto3', 312 | extension_ranges=[], 313 | oneofs=[ 314 | ], 315 | serialized_start=407, 316 | serialized_end=458, 317 | ) 318 | 319 | 320 | _PEER = _descriptor.Descriptor( 321 | name='Peer', 322 | full_name='ethereum.eth.v1alpha1.Peer', 323 | filename=None, 324 | file=DESCRIPTOR, 325 | containing_type=None, 326 | create_key=_descriptor._internal_create_key, 327 | fields=[ 328 | _descriptor.FieldDescriptor( 329 | name='address', full_name='ethereum.eth.v1alpha1.Peer.address', index=0, 330 | number=1, type=9, cpp_type=9, label=1, 331 | has_default_value=False, default_value=b"".decode('utf-8'), 332 | message_type=None, enum_type=None, containing_type=None, 333 | is_extension=False, extension_scope=None, 334 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 335 | _descriptor.FieldDescriptor( 336 | name='direction', full_name='ethereum.eth.v1alpha1.Peer.direction', index=1, 337 | number=2, type=14, cpp_type=8, label=1, 338 | has_default_value=False, default_value=0, 339 | message_type=None, enum_type=None, containing_type=None, 340 | is_extension=False, extension_scope=None, 341 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 342 | _descriptor.FieldDescriptor( 343 | name='connection_state', full_name='ethereum.eth.v1alpha1.Peer.connection_state', index=2, 344 | number=3, type=14, cpp_type=8, label=1, 345 | has_default_value=False, default_value=0, 346 | message_type=None, enum_type=None, containing_type=None, 347 | is_extension=False, extension_scope=None, 348 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 349 | _descriptor.FieldDescriptor( 350 | name='peer_id', full_name='ethereum.eth.v1alpha1.Peer.peer_id', index=3, 351 | number=4, type=9, cpp_type=9, label=1, 352 | has_default_value=False, default_value=b"".decode('utf-8'), 353 | message_type=None, enum_type=None, containing_type=None, 354 | is_extension=False, extension_scope=None, 355 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 356 | _descriptor.FieldDescriptor( 357 | name='enr', full_name='ethereum.eth.v1alpha1.Peer.enr', index=4, 358 | number=5, type=9, cpp_type=9, label=1, 359 | has_default_value=False, default_value=b"".decode('utf-8'), 360 | message_type=None, enum_type=None, containing_type=None, 361 | is_extension=False, extension_scope=None, 362 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 363 | ], 364 | extensions=[ 365 | ], 366 | nested_types=[], 367 | enum_types=[ 368 | ], 369 | serialized_options=None, 370 | is_extendable=False, 371 | syntax='proto3', 372 | extension_ranges=[], 373 | oneofs=[ 374 | ], 375 | serialized_start=461, 376 | serialized_end=637, 377 | ) 378 | 379 | 380 | _HOSTDATA = _descriptor.Descriptor( 381 | name='HostData', 382 | full_name='ethereum.eth.v1alpha1.HostData', 383 | filename=None, 384 | file=DESCRIPTOR, 385 | containing_type=None, 386 | create_key=_descriptor._internal_create_key, 387 | fields=[ 388 | _descriptor.FieldDescriptor( 389 | name='addresses', full_name='ethereum.eth.v1alpha1.HostData.addresses', index=0, 390 | number=1, type=9, cpp_type=9, label=3, 391 | has_default_value=False, default_value=[], 392 | message_type=None, enum_type=None, containing_type=None, 393 | is_extension=False, extension_scope=None, 394 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 395 | _descriptor.FieldDescriptor( 396 | name='peer_id', full_name='ethereum.eth.v1alpha1.HostData.peer_id', index=1, 397 | number=2, type=9, cpp_type=9, label=1, 398 | has_default_value=False, default_value=b"".decode('utf-8'), 399 | message_type=None, enum_type=None, containing_type=None, 400 | is_extension=False, extension_scope=None, 401 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 402 | _descriptor.FieldDescriptor( 403 | name='enr', full_name='ethereum.eth.v1alpha1.HostData.enr', index=2, 404 | number=3, type=9, cpp_type=9, label=1, 405 | has_default_value=False, default_value=b"".decode('utf-8'), 406 | message_type=None, enum_type=None, containing_type=None, 407 | is_extension=False, extension_scope=None, 408 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 409 | ], 410 | extensions=[ 411 | ], 412 | nested_types=[], 413 | enum_types=[ 414 | ], 415 | serialized_options=None, 416 | is_extendable=False, 417 | syntax='proto3', 418 | extension_ranges=[], 419 | oneofs=[ 420 | ], 421 | serialized_start=639, 422 | serialized_end=698, 423 | ) 424 | 425 | _GENESIS.fields_by_name['genesis_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP 426 | _PEERS.fields_by_name['peers'].message_type = _PEER 427 | _PEER.fields_by_name['direction'].enum_type = _PEERDIRECTION 428 | _PEER.fields_by_name['connection_state'].enum_type = _CONNECTIONSTATE 429 | DESCRIPTOR.message_types_by_name['SyncStatus'] = _SYNCSTATUS 430 | DESCRIPTOR.message_types_by_name['Genesis'] = _GENESIS 431 | DESCRIPTOR.message_types_by_name['Version'] = _VERSION 432 | DESCRIPTOR.message_types_by_name['ImplementedServices'] = _IMPLEMENTEDSERVICES 433 | DESCRIPTOR.message_types_by_name['PeerRequest'] = _PEERREQUEST 434 | DESCRIPTOR.message_types_by_name['Peers'] = _PEERS 435 | DESCRIPTOR.message_types_by_name['Peer'] = _PEER 436 | DESCRIPTOR.message_types_by_name['HostData'] = _HOSTDATA 437 | DESCRIPTOR.enum_types_by_name['PeerDirection'] = _PEERDIRECTION 438 | DESCRIPTOR.enum_types_by_name['ConnectionState'] = _CONNECTIONSTATE 439 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 440 | 441 | SyncStatus = _reflection.GeneratedProtocolMessageType('SyncStatus', (_message.Message,), { 442 | 'DESCRIPTOR' : _SYNCSTATUS, 443 | '__module__' : 'node_pb2' 444 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.SyncStatus) 445 | }) 446 | _sym_db.RegisterMessage(SyncStatus) 447 | 448 | Genesis = _reflection.GeneratedProtocolMessageType('Genesis', (_message.Message,), { 449 | 'DESCRIPTOR' : _GENESIS, 450 | '__module__' : 'node_pb2' 451 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Genesis) 452 | }) 453 | _sym_db.RegisterMessage(Genesis) 454 | 455 | Version = _reflection.GeneratedProtocolMessageType('Version', (_message.Message,), { 456 | 'DESCRIPTOR' : _VERSION, 457 | '__module__' : 'node_pb2' 458 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Version) 459 | }) 460 | _sym_db.RegisterMessage(Version) 461 | 462 | ImplementedServices = _reflection.GeneratedProtocolMessageType('ImplementedServices', (_message.Message,), { 463 | 'DESCRIPTOR' : _IMPLEMENTEDSERVICES, 464 | '__module__' : 'node_pb2' 465 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.ImplementedServices) 466 | }) 467 | _sym_db.RegisterMessage(ImplementedServices) 468 | 469 | PeerRequest = _reflection.GeneratedProtocolMessageType('PeerRequest', (_message.Message,), { 470 | 'DESCRIPTOR' : _PEERREQUEST, 471 | '__module__' : 'node_pb2' 472 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.PeerRequest) 473 | }) 474 | _sym_db.RegisterMessage(PeerRequest) 475 | 476 | Peers = _reflection.GeneratedProtocolMessageType('Peers', (_message.Message,), { 477 | 'DESCRIPTOR' : _PEERS, 478 | '__module__' : 'node_pb2' 479 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Peers) 480 | }) 481 | _sym_db.RegisterMessage(Peers) 482 | 483 | Peer = _reflection.GeneratedProtocolMessageType('Peer', (_message.Message,), { 484 | 'DESCRIPTOR' : _PEER, 485 | '__module__' : 'node_pb2' 486 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.Peer) 487 | }) 488 | _sym_db.RegisterMessage(Peer) 489 | 490 | HostData = _reflection.GeneratedProtocolMessageType('HostData', (_message.Message,), { 491 | 'DESCRIPTOR' : _HOSTDATA, 492 | '__module__' : 'node_pb2' 493 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.HostData) 494 | }) 495 | _sym_db.RegisterMessage(HostData) 496 | 497 | 498 | DESCRIPTOR._options = None 499 | 500 | _NODE = _descriptor.ServiceDescriptor( 501 | name='Node', 502 | full_name='ethereum.eth.v1alpha1.Node', 503 | file=DESCRIPTOR, 504 | index=0, 505 | serialized_options=None, 506 | create_key=_descriptor._internal_create_key, 507 | serialized_start=845, 508 | serialized_end=1618, 509 | methods=[ 510 | _descriptor.MethodDescriptor( 511 | name='GetSyncStatus', 512 | full_name='ethereum.eth.v1alpha1.Node.GetSyncStatus', 513 | index=0, 514 | containing_service=None, 515 | input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, 516 | output_type=_SYNCSTATUS, 517 | serialized_options=b'\202\323\344\223\002\034\022\032/eth/v1alpha1/node/syncing', 518 | create_key=_descriptor._internal_create_key, 519 | ), 520 | _descriptor.MethodDescriptor( 521 | name='GetGenesis', 522 | full_name='ethereum.eth.v1alpha1.Node.GetGenesis', 523 | index=1, 524 | containing_service=None, 525 | input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, 526 | output_type=_GENESIS, 527 | serialized_options=b'\202\323\344\223\002\034\022\032/eth/v1alpha1/node/genesis', 528 | create_key=_descriptor._internal_create_key, 529 | ), 530 | _descriptor.MethodDescriptor( 531 | name='GetVersion', 532 | full_name='ethereum.eth.v1alpha1.Node.GetVersion', 533 | index=2, 534 | containing_service=None, 535 | input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, 536 | output_type=_VERSION, 537 | serialized_options=b'\202\323\344\223\002\034\022\032/eth/v1alpha1/node/version', 538 | create_key=_descriptor._internal_create_key, 539 | ), 540 | _descriptor.MethodDescriptor( 541 | name='ListImplementedServices', 542 | full_name='ethereum.eth.v1alpha1.Node.ListImplementedServices', 543 | index=3, 544 | containing_service=None, 545 | input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, 546 | output_type=_IMPLEMENTEDSERVICES, 547 | serialized_options=b'\202\323\344\223\002\035\022\033/eth/v1alpha1/node/services', 548 | create_key=_descriptor._internal_create_key, 549 | ), 550 | _descriptor.MethodDescriptor( 551 | name='GetHost', 552 | full_name='ethereum.eth.v1alpha1.Node.GetHost', 553 | index=4, 554 | containing_service=None, 555 | input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, 556 | output_type=_HOSTDATA, 557 | serialized_options=b'\202\323\344\223\002\030\022\026/eth/v1alpha1/node/p2p', 558 | create_key=_descriptor._internal_create_key, 559 | ), 560 | _descriptor.MethodDescriptor( 561 | name='GetPeer', 562 | full_name='ethereum.eth.v1alpha1.Node.GetPeer', 563 | index=5, 564 | containing_service=None, 565 | input_type=_PEERREQUEST, 566 | output_type=_PEER, 567 | serialized_options=b'\202\323\344\223\002\031\022\027/eth/v1alpha1/node/peer', 568 | create_key=_descriptor._internal_create_key, 569 | ), 570 | _descriptor.MethodDescriptor( 571 | name='ListPeers', 572 | full_name='ethereum.eth.v1alpha1.Node.ListPeers', 573 | index=6, 574 | containing_service=None, 575 | input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, 576 | output_type=_PEERS, 577 | serialized_options=b'\202\323\344\223\002\032\022\030/eth/v1alpha1/node/peers', 578 | create_key=_descriptor._internal_create_key, 579 | ), 580 | ]) 581 | _sym_db.RegisterServiceDescriptor(_NODE) 582 | 583 | DESCRIPTOR.services_by_name['Node'] = _NODE 584 | 585 | # @@protoc_insertion_point(module_scope) 586 | -------------------------------------------------------------------------------- /node_pb2_grpc.py: -------------------------------------------------------------------------------- 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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 6 | import node_pb2 as node__pb2 7 | 8 | 9 | class NodeStub(object): 10 | """Node service API 11 | 12 | Node service provides general information about the node itself, the services 13 | it supports, chain information and node version. 14 | """ 15 | 16 | def __init__(self, channel): 17 | """Constructor. 18 | 19 | Args: 20 | channel: A grpc.Channel. 21 | """ 22 | self.GetSyncStatus = channel.unary_unary( 23 | '/ethereum.eth.v1alpha1.Node/GetSyncStatus', 24 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 25 | response_deserializer=node__pb2.SyncStatus.FromString, 26 | ) 27 | self.GetGenesis = channel.unary_unary( 28 | '/ethereum.eth.v1alpha1.Node/GetGenesis', 29 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 30 | response_deserializer=node__pb2.Genesis.FromString, 31 | ) 32 | self.GetVersion = channel.unary_unary( 33 | '/ethereum.eth.v1alpha1.Node/GetVersion', 34 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 35 | response_deserializer=node__pb2.Version.FromString, 36 | ) 37 | self.ListImplementedServices = channel.unary_unary( 38 | '/ethereum.eth.v1alpha1.Node/ListImplementedServices', 39 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 40 | response_deserializer=node__pb2.ImplementedServices.FromString, 41 | ) 42 | self.GetHost = channel.unary_unary( 43 | '/ethereum.eth.v1alpha1.Node/GetHost', 44 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 45 | response_deserializer=node__pb2.HostData.FromString, 46 | ) 47 | self.GetPeer = channel.unary_unary( 48 | '/ethereum.eth.v1alpha1.Node/GetPeer', 49 | request_serializer=node__pb2.PeerRequest.SerializeToString, 50 | response_deserializer=node__pb2.Peer.FromString, 51 | ) 52 | self.ListPeers = channel.unary_unary( 53 | '/ethereum.eth.v1alpha1.Node/ListPeers', 54 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 55 | response_deserializer=node__pb2.Peers.FromString, 56 | ) 57 | 58 | 59 | class NodeServicer(object): 60 | """Node service API 61 | 62 | Node service provides general information about the node itself, the services 63 | it supports, chain information and node version. 64 | """ 65 | 66 | def GetSyncStatus(self, request, context): 67 | """Retrieve the current network sync status of the node. 68 | """ 69 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 70 | context.set_details('Method not implemented!') 71 | raise NotImplementedError('Method not implemented!') 72 | 73 | def GetGenesis(self, request, context): 74 | """Retrieve information about the genesis of Ethereum 2.0. 75 | """ 76 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 77 | context.set_details('Method not implemented!') 78 | raise NotImplementedError('Method not implemented!') 79 | 80 | def GetVersion(self, request, context): 81 | """Retrieve information about the running Ethereum 2.0 node. 82 | """ 83 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 84 | context.set_details('Method not implemented!') 85 | raise NotImplementedError('Method not implemented!') 86 | 87 | def ListImplementedServices(self, request, context): 88 | """Retrieve the list of services implemented and enabled by this node. 89 | 90 | Any service not present in this list may return UNIMPLEMENTED or 91 | PERMISSION_DENIED. The server may also support fetching services by grpc 92 | reflection. 93 | """ 94 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 95 | context.set_details('Method not implemented!') 96 | raise NotImplementedError('Method not implemented!') 97 | 98 | def GetHost(self, request, context): 99 | """Retrieves the peer data of the local peer. 100 | """ 101 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 102 | context.set_details('Method not implemented!') 103 | raise NotImplementedError('Method not implemented!') 104 | 105 | def GetPeer(self, request, context): 106 | """Retrieve the peer corresponding to the provided peer id. 107 | """ 108 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 109 | context.set_details('Method not implemented!') 110 | raise NotImplementedError('Method not implemented!') 111 | 112 | def ListPeers(self, request, context): 113 | """Retrieve the list of peers currently connected to this node. 114 | """ 115 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 116 | context.set_details('Method not implemented!') 117 | raise NotImplementedError('Method not implemented!') 118 | 119 | 120 | def add_NodeServicer_to_server(servicer, server): 121 | rpc_method_handlers = { 122 | 'GetSyncStatus': grpc.unary_unary_rpc_method_handler( 123 | servicer.GetSyncStatus, 124 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 125 | response_serializer=node__pb2.SyncStatus.SerializeToString, 126 | ), 127 | 'GetGenesis': grpc.unary_unary_rpc_method_handler( 128 | servicer.GetGenesis, 129 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 130 | response_serializer=node__pb2.Genesis.SerializeToString, 131 | ), 132 | 'GetVersion': grpc.unary_unary_rpc_method_handler( 133 | servicer.GetVersion, 134 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 135 | response_serializer=node__pb2.Version.SerializeToString, 136 | ), 137 | 'ListImplementedServices': grpc.unary_unary_rpc_method_handler( 138 | servicer.ListImplementedServices, 139 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 140 | response_serializer=node__pb2.ImplementedServices.SerializeToString, 141 | ), 142 | 'GetHost': grpc.unary_unary_rpc_method_handler( 143 | servicer.GetHost, 144 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 145 | response_serializer=node__pb2.HostData.SerializeToString, 146 | ), 147 | 'GetPeer': grpc.unary_unary_rpc_method_handler( 148 | servicer.GetPeer, 149 | request_deserializer=node__pb2.PeerRequest.FromString, 150 | response_serializer=node__pb2.Peer.SerializeToString, 151 | ), 152 | 'ListPeers': grpc.unary_unary_rpc_method_handler( 153 | servicer.ListPeers, 154 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 155 | response_serializer=node__pb2.Peers.SerializeToString, 156 | ), 157 | } 158 | generic_handler = grpc.method_handlers_generic_handler( 159 | 'ethereum.eth.v1alpha1.Node', rpc_method_handlers) 160 | server.add_generic_rpc_handlers((generic_handler,)) 161 | 162 | 163 | # This class is part of an EXPERIMENTAL API. 164 | class Node(object): 165 | """Node service API 166 | 167 | Node service provides general information about the node itself, the services 168 | it supports, chain information and node version. 169 | """ 170 | 171 | @staticmethod 172 | def GetSyncStatus(request, 173 | target, 174 | options=(), 175 | channel_credentials=None, 176 | call_credentials=None, 177 | insecure=False, 178 | compression=None, 179 | wait_for_ready=None, 180 | timeout=None, 181 | metadata=None): 182 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/GetSyncStatus', 183 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 184 | node__pb2.SyncStatus.FromString, 185 | options, channel_credentials, 186 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 187 | 188 | @staticmethod 189 | def GetGenesis(request, 190 | target, 191 | options=(), 192 | channel_credentials=None, 193 | call_credentials=None, 194 | insecure=False, 195 | compression=None, 196 | wait_for_ready=None, 197 | timeout=None, 198 | metadata=None): 199 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/GetGenesis', 200 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 201 | node__pb2.Genesis.FromString, 202 | options, channel_credentials, 203 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 204 | 205 | @staticmethod 206 | def GetVersion(request, 207 | target, 208 | options=(), 209 | channel_credentials=None, 210 | call_credentials=None, 211 | insecure=False, 212 | compression=None, 213 | wait_for_ready=None, 214 | timeout=None, 215 | metadata=None): 216 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/GetVersion', 217 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 218 | node__pb2.Version.FromString, 219 | options, channel_credentials, 220 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 221 | 222 | @staticmethod 223 | def ListImplementedServices(request, 224 | target, 225 | options=(), 226 | channel_credentials=None, 227 | call_credentials=None, 228 | insecure=False, 229 | compression=None, 230 | wait_for_ready=None, 231 | timeout=None, 232 | metadata=None): 233 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/ListImplementedServices', 234 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 235 | node__pb2.ImplementedServices.FromString, 236 | options, channel_credentials, 237 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 238 | 239 | @staticmethod 240 | def GetHost(request, 241 | target, 242 | options=(), 243 | channel_credentials=None, 244 | call_credentials=None, 245 | insecure=False, 246 | compression=None, 247 | wait_for_ready=None, 248 | timeout=None, 249 | metadata=None): 250 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/GetHost', 251 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 252 | node__pb2.HostData.FromString, 253 | options, channel_credentials, 254 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 255 | 256 | @staticmethod 257 | def GetPeer(request, 258 | target, 259 | options=(), 260 | channel_credentials=None, 261 | call_credentials=None, 262 | insecure=False, 263 | compression=None, 264 | wait_for_ready=None, 265 | timeout=None, 266 | metadata=None): 267 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/GetPeer', 268 | node__pb2.PeerRequest.SerializeToString, 269 | node__pb2.Peer.FromString, 270 | options, channel_credentials, 271 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 272 | 273 | @staticmethod 274 | def ListPeers(request, 275 | target, 276 | options=(), 277 | channel_credentials=None, 278 | call_credentials=None, 279 | insecure=False, 280 | compression=None, 281 | wait_for_ready=None, 282 | timeout=None, 283 | metadata=None): 284 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.Node/ListPeers', 285 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 286 | node__pb2.Peers.FromString, 287 | options, channel_credentials, 288 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 289 | -------------------------------------------------------------------------------- /privkey_to_threshold.py: -------------------------------------------------------------------------------- 1 | # Turns a private key into a threshold key. This is NOT a DKG and only for experimental purposes 2 | # Alternatively, this can be used to turn an already existing validator into a secret shared validator; 3 | # however, if the key was compromised before the split happened, it does not help. 4 | 5 | from python_ibft.bls_threshold import eval_poly, generate_keys 6 | import sys 7 | import random 8 | import base64 9 | import py_ecc.optimized_bls12_381 as b 10 | from py_ecc.bls.g2_primatives import G1_to_pubkey 11 | 12 | if len(sys.argv) != 2: 13 | print("Usage: python privkey_to_threshold.py {privkey_as_hex}") 14 | sys.exit(1) 15 | 16 | privkey = int(sys.argv[1], base=16) 17 | printable_pubkey = G1_to_pubkey(b.multiply(b.G1, privkey)).hex() 18 | print("Generating threshold keys for validator {0}".format(printable_pubkey)) 19 | 20 | coefs = [privkey] + [random.randint(0, b.curve_order) for i in range(2)] 21 | privkeys = [eval_poly(x, coefs) for x in range(1,5)] 22 | 23 | printable_pubkeys = [G1_to_pubkey(b.multiply(b.G1, p)).hex() for p in privkeys] 24 | printable_privkeys = [base64.encodebytes(p.to_bytes(32, byteorder="big")).decode()[:-1] for p in privkeys] 25 | 26 | 27 | for i, p in enumerate(zip(printable_pubkeys, printable_privkeys)): 28 | print("Pubkey {0}:".format(i), p[0]) 29 | print("Privkey {0}:".format(i), p[1]) 30 | 31 | print() 32 | print("Copy this into validators.json:") 33 | print([{"public_key": printable_pubkey, "threshold_public_keys": printable_pubkeys}]) 34 | print() 35 | print("Unencrypted keystores for validator clients:") 36 | print() 37 | 38 | for i, p in enumerate(printable_privkeys): 39 | print("threshold_key_{0}.json".format(i)) 40 | print('{"keys":[{"validator_key":"'+p+'","withdrawal_key":""}]}') 41 | print() 42 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | grpcio 2 | py_ecc 3 | apscheduler 4 | protobuf 5 | googleapis-common-protos 6 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tmux \ 4 | new-session "python ssv_node.py 0 --port 50051; read" \; \ 5 | split-window "python ssv_node.py 1 --port 50052; read" \; \ 6 | split-window "python ssv_node.py 2 --port 50053; read" \; \ 7 | split-window "python ssv_node.py 3 --port 50054; read" \; \ 8 | split-window "bash wait.sh" \; \ 9 | select-layout tiled 10 | -------------------------------------------------------------------------------- /run_validator_clients.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Example script to run validator clients in one windows using tmux 4 | # Copy this into the validator directory of prysm repo 5 | 6 | tmux \ 7 | new-session "./validator --beacon-rpc-provider=:50051 --ssv-mode=true --disable-accounts-v2 --unencrypted-keys=threshold_key_0.json --datadir val0; read" \; \ 8 | split-window "./validator --beacon-rpc-provider=:50052 --ssv-mode=true --disable-accounts-v2 --unencrypted-keys=threshold_key_1.json --datadir val1; read" \; \ 9 | split-window "./validator --beacon-rpc-provider=:50053 --ssv-mode=true --disable-accounts-v2 --unencrypted-keys=threshold_key_2.json --datadir val2; read" \; \ 10 | split-window "./validator --beacon-rpc-provider=:50054 --ssv-mode=true --disable-accounts-v2 --unencrypted-keys=threshold_key_3.json --datadir val3; read" \; \ 11 | split-window "bash wait.sh" \; \ 12 | select-layout tiled 13 | -------------------------------------------------------------------------------- /ssv_node.py: -------------------------------------------------------------------------------- 1 | from python_ibft import ibft 2 | from python_ibft.bls_threshold import reconstruct 3 | import grpc 4 | from concurrent import futures 5 | import time 6 | from queue import Queue 7 | from collections import defaultdict 8 | from copy import deepcopy 9 | from apscheduler.schedulers.background import BackgroundScheduler 10 | from google.protobuf.empty_pb2 import Empty 11 | from datetime import datetime 12 | import json 13 | import argparse 14 | import base64 15 | 16 | # import the generated classes 17 | import ssv_pb2 18 | import ssv_pb2_grpc 19 | import validator_pb2_grpc 20 | import validator_pb2 21 | import attestation_pb2 22 | 23 | parser = argparse.ArgumentParser(description='Run SSV node.') 24 | parser.add_argument('process_id', metavar='process_id', type=int, 25 | help='The ID of the process') 26 | parser.add_argument('--parties', metavar='parties_json', type=str, default="python_ibft/parties.json", 27 | help='IBFT: JSON configuring the parties') 28 | parser.add_argument('--config', metavar='config_json', type=str, default="python_ibft/config.json", 29 | help='IBFT: JSON configuration') 30 | parser.add_argument('--privkey', metavar='privkey_json', type=str, default="", 31 | help='IBFT: JSON configuration') 32 | parser.add_argument('--port', metavar='port', type=int, default=50051, 33 | help='Incoming RPC port') 34 | parser.add_argument('--validators', metavar='validators_json', type=str, default="validators.json", 35 | help='Validator configuration') 36 | parser.add_argument('--beacon_rpc', metavar='beacon_rpc', type=str, default="localhost:4000", 37 | help='Beacon RPC Node') 38 | 39 | args = parser.parse_args() 40 | process_id = args.process_id 41 | 42 | # Global state variables 43 | streaming_event_queues = [] 44 | # Partial signature store until enough available for reconstruction 45 | partial_attestation_store = defaultdict(dict) 46 | # Store the attestation data 47 | # TODO: Replace this by loading attestation data from serialized attestation, so also nodes that didn't 48 | # get the attestation data can sign after commit quorum reached 49 | attestation_data_store = {} 50 | 51 | 52 | # Eth2 slot time logic 53 | SECONDS_PER_SLOT = 12 54 | ATTESTATION_DELAY = SECONDS_PER_SLOT // 3 55 | 56 | 57 | def get_current_slot(): 58 | return (time.time() - genesis_time) // SECONDS_PER_SLOT 59 | 60 | def get_slot_time(slot): 61 | return slot * SECONDS_PER_SLOT + genesis_time 62 | 63 | # open a gRPC channel to the beacon node 64 | channel = grpc.insecure_channel(args.beacon_rpc) 65 | 66 | 67 | def get_attestation_and_sign(slot, committee_index): 68 | request = validator_pb2.AttestationDataRequest(slot=slot, committee_index=committee_index) 69 | response = stub.GetAttestationData(request) 70 | attestation = response 71 | ibft.start_instance(attestation.target.epoch, base64.encodebytes(attestation.SerializeToString()).decode("utf-8"), decision_callback=decision_callback) 72 | 73 | 74 | def decision_callback(serialized_attestation): 75 | attestation = attestation_pb2.AttestationData() 76 | attestation.ParseFromString(base64.decodebytes(serialized_attestation.encode("utf-8"))) #.decode("iso8859_15") 77 | for request, stream in streaming_event_queues: 78 | task = ssv_pb2.SSVTask(public_key=threshold_public_keys[process_id], 79 | topic=ssv_pb2.SIGN_ATTESTATION, 80 | attestation=attestation) 81 | stream.put(task) 82 | 83 | 84 | # Broadcast callback -- this is called by the IBFT library when a partial signature is broadcast 85 | # Need to aggregate and reconstruct if we have more than the threshold 86 | def broadcast_callback(msg, sender): 87 | if msg["type"] == "signed_attestation": 88 | print("Received signed attestation from process_id={0}".format(sender)) 89 | partial_attestation_store[msg["attestation"]][sender] = bytes.fromhex(msg["signature"]) 90 | 91 | if len(partial_attestation_store[msg["attestation"]]) == 3: 92 | print("Got 3 attestation signatures, ready to reconstruct") 93 | store = deepcopy(partial_attestation_store[msg["attestation"]]) 94 | full_signature = reconstruct(store) 95 | attestation = attestation_data_store[msg["attestation"]] 96 | attestation.signature = full_signature 97 | 98 | x = stub.ProposeAttestation(attestation) 99 | print(x) 100 | 101 | 102 | ibft.broadcast_callback = broadcast_callback 103 | 104 | 105 | # GRPC Server that implements the SSV streaming endpoint (sends attestations for VC to sign) 106 | class SSVServicer(ssv_pb2_grpc.SSVServicer): 107 | 108 | def GetTaskStream(self, request, context): 109 | print("Validator node connected") 110 | stream = Queue() 111 | streaming_event_queues.append((request, stream)) 112 | while True: 113 | response = stream.get() 114 | yield response 115 | 116 | 117 | # GRPC server that implements pass-through endpoints to the beacon node 118 | class BeaconProxy(validator_pb2_grpc.BeaconNodeValidatorServicer): 119 | 120 | def DomainData(self, request, context): 121 | return stub.DomainData(request) 122 | 123 | 124 | def ProposeAttestation(self, request, context): 125 | serialized = base64.encodebytes(request.data.SerializeToString()).decode("utf-8") 126 | 127 | attestation_data_store[serialized] = deepcopy(request) 128 | 129 | ibft.send_broadcast({"type": "signed_attestation", "attestation": serialized, "signature": request.signature.hex()}) 130 | 131 | return validator_pb2.AttestResponse(attestation_data_root=bytes.fromhex("c797a8d3aa7c4174a0bf84f4ef3a06c3f9fe8e998fbb8374ae31ad8d003b5955")) 132 | 133 | def GetDuties(self, request, context): 134 | request.public_keys[0] = public_key 135 | duties = stub.GetDuties(request) 136 | return duties 137 | 138 | # Load the combined as well as threshold public keys 139 | # TODO: Currently only supports one key 140 | keys_json = json.load(open("validators.json", "r")) 141 | public_key = bytes.fromhex(keys_json[0]["public_key"]) 142 | threshold_public_keys = [bytes.fromhex(x) for x in keys_json[0]["threshold_public_keys"]] 143 | 144 | # Load the private key 145 | if args.privkey == "": 146 | privkey_file = "python_ibft/privkey_{0}.json".format(args.process_id) 147 | else: 148 | privkey_file = args.privkey 149 | 150 | # Start IBFT service 151 | ibft.load_config(args.parties, args.config, privkey_file, process_id) 152 | ibft.run_server() 153 | 154 | # Start scheduler 155 | scheduler = BackgroundScheduler() 156 | scheduler.start() 157 | 158 | # Start GRPC service 159 | server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) 160 | ssv_pb2_grpc.add_SSVServicer_to_server( 161 | SSVServicer(), server) 162 | validator_pb2_grpc.add_BeaconNodeValidatorServicer_to_server(BeaconProxy(), server) 163 | print('Starting server. Listening on port {0}.'.format(args.port)) 164 | server.add_insecure_port('[::]:{0}'.format(args.port)) 165 | server.start() 166 | 167 | stub = validator_pb2_grpc.BeaconNodeValidatorStub(channel) 168 | syncedResponse = stub.WaitForSynced(Empty()).next() 169 | genesis_time = syncedResponse.genesis_time 170 | 171 | # create a request for the duties streaming endpoint 172 | request = validator_pb2.DutiesRequest(epoch=1, public_keys=[public_key]) 173 | 174 | # make the call 175 | response = stub.StreamDuties(request) 176 | 177 | # Loop that gets new duties and schedules an IBFT process to decide on them 178 | for new_duty in response: 179 | # Compute time of the slot to attest 180 | attestation_time = get_slot_time(new_duty.current_epoch_duties[0].attester_slot) 181 | print(datetime.fromtimestamp(attestation_time).isoformat()) 182 | 183 | # Subscribe to the right subnets to broadcast attestations 184 | ssr = validator_pb2.CommitteeSubnetsSubscribeRequest(slots=[new_duty.current_epoch_duties[0].attester_slot, 185 | new_duty.next_epoch_duties[0].attester_slot], 186 | committee_ids=[new_duty.current_epoch_duties[0].committee_index, 187 | new_duty.next_epoch_duties[0].committee_index], 188 | is_aggregator=[False, False]) 189 | stub.SubscribeCommitteeSubnets(ssr) 190 | 191 | scheduler.add_job(lambda: get_attestation_and_sign(new_duty.duties[0].attester_slot, new_duty.duties[0].committee_index), 192 | trigger="date", run_date=datetime.fromtimestamp(attestation_time + ATTESTATION_DELAY)) -------------------------------------------------------------------------------- /ssv_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: ssv.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf.internal import enum_type_wrapper 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import message as _message 8 | from google.protobuf import reflection as _reflection 9 | from google.protobuf import symbol_database as _symbol_database 10 | # @@protoc_insertion_point(imports) 11 | 12 | _sym_db = _symbol_database.Default() 13 | 14 | 15 | import attestation_pb2 as attestation__pb2 16 | import beacon_block_pb2 as beacon__block__pb2 17 | from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 18 | 19 | 20 | DESCRIPTOR = _descriptor.FileDescriptor( 21 | name='ssv.proto', 22 | package='ethereum.eth.v1alpha1', 23 | syntax='proto3', 24 | serialized_options=b'\n\031org.ethereum.eth.v1alpha1B\010SSVProtoP\001Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\252\002\025Ethereum.Eth.v1alpha1\312\002\025Ethereum\\Eth\\v1alpha1', 25 | create_key=_descriptor._internal_create_key, 26 | serialized_pb=b'\n\tssv.proto\x12\x15\x65thereum.eth.v1alpha1\x1a\x11\x61ttestation.proto\x1a\x12\x62\x65\x61\x63on_block.proto\x1a\x1cgoogle/api/annotations.proto\"Y\n\rStreamRequest\x12\x13\n\x0bpublic_keys\x18\x01 \x03(\x0c\x12\x33\n\x06topics\x18\x02 \x03(\x0e\x32#.ethereum.eth.v1alpha1.StreamTopics\"\xcd\x01\n\x07SSVTask\x12\x12\n\npublic_key\x18\x01 \x01(\x0c\x12\x32\n\x05topic\x18\x02 \x01(\x0e\x32#.ethereum.eth.v1alpha1.StreamTopics\x12=\n\x0b\x61ttestation\x18\x03 \x01(\x0b\x32&.ethereum.eth.v1alpha1.AttestationDataH\x00\x12\x33\n\x05\x62lock\x18\x04 \x01(\x0b\x32\".ethereum.eth.v1alpha1.BeaconBlockH\x00\x42\x06\n\x04\x64\x61ta*r\n\x0cStreamTopics\x12\x0e\n\nSIGN_BLOCK\x10\x00\x12\x0f\n\x0b\x43HECK_BLOCK\x10\x01\x12\x14\n\x10SIGN_ATTESTATION\x10\x02\x12\x15\n\x11\x43HECK_ATTESTATION\x10\x03\x12\x14\n\x10SIGN_AGGREGATION\x10\x04\x32\x80\x01\n\x03SSV\x12y\n\rGetTaskStream\x12$.ethereum.eth.v1alpha1.StreamRequest\x1a\x1e.ethereum.eth.v1alpha1.SSVTask\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/eth/v1alpha1/ssv/stream0\x01\x42\x8f\x01\n\x19org.ethereum.eth.v1alpha1B\x08SSVProtoP\x01Z6github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth\xaa\x02\x15\x45thereum.Eth.v1alpha1\xca\x02\x15\x45thereum\\Eth\\v1alpha1b\x06proto3' 27 | , 28 | dependencies=[attestation__pb2.DESCRIPTOR,beacon__block__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,]) 29 | 30 | _STREAMTOPICS = _descriptor.EnumDescriptor( 31 | name='StreamTopics', 32 | full_name='ethereum.eth.v1alpha1.StreamTopics', 33 | filename=None, 34 | file=DESCRIPTOR, 35 | create_key=_descriptor._internal_create_key, 36 | values=[ 37 | _descriptor.EnumValueDescriptor( 38 | name='SIGN_BLOCK', index=0, number=0, 39 | serialized_options=None, 40 | type=None, 41 | create_key=_descriptor._internal_create_key), 42 | _descriptor.EnumValueDescriptor( 43 | name='CHECK_BLOCK', index=1, number=1, 44 | serialized_options=None, 45 | type=None, 46 | create_key=_descriptor._internal_create_key), 47 | _descriptor.EnumValueDescriptor( 48 | name='SIGN_ATTESTATION', index=2, number=2, 49 | serialized_options=None, 50 | type=None, 51 | create_key=_descriptor._internal_create_key), 52 | _descriptor.EnumValueDescriptor( 53 | name='CHECK_ATTESTATION', index=3, number=3, 54 | serialized_options=None, 55 | type=None, 56 | create_key=_descriptor._internal_create_key), 57 | _descriptor.EnumValueDescriptor( 58 | name='SIGN_AGGREGATION', index=4, number=4, 59 | serialized_options=None, 60 | type=None, 61 | create_key=_descriptor._internal_create_key), 62 | ], 63 | containing_type=None, 64 | serialized_options=None, 65 | serialized_start=404, 66 | serialized_end=518, 67 | ) 68 | _sym_db.RegisterEnumDescriptor(_STREAMTOPICS) 69 | 70 | StreamTopics = enum_type_wrapper.EnumTypeWrapper(_STREAMTOPICS) 71 | SIGN_BLOCK = 0 72 | CHECK_BLOCK = 1 73 | SIGN_ATTESTATION = 2 74 | CHECK_ATTESTATION = 3 75 | SIGN_AGGREGATION = 4 76 | 77 | 78 | 79 | _STREAMREQUEST = _descriptor.Descriptor( 80 | name='StreamRequest', 81 | full_name='ethereum.eth.v1alpha1.StreamRequest', 82 | filename=None, 83 | file=DESCRIPTOR, 84 | containing_type=None, 85 | create_key=_descriptor._internal_create_key, 86 | fields=[ 87 | _descriptor.FieldDescriptor( 88 | name='public_keys', full_name='ethereum.eth.v1alpha1.StreamRequest.public_keys', index=0, 89 | number=1, type=12, cpp_type=9, label=3, 90 | has_default_value=False, default_value=[], 91 | message_type=None, enum_type=None, containing_type=None, 92 | is_extension=False, extension_scope=None, 93 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 94 | _descriptor.FieldDescriptor( 95 | name='topics', full_name='ethereum.eth.v1alpha1.StreamRequest.topics', index=1, 96 | number=2, type=14, cpp_type=8, label=3, 97 | has_default_value=False, default_value=[], 98 | message_type=None, enum_type=None, containing_type=None, 99 | is_extension=False, extension_scope=None, 100 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 101 | ], 102 | extensions=[ 103 | ], 104 | nested_types=[], 105 | enum_types=[ 106 | ], 107 | serialized_options=None, 108 | is_extendable=False, 109 | syntax='proto3', 110 | extension_ranges=[], 111 | oneofs=[ 112 | ], 113 | serialized_start=105, 114 | serialized_end=194, 115 | ) 116 | 117 | 118 | _SSVTASK = _descriptor.Descriptor( 119 | name='SSVTask', 120 | full_name='ethereum.eth.v1alpha1.SSVTask', 121 | filename=None, 122 | file=DESCRIPTOR, 123 | containing_type=None, 124 | create_key=_descriptor._internal_create_key, 125 | fields=[ 126 | _descriptor.FieldDescriptor( 127 | name='public_key', full_name='ethereum.eth.v1alpha1.SSVTask.public_key', index=0, 128 | number=1, type=12, cpp_type=9, label=1, 129 | has_default_value=False, default_value=b"", 130 | message_type=None, enum_type=None, containing_type=None, 131 | is_extension=False, extension_scope=None, 132 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 133 | _descriptor.FieldDescriptor( 134 | name='topic', full_name='ethereum.eth.v1alpha1.SSVTask.topic', index=1, 135 | number=2, type=14, cpp_type=8, label=1, 136 | has_default_value=False, default_value=0, 137 | message_type=None, enum_type=None, containing_type=None, 138 | is_extension=False, extension_scope=None, 139 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 140 | _descriptor.FieldDescriptor( 141 | name='attestation', full_name='ethereum.eth.v1alpha1.SSVTask.attestation', index=2, 142 | number=3, type=11, cpp_type=10, label=1, 143 | has_default_value=False, default_value=None, 144 | message_type=None, enum_type=None, containing_type=None, 145 | is_extension=False, extension_scope=None, 146 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 147 | _descriptor.FieldDescriptor( 148 | name='block', full_name='ethereum.eth.v1alpha1.SSVTask.block', index=3, 149 | number=4, type=11, cpp_type=10, label=1, 150 | has_default_value=False, default_value=None, 151 | message_type=None, enum_type=None, containing_type=None, 152 | is_extension=False, extension_scope=None, 153 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 154 | ], 155 | extensions=[ 156 | ], 157 | nested_types=[], 158 | enum_types=[ 159 | ], 160 | serialized_options=None, 161 | is_extendable=False, 162 | syntax='proto3', 163 | extension_ranges=[], 164 | oneofs=[ 165 | _descriptor.OneofDescriptor( 166 | name='data', full_name='ethereum.eth.v1alpha1.SSVTask.data', 167 | index=0, containing_type=None, 168 | create_key=_descriptor._internal_create_key, 169 | fields=[]), 170 | ], 171 | serialized_start=197, 172 | serialized_end=402, 173 | ) 174 | 175 | _STREAMREQUEST.fields_by_name['topics'].enum_type = _STREAMTOPICS 176 | _SSVTASK.fields_by_name['topic'].enum_type = _STREAMTOPICS 177 | _SSVTASK.fields_by_name['attestation'].message_type = attestation__pb2._ATTESTATIONDATA 178 | _SSVTASK.fields_by_name['block'].message_type = beacon__block__pb2._BEACONBLOCK 179 | _SSVTASK.oneofs_by_name['data'].fields.append( 180 | _SSVTASK.fields_by_name['attestation']) 181 | _SSVTASK.fields_by_name['attestation'].containing_oneof = _SSVTASK.oneofs_by_name['data'] 182 | _SSVTASK.oneofs_by_name['data'].fields.append( 183 | _SSVTASK.fields_by_name['block']) 184 | _SSVTASK.fields_by_name['block'].containing_oneof = _SSVTASK.oneofs_by_name['data'] 185 | DESCRIPTOR.message_types_by_name['StreamRequest'] = _STREAMREQUEST 186 | DESCRIPTOR.message_types_by_name['SSVTask'] = _SSVTASK 187 | DESCRIPTOR.enum_types_by_name['StreamTopics'] = _STREAMTOPICS 188 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 189 | 190 | StreamRequest = _reflection.GeneratedProtocolMessageType('StreamRequest', (_message.Message,), { 191 | 'DESCRIPTOR' : _STREAMREQUEST, 192 | '__module__' : 'ssv_pb2' 193 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.StreamRequest) 194 | }) 195 | _sym_db.RegisterMessage(StreamRequest) 196 | 197 | SSVTask = _reflection.GeneratedProtocolMessageType('SSVTask', (_message.Message,), { 198 | 'DESCRIPTOR' : _SSVTASK, 199 | '__module__' : 'ssv_pb2' 200 | # @@protoc_insertion_point(class_scope:ethereum.eth.v1alpha1.SSVTask) 201 | }) 202 | _sym_db.RegisterMessage(SSVTask) 203 | 204 | 205 | DESCRIPTOR._options = None 206 | 207 | _SSV = _descriptor.ServiceDescriptor( 208 | name='SSV', 209 | full_name='ethereum.eth.v1alpha1.SSV', 210 | file=DESCRIPTOR, 211 | index=0, 212 | serialized_options=None, 213 | create_key=_descriptor._internal_create_key, 214 | serialized_start=521, 215 | serialized_end=649, 216 | methods=[ 217 | _descriptor.MethodDescriptor( 218 | name='GetTaskStream', 219 | full_name='ethereum.eth.v1alpha1.SSV.GetTaskStream', 220 | index=0, 221 | containing_service=None, 222 | input_type=_STREAMREQUEST, 223 | output_type=_SSVTASK, 224 | serialized_options=b'\202\323\344\223\002\032\022\030/eth/v1alpha1/ssv/stream', 225 | create_key=_descriptor._internal_create_key, 226 | ), 227 | ]) 228 | _sym_db.RegisterServiceDescriptor(_SSV) 229 | 230 | DESCRIPTOR.services_by_name['SSV'] = _SSV 231 | 232 | # @@protoc_insertion_point(module_scope) 233 | -------------------------------------------------------------------------------- /ssv_pb2_grpc.py: -------------------------------------------------------------------------------- 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 | import ssv_pb2 as ssv__pb2 6 | 7 | 8 | class SSVStub(object): 9 | """Shared-Secret-Validator(SSV) API 10 | 11 | This API enables the communication between a validator client and an SSV node 12 | """ 13 | 14 | def __init__(self, channel): 15 | """Constructor. 16 | 17 | Args: 18 | channel: A grpc.Channel. 19 | """ 20 | self.GetTaskStream = channel.unary_stream( 21 | '/ethereum.eth.v1alpha1.SSV/GetTaskStream', 22 | request_serializer=ssv__pb2.StreamRequest.SerializeToString, 23 | response_deserializer=ssv__pb2.SSVTask.FromString, 24 | ) 25 | 26 | 27 | class SSVServicer(object): 28 | """Shared-Secret-Validator(SSV) API 29 | 30 | This API enables the communication between a validator client and an SSV node 31 | """ 32 | 33 | def GetTaskStream(self, request, context): 34 | """Missing associated documentation comment in .proto file.""" 35 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 36 | context.set_details('Method not implemented!') 37 | raise NotImplementedError('Method not implemented!') 38 | 39 | 40 | def add_SSVServicer_to_server(servicer, server): 41 | rpc_method_handlers = { 42 | 'GetTaskStream': grpc.unary_stream_rpc_method_handler( 43 | servicer.GetTaskStream, 44 | request_deserializer=ssv__pb2.StreamRequest.FromString, 45 | response_serializer=ssv__pb2.SSVTask.SerializeToString, 46 | ), 47 | } 48 | generic_handler = grpc.method_handlers_generic_handler( 49 | 'ethereum.eth.v1alpha1.SSV', rpc_method_handlers) 50 | server.add_generic_rpc_handlers((generic_handler,)) 51 | 52 | 53 | # This class is part of an EXPERIMENTAL API. 54 | class SSV(object): 55 | """Shared-Secret-Validator(SSV) API 56 | 57 | This API enables the communication between a validator client and an SSV node 58 | """ 59 | 60 | @staticmethod 61 | def GetTaskStream(request, 62 | target, 63 | options=(), 64 | channel_credentials=None, 65 | call_credentials=None, 66 | insecure=False, 67 | compression=None, 68 | wait_for_ready=None, 69 | timeout=None, 70 | metadata=None): 71 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.SSV/GetTaskStream', 72 | ssv__pb2.StreamRequest.SerializeToString, 73 | ssv__pb2.SSVTask.FromString, 74 | options, channel_credentials, 75 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 76 | -------------------------------------------------------------------------------- /validator_pb2_grpc.py: -------------------------------------------------------------------------------- 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 | import attestation_pb2 as attestation__pb2 6 | import beacon_block_pb2 as beacon__block__pb2 7 | from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 8 | import validator_pb2 as validator__pb2 9 | 10 | 11 | class BeaconNodeValidatorStub(object): 12 | """Beacon node validator API 13 | 14 | The beacon node validator API enables a validator to connect 15 | and perform its obligations on the Ethereum 2.0 phase 0 beacon chain. 16 | """ 17 | 18 | def __init__(self, channel): 19 | """Constructor. 20 | 21 | Args: 22 | channel: A grpc.Channel. 23 | """ 24 | self.GetDuties = channel.unary_unary( 25 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties', 26 | request_serializer=validator__pb2.DutiesRequest.SerializeToString, 27 | response_deserializer=validator__pb2.DutiesResponse.FromString, 28 | ) 29 | self.StreamDuties = channel.unary_stream( 30 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/StreamDuties', 31 | request_serializer=validator__pb2.DutiesRequest.SerializeToString, 32 | response_deserializer=validator__pb2.DutiesResponse.FromString, 33 | ) 34 | self.DomainData = channel.unary_unary( 35 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/DomainData', 36 | request_serializer=validator__pb2.DomainRequest.SerializeToString, 37 | response_deserializer=validator__pb2.DomainResponse.FromString, 38 | ) 39 | self.WaitForChainStart = channel.unary_stream( 40 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForChainStart', 41 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 42 | response_deserializer=validator__pb2.ChainStartResponse.FromString, 43 | ) 44 | self.WaitForSynced = channel.unary_stream( 45 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForSynced', 46 | request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 47 | response_deserializer=validator__pb2.SyncedResponse.FromString, 48 | ) 49 | self.WaitForActivation = channel.unary_stream( 50 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForActivation', 51 | request_serializer=validator__pb2.ValidatorActivationRequest.SerializeToString, 52 | response_deserializer=validator__pb2.ValidatorActivationResponse.FromString, 53 | ) 54 | self.ValidatorIndex = channel.unary_unary( 55 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorIndex', 56 | request_serializer=validator__pb2.ValidatorIndexRequest.SerializeToString, 57 | response_deserializer=validator__pb2.ValidatorIndexResponse.FromString, 58 | ) 59 | self.ValidatorStatus = channel.unary_unary( 60 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorStatus', 61 | request_serializer=validator__pb2.ValidatorStatusRequest.SerializeToString, 62 | response_deserializer=validator__pb2.ValidatorStatusResponse.FromString, 63 | ) 64 | self.MultipleValidatorStatus = channel.unary_unary( 65 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/MultipleValidatorStatus', 66 | request_serializer=validator__pb2.MultipleValidatorStatusRequest.SerializeToString, 67 | response_deserializer=validator__pb2.MultipleValidatorStatusResponse.FromString, 68 | ) 69 | self.GetBlock = channel.unary_unary( 70 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBlock', 71 | request_serializer=validator__pb2.BlockRequest.SerializeToString, 72 | response_deserializer=beacon__block__pb2.BeaconBlock.FromString, 73 | ) 74 | self.ProposeBlock = channel.unary_unary( 75 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeBlock', 76 | request_serializer=beacon__block__pb2.SignedBeaconBlock.SerializeToString, 77 | response_deserializer=validator__pb2.ProposeResponse.FromString, 78 | ) 79 | self.GetAttestationData = channel.unary_unary( 80 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData', 81 | request_serializer=validator__pb2.AttestationDataRequest.SerializeToString, 82 | response_deserializer=attestation__pb2.AttestationData.FromString, 83 | ) 84 | self.ProposeAttestation = channel.unary_unary( 85 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestation', 86 | request_serializer=attestation__pb2.Attestation.SerializeToString, 87 | response_deserializer=validator__pb2.AttestResponse.FromString, 88 | ) 89 | self.SubmitAggregateSelectionProof = channel.unary_unary( 90 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof', 91 | request_serializer=validator__pb2.AggregateSelectionRequest.SerializeToString, 92 | response_deserializer=validator__pb2.AggregateSelectionResponse.FromString, 93 | ) 94 | self.SubmitSignedAggregateSelectionProof = channel.unary_unary( 95 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof', 96 | request_serializer=validator__pb2.SignedAggregateSubmitRequest.SerializeToString, 97 | response_deserializer=validator__pb2.SignedAggregateSubmitResponse.FromString, 98 | ) 99 | self.ProposeExit = channel.unary_unary( 100 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit', 101 | request_serializer=beacon__block__pb2.SignedVoluntaryExit.SerializeToString, 102 | response_deserializer=validator__pb2.ProposeExitResponse.FromString, 103 | ) 104 | self.SubscribeCommitteeSubnets = channel.unary_unary( 105 | '/ethereum.eth.v1alpha1.BeaconNodeValidator/SubscribeCommitteeSubnets', 106 | request_serializer=validator__pb2.CommitteeSubnetsSubscribeRequest.SerializeToString, 107 | response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 108 | ) 109 | 110 | 111 | class BeaconNodeValidatorServicer(object): 112 | """Beacon node validator API 113 | 114 | The beacon node validator API enables a validator to connect 115 | and perform its obligations on the Ethereum 2.0 phase 0 beacon chain. 116 | """ 117 | 118 | def GetDuties(self, request, context): 119 | """Retrieves validator duties for the requested validators. 120 | 121 | The duties consist of: 122 | Proposer - the validator that creates a beacon chain block. 123 | Attester — a validator that is part of a committee that needs to sign off on a beacon chain 124 | block while simultaneously creating a cross link to a recent shard block on a particular shard chain. 125 | The server returns a list of duties which are the actions should be performed by validators for a given epoch. 126 | Validator duties should be polled every epoch, but due to chain reorg of >MIN_SEED_LOOKAHEAD could occur, 127 | the validator duties could chain. For complete safety, it is recommended to poll at every slot to ensure 128 | validator is fully aware of any sudden chain reorg. 129 | """ 130 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 131 | context.set_details('Method not implemented!') 132 | raise NotImplementedError('Method not implemented!') 133 | 134 | def StreamDuties(self, request, context): 135 | """Stream validator duties for the requested validators. 136 | 137 | The duties consist of: 138 | Proposer - the validator that creates a beacon chain block. 139 | Attester — a validator that is part of a committee that needs to sign off on a beacon chain 140 | """ 141 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 142 | context.set_details('Method not implemented!') 143 | raise NotImplementedError('Method not implemented!') 144 | 145 | def DomainData(self, request, context): 146 | """DomainData fetches the current BLS signature domain version information from the 147 | running beacon node's state. This information is used when validators sign 148 | blocks and attestations appropriately based on their duty. 149 | """ 150 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 151 | context.set_details('Method not implemented!') 152 | raise NotImplementedError('Method not implemented!') 153 | 154 | def WaitForChainStart(self, request, context): 155 | """WaitForChainStart queries the logs of the Validator Deposit Contract on the Ethereum 156 | proof-of-work chain to verify the beacon chain has started its runtime and 157 | validators are ready to begin their responsibilities. 158 | 159 | If the chain has not yet started, this endpoint starts a server-side stream which updates 160 | the client when the beacon chain is ready. 161 | 162 | This RPC is deprecated. Please use WaitForSynced. 163 | """ 164 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 165 | context.set_details('Method not implemented!') 166 | raise NotImplementedError('Method not implemented!') 167 | 168 | def WaitForSynced(self, request, context): 169 | """WaitForSynced checks if the beacon node is synced and ready to communicate with the validator. 170 | 171 | If the node is not synced yet, this endpoint starts a server-side stream which updates 172 | the validator client when the beacon chain is ready. 173 | """ 174 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 175 | context.set_details('Method not implemented!') 176 | raise NotImplementedError('Method not implemented!') 177 | 178 | def WaitForActivation(self, request, context): 179 | """WaitForActivation checks if a validator public key exists in the active validator 180 | registry of the current beacon state. If the validator is NOT yet active, it starts a 181 | server-side stream which updates the client whenever the validator becomes active in 182 | the beacon node's state. 183 | 184 | The input to this endpoint is a list of validator public keys, and the corresponding 185 | stream will respond until at least a single corresponding validator to those 186 | keys is activated. 187 | """ 188 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 189 | context.set_details('Method not implemented!') 190 | raise NotImplementedError('Method not implemented!') 191 | 192 | def ValidatorIndex(self, request, context): 193 | """ValidatorIndex retrieves a validator's index location in the beacon state's 194 | validator registry looking up whether the validator exists based on its 195 | public key. This method returns NOT_FOUND if no index is found for the public key 196 | specified in the request. 197 | """ 198 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 199 | context.set_details('Method not implemented!') 200 | raise NotImplementedError('Method not implemented!') 201 | 202 | def ValidatorStatus(self, request, context): 203 | """ValidatorStatus returns a validator's status based on the current epoch. 204 | The request can specify either a validator's public key or validator index. 205 | 206 | The status response can be one of the following: 207 | DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum 2. 208 | PENDING - validator is in Ethereum 2's activation queue. 209 | ACTIVE - validator is active. 210 | EXITING - validator has initiated an an exit request, or has dropped below the ejection balance and is being kicked out. 211 | EXITED - validator is no longer validating. 212 | SLASHING - validator has been kicked out due to meeting a slashing condition. 213 | UNKNOWN_STATUS - validator does not have a known status in the network. 214 | """ 215 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 216 | context.set_details('Method not implemented!') 217 | raise NotImplementedError('Method not implemented!') 218 | 219 | def MultipleValidatorStatus(self, request, context): 220 | """MultipleValidatorStatus returns a list of validator statuses on the current epoch. 221 | The request can specify a list of validator public keys. 222 | 223 | Returns a list of ValidatorStatusResponses. 224 | """ 225 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 226 | context.set_details('Method not implemented!') 227 | raise NotImplementedError('Method not implemented!') 228 | 229 | def GetBlock(self, request, context): 230 | """Retrieves the latest valid beacon block to be proposed on the beacon chain. 231 | 232 | The server returns a new beacon block, without proposer signature, that can be 233 | proposed on the beacon chain. The block should be filled with all the necessary 234 | data for proposer to sign. 235 | """ 236 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 237 | context.set_details('Method not implemented!') 238 | raise NotImplementedError('Method not implemented!') 239 | 240 | def ProposeBlock(self, request, context): 241 | """Sends the newly signed beacon block to beacon node. 242 | 243 | The validator sends the newly signed beacon block to the beacon node so the beacon block can 244 | be included in the beacon chain. The beacon node is expected to validate and process the 245 | beacon block into its state. 246 | """ 247 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 248 | context.set_details('Method not implemented!') 249 | raise NotImplementedError('Method not implemented!') 250 | 251 | def GetAttestationData(self, request, context): 252 | """Retrieves the latest valid attestation data to be attested on the beacon chain. 253 | 254 | The server returns the latest valid data which represents the correct vote 255 | for the head of the beacon chain, 256 | """ 257 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 258 | context.set_details('Method not implemented!') 259 | raise NotImplementedError('Method not implemented!') 260 | 261 | def ProposeAttestation(self, request, context): 262 | """Sends the newly signed attestation to beacon node. 263 | 264 | The validator sends the newly signed attestation to the beacon node for the attestation to 265 | be included in the beacon chain. The beacon node is expected to validate and publish attestation on 266 | appropriate committee subnet. 267 | """ 268 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 269 | context.set_details('Method not implemented!') 270 | raise NotImplementedError('Method not implemented!') 271 | 272 | def SubmitAggregateSelectionProof(self, request, context): 273 | """Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root. 274 | the beacon node responses with an aggregate and proof object back to validator to sign over. 275 | """ 276 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 277 | context.set_details('Method not implemented!') 278 | raise NotImplementedError('Method not implemented!') 279 | 280 | def SubmitSignedAggregateSelectionProof(self, request, context): 281 | """Submit a signed aggregate and proof object, the beacon node will broadcast the 282 | signed aggregated attestation and proof object. 283 | """ 284 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 285 | context.set_details('Method not implemented!') 286 | raise NotImplementedError('Method not implemented!') 287 | 288 | def ProposeExit(self, request, context): 289 | """Propose to leave the list of active validators. 290 | 291 | The beacon node is expected to validate the request and make it available for inclusion in 292 | the next proposed block. 293 | """ 294 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 295 | context.set_details('Method not implemented!') 296 | raise NotImplementedError('Method not implemented!') 297 | 298 | def SubscribeCommitteeSubnets(self, request, context): 299 | """Subscribe to particular committee ID subnets given validator's duty. 300 | 301 | The beacon node is expected to subscribe to the committee ID subnet given by the request. With this, 302 | beacon node serving attesters can find persistent peers on the subnet to publish attestation, 303 | and beacon node serving aggregator can join the subnet. 304 | """ 305 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 306 | context.set_details('Method not implemented!') 307 | raise NotImplementedError('Method not implemented!') 308 | 309 | 310 | def add_BeaconNodeValidatorServicer_to_server(servicer, server): 311 | rpc_method_handlers = { 312 | 'GetDuties': grpc.unary_unary_rpc_method_handler( 313 | servicer.GetDuties, 314 | request_deserializer=validator__pb2.DutiesRequest.FromString, 315 | response_serializer=validator__pb2.DutiesResponse.SerializeToString, 316 | ), 317 | 'StreamDuties': grpc.unary_stream_rpc_method_handler( 318 | servicer.StreamDuties, 319 | request_deserializer=validator__pb2.DutiesRequest.FromString, 320 | response_serializer=validator__pb2.DutiesResponse.SerializeToString, 321 | ), 322 | 'DomainData': grpc.unary_unary_rpc_method_handler( 323 | servicer.DomainData, 324 | request_deserializer=validator__pb2.DomainRequest.FromString, 325 | response_serializer=validator__pb2.DomainResponse.SerializeToString, 326 | ), 327 | 'WaitForChainStart': grpc.unary_stream_rpc_method_handler( 328 | servicer.WaitForChainStart, 329 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 330 | response_serializer=validator__pb2.ChainStartResponse.SerializeToString, 331 | ), 332 | 'WaitForSynced': grpc.unary_stream_rpc_method_handler( 333 | servicer.WaitForSynced, 334 | request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, 335 | response_serializer=validator__pb2.SyncedResponse.SerializeToString, 336 | ), 337 | 'WaitForActivation': grpc.unary_stream_rpc_method_handler( 338 | servicer.WaitForActivation, 339 | request_deserializer=validator__pb2.ValidatorActivationRequest.FromString, 340 | response_serializer=validator__pb2.ValidatorActivationResponse.SerializeToString, 341 | ), 342 | 'ValidatorIndex': grpc.unary_unary_rpc_method_handler( 343 | servicer.ValidatorIndex, 344 | request_deserializer=validator__pb2.ValidatorIndexRequest.FromString, 345 | response_serializer=validator__pb2.ValidatorIndexResponse.SerializeToString, 346 | ), 347 | 'ValidatorStatus': grpc.unary_unary_rpc_method_handler( 348 | servicer.ValidatorStatus, 349 | request_deserializer=validator__pb2.ValidatorStatusRequest.FromString, 350 | response_serializer=validator__pb2.ValidatorStatusResponse.SerializeToString, 351 | ), 352 | 'MultipleValidatorStatus': grpc.unary_unary_rpc_method_handler( 353 | servicer.MultipleValidatorStatus, 354 | request_deserializer=validator__pb2.MultipleValidatorStatusRequest.FromString, 355 | response_serializer=validator__pb2.MultipleValidatorStatusResponse.SerializeToString, 356 | ), 357 | 'GetBlock': grpc.unary_unary_rpc_method_handler( 358 | servicer.GetBlock, 359 | request_deserializer=validator__pb2.BlockRequest.FromString, 360 | response_serializer=beacon__block__pb2.BeaconBlock.SerializeToString, 361 | ), 362 | 'ProposeBlock': grpc.unary_unary_rpc_method_handler( 363 | servicer.ProposeBlock, 364 | request_deserializer=beacon__block__pb2.SignedBeaconBlock.FromString, 365 | response_serializer=validator__pb2.ProposeResponse.SerializeToString, 366 | ), 367 | 'GetAttestationData': grpc.unary_unary_rpc_method_handler( 368 | servicer.GetAttestationData, 369 | request_deserializer=validator__pb2.AttestationDataRequest.FromString, 370 | response_serializer=attestation__pb2.AttestationData.SerializeToString, 371 | ), 372 | 'ProposeAttestation': grpc.unary_unary_rpc_method_handler( 373 | servicer.ProposeAttestation, 374 | request_deserializer=attestation__pb2.Attestation.FromString, 375 | response_serializer=validator__pb2.AttestResponse.SerializeToString, 376 | ), 377 | 'SubmitAggregateSelectionProof': grpc.unary_unary_rpc_method_handler( 378 | servicer.SubmitAggregateSelectionProof, 379 | request_deserializer=validator__pb2.AggregateSelectionRequest.FromString, 380 | response_serializer=validator__pb2.AggregateSelectionResponse.SerializeToString, 381 | ), 382 | 'SubmitSignedAggregateSelectionProof': grpc.unary_unary_rpc_method_handler( 383 | servicer.SubmitSignedAggregateSelectionProof, 384 | request_deserializer=validator__pb2.SignedAggregateSubmitRequest.FromString, 385 | response_serializer=validator__pb2.SignedAggregateSubmitResponse.SerializeToString, 386 | ), 387 | 'ProposeExit': grpc.unary_unary_rpc_method_handler( 388 | servicer.ProposeExit, 389 | request_deserializer=beacon__block__pb2.SignedVoluntaryExit.FromString, 390 | response_serializer=validator__pb2.ProposeExitResponse.SerializeToString, 391 | ), 392 | 'SubscribeCommitteeSubnets': grpc.unary_unary_rpc_method_handler( 393 | servicer.SubscribeCommitteeSubnets, 394 | request_deserializer=validator__pb2.CommitteeSubnetsSubscribeRequest.FromString, 395 | response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 396 | ), 397 | } 398 | generic_handler = grpc.method_handlers_generic_handler( 399 | 'ethereum.eth.v1alpha1.BeaconNodeValidator', rpc_method_handlers) 400 | server.add_generic_rpc_handlers((generic_handler,)) 401 | 402 | 403 | # This class is part of an EXPERIMENTAL API. 404 | class BeaconNodeValidator(object): 405 | """Beacon node validator API 406 | 407 | The beacon node validator API enables a validator to connect 408 | and perform its obligations on the Ethereum 2.0 phase 0 beacon chain. 409 | """ 410 | 411 | @staticmethod 412 | def GetDuties(request, 413 | target, 414 | options=(), 415 | channel_credentials=None, 416 | call_credentials=None, 417 | insecure=False, 418 | compression=None, 419 | wait_for_ready=None, 420 | timeout=None, 421 | metadata=None): 422 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties', 423 | validator__pb2.DutiesRequest.SerializeToString, 424 | validator__pb2.DutiesResponse.FromString, 425 | options, channel_credentials, 426 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 427 | 428 | @staticmethod 429 | def StreamDuties(request, 430 | target, 431 | options=(), 432 | channel_credentials=None, 433 | call_credentials=None, 434 | insecure=False, 435 | compression=None, 436 | wait_for_ready=None, 437 | timeout=None, 438 | metadata=None): 439 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/StreamDuties', 440 | validator__pb2.DutiesRequest.SerializeToString, 441 | validator__pb2.DutiesResponse.FromString, 442 | options, channel_credentials, 443 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 444 | 445 | @staticmethod 446 | def DomainData(request, 447 | target, 448 | options=(), 449 | channel_credentials=None, 450 | call_credentials=None, 451 | insecure=False, 452 | compression=None, 453 | wait_for_ready=None, 454 | timeout=None, 455 | metadata=None): 456 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/DomainData', 457 | validator__pb2.DomainRequest.SerializeToString, 458 | validator__pb2.DomainResponse.FromString, 459 | options, channel_credentials, 460 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 461 | 462 | @staticmethod 463 | def WaitForChainStart(request, 464 | target, 465 | options=(), 466 | channel_credentials=None, 467 | call_credentials=None, 468 | insecure=False, 469 | compression=None, 470 | wait_for_ready=None, 471 | timeout=None, 472 | metadata=None): 473 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForChainStart', 474 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 475 | validator__pb2.ChainStartResponse.FromString, 476 | options, channel_credentials, 477 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 478 | 479 | @staticmethod 480 | def WaitForSynced(request, 481 | target, 482 | options=(), 483 | channel_credentials=None, 484 | call_credentials=None, 485 | insecure=False, 486 | compression=None, 487 | wait_for_ready=None, 488 | timeout=None, 489 | metadata=None): 490 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForSynced', 491 | google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, 492 | validator__pb2.SyncedResponse.FromString, 493 | options, channel_credentials, 494 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 495 | 496 | @staticmethod 497 | def WaitForActivation(request, 498 | target, 499 | options=(), 500 | channel_credentials=None, 501 | call_credentials=None, 502 | insecure=False, 503 | compression=None, 504 | wait_for_ready=None, 505 | timeout=None, 506 | metadata=None): 507 | return grpc.experimental.unary_stream(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForActivation', 508 | validator__pb2.ValidatorActivationRequest.SerializeToString, 509 | validator__pb2.ValidatorActivationResponse.FromString, 510 | options, channel_credentials, 511 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 512 | 513 | @staticmethod 514 | def ValidatorIndex(request, 515 | target, 516 | options=(), 517 | channel_credentials=None, 518 | call_credentials=None, 519 | insecure=False, 520 | compression=None, 521 | wait_for_ready=None, 522 | timeout=None, 523 | metadata=None): 524 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorIndex', 525 | validator__pb2.ValidatorIndexRequest.SerializeToString, 526 | validator__pb2.ValidatorIndexResponse.FromString, 527 | options, channel_credentials, 528 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 529 | 530 | @staticmethod 531 | def ValidatorStatus(request, 532 | target, 533 | options=(), 534 | channel_credentials=None, 535 | call_credentials=None, 536 | insecure=False, 537 | compression=None, 538 | wait_for_ready=None, 539 | timeout=None, 540 | metadata=None): 541 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorStatus', 542 | validator__pb2.ValidatorStatusRequest.SerializeToString, 543 | validator__pb2.ValidatorStatusResponse.FromString, 544 | options, channel_credentials, 545 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 546 | 547 | @staticmethod 548 | def MultipleValidatorStatus(request, 549 | target, 550 | options=(), 551 | channel_credentials=None, 552 | call_credentials=None, 553 | insecure=False, 554 | compression=None, 555 | wait_for_ready=None, 556 | timeout=None, 557 | metadata=None): 558 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/MultipleValidatorStatus', 559 | validator__pb2.MultipleValidatorStatusRequest.SerializeToString, 560 | validator__pb2.MultipleValidatorStatusResponse.FromString, 561 | options, channel_credentials, 562 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 563 | 564 | @staticmethod 565 | def GetBlock(request, 566 | target, 567 | options=(), 568 | channel_credentials=None, 569 | call_credentials=None, 570 | insecure=False, 571 | compression=None, 572 | wait_for_ready=None, 573 | timeout=None, 574 | metadata=None): 575 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBlock', 576 | validator__pb2.BlockRequest.SerializeToString, 577 | beacon__block__pb2.BeaconBlock.FromString, 578 | options, channel_credentials, 579 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 580 | 581 | @staticmethod 582 | def ProposeBlock(request, 583 | target, 584 | options=(), 585 | channel_credentials=None, 586 | call_credentials=None, 587 | insecure=False, 588 | compression=None, 589 | wait_for_ready=None, 590 | timeout=None, 591 | metadata=None): 592 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeBlock', 593 | beacon__block__pb2.SignedBeaconBlock.SerializeToString, 594 | validator__pb2.ProposeResponse.FromString, 595 | options, channel_credentials, 596 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 597 | 598 | @staticmethod 599 | def GetAttestationData(request, 600 | target, 601 | options=(), 602 | channel_credentials=None, 603 | call_credentials=None, 604 | insecure=False, 605 | compression=None, 606 | wait_for_ready=None, 607 | timeout=None, 608 | metadata=None): 609 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData', 610 | validator__pb2.AttestationDataRequest.SerializeToString, 611 | attestation__pb2.AttestationData.FromString, 612 | options, channel_credentials, 613 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 614 | 615 | @staticmethod 616 | def ProposeAttestation(request, 617 | target, 618 | options=(), 619 | channel_credentials=None, 620 | call_credentials=None, 621 | insecure=False, 622 | compression=None, 623 | wait_for_ready=None, 624 | timeout=None, 625 | metadata=None): 626 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestation', 627 | attestation__pb2.Attestation.SerializeToString, 628 | validator__pb2.AttestResponse.FromString, 629 | options, channel_credentials, 630 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 631 | 632 | @staticmethod 633 | def SubmitAggregateSelectionProof(request, 634 | target, 635 | options=(), 636 | channel_credentials=None, 637 | call_credentials=None, 638 | insecure=False, 639 | compression=None, 640 | wait_for_ready=None, 641 | timeout=None, 642 | metadata=None): 643 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof', 644 | validator__pb2.AggregateSelectionRequest.SerializeToString, 645 | validator__pb2.AggregateSelectionResponse.FromString, 646 | options, channel_credentials, 647 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 648 | 649 | @staticmethod 650 | def SubmitSignedAggregateSelectionProof(request, 651 | target, 652 | options=(), 653 | channel_credentials=None, 654 | call_credentials=None, 655 | insecure=False, 656 | compression=None, 657 | wait_for_ready=None, 658 | timeout=None, 659 | metadata=None): 660 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof', 661 | validator__pb2.SignedAggregateSubmitRequest.SerializeToString, 662 | validator__pb2.SignedAggregateSubmitResponse.FromString, 663 | options, channel_credentials, 664 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 665 | 666 | @staticmethod 667 | def ProposeExit(request, 668 | target, 669 | options=(), 670 | channel_credentials=None, 671 | call_credentials=None, 672 | insecure=False, 673 | compression=None, 674 | wait_for_ready=None, 675 | timeout=None, 676 | metadata=None): 677 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit', 678 | beacon__block__pb2.SignedVoluntaryExit.SerializeToString, 679 | validator__pb2.ProposeExitResponse.FromString, 680 | options, channel_credentials, 681 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 682 | 683 | @staticmethod 684 | def SubscribeCommitteeSubnets(request, 685 | target, 686 | options=(), 687 | channel_credentials=None, 688 | call_credentials=None, 689 | insecure=False, 690 | compression=None, 691 | wait_for_ready=None, 692 | timeout=None, 693 | metadata=None): 694 | return grpc.experimental.unary_unary(request, target, '/ethereum.eth.v1alpha1.BeaconNodeValidator/SubscribeCommitteeSubnets', 695 | validator__pb2.CommitteeSubnetsSubscribeRequest.SerializeToString, 696 | google_dot_protobuf_dot_empty__pb2.Empty.FromString, 697 | options, channel_credentials, 698 | insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 699 | -------------------------------------------------------------------------------- /venv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | virtualenv venv -p `which python3` 3 | . venv/bin/activate 4 | pip install -r requirements.txt 5 | pip install -r python_ibft/requirements.txt -------------------------------------------------------------------------------- /wait.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | read 4 | 5 | tmux kill-session --------------------------------------------------------------------------------