add state root endpoint
This commit is contained in:
parent
8a936ef387
commit
2d522dc3a4
|
@ -0,0 +1,17 @@
|
|||
get:
|
||||
operationId: "getStateRoot"
|
||||
summary: "Get state SSZ HashTreeRoot"
|
||||
description: "Calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned."
|
||||
tags:
|
||||
- Beacon
|
||||
parameters:
|
||||
- name: stateId
|
||||
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/StateId'
|
||||
responses:
|
||||
"200":
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Root'
|
||||
|
|
@ -32,6 +32,9 @@ paths:
|
|||
|
||||
/v1/beacon/genesis:
|
||||
$ref: "./apis/beacon/genesis.yaml"
|
||||
/v1/beacon/states/{stateId}/root:
|
||||
$ref: "./apis/beacon/states/root.yaml"
|
||||
|
||||
# /v1/beacon/fork:
|
||||
# $ref: "./apis/beacon/fork.yaml#/single"
|
||||
# /v1/beacon/fork/stream:
|
||||
|
@ -69,6 +72,8 @@ paths:
|
|||
|
||||
components:
|
||||
schemas:
|
||||
BeaconState:
|
||||
$ref: './types/state.yaml#/BeaconState'
|
||||
BeaconBlock:
|
||||
$ref: './types/block.yaml#/schemas/BeaconBlock'
|
||||
SignedBeaconBlock:
|
||||
|
@ -105,6 +110,11 @@ components:
|
|||
$ref: './types/primitive.yaml#/schemas/Root'
|
||||
Signature:
|
||||
$ref: './types/primitive.yaml#/schemas/Signature'
|
||||
|
||||
parameters:
|
||||
StateId:
|
||||
$ref: './params/index.yaml#/StateId'
|
||||
|
||||
responses:
|
||||
InvalidRequest:
|
||||
$ref: './types/http.yaml#/responses/InvalidRequest'
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
url: "https://petstore.swagger.io/v2/swagger.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
showExtensions: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
StateId:
|
||||
name: stateId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: |
|
||||
State identifier.
|
||||
Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<stateRoot\>.
|
|
@ -1,4 +1,3 @@
|
|||
schemas:
|
||||
BeaconState:
|
||||
type: object
|
||||
description: "The [`BeaconState`](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#beaconblock) object from the Eth2.0 spec."
|
||||
|
|
Loading…
Reference in New Issue