Skip to content

Commit

Permalink
API: New algod endpoint /v2/block/{round}/header omits transactions…
Browse files Browse the repository at this point in the history
… and cert from response (#6163)
  • Loading branch information
nullun authored Nov 18, 2024
1 parent e97beee commit a6123b6
Show file tree
Hide file tree
Showing 11 changed files with 1,671 additions and 1,327 deletions.
78 changes: 78 additions & 0 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,68 @@
}
}
},
"/v2/blocks/{round}/header": {
"get": {
"tags": [
"public",
"nonparticipating"
],
"produces": [
"application/json",
"application/msgpack"
],
"schemes": [
"http"
],
"summary": "Get the block header for the block on the given round.",
"operationId": "GetBlockHeader",
"parameters": [
{
"minimum": 0,
"type": "integer",
"description": "The round from which to fetch block header information.",
"name": "round",
"in": "path",
"required": true
},
{
"$ref": "#/parameters/format"
}
],
"responses": {
"200": {
"$ref": "#/responses/BlockHeaderResponse"
},
"400": {
"description": "Bad Request - Non integer number",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Invalid API Token",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "None existing block ",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Unknown Error"
}
}
}
},
"/v2/blocks/{round}/transactions/{txid}/proof": {
"get": {
"tags": [
Expand Down Expand Up @@ -5106,6 +5168,22 @@
}
}
},
"BlockHeaderResponse": {
"description": "Block header.",
"schema": {
"type": "object",
"required": [
"blockHeader"
],
"properties": {
"blockHeader": {
"description": "Block header data.",
"type": "object",
"x-algorand-format": "BlockHeader"
}
}
}
},
"TransactionProofResponse": {
"description": "Proof of transaction in a block.",
"schema": {
Expand Down
158 changes: 158 additions & 0 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,27 @@
},
"description": "Hash of a block header."
},
"BlockHeaderResponse": {
"content": {
"application/json": {
"schema": {
"properties": {
"blockHeader": {
"description": "Block header data.",
"properties": {},
"type": "object",
"x-algorand-format": "BlockHeader"
}
},
"required": [
"blockHeader"
],
"type": "object"
}
}
},
"description": "Block header."
},
"BlockLogsResponse": {
"content": {
"application/json": {
Expand Down Expand Up @@ -4203,6 +4224,143 @@
]
}
},
"/v2/blocks/{round}/header": {
"get": {
"operationId": "GetBlockHeader",
"parameters": [
{
"description": "The round from which to fetch block header information.",
"in": "path",
"name": "round",
"required": true,
"schema": {
"minimum": 0,
"type": "integer"
}
},
{
"description": "Configures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.",
"in": "query",
"name": "format",
"schema": {
"enum": [
"json",
"msgpack"
],
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"blockHeader": {
"description": "Block header data.",
"properties": {},
"type": "object",
"x-algorand-format": "BlockHeader"
}
},
"required": [
"blockHeader"
],
"type": "object"
}
},
"application/msgpack": {
"schema": {
"properties": {
"blockHeader": {
"description": "Block header data.",
"properties": {},
"type": "object",
"x-algorand-format": "BlockHeader"
}
},
"required": [
"blockHeader"
],
"type": "object"
}
}
},
"description": "Block header."
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
},
"application/msgpack": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Request - Non integer number"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
},
"application/msgpack": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Invalid API Token"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
},
"application/msgpack": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "None existing block "
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
},
"application/msgpack": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Internal Error"
},
"default": {
"content": {},
"description": "Unknown Error"
}
},
"summary": "Get the block header for the block on the given round.",
"tags": [
"public",
"nonparticipating"
]
}
},
"/v2/blocks/{round}/lightheader/proof": {
"get": {
"operationId": "GetLightBlockHeaderProof",
Expand Down
Loading

0 comments on commit a6123b6

Please sign in to comment.