Skip to content

Commit a52a190

Browse files
committed
feat(repo,docs-site): migrate swagger apis to docs
1 parent 357ecf2 commit a52a190

File tree

13 files changed

+1876
-1602
lines changed

13 files changed

+1876
-1602
lines changed

.github/workflows/blobstorage-preview.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/blobstorage-production.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/docs-site/astro.config.ts

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from "astro/config";
22
import starlight from "@astrojs/starlight";
33
import starlightLinksValidator from "starlight-links-validator";
4+
import starlightOpenAPI, { openAPISidebarGroups } from "starlight-openapi";
45

56
// https://astro.build/config
67
export default defineConfig({
@@ -13,7 +14,38 @@ export default defineConfig({
1314
},
1415
integrations: [
1516
starlight({
16-
plugins: [starlightLinksValidator()],
17+
plugins: [
18+
starlightLinksValidator({
19+
exclude: [
20+
// "/api-reference/blob-storage",
21+
"/api-reference/bridge-relayer",
22+
"/api-reference/event-indexer",
23+
"/api-reference/prover-server",
24+
],
25+
}),
26+
starlightOpenAPI([
27+
// {
28+
// base: "api-reference/blob-storage",
29+
// label: "Blob Storage API",
30+
// schema: "../blobstorage/docs/swagger.yaml",
31+
// },
32+
{
33+
base: "api-reference/bridge-relayer",
34+
label: "Bridge Relayer API",
35+
schema: "../relayer/docs/swagger.yaml",
36+
},
37+
{
38+
base: "api-reference/event-indexer",
39+
label: "Event Indexer API",
40+
schema: "../eventindexer/docs/swagger.yaml",
41+
},
42+
{
43+
base: "api-reference/prover-server",
44+
label: "Prover Server API",
45+
schema: "../taiko-client/docs/swagger.yaml",
46+
},
47+
]),
48+
],
1749
components: {
1850
SiteTitle: "./src/components/starlight/SiteTitle.astro",
1951
Head: "./src/components/starlight/Head.astro",
@@ -115,14 +147,14 @@ export default defineConfig({
115147
},
116148
],
117149
},
118-
{
119-
label: "API Reference",
120-
autogenerate: { directory: "api-reference" },
121-
},
122150
{
123151
label: "Resources",
124152
autogenerate: { directory: "resources" },
125153
},
154+
{
155+
label: "API Reference",
156+
items: openAPISidebarGroups,
157+
},
126158
],
127159
}),
128160
],

packages/docs-site/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
"dependencies": {
1313
"@astrojs/check": "^0.6.0",
1414
"@astrojs/starlight": "^0.22.2",
15-
"astro": "^4.7.1",
16-
"astro-og-canvas": "^0.4.2",
15+
"astro": "^4.8.3",
16+
"astro-og-canvas": "^0.5.0",
1717
"canvaskit-wasm": "^0.39.1",
1818
"sharp": "^0.33.3",
19-
"starlight-links-validator": "^0.6.0",
20-
"typescript": "^5.4.3"
19+
"starlight-links-validator": "^0.8.0",
20+
"starlight-openapi": "^0.6.3",
21+
"typescript": "^5.4.5"
2122
}
2223
}

packages/docs-site/src/content/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const collections = {
77
extend: z.object({
88
description: z
99
.string()
10-
.max(160, { message: "Must be 160 characters or less." }),
10+
.max(160, { message: "Must be 160 characters or less." }).optional(),
1111
}),
1212
}),
1313
}),

packages/docs-site/src/content/docs/api-reference/bridge-relayer-api.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/docs-site/src/content/docs/api-reference/event-indexer-api.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/docs-site/src/content/docs/api-reference/prover-server-api.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/docs-site/src/content/docs/api-reference/taiko-node-api.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/docs-site/src/content/docs/core-concepts/taiko-nodes.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,23 @@ If the proposed block has a **valid** or **invalid** `txList`, the `prover`:
8585

8686
1. Generates a Merkle proof of the block's `TaikoL2.anchor` transaction to prove its existence in the `block.txRoot`'s [MPT](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/) and this transaction receipt's [Merkle proof](https://rollup-glossary.vercel.app/other-terms#merkle-proofs) in the `block.receiptRoot`'s MPT from the L2 execution engine.
8787
2. Submits the `TaikoL2.anchor` transaction's RLP encoded bytes, its receipt's RLP encoded bytes, the generated Merkle proofs, and a validity proof to prove this block **valid** by sending a `TaikoL1.proveBlock` transaction (the block is valid even for an invalid `txList` because we prove the invalid `txList` maps to an empty block with only the anchor transaction).
88+
89+
## Taiko Node API
90+
91+
Using a Taiko node should feel the same as using any other L1 node, because we essentially re-use the L1 client and make a few backwards-compatible modifications. You can first read about the architecture of Taiko nodes [here](/core-concepts/taiko-nodes).
92+
93+
### Differences from a Geth client
94+
95+
View the fork diff page to see the minimal set of changes made to Geth [here](https://geth.taiko.xyz).
96+
97+
### Execution JSON-RPC API
98+
99+
Check out the execution client spec [here](https://ethereum.github.io/execution-apis/api-documentation/).
100+
101+
### Engine API
102+
103+
Check out the engine API spec [here](https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md).
104+
105+
### Hive test harness
106+
107+
If a Taiko node should feel the same as using any other L1 node, it should surely be able to pass the [hive e2e test harness](https://github.com/ethereum/hive). At the time of writing, the hive tests are actually one of the best references for what the API of an Ethereum node actually is.

0 commit comments

Comments
 (0)