Beacon Endpoints
beacon_client.beacon_endpoints.BeaconEndpoints
Source code in beacon_client/beacon_endpoints.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|
get_attestations_from_block_id(block_id)
Retrieves attestation included in requested block.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_id |
BlockId
|
Return attestations matching given block id |
required |
Source code in beacon_client/beacon_endpoints.py
291 292 293 294 295 296 297 298 299 |
|
get_block_from_block_id(block_id, response_type='json')
Retrieves block details for given block id. Depending on Accept header it can be returned either as json or as bytes serialized by SSZ response_type in [json, ssz]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_id |
BlockId
|
Return block matching given block id |
required |
response_type |
str
|
Element of [json, szz] that determines the return type |
'json'
|
Source code in beacon_client/beacon_endpoints.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
get_block_root_from_block_id(block_id)
Retrieves hashTreeRoot of BeaconBlock/BeaconBlockHeader
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_id |
BlockId
|
Return block root matching given block id |
required |
Source code in beacon_client/beacon_endpoints.py
282 283 284 285 286 287 288 289 |
|
get_committees_from_state(state_id, epoch=None, index=None, slot=None)
Retrieves the committees for the given state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
epoch |
Union[Epoch, None]
|
Fetch committees for the given epoch. If not present then the committees for the epoch of the state will be obtained |
None
|
index |
Union[ValidatorIndex, None]
|
Restrict returned values to those matching the supplied committee index |
None
|
slot |
Union[Slot, None]
|
Restrict returned values to those matching the supplied slot |
None
|
Source code in beacon_client/beacon_endpoints.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
get_finality_checkpoints_from_state(state_id)
Returns finality checkpoints for state with given 'state_id'. In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
Source code in beacon_client/beacon_endpoints.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
get_fork_from_state(state_id)
Returns Fork object for state with given 'state_id'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
Source code in beacon_client/beacon_endpoints.py
51 52 53 54 55 56 57 58 59 |
|
get_genesis()
Retrieve details of the chain's genesis which can be used to identify chain.
Source code in beacon_client/beacon_endpoints.py
32 33 34 35 36 37 38 |
|
get_headers(slot=None, parent_root=None)
Retrieves block headers matching given query. By default it will fetch current head slot blocks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
Union[Slot, None]
|
Restrict returned values to those matching the supplied slot |
None
|
parent_root |
Union[Root, None]
|
Restrict returned values to those matching the supplied parent_root |
None
|
Source code in beacon_client/beacon_endpoints.py
231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
get_headers_from_block_id(block_id)
Retrieves block headers matching given query. By default it will fetch current head slot blocks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block_id |
BlockId
|
Return block header matching given block id |
required |
Source code in beacon_client/beacon_endpoints.py
245 246 247 248 249 250 251 252 253 |
|
get_pool_attestations(slot=None, committee_index=None)
Retrieves attestations known by the node but not necessarily incorporated into any block
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
Union[Slot, None]
|
Restrict returned values to those matching the supplied slot |
None
|
committee_index |
Union[CommitteeIndex, None]
|
Restrict returned values to those matching the supplied committee index |
None
|
Source code in beacon_client/beacon_endpoints.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
|
get_pool_attester_slashings()
Retrieves attester slashings known by the node but not necessarily incorporated into any block
Source code in beacon_client/beacon_endpoints.py
317 318 319 320 321 322 323 |
|
get_pool_proposer_slashings()
Retrieves proposer slashings known by the node but not necessarily incorporated into any block
Source code in beacon_client/beacon_endpoints.py
325 326 327 328 329 330 331 |
|
get_pool_voluntary_exits()
Retrieves voluntary exits known by the node but not necessarily incorporated into any block
Source code in beacon_client/beacon_endpoints.py
333 334 335 336 337 338 339 |
|
get_state_root(state_id)
Calculates HashTreeRoot for state with given 'state_id'. If state_id is root, same value will be returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
Source code in beacon_client/beacon_endpoints.py
40 41 42 43 44 45 46 47 48 49 |
|
get_sync_committees_from_state(state_id, epoch=None)
Retrieves the sync committees for the given state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
epoch |
Union[Epoch, None]
|
Fetch committees for the given epoch. If not present then the committees for the epoch of the state will be obtained |
None
|
Source code in beacon_client/beacon_endpoints.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
get_validators_balances_from_state(state_id, validator_list=None)
Returns filterable list of validators balances. Balances will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no balance will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; the index and is returned for each balance, and can be used to confirm for which inputs a response has been returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
validator_list |
Union[List[ValidatorId], None]
|
List of validators identified by public key or validator index |
None
|
Source code in beacon_client/beacon_endpoints.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
get_validators_from_state(state_id, validator_list=None, pending_initialized=False, pending_queued=False, active_ongoing=False, active_exiting=False, active_slashed=False, exited_unslashed=False, exited_slashed=False, withdrawal_possible=False, withdrawal_done=False, active=False, pending=False, exited=False, withdrawal=False)
Returns filterable list of validators with their balance, status and index. Information will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no information will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; both the index and public key are returned for each validator, and can be used to confirm for which inputs a response has been returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
validator_list |
Union[List[ValidatorId], None]
|
List of validators identified by public key or validator index |
None
|
pending_initialized |
bool
|
If true return validators with this status |
False
|
pending_queued |
bool
|
If true return validators with this status |
False
|
active_ongoing |
bool
|
If true return validators with this status |
False
|
active_exiting |
bool
|
If true return validators with this status |
False
|
active_slashed |
bool
|
If true return validators with this status |
False
|
exited_unslashed |
bool
|
If true return validators with this status |
False
|
exited_slashed |
bool
|
If true return validators with this status |
False
|
withdrawal_possible |
bool
|
If true return validators with this status |
False
|
withdrawal_done |
bool
|
If true return validators with this status |
False
|
active |
bool
|
If true return validators with this status |
False
|
pending |
bool
|
If true return validators with this status |
False
|
exited |
bool
|
If true return validators with this status |
False
|
withdrawal |
bool
|
If true return validators with this status |
False
|
Source code in beacon_client/beacon_endpoints.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get_validators_from_state_by_id(state_id, validator_id)
Returns validator specified by state and id or public key along with status and balance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_id |
StateId
|
Element of [head, genesis, finalized, justified] or block number (int) or string starting with 0x |
required |
validator_id |
ValidatorId
|
Validator identified by public key or validator index |
required |
Source code in beacon_client/beacon_endpoints.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|