Skip to content

Commit

Permalink
Support blob and batch fetch APIs (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Dec 10, 2024
1 parent 3552a36 commit ccc1e9a
Show file tree
Hide file tree
Showing 7 changed files with 879 additions and 78 deletions.
188 changes: 187 additions & 1 deletion disperser/dataapi/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,98 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/batch/{batch_header_hash}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Feed"
],
"summary": "Fetch batch by the batch header hash",
"parameters": [
{
"type": "string",
"description": "Batch header hash in hex string",
"name": "batch_header_hash",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.BlobResponse"
}
},
"400": {
"description": "error: Bad request",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
},
"404": {
"description": "error: Not found",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
},
"500": {
"description": "error: Server error",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
}
}
}
},
"/blob/{blob_key}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Feed"
],
"summary": "Fetch blob metadata by blob key",
"parameters": [
{
"type": "string",
"description": "Blob key in hex string",
"name": "blob_key",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.BlobResponse"
}
},
"400": {
"description": "error: Bad request",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
},
"404": {
"description": "error: Not found",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
},
"500": {
"description": "error: Server error",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
}
}
}
},
"/feed/batches/{batch_header_hash}/blobs": {
"get": {
"produces": [
Expand Down Expand Up @@ -750,6 +842,27 @@ const docTemplate = `{
"big.Int": {
"type": "object"
},
"core.PaymentMetadata": {
"type": "object",
"properties": {
"account_id": {
"description": "AccountID is the ETH account address for the payer",
"type": "string"
},
"bin_index": {
"description": "BinIndex represents the range of time at which the dispersal is made",
"type": "integer"
},
"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.",
"allOf": [
{
"$ref": "#/definitions/big.Int"
}
]
}
}
},
"core.SecurityParam": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -823,6 +936,23 @@ const docTemplate = `{
}
}
},
"dataapi.BlobResponse": {
"type": "object",
"properties": {
"blob_header": {
"$ref": "#/definitions/github_com_Layr-Labs_eigenda_core_v2.BlobHeader"
},
"blob_size_bytes": {
"type": "integer"
},
"dispersed_at": {
"type": "integer"
},
"status": {
"type": "string"
}
}
},
"dataapi.BlobsResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1060,7 +1190,7 @@ const docTemplate = `{
"semver": {
"type": "object",
"additionalProperties": {
"type": "integer"
"$ref": "#/definitions/semver.SemverMetrics"
}
}
}
Expand Down Expand Up @@ -1145,6 +1275,39 @@ const docTemplate = `{
}
}
},
"github_com_Layr-Labs_eigenda_core_v2.BlobHeader": {
"type": "object",
"properties": {
"blobCommitments": {
"$ref": "#/definitions/encoding.BlobCommitments"
},
"blobVersion": {
"type": "integer"
},
"paymentMetadata": {
"description": "PaymentMetadata contains the payment information for the blob",
"allOf": [
{
"$ref": "#/definitions/core.PaymentMetadata"
}
]
},
"quorumNumbers": {
"description": "QuorumNumbers contains the quorums the blob is dispersed to",
"type": "array",
"items": {
"type": "integer"
}
},
"signature": {
"description": "Signature is the signature of the blob header by the account ID",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"github_com_Layr-Labs_eigenda_disperser.BlobStatus": {
"type": "integer",
"enum": [
Expand Down Expand Up @@ -1174,6 +1337,29 @@ const docTemplate = `{
}
}
}
},
"semver.SemverMetrics": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"operators": {
"type": "array",
"items": {
"type": "string"
}
},
"semver": {
"type": "string"
},
"stake_percentage": {
"type": "object",
"additionalProperties": {
"type": "number"
}
}
}
}
}
}`
Expand Down
Loading

0 comments on commit ccc1e9a

Please sign in to comment.