Skip to content

Commit

Permalink
algod: Add API Endpoint to fetch TxIDs from block (#5611)
Browse files Browse the repository at this point in the history
Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com>
  • Loading branch information
algochoi and tzaffi committed Aug 9, 2023
1 parent 4dc3f92 commit 867aa17
Show file tree
Hide file tree
Showing 12 changed files with 1,428 additions and 1,135 deletions.
76 changes: 76 additions & 0 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,64 @@
}
]
},
"/v2/blocks/{round}/txids": {
"get": {
"tags": [
"public",
"nonparticipating"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"summary": "Get the top level transaction IDs for the block on the given round.",
"operationId": "GetBlockTxids",
"parameters": [
{
"minimum": 0,
"type": "integer",
"description": "The round from which to fetch block transaction IDs.",
"name": "round",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/BlockTxidsResponse"
},
"400": {
"description": "Bad Request - Non integer number",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Invalid API Token",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "Non existing block",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Unknown Error"
}
}
}
},
"/v2/blocks/{round}/hash": {
"get": {
"tags": [
Expand Down Expand Up @@ -4350,6 +4408,24 @@
}
}
},
"BlockTxidsResponse": {
"description": "Top level transaction IDs in a block.",
"schema": {
"type": "object",
"required": [
"blockTxids"
],
"properties": {
"blockTxids": {
"description": "Block transaction IDs.",
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"BlockHashResponse": {
"description": "Hash of a block header.",
"schema": {
Expand Down
112 changes: 112 additions & 0 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,28 @@
},
"description": "Encoded block object."
},
"BlockTxidsResponse": {
"content": {
"application/json": {
"schema": {
"properties": {
"blockTxids": {
"description": "Block transaction IDs.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"blockTxids"
],
"type": "object"
}
}
},
"description": "Top level transaction IDs in a block."
},
"BoxResponse": {
"content": {
"application/json": {
Expand Down Expand Up @@ -3817,6 +3839,96 @@
]
}
},
"/v2/blocks/{round}/txids": {
"get": {
"operationId": "GetBlockTxids",
"parameters": [
{
"description": "The round from which to fetch block transaction IDs.",
"in": "path",
"name": "round",
"required": true,
"schema": {
"minimum": 0,
"type": "integer"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"blockTxids": {
"description": "Block transaction IDs.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"blockTxids"
],
"type": "object"
}
}
},
"description": "Top level transaction IDs in a block."
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Request - Non integer number"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Invalid API Token"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Non existing block"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Internal Error"
},
"default": {
"content": {},
"description": "Unknown Error"
}
},
"summary": "Get the top level transaction IDs for the block on the given round.",
"tags": [
"public",
"nonparticipating"
]
}
},
"/v2/catchup/{catchpoint}": {
"delete": {
"description": "Given a catchpoint, it aborts catching up to this catchpoint",
Expand Down

0 comments on commit 867aa17

Please sign in to comment.