Skip to content

Commit

Permalink
chore(eventindexer,relayer,taiko-client): clean up swagger apis for m…
Browse files Browse the repository at this point in the history
…igration
  • Loading branch information
d1onys1us committed May 14, 2024
1 parent f937525 commit 67f4ac8
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 141 deletions.
57 changes: 7 additions & 50 deletions packages/eventindexer/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by swaggo/swag. DO NOT EDIT
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"
Expand All @@ -16,7 +16,8 @@ const docTemplate = `{
"email": "[email protected]"
},
"license": {
"name": "MIT"
"name": "MIT",
"url": "https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md"
},
"version": "{{.Version}}"
},
Expand Down Expand Up @@ -167,26 +168,6 @@ const docTemplate = `{
}
}
},
"/stats": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Get stats",
"operationId": "get-stats",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/eventindexer.Stat"
}
}
}
}
},
"/uniqueProposers": {
"get": {
"consumes": [
Expand Down Expand Up @@ -251,32 +232,6 @@ const docTemplate = `{
}
}
},
"eventindexer.Stat": {
"type": "object",
"properties": {
"averageProofReward": {
"type": "string"
},
"averageProofTime": {
"type": "string"
},
"feeTokenAddress": {
"type": "string"
},
"id": {
"type": "integer"
},
"numBlocksAssigned": {
"type": "integer"
},
"numProofs": {
"type": "integer"
},
"statType": {
"type": "string"
}
}
},
"eventindexer.UniqueProposersResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -369,13 +324,15 @@ const docTemplate = `{
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "eventindexer.katla.taiko.xyz",
Host: "eventindexer.hekla.taiko.xyz",
BasePath: "",
Schemes: []string{},
Title: "Taiko Eventindexer API",
Title: "Taiko Event Indexer API",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
Expand Down
49 changes: 4 additions & 45 deletions packages/eventindexer/docs/swagger.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"swagger": "2.0",
"info": {
"title": "Taiko Eventindexer API",
"title": "Taiko Event Indexer API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "https://community.taiko.xyz/",
"email": "[email protected]"
},
"license": {
"name": "MIT"
"name": "MIT",
"url": "https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md"
},
"version": "1.0"
},
"host": "eventindexer.katla.taiko.xyz",
"host": "eventindexer.hekla.taiko.xyz",
"paths": {
"/assignedBlocks": {
"get": {
Expand Down Expand Up @@ -143,22 +144,6 @@
}
}
},
"/stats": {
"get": {
"consumes": ["application/json"],
"produces": ["application/json"],
"summary": "Get stats",
"operationId": "get-stats",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/eventindexer.Stat"
}
}
}
}
},
"/uniqueProposers": {
"get": {
"consumes": ["application/json"],
Expand Down Expand Up @@ -215,32 +200,6 @@
}
}
},
"eventindexer.Stat": {
"type": "object",
"properties": {
"averageProofReward": {
"type": "string"
},
"averageProofTime": {
"type": "string"
},
"feeTokenAddress": {
"type": "string"
},
"id": {
"type": "integer"
},
"numBlocksAssigned": {
"type": "integer"
},
"numProofs": {
"type": "integer"
},
"statType": {
"type": "string"
}
}
},
"eventindexer.UniqueProposersResponse": {
"type": "object",
"properties": {
Expand Down
35 changes: 3 additions & 32 deletions packages/eventindexer/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,6 @@ definitions:
$ref: "#/definitions/eventindexer.ChartItem"
type: array
type: object
eventindexer.Stat:
properties:
averageProofReward:
type: string
averageProofTime:
type: string
feeTokenAddress:
type: string
id:
type: integer
numBlocksAssigned:
type: integer
numProofs:
type: integer
statType:
type: string
type: object
eventindexer.UniqueProposersResponse:
properties:
address:
Expand Down Expand Up @@ -86,16 +69,17 @@ definitions:
visible:
type: integer
type: object
host: eventindexer.katla.taiko.xyz
host: eventindexer.hekla.taiko.xyz
info:
contact:
email: [email protected]
name: API Support
url: https://community.taiko.xyz/
license:
name: MIT
url: https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md
termsOfService: http://swagger.io/terms/
title: Taiko Eventindexer API
title: Taiko Event Indexer API
version: "1.0"
paths:
/assignedBlocks:
Expand Down Expand Up @@ -194,19 +178,6 @@ paths:
schema:
$ref: "#/definitions/paginate.Page"
summary: Get nft balances by address and chain ID
/stats:
get:
consumes:
- application/json
operationId: get-stats
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: "#/definitions/eventindexer.Stat"
summary: Get stats
/uniqueProposers:
get:
consumes:
Expand Down
5 changes: 3 additions & 2 deletions packages/eventindexer/pkg/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
echo "github.com/labstack/echo/v4"
)

// @title Taiko Eventindexer API
// @title Taiko Event Indexer API
// @version 1.0
// @termsOfService http://swagger.io/terms/

Expand All @@ -23,8 +23,9 @@ import (
// @contact.email [email protected]

// @license.name MIT
// @license.url https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md

// @host eventindexer.katla.taiko.xyz
// @host eventindexer.hekla.taiko.xyz
// Server represents an eventindexer http server instance.
type Server struct {
echo *echo.Echo
Expand Down
13 changes: 10 additions & 3 deletions packages/relayer/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const docTemplate = `{
"email": "[email protected]"
},
"license": {
"name": "MIT"
"name": "MIT",
"url": "https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md"
},
"version": "{{.Version}}"
},
Expand Down Expand Up @@ -126,6 +127,12 @@ const docTemplate = `{
"paginate.Page": {
"type": "object",
"properties": {
"error": {
"type": "boolean"
},
"error_message": {
"type": "string"
},
"first": {
"type": "boolean"
},
Expand Down Expand Up @@ -159,10 +166,10 @@ const docTemplate = `{
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "relayer.katla.taiko.xyz",
Host: "relayer.hekla.taiko.xyz",
BasePath: "",
Schemes: []string{},
Title: "Taiko Relayer API",
Title: "Taiko Bridge Relayer API",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
Expand Down
13 changes: 10 additions & 3 deletions packages/relayer/docs/swagger.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"swagger": "2.0",
"info": {
"title": "Taiko Relayer API",
"title": "Taiko Bridge Relayer API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "https://community.taiko.xyz/",
"email": "[email protected]"
},
"license": {
"name": "MIT"
"name": "MIT",
"url": "https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md"
},
"version": "1.0"
},
"host": "relayer.katla.taiko.xyz",
"host": "relayer.hekla.taiko.xyz",
"paths": {
"/blockInfo": {
"get": {
Expand Down Expand Up @@ -110,6 +111,12 @@
"paginate.Page": {
"type": "object",
"properties": {
"error": {
"type": "boolean"
},
"error_message": {
"type": "string"
},
"first": {
"type": "boolean"
},
Expand Down
9 changes: 7 additions & 2 deletions packages/relayer/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ definitions:
type: object
paginate.Page:
properties:
error:
type: boolean
error_message:
type: string
first:
type: boolean
items: {}
Expand All @@ -35,16 +39,17 @@ definitions:
visible:
type: integer
type: object
host: relayer.katla.taiko.xyz
host: relayer.hekla.taiko.xyz
info:
contact:
email: [email protected]
name: API Support
url: https://community.taiko.xyz/
license:
name: MIT
url: https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md
termsOfService: http://swagger.io/terms/
title: Taiko Relayer API
title: Taiko Bridge Relayer API
version: "1.0"
paths:
/blockInfo:
Expand Down
5 changes: 3 additions & 2 deletions packages/relayer/pkg/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type ethClient interface {
BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
}

// @title Taiko Relayer API
// @title Taiko Bridge Relayer API
// @version 1.0
// @termsOfService http://swagger.io/terms/

Expand All @@ -30,8 +30,9 @@ type ethClient interface {
// @contact.email [email protected]

// @license.name MIT
// @license.url https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md

// @host relayer.katla.taiko.xyz
// @host relayer.hekla.taiko.xyz
// Server represents an relayer http server instance.
type Server struct {
echo *echo.Echo
Expand Down
3 changes: 1 addition & 2 deletions packages/taiko-client/prover/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import (
// @contact.email [email protected]

// @license.name MIT
// @license.url https://github.com/taikoxyz/taiko-mono/packages/taiko-client/blob/main/LICENSE.md

// @license.url https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md
// ProverServer represents a prover server instance.
type ProverServer struct {
echo *echo.Echo
Expand Down

0 comments on commit 67f4ac8

Please sign in to comment.