This reverts commit 6ebcbbdf4e
.
This commit is contained in:
parent
6ebcbbdf4e
commit
1b77831758
|
@ -61,6 +61,13 @@ proc installDebugApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
RestApiResponse.jsonError(Http500, InvalidAcceptError)
|
||||
return RestApiResponse.jsonError(Http404, StateNotFoundError)
|
||||
|
||||
# https://ethereum.github.io/beacon-APIs/#/Debug/getDebugChainHeads
|
||||
router.api(MethodGet,
|
||||
"/eth/v1/debug/beacon/heads") do () -> RestApiResponse:
|
||||
return RestApiResponse.jsonResponse(
|
||||
node.dag.heads.mapIt((root: it.root, slot: it.slot))
|
||||
)
|
||||
|
||||
# https://ethereum.github.io/beacon-APIs/#/Debug/getDebugChainHeadsV2
|
||||
router.api(MethodGet,
|
||||
"/eth/v2/debug/beacon/heads") do () -> RestApiResponse:
|
||||
|
|
|
@ -13,6 +13,11 @@ import
|
|||
|
||||
export chronos, client, rest_types, eth2_rest_serialization
|
||||
|
||||
proc getDebugChainHeads*(): RestResponse[GetDebugChainHeadsResponse] {.
|
||||
rest, endpoint: "/eth/v1/debug/beacon/heads",
|
||||
meth: MethodGet.}
|
||||
## https://ethereum.github.io/beacon-APIs/#/Beacon/getDebugChainHeads
|
||||
|
||||
proc getStateV2Plain*(state_id: StateIdent): RestPlainResponse {.
|
||||
rest, endpoint: "/eth/v2/debug/beacon/states/{state_id}",
|
||||
accept: preferSSZ,
|
||||
|
|
|
@ -466,6 +466,14 @@ Equivalent call in the official REST API:
|
|||
curl http://localhost:5052/eth/v2/debug/beacon/states/head -s | jq
|
||||
```
|
||||
|
||||
### [`get_v1_debug_beacon_heads`](https://ethereum.github.io/eth2.0-APIs/#/Debug/getDebugChainHeads)
|
||||
|
||||
Equivalent call in the official REST API:
|
||||
|
||||
```
|
||||
curl http://localhost:5052/eth/v1/debug/beacon/heads -s | jq
|
||||
```
|
||||
|
||||
## Nimbus extensions
|
||||
|
||||
### getBeaconHead
|
||||
|
|
|
@ -2817,6 +2817,18 @@
|
|||
"body": [{"operator": "jstructcmps", "start": ["data"], "value": {"chain_id": "", "address": ""}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": ["debug"],
|
||||
"request": {
|
||||
"url": "/eth/v1/debug/beacon/heads",
|
||||
"headers": {"Accept": "application/json"}
|
||||
},
|
||||
"response": {
|
||||
"status": {"operator": "equals", "value": "200"},
|
||||
"headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}],
|
||||
"body": [{"operator": "jstructcmps", "start": ["data"], "value": [{"root": "", "slot": ""}]}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": ["debug", "beacon_states_head_slow", "slow"],
|
||||
"request": {
|
||||
|
|
Loading…
Reference in New Issue