Skip to content

Commit

Permalink
Add suppport for batch feed API at dataapi (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Jan 23, 2025
1 parent 62d8283 commit d8a09a3
Show file tree
Hide file tree
Showing 5 changed files with 703 additions and 27 deletions.
172 changes: 166 additions & 6 deletions disperser/dataapi/docs/v2/V2_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,63 @@ const docTemplateV2 = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/batches/feed": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Blob"
],
"summary": "Fetch batch feed",
"parameters": [
{
"type": "string",
"description": "Fetch batches up to the end time (ISO 8601 format: 2006-01-02T15:04:05Z) [default: now]",
"name": "end",
"in": "query"
},
{
"type": "integer",
"description": "Fetch batches starting from an interval (in seconds) before the end time [default: 3600]",
"name": "interval",
"in": "query"
},
{
"type": "integer",
"description": "The maximum number of batches to fetch. System max (1000) if limit \u003c= 0 [default: 20; max: 1000]",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v2.BatchFeedResponse"
}
},
"400": {
"description": "error: Bad request",
"schema": {
"$ref": "#/definitions/v2.ErrorResponse"
}
},
"404": {
"description": "error: Not found",
"schema": {
"$ref": "#/definitions/v2.ErrorResponse"
}
},
"500": {
"description": "error: Server error",
"schema": {
"$ref": "#/definitions/v2.ErrorResponse"
}
}
}
}
},
"/batches/{batch_header_hash}": {
"get": {
"produces": [
Expand Down Expand Up @@ -61,6 +118,69 @@ const docTemplateV2 = `{
}
}
},
"/blobs/feed": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Blob"
],
"summary": "Fetch blob feed",
"parameters": [
{
"type": "string",
"description": "Fetch blobs up to the end time (ISO 8601 format: 2006-01-02T15:04:05Z) [default: now]",
"name": "end",
"in": "query"
},
{
"type": "integer",
"description": "Fetch blobs starting from an interval (in seconds) before the end time [default: 3600]",
"name": "interval",
"in": "query"
},
{
"type": "string",
"description": "Fetch blobs starting from the pagination token (exclusively). Overrides the interval param if specified [default: empty]",
"name": "pagination_token",
"in": "query"
},
{
"type": "integer",
"description": "The maximum number of blobs to fetch. System max (1000) if limit \u003c= 0 [default: 20; max: 1000]",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v2.BlobFeedResponse"
}
},
"400": {
"description": "error: Bad request",
"schema": {
"$ref": "#/definitions/v2.ErrorResponse"
}
},
"404": {
"description": "error: Not found",
"schema": {
"$ref": "#/definitions/v2.ErrorResponse"
}
},
"500": {
"description": "error: Server error",
"schema": {
"$ref": "#/definitions/v2.ErrorResponse"
}
}
}
}
},
"/blobs/{blob_key}": {
"get": {
"produces": [
Expand Down Expand Up @@ -562,7 +682,7 @@ const docTemplateV2 = `{
"type": "string"
},
"cumulative_payment": {
"description": "TODO: we are thinking the contract can use uint128 for cumulative payment,\nbut the definition on v2 uses uint64. Double check with team.",
"description": "CumulativePayment represents the total amount of payment (in wei) made by the user up to this point",
"allOf": [
{
"$ref": "#/definitions/big.Int"
Expand All @@ -572,10 +692,6 @@ const docTemplateV2 = `{
"reservation_period": {
"description": "ReservationPeriod represents the range of time at which the dispersal is made",
"type": "integer"
},
"salt": {
"description": "Allow same blob to be dispersed multiple times within the same reservation period",
"type": "integer"
}
}
},
Expand Down Expand Up @@ -753,8 +869,12 @@ const docTemplateV2 = `{
"type": "integer"
}
},
"salt": {
"description": "Salt is used to make blob intentionally unique when everything else is the same",
"type": "integer"
},
"signature": {
"description": "Signature is the signature of the blob header by the account ID",
"description": "Signature is an ECDSA signature signed by the blob request signer's account ID over the BlobHeader's blobKey,\nwhich is a keccak hash of the serialized BlobHeader, and used to verify against blob dispersal request's account ID",
"type": "array",
"items": {
"type": "integer"
Expand Down Expand Up @@ -855,6 +975,46 @@ const docTemplateV2 = `{
}
}
},
"v2.BatchFeedResponse": {
"type": "object",
"properties": {
"batches": {
"type": "array",
"items": {
"$ref": "#/definitions/v2.BatchInfo"
}
}
}
},
"v2.BatchInfo": {
"type": "object",
"properties": {
"aggregated_signature": {
"$ref": "#/definitions/core.Signature"
},
"attested_at": {
"type": "integer"
},
"batch_header": {
"$ref": "#/definitions/github_com_Layr-Labs_eigenda_core_v2.BatchHeader"
},
"batch_header_hash": {
"type": "string"
},
"quorum_numbers": {
"type": "array",
"items": {
"type": "integer"
}
},
"quorum_signed_percentages": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
}
},
"v2.BatchResponse": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit d8a09a3

Please sign in to comment.