Updated API spec with suggestions by @hwwhww.
- Corrected to use American English instead of Australian - Fixed spelling mistake with indices - Changed tag to 'MinimalSet' and 'OptionalSet' - Added a response to the list of components - Renamed 'block_production' to 'block_proposal'
This commit is contained in:
parent
67921ab96f
commit
73c9d126de
|
@ -11,7 +11,7 @@ The API is a REST interface, accessed via HTTP, designed for use as a local comm
|
||||||
### Background
|
### Background
|
||||||
The beacon node maintains the state of the beacon chain by communicating with other beacon nodes in the Ethereum Serenity network. Conceptually, it does not maintain keypairs that participate with the beacon chain.
|
The beacon node maintains the state of the beacon chain by communicating with other beacon nodes in the Ethereum Serenity network. Conceptually, it does not maintain keypairs that participate with the beacon chain.
|
||||||
|
|
||||||
The validator client is a conceptually separate entity which utilises private keys to perform validator related tasks on the beacon chain, which we call validator "duties". These duties includes the production of beacon blocks and signing of attestations.
|
The validator client is a conceptually separate entity which utilizes private keys to perform validator related tasks on the beacon chain, which we call validator "duties". These duties include the production of beacon blocks and signing of attestations.
|
||||||
|
|
||||||
Since it is recommended to separate these concerns in the client implementations, we must clearly define the communication between them.
|
Since it is recommended to separate these concerns in the client implementations, we must clearly define the communication between them.
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,15 @@ info:
|
||||||
name: "Apache 2.0"
|
name: "Apache 2.0"
|
||||||
url: "https://www.apache.org/licenses/LICENSE-2.0.html"
|
url: "https://www.apache.org/licenses/LICENSE-2.0.html"
|
||||||
tags:
|
tags:
|
||||||
- name: Necessary for validator
|
- name: MinimalSet
|
||||||
description: The minimal set of endpoints to enable a working validator implementation.
|
description: The minimal set of endpoints to enable a working validator implementation.
|
||||||
- name: Optional
|
- name: OptionalSet
|
||||||
description: Extra endpoints which are nice-to-haves.
|
description: Extra endpoints which are nice-to-haves.
|
||||||
paths:
|
paths:
|
||||||
/node/version:
|
/node/version:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Get version string of the running beacon node."
|
summary: "Get version string of the running beacon node."
|
||||||
description: "Requests that the beacon node identify information about its implementation in a format similar to a [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) field."
|
description: "Requests that the beacon node identify information about its implementation in a format similar to a [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) field."
|
||||||
responses:
|
responses:
|
||||||
|
@ -30,7 +30,7 @@ paths:
|
||||||
/node/genesis_time:
|
/node/genesis_time:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Get the genesis_time parameter from beacon node configuration."
|
summary: "Get the genesis_time parameter from beacon node configuration."
|
||||||
description: "Requests the genesis_time parameter from the beacon node, which should be consistent across all beacon nodes that follow the same beacon chain."
|
description: "Requests the genesis_time parameter from the beacon node, which should be consistent across all beacon nodes that follow the same beacon chain."
|
||||||
responses:
|
responses:
|
||||||
|
@ -46,7 +46,7 @@ paths:
|
||||||
/node/syncing:
|
/node/syncing:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Poll to see if the the beacon node is syncing."
|
summary: "Poll to see if the the beacon node is syncing."
|
||||||
description: "Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to. This is modelled after the Eth1.0 JSON-RPC eth_syncing call.."
|
description: "Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to. This is modelled after the Eth1.0 JSON-RPC eth_syncing call.."
|
||||||
responses:
|
responses:
|
||||||
|
@ -67,7 +67,7 @@ paths:
|
||||||
/node/fork:
|
/node/fork:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Optional
|
- OptionalSet
|
||||||
summary: "Get fork information from running beacon node."
|
summary: "Get fork information from running beacon node."
|
||||||
description: "Requests the beacon node to provide which fork version it is currently on."
|
description: "Requests the beacon node to provide which fork version it is currently on."
|
||||||
responses:
|
responses:
|
||||||
|
@ -83,16 +83,16 @@ paths:
|
||||||
chain_id:
|
chain_id:
|
||||||
type: integer
|
type: integer
|
||||||
format: uint64
|
format: uint64
|
||||||
description: "Sometimes called the network id, this number discerns the active chain for the BeaconNode. Analagous to Eth1.0 JSON-RPC net_version."
|
description: "Sometimes called the network id, this number discerns the active chain for the beacon node. Analagous to Eth1.0 JSON-RPC net_version."
|
||||||
500:
|
500:
|
||||||
$ref: '#/components/responses/InternalError'
|
$ref: '#/components/responses/InternalError'
|
||||||
|
|
||||||
/validator/duties:
|
/validator/duties:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Get validator duties for the requested validators."
|
summary: "Get validator duties for the requested validators."
|
||||||
description: "Requests the beacon node to provide a set of _duties_, which are actions that should be performed by validators. This API call should be polled at every slot, to ensure that any chain reorganisations are catered for, and to ensure that the currently connected beacon node is properly synchronised."
|
description: "Requests the beacon node to provide a set of _duties_, which are actions that should be performed by validators. This API call should be polled at every slot, to ensure that any chain reorganisations are catered for, and to ensure that the currently connected beacon node is properly synchronized."
|
||||||
parameters:
|
parameters:
|
||||||
- name: validator_pubkeys
|
- name: validator_pubkeys
|
||||||
in: query
|
in: query
|
||||||
|
@ -122,7 +122,7 @@ paths:
|
||||||
/validator/block:
|
/validator/block:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Produce a new block, without signature."
|
summary: "Produce a new block, without signature."
|
||||||
description: "Requests a beacon node to produce a valid block, which can then be signed by a validator."
|
description: "Requests a beacon node to produce a valid block, which can then be signed by a validator."
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -155,7 +155,7 @@ paths:
|
||||||
$ref: '#/components/responses/CurrentlySyncing'
|
$ref: '#/components/responses/CurrentlySyncing'
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Publish a signed block."
|
summary: "Publish a signed block."
|
||||||
description: "Instructs the beacon node to publish a newly signed beacon block to the beacon network, to be included in the beacon chain."
|
description: "Instructs the beacon node to publish a newly signed beacon block to the beacon network, to be included in the beacon chain."
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -178,7 +178,7 @@ paths:
|
||||||
/validator/attestation:
|
/validator/attestation:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Produce an attestation, without signature."
|
summary: "Produce an attestation, without signature."
|
||||||
description: "Requests that the beacon node produce an IndexedAttestation, with a blank signature field, which the validator will then sign."
|
description: "Requests that the beacon node produce an IndexedAttestation, with a blank signature field, which the validator will then sign."
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -209,7 +209,7 @@ paths:
|
||||||
$ref: '#/components/responses/CurrentlySyncing'
|
$ref: '#/components/responses/CurrentlySyncing'
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- Necessary for validator
|
- MinimalSet
|
||||||
summary: "Published a signed attestation."
|
summary: "Published a signed attestation."
|
||||||
description: "Instructs the beacon node to publish a newly signed IndexedAttestation object, to be incorporated into the beacon chain."
|
description: "Instructs the beacon node to publish a newly signed IndexedAttestation object, to be incorporated into the beacon chain."
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -263,7 +263,7 @@ components:
|
||||||
type: integer
|
type: integer
|
||||||
format: uint64
|
format: uint64
|
||||||
description: "The shard in which the validator must attest."
|
description: "The shard in which the validator must attest."
|
||||||
block_production_slot:
|
block_proposal_slot:
|
||||||
type: integer
|
type: integer
|
||||||
format: uint64
|
format: uint64
|
||||||
nullable: true
|
nullable: true
|
||||||
|
@ -537,15 +537,15 @@ components:
|
||||||
type: object
|
type: object
|
||||||
description: "The [`IndexedAttestation`](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#indexedattestation) object from the Eth2.0 spec."
|
description: "The [`IndexedAttestation`](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#indexedattestation) object from the Eth2.0 spec."
|
||||||
properties:
|
properties:
|
||||||
custody_bit_0_indicies:
|
custody_bit_0_indices:
|
||||||
type: array
|
type: array
|
||||||
description: "Validator indicies for 0 bits."
|
description: "Validator indices for 0 bits."
|
||||||
items:
|
items:
|
||||||
type: integer
|
type: integer
|
||||||
format: uint64
|
format: uint64
|
||||||
custody_bit_1_indicies:
|
custody_bit_1_indices:
|
||||||
type: array
|
type: array
|
||||||
description: "Validator indicies for 1 bits."
|
description: "Validator indices for 1 bits."
|
||||||
items:
|
items:
|
||||||
type: integer
|
type: integer
|
||||||
format: uint64
|
format: uint64
|
||||||
|
@ -611,3 +611,5 @@ components:
|
||||||
description: "Beacon node internal error."
|
description: "Beacon node internal error."
|
||||||
CurrentlySyncing:
|
CurrentlySyncing:
|
||||||
description: "Beacon node is currently syncing, try again later."
|
description: "Beacon node is currently syncing, try again later."
|
||||||
|
NotFound:
|
||||||
|
description: "The requested API endpoint does not exist."
|
||||||
|
|
Loading…
Reference in New Issue