forked from ethereum/beacon-APIs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added POST /eth/v1/beacon/blocks back in place
Mistakenly removed in ethereum#218, this PR puts back the /eth/v1/beacon/blocks POST.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
post: | ||
tags: | ||
- Beacon | ||
- ValidatorRequiredApi | ||
summary: "Publish a signed block." | ||
operationId: "publishBlock" | ||
description: | | ||
Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, | ||
to be included in the beacon chain. The beacon node is not required to validate the signed | ||
`BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been | ||
successful. The beacon node is expected to integrate the new block into its state, and | ||
therefore validate the block internally, however blocks which fail the validation are still | ||
broadcast but a different status code is returned (202) | ||
parameters: | ||
- in: header | ||
schema: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' | ||
required: false | ||
name: Eth-Consensus-Version | ||
description: "Version of the block being submitted, if using SSZ encoding." | ||
requestBody: | ||
description: "The `SignedBeaconBlock` object composed of `BeaconBlock` object (produced by beacon node) and validator signature." | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
oneOf: | ||
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/SignedBeaconBlock' | ||
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock" | ||
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBeaconBlock" | ||
application/octet-stream: | ||
schema: | ||
description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body." | ||
responses: | ||
"200": | ||
description: "The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database." | ||
"202": | ||
description: "The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database." | ||
"400": | ||
description: "The `SignedBeaconBlock` object is invalid" | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
- example: | ||
code: 400 | ||
message: "Invalid block: missing signature" | ||
"500": | ||
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' | ||
"503": | ||
$ref: '../../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters