diff --git a/disperser/cmd/dataapi/main.go b/disperser/cmd/dataapi/main.go index 7053639e0c..5a098f06d7 100644 --- a/disperser/cmd/dataapi/main.go +++ b/disperser/cmd/dataapi/main.go @@ -18,6 +18,7 @@ import ( "github.com/Layr-Labs/eigenda/disperser/common/blobstore" blobstorev2 "github.com/Layr-Labs/eigenda/disperser/common/v2/blobstore" "github.com/Layr-Labs/eigenda/disperser/dataapi" + "github.com/Layr-Labs/eigenda/disperser/dataapi/prometheus" "github.com/Layr-Labs/eigenda/disperser/dataapi/subgraph" "github.com/Layr-Labs/eigensdk-go/logging" @@ -33,10 +34,6 @@ var ( gitDate string ) -// @title EigenDA Data Access API -// @description This is the EigenDA Data Access API server. -// @version 1 -// @Schemes https http func main() { app := cli.NewApp() app.Flags = flags.Flags diff --git a/disperser/dataapi/Makefile b/disperser/dataapi/Makefile index 0d41147d5b..794065f373 100644 --- a/disperser/dataapi/Makefile +++ b/disperser/dataapi/Makefile @@ -1,10 +1,17 @@ -build: +build: cd .. && go build -o ./bin/dataapi ./cmd/dataapi test: go test -v . -generate-swagger: - @echo " > Generating swagger..." - swag init -g ../cmd/dataapi/main.go --parseDependency - swag fmt +generate-swagger-v1: + @echo " > Generating v1 swagger..." + swag init -g swagger.go --parseDependency --parseInternal --output docs/v1 --instanceName V1 --packageName v1 --dir ./v1 --parseDepth 1 + swag fmt --dir ./v1 + +generate-swagger-v2: + @echo " > Generating v2 swagger..." + swag init -g swagger.go --parseDependency --parseInternal --output docs/v2 --instanceName V2 --packageName v2 --dir ./v2 --parseDepth 1 + swag fmt --dir ./v2 + +generate-swagger: generate-swagger-v1 generate-swagger-v2 diff --git a/disperser/dataapi/docs/docs.go b/disperser/dataapi/docs/v1/v1_docs.go similarity index 67% rename from disperser/dataapi/docs/docs.go rename to disperser/dataapi/docs/v1/v1_docs.go index 550f7938ed..b0e9b04e0b 100644 --- a/disperser/dataapi/docs/docs.go +++ b/disperser/dataapi/docs/v1/v1_docs.go @@ -1,9 +1,9 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT -package docs +// Package v1 Code generated by swaggo/swag. DO NOT EDIT +package v1 import "github.com/swaggo/swag" -const docTemplate = `{ +const docTemplateV1 = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { @@ -15,98 +15,6 @@ 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": [ @@ -141,25 +49,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.BlobsResponse" + "$ref": "#/definitions/v1.BlobsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -186,25 +94,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.BlobsResponse" + "$ref": "#/definitions/v1.BlobsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -232,25 +140,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.BlobMetadataResponse" + "$ref": "#/definitions/v1.BlobMetadataResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -289,25 +197,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.Metric" + "$ref": "#/definitions/v1.Metric" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -319,32 +227,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Batcher Availability" + "ServiceAvailability" ], - "summary": "Get status of EigenDA batcher.", + "summary": "Get status of EigenDA batcher", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.ServiceAvailabilityResponse" + "$ref": "#/definitions/v1.ServiceAvailabilityResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -356,32 +264,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Churner ServiceAvailability" + "ServiceAvailability" ], - "summary": "Get status of EigenDA churner service.", + "summary": "Get status of EigenDA churner service", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.ServiceAvailabilityResponse" + "$ref": "#/definitions/v1.ServiceAvailabilityResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -395,30 +303,30 @@ const docTemplate = `{ "tags": [ "ServiceAvailability" ], - "summary": "Get status of EigenDA Disperser service.", + "summary": "Get status of EigenDA Disperser service", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.ServiceAvailabilityResponse" + "$ref": "#/definitions/v1.ServiceAvailabilityResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -447,26 +355,26 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.NonSigner" + "$ref": "#/definitions/v1.NonSigner" } } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -505,25 +413,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.OperatorsNonsigningPercentage" + "$ref": "#/definitions/v1.OperatorsNonsigningPercentage" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -558,26 +466,26 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.Throughput" + "$ref": "#/definitions/v1.Throughput" } } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -591,30 +499,30 @@ const docTemplate = `{ "tags": [ "OperatorsInfo" ], - "summary": "Fetch list of operators that have been deregistered for days. Days is a query parameter with a default value of 14 and max value of 30.", + "summary": "Fetch list of operators that have been deregistered for days", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse" + "$ref": "#/definitions/v1.QueriedStateOperatorsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -628,7 +536,7 @@ const docTemplate = `{ "tags": [ "OperatorsInfo" ], - "summary": "Fetch list of operator ejections over last N days.", + "summary": "Fetch list of operator ejections over last N days", "parameters": [ { "type": "integer", @@ -659,25 +567,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.QueriedOperatorEjectionsResponse" + "$ref": "#/definitions/v1.QueriedOperatorEjectionsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -705,25 +613,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.OperatorsStakeResponse" + "$ref": "#/definitions/v1.OperatorsStakeResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -751,25 +659,25 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.OperatorPortCheckResponse" + "$ref": "#/definitions/v1.OperatorPortCheckResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -783,30 +691,30 @@ const docTemplate = `{ "tags": [ "OperatorsInfo" ], - "summary": "Fetch list of operators that have been registered for days. Days is a query parameter with a default value of 14 and max value of 30.", + "summary": "Fetch list of operators that have been registered for days", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse" + "$ref": "#/definitions/v1.QueriedStateOperatorsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -825,184 +733,159 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.SemverReportResponse" + "$ref": "#/definitions/v1.SemverReportResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } } + } + }, + "definitions": { + "big.Int": { + "type": "object" }, - "/operators/nodeinfo": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "OperatorsNodeInfo" - ], - "summary": "Active operator semver", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dataapi.SemverReportResponse" - } - }, - "500": { - "description": "error: Server error", - "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" - } - } + "core.SecurityParam": { + "type": "object", + "properties": { + "adversaryThreshold": { + "description": "AdversaryThreshold is the maximum amount of stake that can be controlled by an adversary in the quorum as a percentage of the total stake in the quorum", + "type": "integer" + }, + "confirmationThreshold": { + "description": "ConfirmationThreshold is the amount of stake that must sign a message for it to be considered valid as a percentage of the total stake in the quorum", + "type": "integer" + }, + "quorumID": { + "type": "integer" + }, + "quorumRate": { + "description": "Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used\nfor restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the\ndata was posted to the DA node.", + "type": "integer" } } }, - "/operators/reachability": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "OperatorsReachability" - ], - "summary": "Operator node reachability check", - "parameters": [ - { - "type": "string", - "description": "Operator ID in hex string [default: all operators if unspecified]", - "name": "operator_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dataapi.OperatorPortCheckResponse" - } - }, - "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" - } - } + "encoding.BlobCommitments": { + "type": "object", + "properties": { + "commitment": { + "$ref": "#/definitions/encoding.G1Commitment" + }, + "length": { + "type": "integer" + }, + "length_commitment": { + "$ref": "#/definitions/encoding.G2Commitment" + }, + "length_proof": { + "$ref": "#/definitions/encoding.LengthProof" } } }, - "/operators/stake": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "OperatorsStake" - ], - "summary": "Operator stake distribution query", - "parameters": [ - { - "type": "string", - "description": "Operator ID in hex string [default: all operators if unspecified]", - "name": "operator_id", - "in": "query" + "encoding.G1Commitment": { + "type": "object", + "properties": { + "x": { + "type": "array", + "items": { + "type": "integer" } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dataapi.OperatorsStakeResponse" - } - }, - "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" - } + }, + "y": { + "type": "array", + "items": { + "type": "integer" } } } - } - }, - "definitions": { - "big.Int": { - "type": "object" }, - "core.PaymentMetadata": { + "encoding.G2Commitment": { "type": "object", "properties": { - "account_id": { - "description": "AccountID is the ETH account address for the payer", - "type": "string" + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" }, - "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" - } - ] + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "encoding.LengthProof": { + "type": "object", + "properties": { + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" }, - "reservation_period": { - "description": "ReservationPeriod represents the range of time at which the dispersal is made", - "type": "integer" + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "github_com_Layr-Labs_eigenda_disperser.BlobStatus": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "x-enum-varnames": [ + "Processing", + "Confirmed", + "Failed", + "Finalized", + "InsufficientSignatures", + "Dispersing" + ] + }, + "github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { + "type": "object", + "properties": { + "a0": { + "type": "array", + "items": { + "type": "integer" + } }, - "salt": { - "description": "Allow same blob to be dispersed multiple times within the same reservation period", - "type": "integer" + "a1": { + "type": "array", + "items": { + "type": "integer" + } } } }, - "core.SecurityParam": { + "semver.SemverMetrics": { "type": "object", "properties": { - "adversaryThreshold": { - "description": "AdversaryThreshold is the maximum amount of stake that can be controlled by an adversary in the quorum as a percentage of the total stake in the quorum", + "count": { "type": "integer" }, - "confirmationThreshold": { - "description": "ConfirmationThreshold is the amount of stake that must sign a message for it to be considered valid as a percentage of the total stake in the quorum", - "type": "integer" + "operators": { + "type": "array", + "items": { + "type": "string" + } }, - "quorumID": { - "type": "integer" + "semver": { + "type": "string" }, - "quorumRate": { - "description": "Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used\nfor restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the\ndata was posted to the DA node.", - "type": "integer" + "stake_percentage": { + "type": "object", + "additionalProperties": { + "type": "number" + } } } }, - "dataapi.BlobMetadataResponse": { + "v1.BlobMetadataResponse": { "type": "object", "properties": { "batch_header_hash": { @@ -1055,38 +938,21 @@ 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": { + "v1.BlobsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.BlobMetadataResponse" + "$ref": "#/definitions/v1.BlobMetadataResponse" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.ErrorResponse": { + "v1.ErrorResponse": { "type": "object", "properties": { "error": { @@ -1094,7 +960,7 @@ const docTemplate = `{ } } }, - "dataapi.Meta": { + "v1.Meta": { "type": "object", "properties": { "next_token": { @@ -1105,7 +971,7 @@ const docTemplate = `{ } } }, - "dataapi.Metric": { + "v1.Metric": { "type": "object", "properties": { "cost_in_gas": { @@ -1115,12 +981,7 @@ const docTemplate = `{ "type": "number" }, "total_stake": { - "description": "deprecated: use TotalStakePerQuorum instead. Remove when the frontend is updated.", - "allOf": [ - { - "$ref": "#/definitions/big.Int" - } - ] + "$ref": "#/definitions/big.Int" }, "total_stake_per_quorum": { "type": "object", @@ -1130,18 +991,27 @@ const docTemplate = `{ } } }, - "dataapi.NonSigner": { + "v1.NonSigner": { "type": "object", "properties": { - "count": { - "type": "integer" + "error_rate": { + "type": "number" }, - "operatorId": { + "operator_address": { "type": "string" + }, + "operator_id": { + "type": "string" + }, + "quorum_id": { + "type": "integer" + }, + "total_batches": { + "type": "integer" } } }, - "dataapi.OperatorNonsigningPercentageMetrics": { + "v1.OperatorNonsigningPercentageMetrics": { "type": "object", "properties": { "operator_address": { @@ -1167,7 +1037,7 @@ const docTemplate = `{ } } }, - "dataapi.OperatorPortCheckResponse": { + "v1.OperatorPortCheckResponse": { "type": "object", "properties": { "dispersal_online": { @@ -1187,7 +1057,7 @@ const docTemplate = `{ } } }, - "dataapi.OperatorStake": { + "v1.OperatorStake": { "type": "object", "properties": { "operator_id": { @@ -1204,21 +1074,21 @@ const docTemplate = `{ } } }, - "dataapi.OperatorsNonsigningPercentage": { + "v1.OperatorsNonsigningPercentage": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.OperatorNonsigningPercentageMetrics" + "$ref": "#/definitions/v1.OperatorNonsigningPercentageMetrics" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.OperatorsStakeResponse": { + "v1.OperatorsStakeResponse": { "type": "object", "properties": { "stake_ranked_operators": { @@ -1226,13 +1096,13 @@ const docTemplate = `{ "additionalProperties": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.OperatorStake" + "$ref": "#/definitions/v1.OperatorStake" } } } } }, - "dataapi.QueriedOperatorEjections": { + "v1.QueriedOperatorEjections": { "type": "object", "properties": { "block_number": { @@ -1258,18 +1128,18 @@ const docTemplate = `{ } } }, - "dataapi.QueriedOperatorEjectionsResponse": { + "v1.QueriedOperatorEjectionsResponse": { "type": "object", "properties": { "ejections": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.QueriedOperatorEjections" + "$ref": "#/definitions/v1.QueriedOperatorEjections" } } } }, - "dataapi.QueriedStateOperatorMetadata": { + "v1.QueriedStateOperatorMetadata": { "type": "object", "properties": { "block_number": { @@ -1289,21 +1159,21 @@ const docTemplate = `{ } } }, - "dataapi.QueriedStateOperatorsResponse": { + "v1.QueriedStateOperatorsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.QueriedStateOperatorMetadata" + "$ref": "#/definitions/v1.QueriedStateOperatorMetadata" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.SemverReportResponse": { + "v1.SemverReportResponse": { "type": "object", "properties": { "semver": { @@ -1314,7 +1184,7 @@ const docTemplate = `{ } } }, - "dataapi.ServiceAvailability": { + "v1.ServiceAvailability": { "type": "object", "properties": { "service_name": { @@ -1325,21 +1195,21 @@ const docTemplate = `{ } } }, - "dataapi.ServiceAvailabilityResponse": { + "v1.ServiceAvailabilityResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.ServiceAvailability" + "$ref": "#/definitions/v1.ServiceAvailability" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.Throughput": { + "v1.Throughput": { "type": "object", "properties": { "throughput": { @@ -1349,154 +1219,24 @@ const docTemplate = `{ "type": "integer" } } - }, - "encoding.BlobCommitments": { - "type": "object", - "properties": { - "commitment": { - "$ref": "#/definitions/encoding.G1Commitment" - }, - "length": { - "type": "integer" - }, - "length_commitment": { - "$ref": "#/definitions/encoding.G2Commitment" - }, - "length_proof": { - "$ref": "#/definitions/encoding.LengthProof" - } - } - }, - "encoding.G1Commitment": { - "type": "object", - "properties": { - "x": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "encoding.G2Commitment": { - "type": "object", - "properties": { - "x": { - "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" - } - } - }, - "encoding.LengthProof": { - "type": "object", - "properties": { - "x": { - "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" - } - } - }, - "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": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "x-enum-varnames": [ - "Processing", - "Confirmed", - "Failed", - "Finalized", - "InsufficientSignatures", - "Dispersing" - ] - }, - "github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { - "type": "object", - "properties": { - "a0": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "semver.SemverMetrics": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "operators": { - "type": "array", - "items": { - "type": "string" - } - }, - "semver": { - "type": "string" - }, - "stake_percentage": { - "type": "object", - "additionalProperties": { - "type": "number" - } - } - } } } }` -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1", +// SwaggerInfoV1 holds exported Swagger Info so clients can modify it +var SwaggerInfoV1 = &swag.Spec{ + Version: "1.0", Host: "", - BasePath: "", + BasePath: "/api/v1", Schemes: []string{"https", "http"}, - Title: "EigenDA Data Access API", - Description: "This is the EigenDA Data Access API server.", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, + Title: "EigenDA Data Access API V1", + Description: "This is the EigenDA Data Access API V1 server.", + InfoInstanceName: "V1", + SwaggerTemplate: docTemplateV1, LeftDelim: "{{", RightDelim: "}}", } func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) + swag.Register(SwaggerInfoV1.InstanceName(), SwaggerInfoV1) } diff --git a/disperser/dataapi/docs/swagger.json b/disperser/dataapi/docs/v1/v1_swagger.json similarity index 67% rename from disperser/dataapi/docs/swagger.json rename to disperser/dataapi/docs/v1/v1_swagger.json index 1fc232d13d..f2647d7fdb 100644 --- a/disperser/dataapi/docs/swagger.json +++ b/disperser/dataapi/docs/v1/v1_swagger.json @@ -5,104 +5,13 @@ ], "swagger": "2.0", "info": { - "description": "This is the EigenDA Data Access API server.", - "title": "EigenDA Data Access API", + "description": "This is the EigenDA Data Access API V1 server.", + "title": "EigenDA Data Access API V1", "contact": {}, - "version": "1" + "version": "1.0" }, + "basePath": "/api/v1", "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": [ @@ -137,25 +46,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.BlobsResponse" + "$ref": "#/definitions/v1.BlobsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -182,25 +91,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.BlobsResponse" + "$ref": "#/definitions/v1.BlobsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -228,25 +137,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.BlobMetadataResponse" + "$ref": "#/definitions/v1.BlobMetadataResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -285,25 +194,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.Metric" + "$ref": "#/definitions/v1.Metric" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -315,32 +224,32 @@ "application/json" ], "tags": [ - "Batcher Availability" + "ServiceAvailability" ], - "summary": "Get status of EigenDA batcher.", + "summary": "Get status of EigenDA batcher", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.ServiceAvailabilityResponse" + "$ref": "#/definitions/v1.ServiceAvailabilityResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -352,32 +261,32 @@ "application/json" ], "tags": [ - "Churner ServiceAvailability" + "ServiceAvailability" ], - "summary": "Get status of EigenDA churner service.", + "summary": "Get status of EigenDA churner service", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.ServiceAvailabilityResponse" + "$ref": "#/definitions/v1.ServiceAvailabilityResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -391,30 +300,30 @@ "tags": [ "ServiceAvailability" ], - "summary": "Get status of EigenDA Disperser service.", + "summary": "Get status of EigenDA Disperser service", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.ServiceAvailabilityResponse" + "$ref": "#/definitions/v1.ServiceAvailabilityResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -443,26 +352,26 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.NonSigner" + "$ref": "#/definitions/v1.NonSigner" } } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -501,25 +410,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.OperatorsNonsigningPercentage" + "$ref": "#/definitions/v1.OperatorsNonsigningPercentage" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -554,26 +463,26 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.Throughput" + "$ref": "#/definitions/v1.Throughput" } } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -587,30 +496,30 @@ "tags": [ "OperatorsInfo" ], - "summary": "Fetch list of operators that have been deregistered for days. Days is a query parameter with a default value of 14 and max value of 30.", + "summary": "Fetch list of operators that have been deregistered for days", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse" + "$ref": "#/definitions/v1.QueriedStateOperatorsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -624,7 +533,7 @@ "tags": [ "OperatorsInfo" ], - "summary": "Fetch list of operator ejections over last N days.", + "summary": "Fetch list of operator ejections over last N days", "parameters": [ { "type": "integer", @@ -655,25 +564,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.QueriedOperatorEjectionsResponse" + "$ref": "#/definitions/v1.QueriedOperatorEjectionsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -701,25 +610,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.OperatorsStakeResponse" + "$ref": "#/definitions/v1.OperatorsStakeResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -747,25 +656,25 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.OperatorPortCheckResponse" + "$ref": "#/definitions/v1.OperatorPortCheckResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -779,30 +688,30 @@ "tags": [ "OperatorsInfo" ], - "summary": "Fetch list of operators that have been registered for days. Days is a query parameter with a default value of 14 and max value of 30.", + "summary": "Fetch list of operators that have been registered for days", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse" + "$ref": "#/definitions/v1.QueriedStateOperatorsResponse" } }, "400": { "description": "error: Bad request", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "404": { "description": "error: Not found", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } @@ -821,184 +730,159 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dataapi.SemverReportResponse" + "$ref": "#/definitions/v1.SemverReportResponse" } }, "500": { "description": "error: Server error", "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" + "$ref": "#/definitions/v1.ErrorResponse" } } } } + } + }, + "definitions": { + "big.Int": { + "type": "object" }, - "/operators/nodeinfo": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "OperatorsNodeInfo" - ], - "summary": "Active operator semver", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dataapi.SemverReportResponse" - } - }, - "500": { - "description": "error: Server error", - "schema": { - "$ref": "#/definitions/dataapi.ErrorResponse" - } - } + "core.SecurityParam": { + "type": "object", + "properties": { + "adversaryThreshold": { + "description": "AdversaryThreshold is the maximum amount of stake that can be controlled by an adversary in the quorum as a percentage of the total stake in the quorum", + "type": "integer" + }, + "confirmationThreshold": { + "description": "ConfirmationThreshold is the amount of stake that must sign a message for it to be considered valid as a percentage of the total stake in the quorum", + "type": "integer" + }, + "quorumID": { + "type": "integer" + }, + "quorumRate": { + "description": "Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used\nfor restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the\ndata was posted to the DA node.", + "type": "integer" } } }, - "/operators/reachability": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "OperatorsReachability" - ], - "summary": "Operator node reachability check", - "parameters": [ - { - "type": "string", - "description": "Operator ID in hex string [default: all operators if unspecified]", - "name": "operator_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dataapi.OperatorPortCheckResponse" - } - }, - "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" - } - } + "encoding.BlobCommitments": { + "type": "object", + "properties": { + "commitment": { + "$ref": "#/definitions/encoding.G1Commitment" + }, + "length": { + "type": "integer" + }, + "length_commitment": { + "$ref": "#/definitions/encoding.G2Commitment" + }, + "length_proof": { + "$ref": "#/definitions/encoding.LengthProof" } } }, - "/operators/stake": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "OperatorsStake" - ], - "summary": "Operator stake distribution query", - "parameters": [ - { - "type": "string", - "description": "Operator ID in hex string [default: all operators if unspecified]", - "name": "operator_id", - "in": "query" + "encoding.G1Commitment": { + "type": "object", + "properties": { + "x": { + "type": "array", + "items": { + "type": "integer" } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dataapi.OperatorsStakeResponse" - } - }, - "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" - } + }, + "y": { + "type": "array", + "items": { + "type": "integer" } } } - } - }, - "definitions": { - "big.Int": { - "type": "object" }, - "core.PaymentMetadata": { + "encoding.G2Commitment": { "type": "object", "properties": { - "account_id": { - "description": "AccountID is the ETH account address for the payer", - "type": "string" + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" }, - "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" - } - ] + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "encoding.LengthProof": { + "type": "object", + "properties": { + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" }, - "reservation_period": { - "description": "ReservationPeriod represents the range of time at which the dispersal is made", - "type": "integer" + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "github_com_Layr-Labs_eigenda_disperser.BlobStatus": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "x-enum-varnames": [ + "Processing", + "Confirmed", + "Failed", + "Finalized", + "InsufficientSignatures", + "Dispersing" + ] + }, + "github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { + "type": "object", + "properties": { + "a0": { + "type": "array", + "items": { + "type": "integer" + } }, - "salt": { - "description": "Allow same blob to be dispersed multiple times within the same reservation period", - "type": "integer" + "a1": { + "type": "array", + "items": { + "type": "integer" + } } } }, - "core.SecurityParam": { + "semver.SemverMetrics": { "type": "object", "properties": { - "adversaryThreshold": { - "description": "AdversaryThreshold is the maximum amount of stake that can be controlled by an adversary in the quorum as a percentage of the total stake in the quorum", + "count": { "type": "integer" }, - "confirmationThreshold": { - "description": "ConfirmationThreshold is the amount of stake that must sign a message for it to be considered valid as a percentage of the total stake in the quorum", - "type": "integer" + "operators": { + "type": "array", + "items": { + "type": "string" + } }, - "quorumID": { - "type": "integer" + "semver": { + "type": "string" }, - "quorumRate": { - "description": "Rate Limit. This is a temporary measure until the node can derive rates on its own using rollup authentication. This is used\nfor restricting the rate at which retrievers are able to download data from the DA node to a multiple of the rate at which the\ndata was posted to the DA node.", - "type": "integer" + "stake_percentage": { + "type": "object", + "additionalProperties": { + "type": "number" + } } } }, - "dataapi.BlobMetadataResponse": { + "v1.BlobMetadataResponse": { "type": "object", "properties": { "batch_header_hash": { @@ -1051,38 +935,21 @@ } } }, - "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": { + "v1.BlobsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.BlobMetadataResponse" + "$ref": "#/definitions/v1.BlobMetadataResponse" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.ErrorResponse": { + "v1.ErrorResponse": { "type": "object", "properties": { "error": { @@ -1090,7 +957,7 @@ } } }, - "dataapi.Meta": { + "v1.Meta": { "type": "object", "properties": { "next_token": { @@ -1101,7 +968,7 @@ } } }, - "dataapi.Metric": { + "v1.Metric": { "type": "object", "properties": { "cost_in_gas": { @@ -1111,12 +978,7 @@ "type": "number" }, "total_stake": { - "description": "deprecated: use TotalStakePerQuorum instead. Remove when the frontend is updated.", - "allOf": [ - { - "$ref": "#/definitions/big.Int" - } - ] + "$ref": "#/definitions/big.Int" }, "total_stake_per_quorum": { "type": "object", @@ -1126,18 +988,27 @@ } } }, - "dataapi.NonSigner": { + "v1.NonSigner": { "type": "object", "properties": { - "count": { - "type": "integer" + "error_rate": { + "type": "number" }, - "operatorId": { + "operator_address": { "type": "string" + }, + "operator_id": { + "type": "string" + }, + "quorum_id": { + "type": "integer" + }, + "total_batches": { + "type": "integer" } } }, - "dataapi.OperatorNonsigningPercentageMetrics": { + "v1.OperatorNonsigningPercentageMetrics": { "type": "object", "properties": { "operator_address": { @@ -1163,7 +1034,7 @@ } } }, - "dataapi.OperatorPortCheckResponse": { + "v1.OperatorPortCheckResponse": { "type": "object", "properties": { "dispersal_online": { @@ -1183,7 +1054,7 @@ } } }, - "dataapi.OperatorStake": { + "v1.OperatorStake": { "type": "object", "properties": { "operator_id": { @@ -1200,21 +1071,21 @@ } } }, - "dataapi.OperatorsNonsigningPercentage": { + "v1.OperatorsNonsigningPercentage": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.OperatorNonsigningPercentageMetrics" + "$ref": "#/definitions/v1.OperatorNonsigningPercentageMetrics" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.OperatorsStakeResponse": { + "v1.OperatorsStakeResponse": { "type": "object", "properties": { "stake_ranked_operators": { @@ -1222,13 +1093,13 @@ "additionalProperties": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.OperatorStake" + "$ref": "#/definitions/v1.OperatorStake" } } } } }, - "dataapi.QueriedOperatorEjections": { + "v1.QueriedOperatorEjections": { "type": "object", "properties": { "block_number": { @@ -1254,18 +1125,18 @@ } } }, - "dataapi.QueriedOperatorEjectionsResponse": { + "v1.QueriedOperatorEjectionsResponse": { "type": "object", "properties": { "ejections": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.QueriedOperatorEjections" + "$ref": "#/definitions/v1.QueriedOperatorEjections" } } } }, - "dataapi.QueriedStateOperatorMetadata": { + "v1.QueriedStateOperatorMetadata": { "type": "object", "properties": { "block_number": { @@ -1285,21 +1156,21 @@ } } }, - "dataapi.QueriedStateOperatorsResponse": { + "v1.QueriedStateOperatorsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.QueriedStateOperatorMetadata" + "$ref": "#/definitions/v1.QueriedStateOperatorMetadata" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.SemverReportResponse": { + "v1.SemverReportResponse": { "type": "object", "properties": { "semver": { @@ -1310,7 +1181,7 @@ } } }, - "dataapi.ServiceAvailability": { + "v1.ServiceAvailability": { "type": "object", "properties": { "service_name": { @@ -1321,21 +1192,21 @@ } } }, - "dataapi.ServiceAvailabilityResponse": { + "v1.ServiceAvailabilityResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/definitions/dataapi.ServiceAvailability" + "$ref": "#/definitions/v1.ServiceAvailability" } }, "meta": { - "$ref": "#/definitions/dataapi.Meta" + "$ref": "#/definitions/v1.Meta" } } }, - "dataapi.Throughput": { + "v1.Throughput": { "type": "object", "properties": { "throughput": { @@ -1345,136 +1216,6 @@ "type": "integer" } } - }, - "encoding.BlobCommitments": { - "type": "object", - "properties": { - "commitment": { - "$ref": "#/definitions/encoding.G1Commitment" - }, - "length": { - "type": "integer" - }, - "length_commitment": { - "$ref": "#/definitions/encoding.G2Commitment" - }, - "length_proof": { - "$ref": "#/definitions/encoding.LengthProof" - } - } - }, - "encoding.G1Commitment": { - "type": "object", - "properties": { - "x": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "encoding.G2Commitment": { - "type": "object", - "properties": { - "x": { - "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" - } - } - }, - "encoding.LengthProof": { - "type": "object", - "properties": { - "x": { - "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" - } - } - }, - "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": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "x-enum-varnames": [ - "Processing", - "Confirmed", - "Failed", - "Finalized", - "InsufficientSignatures", - "Dispersing" - ] - }, - "github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { - "type": "object", - "properties": { - "a0": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "semver.SemverMetrics": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "operators": { - "type": "array", - "items": { - "type": "string" - } - }, - "semver": { - "type": "string" - }, - "stake_percentage": { - "type": "object", - "additionalProperties": { - "type": "number" - } - } - } } } } \ No newline at end of file diff --git a/disperser/dataapi/docs/swagger.yaml b/disperser/dataapi/docs/v1/v1_swagger.yaml similarity index 60% rename from disperser/dataapi/docs/swagger.yaml rename to disperser/dataapi/docs/v1/v1_swagger.yaml index 53f58bf5c0..c15448845d 100644 --- a/disperser/dataapi/docs/swagger.yaml +++ b/disperser/dataapi/docs/v1/v1_swagger.yaml @@ -1,26 +1,7 @@ +basePath: /api/v1 definitions: big.Int: type: object - core.PaymentMetadata: - properties: - account_id: - description: AccountID is the ETH account address for the payer - type: string - cumulative_payment: - allOf: - - $ref: '#/definitions/big.Int' - description: |- - TODO: we are thinking the contract can use uint128 for cumulative payment, - but the definition on v2 uses uint64. Double check with team. - 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 - type: object core.SecurityParam: properties: adversaryThreshold: @@ -42,7 +23,85 @@ definitions: data was posted to the DA node. type: integer type: object - dataapi.BlobMetadataResponse: + encoding.BlobCommitments: + properties: + commitment: + $ref: '#/definitions/encoding.G1Commitment' + length: + type: integer + length_commitment: + $ref: '#/definitions/encoding.G2Commitment' + length_proof: + $ref: '#/definitions/encoding.LengthProof' + type: object + encoding.G1Commitment: + properties: + x: + items: + type: integer + type: array + "y": + items: + type: integer + type: array + type: object + encoding.G2Commitment: + properties: + x: + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + "y": + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + type: object + encoding.LengthProof: + properties: + x: + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + "y": + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + type: object + github_com_Layr-Labs_eigenda_disperser.BlobStatus: + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + type: integer + x-enum-varnames: + - Processing + - Confirmed + - Failed + - Finalized + - InsufficientSignatures + - Dispersing + github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2: + properties: + a0: + items: + type: integer + type: array + a1: + items: + type: integer + type: array + type: object + semver.SemverMetrics: + properties: + count: + type: integer + operators: + items: + type: string + type: array + semver: + type: string + stake_percentage: + additionalProperties: + type: number + type: object + type: object + v1.BlobMetadataResponse: properties: batch_header_hash: type: string @@ -77,62 +136,54 @@ definitions: signatory_record_hash: type: string type: object - dataapi.BlobResponse: - 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 - type: object - dataapi.BlobsResponse: + v1.BlobsResponse: properties: data: items: - $ref: '#/definitions/dataapi.BlobMetadataResponse' + $ref: '#/definitions/v1.BlobMetadataResponse' type: array meta: - $ref: '#/definitions/dataapi.Meta' + $ref: '#/definitions/v1.Meta' type: object - dataapi.ErrorResponse: + v1.ErrorResponse: properties: error: type: string type: object - dataapi.Meta: + v1.Meta: properties: next_token: type: string size: type: integer type: object - dataapi.Metric: + v1.Metric: properties: cost_in_gas: type: number throughput: type: number total_stake: - allOf: - - $ref: '#/definitions/big.Int' - description: 'deprecated: use TotalStakePerQuorum instead. Remove when the - frontend is updated.' + $ref: '#/definitions/big.Int' total_stake_per_quorum: additionalProperties: $ref: '#/definitions/big.Int' type: object type: object - dataapi.NonSigner: + v1.NonSigner: properties: - count: - type: integer - operatorId: + error_rate: + type: number + operator_address: + type: string + operator_id: type: string + quorum_id: + type: integer + total_batches: + type: integer type: object - dataapi.OperatorNonsigningPercentageMetrics: + v1.OperatorNonsigningPercentageMetrics: properties: operator_address: type: string @@ -149,7 +200,7 @@ definitions: total_unsigned_batches: type: integer type: object - dataapi.OperatorPortCheckResponse: + v1.OperatorPortCheckResponse: properties: dispersal_online: type: boolean @@ -162,7 +213,7 @@ definitions: retrieval_socket: type: string type: object - dataapi.OperatorStake: + v1.OperatorStake: properties: operator_id: type: string @@ -173,25 +224,25 @@ definitions: stake_percentage: type: number type: object - dataapi.OperatorsNonsigningPercentage: + v1.OperatorsNonsigningPercentage: properties: data: items: - $ref: '#/definitions/dataapi.OperatorNonsigningPercentageMetrics' + $ref: '#/definitions/v1.OperatorNonsigningPercentageMetrics' type: array meta: - $ref: '#/definitions/dataapi.Meta' + $ref: '#/definitions/v1.Meta' type: object - dataapi.OperatorsStakeResponse: + v1.OperatorsStakeResponse: properties: stake_ranked_operators: additionalProperties: items: - $ref: '#/definitions/dataapi.OperatorStake' + $ref: '#/definitions/v1.OperatorStake' type: array type: object type: object - dataapi.QueriedOperatorEjections: + v1.QueriedOperatorEjections: properties: block_number: type: integer @@ -208,14 +259,14 @@ definitions: transaction_hash: type: string type: object - dataapi.QueriedOperatorEjectionsResponse: + v1.QueriedOperatorEjectionsResponse: properties: ejections: items: - $ref: '#/definitions/dataapi.QueriedOperatorEjections' + $ref: '#/definitions/v1.QueriedOperatorEjections' type: array type: object - dataapi.QueriedStateOperatorMetadata: + v1.QueriedStateOperatorMetadata: properties: block_number: type: integer @@ -228,199 +279,51 @@ definitions: socket: type: string type: object - dataapi.QueriedStateOperatorsResponse: + v1.QueriedStateOperatorsResponse: properties: data: items: - $ref: '#/definitions/dataapi.QueriedStateOperatorMetadata' + $ref: '#/definitions/v1.QueriedStateOperatorMetadata' type: array meta: - $ref: '#/definitions/dataapi.Meta' + $ref: '#/definitions/v1.Meta' type: object - dataapi.SemverReportResponse: + v1.SemverReportResponse: properties: semver: additionalProperties: $ref: '#/definitions/semver.SemverMetrics' type: object type: object - dataapi.ServiceAvailability: + v1.ServiceAvailability: properties: service_name: type: string service_status: type: string type: object - dataapi.ServiceAvailabilityResponse: + v1.ServiceAvailabilityResponse: properties: data: items: - $ref: '#/definitions/dataapi.ServiceAvailability' + $ref: '#/definitions/v1.ServiceAvailability' type: array meta: - $ref: '#/definitions/dataapi.Meta' + $ref: '#/definitions/v1.Meta' type: object - dataapi.Throughput: + v1.Throughput: properties: throughput: type: number timestamp: type: integer type: object - encoding.BlobCommitments: - properties: - commitment: - $ref: '#/definitions/encoding.G1Commitment' - length: - type: integer - length_commitment: - $ref: '#/definitions/encoding.G2Commitment' - length_proof: - $ref: '#/definitions/encoding.LengthProof' - type: object - encoding.G1Commitment: - properties: - x: - items: - type: integer - type: array - type: object - encoding.G2Commitment: - properties: - x: - $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' - type: object - encoding.LengthProof: - properties: - x: - $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' - type: object - github_com_Layr-Labs_eigenda_core_v2.BlobHeader: - properties: - blobCommitments: - $ref: '#/definitions/encoding.BlobCommitments' - blobVersion: - type: integer - paymentMetadata: - allOf: - - $ref: '#/definitions/core.PaymentMetadata' - description: PaymentMetadata contains the payment information for the blob - quorumNumbers: - description: QuorumNumbers contains the quorums the blob is dispersed to - items: - type: integer - type: array - signature: - description: Signature is the signature of the blob header by the account - ID - items: - type: integer - type: array - type: object - github_com_Layr-Labs_eigenda_disperser.BlobStatus: - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - type: integer - x-enum-varnames: - - Processing - - Confirmed - - Failed - - Finalized - - InsufficientSignatures - - Dispersing - github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2: - properties: - a0: - items: - type: integer - type: array - type: object - semver.SemverMetrics: - properties: - count: - type: integer - operators: - items: - type: string - type: array - semver: - type: string - stake_percentage: - additionalProperties: - type: number - type: object - type: object info: contact: {} - description: This is the EigenDA Data Access API server. - title: EigenDA Data Access API - version: "1" + description: This is the EigenDA Data Access API V1 server. + title: EigenDA Data Access API V1 + version: "1.0" paths: - /batch/{batch_header_hash}: - get: - parameters: - - description: Batch header hash in hex string - in: path - name: batch_header_hash - required: true - type: string - produces: - - application/json - 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' - summary: Fetch batch by the batch header hash - tags: - - Feed - /blob/{blob_key}: - get: - parameters: - - description: Blob key in hex string - in: path - name: blob_key - required: true - type: string - produces: - - application/json - 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' - summary: Fetch blob metadata by blob key - tags: - - Feed /feed/batches/{batch_header_hash}/blobs: get: parameters: @@ -443,19 +346,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.BlobsResponse' + $ref: '#/definitions/v1.BlobsResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch blob metadata by batch header hash tags: - Feed @@ -472,19 +375,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.BlobsResponse' + $ref: '#/definitions/v1.BlobsResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch blobs metadata list tags: - Feed @@ -502,19 +405,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.BlobMetadataResponse' + $ref: '#/definitions/v1.BlobMetadataResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch blob metadata by blob key tags: - Feed @@ -539,19 +442,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.Metric' + $ref: '#/definitions/v1.Metric' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch metrics tags: - Metrics @@ -563,22 +466,22 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.ServiceAvailabilityResponse' + $ref: '#/definitions/v1.ServiceAvailabilityResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Get status of EigenDA batcher. + $ref: '#/definitions/v1.ErrorResponse' + summary: Get status of EigenDA batcher tags: - - Batcher Availability + - ServiceAvailability /metrics/churner-service-availability: get: produces: @@ -587,22 +490,22 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.ServiceAvailabilityResponse' + $ref: '#/definitions/v1.ServiceAvailabilityResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Get status of EigenDA churner service. + $ref: '#/definitions/v1.ErrorResponse' + summary: Get status of EigenDA churner service tags: - - Churner ServiceAvailability + - ServiceAvailability /metrics/disperser-service-availability: get: produces: @@ -611,20 +514,20 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.ServiceAvailabilityResponse' + $ref: '#/definitions/v1.ServiceAvailabilityResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Get status of EigenDA Disperser service. + $ref: '#/definitions/v1.ErrorResponse' + summary: Get status of EigenDA Disperser service tags: - ServiceAvailability /metrics/non-signers: @@ -641,20 +544,20 @@ paths: description: OK schema: items: - $ref: '#/definitions/dataapi.NonSigner' + $ref: '#/definitions/v1.NonSigner' type: array "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch non signers tags: - Metrics @@ -681,19 +584,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.OperatorsNonsigningPercentage' + $ref: '#/definitions/v1.OperatorsNonsigningPercentage' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch operators non signing percentage tags: - Metrics @@ -715,20 +618,20 @@ paths: description: OK schema: items: - $ref: '#/definitions/dataapi.Throughput' + $ref: '#/definitions/v1.Throughput' type: array "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Fetch throughput time series tags: - Metrics @@ -740,21 +643,20 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.QueriedStateOperatorsResponse' + $ref: '#/definitions/v1.QueriedStateOperatorsResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Fetch list of operators that have been deregistered for days. Days - is a query parameter with a default value of 14 and max value of 30. + $ref: '#/definitions/v1.ErrorResponse' + summary: Fetch list of operators that have been deregistered for days tags: - OperatorsInfo /operators-info/operator-ejections: @@ -782,20 +684,20 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.QueriedOperatorEjectionsResponse' + $ref: '#/definitions/v1.QueriedOperatorEjectionsResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Fetch list of operator ejections over last N days. + $ref: '#/definitions/v1.ErrorResponse' + summary: Fetch list of operator ejections over last N days tags: - OperatorsInfo /operators-info/operators-stake: @@ -812,19 +714,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.OperatorsStakeResponse' + $ref: '#/definitions/v1.OperatorsStakeResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Operator stake distribution query tags: - OperatorsStake @@ -842,19 +744,19 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.OperatorPortCheckResponse' + $ref: '#/definitions/v1.OperatorPortCheckResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Operator node reachability port check tags: - OperatorsInfo @@ -866,21 +768,20 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.QueriedStateOperatorsResponse' + $ref: '#/definitions/v1.QueriedStateOperatorsResponse' "400": description: 'error: Bad request' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "404": description: 'error: Not found' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Fetch list of operators that have been registered for days. Days is - a query parameter with a default value of 14 and max value of 30. + $ref: '#/definitions/v1.ErrorResponse' + summary: Fetch list of operators that have been registered for days tags: - OperatorsInfo /operators-info/semver-scan: @@ -891,88 +792,14 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dataapi.SemverReportResponse' + $ref: '#/definitions/v1.SemverReportResponse' "500": description: 'error: Server error' schema: - $ref: '#/definitions/dataapi.ErrorResponse' + $ref: '#/definitions/v1.ErrorResponse' summary: Active operator semver scan tags: - OperatorsInfo - /operators/nodeinfo: - get: - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dataapi.SemverReportResponse' - "500": - description: 'error: Server error' - schema: - $ref: '#/definitions/dataapi.ErrorResponse' - summary: Active operator semver - tags: - - OperatorsNodeInfo - /operators/reachability: - get: - parameters: - - description: 'Operator ID in hex string [default: all operators if unspecified]' - in: query - name: operator_id - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dataapi.OperatorPortCheckResponse' - "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' - summary: Operator node reachability check - tags: - - OperatorsReachability - /operators/stake: - get: - parameters: - - description: 'Operator ID in hex string [default: all operators if unspecified]' - in: query - name: operator_id - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dataapi.OperatorsStakeResponse' - "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' - summary: Operator stake distribution query - tags: - - OperatorsStake schemes: - https - http diff --git a/disperser/dataapi/docs/v2/v2_docs.go b/disperser/dataapi/docs/v2/v2_docs.go new file mode 100644 index 0000000000..6abb360146 --- /dev/null +++ b/disperser/dataapi/docs/v2/v2_docs.go @@ -0,0 +1,490 @@ +// Package v2 Code generated by swaggo/swag. DO NOT EDIT +package v2 + +import "github.com/swaggo/swag" + +const docTemplateV2 = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "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/v2.BlobResponse" + } + }, + "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" + } + } + } + } + }, + "/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/v2.BlobResponse" + } + }, + "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" + } + } + } + } + }, + "/operators/nodeinfo": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Operators" + ], + "summary": "Active operator semver", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.SemverReportResponse" + } + }, + "500": { + "description": "error: Server error", + "schema": { + "$ref": "#/definitions/v2.ErrorResponse" + } + } + } + } + }, + "/operators/reachability": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Operators" + ], + "summary": "Operator node reachability check", + "parameters": [ + { + "type": "string", + "description": "Operator ID in hex string [default: all operators if unspecified]", + "name": "operator_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.OperatorPortCheckResponse" + } + }, + "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" + } + } + } + } + }, + "/operators/stake": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Operators" + ], + "summary": "Operator stake distribution query", + "parameters": [ + { + "type": "string", + "description": "Operator ID in hex string [default: all operators if unspecified]", + "name": "operator_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.OperatorsStakeResponse" + } + }, + "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" + } + } + } + } + } + }, + "definitions": { + "big.Int": { + "type": "object" + }, + "core.PaymentMetadata": { + "type": "object", + "properties": { + "account_id": { + "description": "AccountID is the ETH account address for the payer", + "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.", + "allOf": [ + { + "$ref": "#/definitions/big.Int" + } + ] + }, + "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" + } + } + }, + "encoding.BlobCommitments": { + "type": "object", + "properties": { + "commitment": { + "$ref": "#/definitions/encoding.G1Commitment" + }, + "length": { + "type": "integer" + }, + "length_commitment": { + "$ref": "#/definitions/encoding.G2Commitment" + }, + "length_proof": { + "$ref": "#/definitions/encoding.LengthProof" + } + } + }, + "encoding.G1Commitment": { + "type": "object", + "properties": { + "x": { + "type": "array", + "items": { + "type": "integer" + } + }, + "y": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "encoding.G2Commitment": { + "type": "object", + "properties": { + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + }, + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "encoding.LengthProof": { + "type": "object", + "properties": { + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + }, + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "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_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { + "type": "object", + "properties": { + "a0": { + "type": "array", + "items": { + "type": "integer" + } + }, + "a1": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "semver.SemverMetrics": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "operators": { + "type": "array", + "items": { + "type": "string" + } + }, + "semver": { + "type": "string" + }, + "stake_percentage": { + "type": "object", + "additionalProperties": { + "type": "number" + } + } + } + }, + "v2.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" + } + } + }, + "v2.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "v2.OperatorPortCheckResponse": { + "type": "object", + "properties": { + "dispersal_online": { + "type": "boolean" + }, + "dispersal_socket": { + "type": "string" + }, + "operator_id": { + "type": "string" + }, + "retrieval_online": { + "type": "boolean" + }, + "retrieval_socket": { + "type": "string" + } + } + }, + "v2.OperatorStake": { + "type": "object", + "properties": { + "operator_id": { + "type": "string" + }, + "quorum_id": { + "type": "string" + }, + "rank": { + "type": "integer" + }, + "stake_percentage": { + "type": "number" + } + } + }, + "v2.OperatorsStakeResponse": { + "type": "object", + "properties": { + "stake_ranked_operators": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.OperatorStake" + } + } + } + } + }, + "v2.SemverReportResponse": { + "type": "object", + "properties": { + "semver": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/semver.SemverMetrics" + } + } + } + } + } +}` + +// SwaggerInfoV2 holds exported Swagger Info so clients can modify it +var SwaggerInfoV2 = &swag.Spec{ + Version: "2.0", + Host: "", + BasePath: "/api/v2", + Schemes: []string{"https", "http"}, + Title: "EigenDA Data Access API V2", + Description: "This is the EigenDA Data Access API V2 server.", + InfoInstanceName: "V2", + SwaggerTemplate: docTemplateV2, + LeftDelim: "{{", + RightDelim: "}}", +} + +func init() { + swag.Register(SwaggerInfoV2.InstanceName(), SwaggerInfoV2) +} diff --git a/disperser/dataapi/docs/v2/v2_swagger.json b/disperser/dataapi/docs/v2/v2_swagger.json new file mode 100644 index 0000000000..9e3dd1fec6 --- /dev/null +++ b/disperser/dataapi/docs/v2/v2_swagger.json @@ -0,0 +1,469 @@ +{ + "schemes": [ + "https", + "http" + ], + "swagger": "2.0", + "info": { + "description": "This is the EigenDA Data Access API V2 server.", + "title": "EigenDA Data Access API V2", + "contact": {}, + "version": "2.0" + }, + "basePath": "/api/v2", + "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/v2.BlobResponse" + } + }, + "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" + } + } + } + } + }, + "/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/v2.BlobResponse" + } + }, + "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" + } + } + } + } + }, + "/operators/nodeinfo": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Operators" + ], + "summary": "Active operator semver", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.SemverReportResponse" + } + }, + "500": { + "description": "error: Server error", + "schema": { + "$ref": "#/definitions/v2.ErrorResponse" + } + } + } + } + }, + "/operators/reachability": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Operators" + ], + "summary": "Operator node reachability check", + "parameters": [ + { + "type": "string", + "description": "Operator ID in hex string [default: all operators if unspecified]", + "name": "operator_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.OperatorPortCheckResponse" + } + }, + "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" + } + } + } + } + }, + "/operators/stake": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Operators" + ], + "summary": "Operator stake distribution query", + "parameters": [ + { + "type": "string", + "description": "Operator ID in hex string [default: all operators if unspecified]", + "name": "operator_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v2.OperatorsStakeResponse" + } + }, + "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" + } + } + } + } + } + }, + "definitions": { + "big.Int": { + "type": "object" + }, + "core.PaymentMetadata": { + "type": "object", + "properties": { + "account_id": { + "description": "AccountID is the ETH account address for the payer", + "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.", + "allOf": [ + { + "$ref": "#/definitions/big.Int" + } + ] + }, + "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" + } + } + }, + "encoding.BlobCommitments": { + "type": "object", + "properties": { + "commitment": { + "$ref": "#/definitions/encoding.G1Commitment" + }, + "length": { + "type": "integer" + }, + "length_commitment": { + "$ref": "#/definitions/encoding.G2Commitment" + }, + "length_proof": { + "$ref": "#/definitions/encoding.LengthProof" + } + } + }, + "encoding.G1Commitment": { + "type": "object", + "properties": { + "x": { + "type": "array", + "items": { + "type": "integer" + } + }, + "y": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "encoding.G2Commitment": { + "type": "object", + "properties": { + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + }, + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "encoding.LengthProof": { + "type": "object", + "properties": { + "x": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + }, + "y": { + "$ref": "#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2" + } + } + }, + "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_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { + "type": "object", + "properties": { + "a0": { + "type": "array", + "items": { + "type": "integer" + } + }, + "a1": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "semver.SemverMetrics": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "operators": { + "type": "array", + "items": { + "type": "string" + } + }, + "semver": { + "type": "string" + }, + "stake_percentage": { + "type": "object", + "additionalProperties": { + "type": "number" + } + } + } + }, + "v2.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" + } + } + }, + "v2.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "v2.OperatorPortCheckResponse": { + "type": "object", + "properties": { + "dispersal_online": { + "type": "boolean" + }, + "dispersal_socket": { + "type": "string" + }, + "operator_id": { + "type": "string" + }, + "retrieval_online": { + "type": "boolean" + }, + "retrieval_socket": { + "type": "string" + } + } + }, + "v2.OperatorStake": { + "type": "object", + "properties": { + "operator_id": { + "type": "string" + }, + "quorum_id": { + "type": "string" + }, + "rank": { + "type": "integer" + }, + "stake_percentage": { + "type": "number" + } + } + }, + "v2.OperatorsStakeResponse": { + "type": "object", + "properties": { + "stake_ranked_operators": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.OperatorStake" + } + } + } + } + }, + "v2.SemverReportResponse": { + "type": "object", + "properties": { + "semver": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/semver.SemverMetrics" + } + } + } + } + } +} \ No newline at end of file diff --git a/disperser/dataapi/docs/v2/v2_swagger.yaml b/disperser/dataapi/docs/v2/v2_swagger.yaml new file mode 100644 index 0000000000..a14de9faea --- /dev/null +++ b/disperser/dataapi/docs/v2/v2_swagger.yaml @@ -0,0 +1,308 @@ +basePath: /api/v2 +definitions: + big.Int: + type: object + core.PaymentMetadata: + properties: + account_id: + description: AccountID is the ETH account address for the payer + type: string + cumulative_payment: + allOf: + - $ref: '#/definitions/big.Int' + description: |- + TODO: we are thinking the contract can use uint128 for cumulative payment, + but the definition on v2 uses uint64. Double check with team. + 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 + type: object + encoding.BlobCommitments: + properties: + commitment: + $ref: '#/definitions/encoding.G1Commitment' + length: + type: integer + length_commitment: + $ref: '#/definitions/encoding.G2Commitment' + length_proof: + $ref: '#/definitions/encoding.LengthProof' + type: object + encoding.G1Commitment: + properties: + x: + items: + type: integer + type: array + "y": + items: + type: integer + type: array + type: object + encoding.G2Commitment: + properties: + x: + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + "y": + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + type: object + encoding.LengthProof: + properties: + x: + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + "y": + $ref: '#/definitions/github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2' + type: object + github_com_Layr-Labs_eigenda_core_v2.BlobHeader: + properties: + blobCommitments: + $ref: '#/definitions/encoding.BlobCommitments' + blobVersion: + type: integer + paymentMetadata: + allOf: + - $ref: '#/definitions/core.PaymentMetadata' + description: PaymentMetadata contains the payment information for the blob + quorumNumbers: + description: QuorumNumbers contains the quorums the blob is dispersed to + items: + type: integer + type: array + signature: + description: Signature is the signature of the blob header by the account + ID + items: + type: integer + type: array + type: object + github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2: + properties: + a0: + items: + type: integer + type: array + a1: + items: + type: integer + type: array + type: object + semver.SemverMetrics: + properties: + count: + type: integer + operators: + items: + type: string + type: array + semver: + type: string + stake_percentage: + additionalProperties: + type: number + type: object + type: object + v2.BlobResponse: + 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 + type: object + v2.ErrorResponse: + properties: + error: + type: string + type: object + v2.OperatorPortCheckResponse: + properties: + dispersal_online: + type: boolean + dispersal_socket: + type: string + operator_id: + type: string + retrieval_online: + type: boolean + retrieval_socket: + type: string + type: object + v2.OperatorStake: + properties: + operator_id: + type: string + quorum_id: + type: string + rank: + type: integer + stake_percentage: + type: number + type: object + v2.OperatorsStakeResponse: + properties: + stake_ranked_operators: + additionalProperties: + items: + $ref: '#/definitions/v2.OperatorStake' + type: array + type: object + type: object + v2.SemverReportResponse: + properties: + semver: + additionalProperties: + $ref: '#/definitions/semver.SemverMetrics' + type: object + type: object +info: + contact: {} + description: This is the EigenDA Data Access API V2 server. + title: EigenDA Data Access API V2 + version: "2.0" +paths: + /batch/{batch_header_hash}: + get: + parameters: + - description: Batch header hash in hex string + in: path + name: batch_header_hash + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v2.BlobResponse' + "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' + summary: Fetch batch by the batch header hash + tags: + - Feed + /blob/{blob_key}: + get: + parameters: + - description: Blob key in hex string + in: path + name: blob_key + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v2.BlobResponse' + "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' + summary: Fetch blob metadata by blob key + tags: + - Feed + /operators/nodeinfo: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v2.SemverReportResponse' + "500": + description: 'error: Server error' + schema: + $ref: '#/definitions/v2.ErrorResponse' + summary: Active operator semver + tags: + - Operators + /operators/reachability: + get: + parameters: + - description: 'Operator ID in hex string [default: all operators if unspecified]' + in: query + name: operator_id + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v2.OperatorPortCheckResponse' + "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' + summary: Operator node reachability check + tags: + - Operators + /operators/stake: + get: + parameters: + - description: 'Operator ID in hex string [default: all operators if unspecified]' + in: query + name: operator_id + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v2.OperatorsStakeResponse' + "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' + summary: Operator stake distribution query + tags: + - Operators +schemes: +- https +- http +swagger: "2.0" diff --git a/disperser/dataapi/server.go b/disperser/dataapi/server.go index eb6ee4f7e5..392238352b 100644 --- a/disperser/dataapi/server.go +++ b/disperser/dataapi/server.go @@ -23,7 +23,7 @@ import ( "github.com/Layr-Labs/eigenda/disperser" "github.com/Layr-Labs/eigenda/disperser/common/semver" - "github.com/Layr-Labs/eigenda/disperser/dataapi/docs" + docsv1 "github.com/Layr-Labs/eigenda/disperser/dataapi/docs/v1" "github.com/gin-contrib/cors" "github.com/gin-contrib/logger" "github.com/gin-gonic/gin" @@ -271,8 +271,8 @@ func (s *server) Start() error { router := gin.New() basePath := "/api/v1" - docs.SwaggerInfo.BasePath = basePath - docs.SwaggerInfo.Host = os.Getenv("SWAGGER_HOST") + docsv1.SwaggerInfoV1.BasePath = basePath + docsv1.SwaggerInfoV1.Host = os.Getenv("SWAGGER_HOST") v1 := router.Group(basePath) { feed := v1.Group("/feed") @@ -302,7 +302,7 @@ func (s *server) Start() error { } swagger := v1.Group("/swagger") { - swagger.GET("/*any", ginswagger.WrapHandler(swaggerfiles.Handler)) + swagger.GET("/*any", ginswagger.WrapHandler(swaggerfiles.Handler, ginswagger.InstanceName("V1"), ginswagger.URL("/api/v1/swagger/doc.json"))) } } @@ -351,17 +351,6 @@ func (s *server) Shutdown() error { return nil } -// FetchBlobHandler godoc -// -// @Summary Fetch blob metadata by blob key -// @Tags Feed -// @Produce json -// @Param blob_key path string true "Blob Key" -// @Success 200 {object} BlobMetadataResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /feed/blobs/{blob_key} [get] func (s *server) FetchBlobHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchBlob", f*1000) // make milliseconds @@ -382,19 +371,6 @@ func (s *server) FetchBlobHandler(c *gin.Context) { c.JSON(http.StatusOK, metadata) } -// FetchBlobsFromBatchHeaderHash godoc -// -// @Summary Fetch blob metadata by batch header hash -// @Tags Feed -// @Produce json -// @Param batch_header_hash path string true "Batch Header Hash" -// @Param limit query int false "Limit [default: 10]" -// @Param next_token query string false "Next page token" -// @Success 200 {object} BlobsResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /feed/batches/{batch_header_hash}/blobs [get] func (s *server) FetchBlobsFromBatchHeaderHash(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchBlobsFromBatchHeaderHash", f*1000) // make milliseconds @@ -490,17 +466,6 @@ func encodeNextToken(key *disperser.BatchIndexExclusiveStartKey) (string, error) return token, nil } -// FetchBlobsHandler godoc -// -// @Summary Fetch blobs metadata list -// @Tags Feed -// @Produce json -// @Param limit query int false "Limit [default: 10]" -// @Success 200 {object} BlobsResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /feed/blobs [get] func (s *server) FetchBlobsHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchBlobs", f*1000) // make milliseconds @@ -536,19 +501,6 @@ func (s *server) FetchBlobsHandler(c *gin.Context) { }) } -// FetchMetricsHandler godoc -// -// @Summary Fetch metrics -// @Tags Metrics -// @Produce json -// @Param start query int false "Start unix timestamp [default: 1 hour ago]" -// @Param end query int false "End unix timestamp [default: unix time now]" -// @Param limit query int false "Limit [default: 10]" -// @Success 200 {object} Metric -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics [get] func (s *server) FetchMetricsHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchMetrics", f*1000) // make milliseconds @@ -578,18 +530,6 @@ func (s *server) FetchMetricsHandler(c *gin.Context) { c.JSON(http.StatusOK, metric) } -// FetchMetricsThroughputHandler godoc -// -// @Summary Fetch throughput time series -// @Tags Metrics -// @Produce json -// @Param start query int false "Start unix timestamp [default: 1 hour ago]" -// @Param end query int false "End unix timestamp [default: unix time now]" -// @Success 200 {object} []Throughput -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/throughput [get] func (s *server) FetchMetricsThroughputHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchMetricsTroughput", f*1000) // make milliseconds @@ -619,17 +559,6 @@ func (s *server) FetchMetricsThroughputHandler(c *gin.Context) { c.JSON(http.StatusOK, ths) } -// FetchNonSigners godoc -// -// @Summary Fetch non signers -// @Tags Metrics -// @Produce json -// @Param interval query int false "Interval to query for non signers in seconds [default: 3600]" -// @Success 200 {object} []NonSigner -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/non-signers [get] func (s *server) FetchNonSigners(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchNonSigners", f*1000) // make milliseconds @@ -652,19 +581,6 @@ func (s *server) FetchNonSigners(c *gin.Context) { c.JSON(http.StatusOK, metric) } -// FetchOperatorsNonsigningPercentageHandler godoc -// -// @Summary Fetch operators non signing percentage -// @Tags Metrics -// @Produce json -// @Param interval query int false "Interval to query for operators nonsigning percentage [default: 3600]" -// @Param end query string false "End time (2006-01-02T15:04:05Z) to query for operators nonsigning percentage [default: now]" -// @Param live_only query string false "Whether return only live nonsigners [default: true]" -// @Success 200 {object} OperatorsNonsigningPercentage -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/operator-nonsigning-percentage [get] func (s *server) FetchOperatorsNonsigningPercentageHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchOperatorsNonsigningPercentageHandler", f*1000) // make milliseconds @@ -710,17 +626,6 @@ func (s *server) FetchOperatorsNonsigningPercentageHandler(c *gin.Context) { c.JSON(http.StatusOK, metric) } -// OperatorsStake godoc -// -// @Summary Operator stake distribution query -// @Tags OperatorsStake -// @Produce json -// @Param operator_id query string true "Operator ID" -// @Success 200 {object} OperatorsStakeResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators-info/operators-stake [get] func (s *server) OperatorsStake(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("OperatorsStake", f*1000) // make milliseconds @@ -742,16 +647,6 @@ func (s *server) OperatorsStake(c *gin.Context) { c.JSON(http.StatusOK, operatorsStakeResponse) } -// FetchDeregisteredOperators godoc -// -// @Summary Fetch list of operators that have been deregistered for days. Days is a query parameter with a default value of 14 and max value of 30. -// @Tags OperatorsInfo -// @Produce json -// @Success 200 {object} QueriedStateOperatorsResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators-info/deregistered-operators [get] func (s *server) FetchDeregisteredOperators(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchDeregisteredOperators", f*1000) // make milliseconds @@ -792,16 +687,6 @@ func (s *server) FetchDeregisteredOperators(c *gin.Context) { }) } -// FetchRegisteredOperators godoc -// -// @Summary Fetch list of operators that have been registered for days. Days is a query parameter with a default value of 14 and max value of 30. -// @Tags OperatorsInfo -// @Produce json -// @Success 200 {object} QueriedStateOperatorsResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators-info/registered-operators [get] func (s *server) FetchRegisteredOperators(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchRegisteredOperators", f*1000) // make milliseconds @@ -841,20 +726,6 @@ func (s *server) FetchRegisteredOperators(c *gin.Context) { }) } -// FetchOperatorEjections godoc -// -// @Summary Fetch list of operator ejections over last N days. -// @Tags OperatorsInfo -// @Produce json -// @Param days query int false "Lookback in days [default: 1]" -// @Param operator_id query string false "Operator ID filter [default: all operators]" -// @Param first query int false "Return first N ejections [default: 1000]" -// @Param skip query int false "Skip first N ejections [default: 0]" -// @Success 200 {object} QueriedOperatorEjectionsResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators-info/operator-ejections [get] func (s *server) FetchOperatorEjections(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchOperatorEjections", f*1000) // make milliseconds @@ -902,17 +773,6 @@ func (s *server) FetchOperatorEjections(c *gin.Context) { }) } -// OperatorPortCheck godoc -// -// @Summary Operator node reachability port check -// @Tags OperatorsInfo -// @Produce json -// @Param operator_id query string true "Operator ID" -// @Success 200 {object} OperatorPortCheckResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators-info/port-check [get] func (s *server) OperatorPortCheck(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("OperatorPortCheck", f*1000) // make milliseconds @@ -939,14 +799,6 @@ func (s *server) OperatorPortCheck(c *gin.Context) { c.JSON(http.StatusOK, portCheckResponse) } -// Semver scan godoc -// -// @Summary Active operator semver scan -// @Tags OperatorsInfo -// @Produce json -// @Success 200 {object} SemverReportResponse -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators-info/semver-scan [get] func (s *server) SemverScan(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("SemverScan", f*1000) // make milliseconds @@ -963,16 +815,6 @@ func (s *server) SemverScan(c *gin.Context) { c.JSON(http.StatusOK, report) } -// FetchDisperserServiceAvailability godoc -// -// @Summary Get status of EigenDA Disperser service. -// @Tags ServiceAvailability -// @Produce json -// @Success 200 {object} ServiceAvailabilityResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/disperser-service-availability [get] func (s *server) FetchDisperserServiceAvailability(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchDisperserServiceAvailability", f*1000) // make milliseconds @@ -1017,16 +859,6 @@ func (s *server) FetchDisperserServiceAvailability(c *gin.Context) { }) } -// FetchChurnerServiceAvailability godoc -// -// @Summary Get status of EigenDA churner service. -// @Tags Churner ServiceAvailability -// @Produce json -// @Success 200 {object} ServiceAvailabilityResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/churner-service-availability [get] func (s *server) FetchChurnerServiceAvailability(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchChurnerServiceAvailability", f*1000) // make milliseconds @@ -1071,16 +903,6 @@ func (s *server) FetchChurnerServiceAvailability(c *gin.Context) { }) } -// FetchBatcherAvailability godoc -// -// @Summary Get status of EigenDA batcher. -// @Tags Batcher Availability -// @Produce json -// @Success 200 {object} ServiceAvailabilityResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/batcher-service-availability [get] func (s *server) FetchBatcherAvailability(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchBatcherAvailability", f*1000) // make milliseconds diff --git a/disperser/dataapi/server_v2.go b/disperser/dataapi/server_v2.go index f8bc44dd5c..49a82378e6 100644 --- a/disperser/dataapi/server_v2.go +++ b/disperser/dataapi/server_v2.go @@ -11,7 +11,7 @@ import ( "github.com/Layr-Labs/eigenda/core" corev2 "github.com/Layr-Labs/eigenda/core/v2" "github.com/Layr-Labs/eigenda/disperser/common/v2/blobstore" - "github.com/Layr-Labs/eigenda/disperser/dataapi/docs" + docsv2 "github.com/Layr-Labs/eigenda/disperser/dataapi/docs/v2" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/gin-contrib/cors" "github.com/gin-contrib/logger" @@ -99,19 +99,19 @@ func (s *ServerV2) Start() error { router := gin.New() basePath := "/api/v2" - docs.SwaggerInfo.BasePath = basePath - docs.SwaggerInfo.Host = os.Getenv("SWAGGER_HOST") + docsv2.SwaggerInfoV2.BasePath = basePath + docsv2.SwaggerInfoV2.Host = os.Getenv("SWAGGER_HOST") v2 := router.Group(basePath) { blob := v2.Group("/blob") { - blob.GET("/blob/feed", s.FetchBlobFeedHandler) - blob.GET("/blob/:blob_key", s.FetchBlobHandler) + blob.GET("/feed", s.FetchBlobFeedHandler) + blob.GET("/:blob_key", s.FetchBlobHandler) } batch := v2.Group("/batch") { - batch.GET("/batch/feed", s.FetchBatchFeedHandler) - batch.GET("/batch/:batch_header_hash", s.FetchBatchHandler) + batch.GET("/feed", s.FetchBatchFeedHandler) + batch.GET("/:batch_header_hash", s.FetchBatchHandler) } operators := v2.Group("/operators") { @@ -127,7 +127,7 @@ func (s *ServerV2) Start() error { } swagger := v2.Group("/swagger") { - swagger.GET("/*any", ginswagger.WrapHandler(swaggerfiles.Handler)) + swagger.GET("/*any", ginswagger.WrapHandler(swaggerfiles.Handler, ginswagger.InstanceName("V2"), ginswagger.URL("/api/v2/swagger/doc.json"))) } } @@ -170,17 +170,6 @@ func (s *ServerV2) FetchBlobFeedHandler(c *gin.Context) { errorResponse(c, errors.New("FetchBlobFeedHandler unimplemented")) } -// FetchBlobHandler godoc -// -// @Summary Fetch blob metadata by blob key -// @Tags Feed -// @Produce json -// @Param blob_key path string true "Blob key in hex string" -// @Success 200 {object} BlobResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /blob/{blob_key} [get] func (s *ServerV2) FetchBlobHandler(c *gin.Context) { start := time.Now() blobKey, err := corev2.HexToBlobKey(c.Param("blob_key")) @@ -211,17 +200,6 @@ func (s *ServerV2) FetchBatchFeedHandler(c *gin.Context) { errorResponse(c, errors.New("FetchBatchFeedHandler unimplemented")) } -// FetchBatchHandler godoc -// -// @Summary Fetch batch by the batch header hash -// @Tags Feed -// @Produce json -// @Param batch_header_hash path string true "Batch header hash in hex string" -// @Success 200 {object} BlobResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /batch/{batch_header_hash} [get] func (s *ServerV2) FetchBatchHandler(c *gin.Context) { start := time.Now() batchHeaderHashHex := c.Param("batch_header_hash") @@ -251,17 +229,6 @@ func (s *ServerV2) FetchBatchHandler(c *gin.Context) { c.JSON(http.StatusOK, batchResponse) } -// FetchOperatorsStake godoc -// -// @Summary Operator stake distribution query -// @Tags OperatorsStake -// @Produce json -// @Param operator_id query string false "Operator ID in hex string [default: all operators if unspecified]" -// @Success 200 {object} OperatorsStakeResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators/stake [get] func (s *ServerV2) FetchOperatorsStake(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchOperatorsStake", f*1000) // make milliseconds @@ -283,14 +250,6 @@ func (s *ServerV2) FetchOperatorsStake(c *gin.Context) { c.JSON(http.StatusOK, operatorsStakeResponse) } -// FetchOperatorsNodeInfo godoc -// -// @Summary Active operator semver -// @Tags OperatorsNodeInfo -// @Produce json -// @Success 200 {object} SemverReportResponse -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators/nodeinfo [get] func (s *ServerV2) FetchOperatorsNodeInfo(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchOperatorsNodeInfo", f*1000) // make milliseconds @@ -307,17 +266,6 @@ func (s *ServerV2) FetchOperatorsNodeInfo(c *gin.Context) { c.JSON(http.StatusOK, report) } -// CheckOperatorsReachability godoc -// -// @Summary Operator node reachability check -// @Tags OperatorsReachability -// @Produce json -// @Param operator_id query string false "Operator ID in hex string [default: all operators if unspecified]" -// @Success 200 {object} OperatorPortCheckResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /operators/reachability [get] func (s *ServerV2) CheckOperatorsReachability(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("OperatorPortCheck", f*1000) // make milliseconds diff --git a/disperser/dataapi/v1/handlers.go b/disperser/dataapi/v1/handlers.go new file mode 100644 index 0000000000..62a8f00ed6 --- /dev/null +++ b/disperser/dataapi/v1/handlers.go @@ -0,0 +1,322 @@ +package v1 + +import ( + "math/big" + + "github.com/Layr-Labs/eigenda/core" + "github.com/Layr-Labs/eigenda/disperser" + "github.com/Layr-Labs/eigenda/disperser/common/semver" + "github.com/Layr-Labs/eigenda/encoding" +) + +// Response Types +type ErrorResponse struct { + Error string `json:"error"` +} + +type BlobMetadataResponse struct { + BlobKey string `json:"blob_key"` + BatchHeaderHash string `json:"batch_header_hash"` + BlobIndex uint32 `json:"blob_index"` + SignatoryRecordHash string `json:"signatory_record_hash"` + ReferenceBlockNumber uint32 `json:"reference_block_number"` + BatchRoot string `json:"batch_root"` + BlobInclusionProof string `json:"blob_inclusion_proof"` + BlobCommitment *encoding.BlobCommitments `json:"blob_commitment"` + BatchId uint32 `json:"batch_id"` + ConfirmationBlockNumber uint32 `json:"confirmation_block_number"` + ConfirmationTxnHash string `json:"confirmation_txn_hash"` + Fee string `json:"fee"` + SecurityParams []*core.SecurityParam `json:"security_params"` + RequestAt uint64 `json:"requested_at"` + BlobStatus disperser.BlobStatus `json:"blob_status"` +} + +type BlobsResponse struct { + Meta Meta `json:"meta"` + Data []*BlobMetadataResponse `json:"data"` +} + +type Meta struct { + Size int `json:"size"` + NextToken string `json:"next_token,omitempty"` +} + +type OperatorNonsigningPercentageMetrics struct { + OperatorId string `json:"operator_id"` + OperatorAddress string `json:"operator_address"` + QuorumId uint8 `json:"quorum_id"` + TotalUnsignedBatches int `json:"total_unsigned_batches"` + TotalBatches int `json:"total_batches"` + Percentage float64 `json:"percentage"` + StakePercentage float64 `json:"stake_percentage"` +} + +type OperatorsNonsigningPercentage struct { + Meta Meta `json:"meta"` + Data []*OperatorNonsigningPercentageMetrics `json:"data"` +} + +type OperatorStake struct { + QuorumId string `json:"quorum_id"` + OperatorId string `json:"operator_id"` + StakePercentage float64 `json:"stake_percentage"` + Rank int `json:"rank"` +} + +type OperatorsStakeResponse struct { + StakeRankedOperators map[string][]*OperatorStake `json:"stake_ranked_operators"` +} + +type QueriedStateOperatorMetadata struct { + OperatorId string `json:"operator_id"` + BlockNumber uint `json:"block_number"` + Socket string `json:"socket"` + IsOnline bool `json:"is_online"` + OperatorProcessError string `json:"operator_process_error"` +} + +type QueriedStateOperatorsResponse struct { + Meta Meta `json:"meta"` + Data []*QueriedStateOperatorMetadata `json:"data"` +} + +type QueriedOperatorEjections struct { + OperatorId string `json:"operator_id"` + OperatorAddress string `json:"operator_address"` + Quorum uint8 `json:"quorum"` + BlockNumber uint64 `json:"block_number"` + BlockTimestamp string `json:"block_timestamp"` + TransactionHash string `json:"transaction_hash"` + StakePercentage float64 `json:"stake_percentage"` +} + +type QueriedOperatorEjectionsResponse struct { + Ejections []*QueriedOperatorEjections `json:"ejections"` +} + +type ServiceAvailability struct { + ServiceName string `json:"service_name"` + ServiceStatus string `json:"service_status"` +} + +type ServiceAvailabilityResponse struct { + Meta Meta `json:"meta"` + Data []*ServiceAvailability `json:"data"` +} + +type OperatorPortCheckResponse struct { + OperatorId string `json:"operator_id"` + DispersalSocket string `json:"dispersal_socket"` + RetrievalSocket string `json:"retrieval_socket"` + DispersalOnline bool `json:"dispersal_online"` + RetrievalOnline bool `json:"retrieval_online"` +} + +type SemverReportResponse struct { + Semver map[string]*semver.SemverMetrics `json:"semver"` +} + +type Metric struct { + Throughput float64 `json:"throughput"` + CostInGas float64 `json:"cost_in_gas"` + TotalStake *big.Int `json:"total_stake"` + TotalStakePerQuorum map[core.QuorumID]*big.Int `json:"total_stake_per_quorum"` +} + +type Throughput struct { + Throughput float64 `json:"throughput"` + Timestamp uint64 `json:"timestamp"` +} + +type NonSigner struct { + OperatorId string `json:"operator_id"` + OperatorAddress string `json:"operator_address"` + QuorumId uint8 `json:"quorum_id"` + ErrorRate float64 `json:"error_rate"` + TotalBatches int `json:"total_batches"` +} + +// @Summary Fetch blob metadata by blob key +// @Tags Feed +// @Produce json +// @Param blob_key path string true "Blob Key" +// @Success 200 {object} BlobMetadataResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /feed/blobs/{blob_key} [get] +func FetchBlob() {} + +// @Summary Fetch blob metadata by batch header hash +// @Tags Feed +// @Produce json +// @Param batch_header_hash path string true "Batch Header Hash" +// @Param limit query int false "Limit [default: 10]" +// @Param next_token query string false "Next page token" +// @Success 200 {object} BlobsResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /feed/batches/{batch_header_hash}/blobs [get] +func FetchBlobsFromBatchHeaderHash() {} + +// @Summary Fetch blobs metadata list +// @Tags Feed +// @Produce json +// @Param limit query int false "Limit [default: 10]" +// @Success 200 {object} BlobsResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /feed/blobs [get] +func FetchBlobs() {} + +// @Summary Operator stake distribution query +// @Tags OperatorsStake +// @Produce json +// @Param operator_id query string true "Operator ID" +// @Success 200 {object} OperatorsStakeResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators-info/operators-stake [get] +func OperatorsStake() {} + +// @Summary Fetch list of operators that have been deregistered for days +// @Tags OperatorsInfo +// @Produce json +// @Success 200 {object} QueriedStateOperatorsResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators-info/deregistered-operators [get] +func FetchDeregisteredOperators() {} + +// @Summary Fetch list of operators that have been registered for days +// @Tags OperatorsInfo +// @Produce json +// @Success 200 {object} QueriedStateOperatorsResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators-info/registered-operators [get] +func FetchRegisteredOperators() {} + +// @Summary Fetch list of operator ejections over last N days +// @Tags OperatorsInfo +// @Produce json +// @Param days query int false "Lookback in days [default: 1]" +// @Param operator_id query string false "Operator ID filter [default: all operators]" +// @Param first query int false "Return first N ejections [default: 1000]" +// @Param skip query int false "Skip first N ejections [default: 0]" +// @Success 200 {object} QueriedOperatorEjectionsResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators-info/operator-ejections [get] +func FetchOperatorEjections() {} + +// @Summary Operator node reachability port check +// @Tags OperatorsInfo +// @Produce json +// @Param operator_id query string true "Operator ID" +// @Success 200 {object} OperatorPortCheckResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators-info/port-check [get] +func OperatorPortCheck() {} + +// @Summary Active operator semver scan +// @Tags OperatorsInfo +// @Produce json +// @Success 200 {object} SemverReportResponse +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators-info/semver-scan [get] +func SemverScan() {} + +// @Summary Fetch metrics +// @Tags Metrics +// @Produce json +// @Param start query int false "Start unix timestamp [default: 1 hour ago]" +// @Param end query int false "End unix timestamp [default: unix time now]" +// @Param limit query int false "Limit [default: 10]" +// @Success 200 {object} Metric +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics [get] +func FetchMetrics() {} + +// FetchMetricsThroughputHandler godoc +// +// @Summary Fetch throughput time series +// @Tags Metrics +// @Produce json +// @Param start query int false "Start unix timestamp [default: 1 hour ago]" +// @Param end query int false "End unix timestamp [default: unix time now]" +// @Success 200 {object} []Throughput +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/throughput [get] +func FetchMetricsThroughputHandler() {} + +// FetchNonSigners godoc +// +// @Summary Fetch non signers +// @Tags Metrics +// @Produce json +// @Param interval query int false "Interval to query for non signers in seconds [default: 3600]" +// @Success 200 {object} []NonSigner +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/non-signers [get] +func FetchNonSigners() {} + +// FetchOperatorsNonsigningPercentageHandler godoc +// +// @Summary Fetch operators non signing percentage +// @Tags Metrics +// @Produce json +// @Param interval query int false "Interval to query for operators nonsigning percentage [default: 3600]" +// @Param end query string false "End time (2006-01-02T15:04:05Z) to query for operators nonsigning percentage [default: now]" +// @Param live_only query string false "Whether return only live nonsigners [default: true]" +// @Success 200 {object} OperatorsNonsigningPercentage +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/operator-nonsigning-percentage [get] +func FetchOperatorsNonsigningPercentageHandler() {} + +// @Summary Get status of EigenDA Disperser service +// @Tags ServiceAvailability +// @Produce json +// @Success 200 {object} ServiceAvailabilityResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/disperser-service-availability [get] +func FetchDisperserServiceAvailability() {} + +// @Summary Get status of EigenDA churner service +// @Tags ServiceAvailability +// @Produce json +// @Success 200 {object} ServiceAvailabilityResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/churner-service-availability [get] +func FetchChurnerServiceAvailability() {} + +// @Summary Get status of EigenDA batcher +// @Tags ServiceAvailability +// @Produce json +// @Success 200 {object} ServiceAvailabilityResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/batcher-service-availability [get] +func FetchBatcherAvailability() {} diff --git a/disperser/dataapi/v1/swagger.go b/disperser/dataapi/v1/swagger.go new file mode 100644 index 0000000000..0b1aab55dd --- /dev/null +++ b/disperser/dataapi/v1/swagger.go @@ -0,0 +1,13 @@ +package v1 + +// @title EigenDA Data Access API V1 +// @version 1.0 +// @description This is the EigenDA Data Access API V1 server. +// @BasePath /api/v1 +// @schemes https http + +// SwaggerV1Doc holds swagger docs for v1 +func SwaggerV1Doc() { + // This function exists solely to hold the swagger docs + // It should never be called +} diff --git a/disperser/dataapi/v2/handlers.go b/disperser/dataapi/v2/handlers.go new file mode 100644 index 0000000000..0cd3ed4e82 --- /dev/null +++ b/disperser/dataapi/v2/handlers.go @@ -0,0 +1,114 @@ +package v2 + +import ( + corev2 "github.com/Layr-Labs/eigenda/core/v2" + "github.com/Layr-Labs/eigenda/disperser/common/semver" +) + +// Response Types +type ErrorResponse struct { + Error string `json:"error"` +} + +type BlobResponse struct { + BlobHeader *corev2.BlobHeader `json:"blob_header"` + Status string `json:"status"` + DispersedAt uint64 `json:"dispersed_at"` + BlobSizeBytes uint64 `json:"blob_size_bytes"` +} + +type SignedBatch struct { + BatchHeader *corev2.BatchHeader `json:"batch_header"` + Attestation *corev2.Attestation `json:"attestation"` +} + +type BatchResponse struct { + BatchHeaderHash string `json:"batch_header_hash"` + SignedBatch *SignedBatch `json:"signed_batch"` + BlobVerificationInfos []*corev2.BlobVerificationInfo `json:"blob_verification_infos"` +} + +type OperatorStake struct { + QuorumId string `json:"quorum_id"` + OperatorId string `json:"operator_id"` + StakePercentage float64 `json:"stake_percentage"` + Rank int `json:"rank"` +} + +type OperatorsStakeResponse struct { + StakeRankedOperators map[string][]*OperatorStake `json:"stake_ranked_operators"` +} + +type SemverReportResponse struct { + Semver map[string]*semver.SemverMetrics `json:"semver"` +} + +type OperatorPortCheckResponse struct { + OperatorId string `json:"operator_id"` + DispersalSocket string `json:"dispersal_socket"` + RetrievalSocket string `json:"retrieval_socket"` + DispersalOnline bool `json:"dispersal_online"` + RetrievalOnline bool `json:"retrieval_online"` +} + +// FetchBlobHandler godoc +// +// @Summary Fetch blob metadata by blob key +// @Tags Feed +// @Produce json +// @Param blob_key path string true "Blob key in hex string" +// @Success 200 {object} BlobResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /blob/{blob_key} [get] +func FetchBlobHandler() {} + +// FetchBatchHandler godoc +// +// @Summary Fetch batch by the batch header hash +// @Tags Feed +// @Produce json +// @Param batch_header_hash path string true "Batch header hash in hex string" +// @Success 200 {object} BlobResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /batch/{batch_header_hash} [get] +func FetchBatchHandler() {} + +// FetchOperatorsStake godoc +// +// @Summary Operator stake distribution query +// @Tags Operators +// @Produce json +// @Param operator_id query string false "Operator ID in hex string [default: all operators if unspecified]" +// @Success 200 {object} OperatorsStakeResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators/stake [get] +func FetchOperatorsStake() {} + +// FetchOperatorsNodeInfo godoc +// +// @Summary Active operator semver +// @Tags Operators +// @Produce json +// @Success 200 {object} SemverReportResponse +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators/nodeinfo [get] +func FetchOperatorsNodeInfo() {} + +// CheckOperatorsReachability godoc +// +// @Summary Operator node reachability check +// @Tags Operators +// @Produce json +// @Param operator_id query string false "Operator ID in hex string [default: all operators if unspecified]" +// @Success 200 {object} OperatorPortCheckResponse +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /operators/reachability [get] +func CheckOperatorsReachability() {} diff --git a/disperser/dataapi/v2/swagger.go b/disperser/dataapi/v2/swagger.go new file mode 100644 index 0000000000..1cdbcb7a6d --- /dev/null +++ b/disperser/dataapi/v2/swagger.go @@ -0,0 +1,13 @@ +package v2 + +// @title EigenDA Data Access API V2 +// @version 2.0 +// @description This is the EigenDA Data Access API V2 server. +// @BasePath /api/v2 +// @schemes https http + +// SwaggerV2Doc holds swagger docs for v2 +func SwaggerV2Doc() { + // This function exists solely to hold the swagger docs + // It should never be called +}