Skip to content

feat: Use tags for chains in OpenRPC specs #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions build/api-specs/alchemy/json-rpc/core-api.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions fern/api-reference/core-api/core-api-quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Core API Quickstart
description: Get started building on the Alchemy Core JSON-RPC API
subtitle: Get started building on the Alchemy Core JSON-RPC API
slug: reference/core-api-quickstart
---

## Introduction

Hi.
3 changes: 3 additions & 0 deletions fern/apis/core-api/generators.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
api:
specs:
- openrpc: ../../../build/api-specs/alchemy/json-rpc/core-api.json
49 changes: 49 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ tabs:
node:
display-name: Node
slug: node
nodes:
display-name: Nodes
slug: nodes

navigation:
- tab: get-started
Expand Down Expand Up @@ -2438,6 +2441,52 @@ navigation:
- api: Superseed API Endpoints
api-name: superseed
slug: superseed
- tab: nodes
layout:
- section: Quickstart
contents:
- page: Getting an API Key
path: api-reference/core-api/core-api-quickstart.mdx
- page: Installing the Alchemy SDK
path: api-reference/core-api/core-api-quickstart.mdx
- page: Making your first request
path: api-reference/core-api/core-api-quickstart.mdx
- section: Concepts
contents:
- page: Blockchains
path: api-reference/core-api/core-api-quickstart.mdx
- page: Nodes
path: api-reference/core-api/core-api-quickstart.mdx
- page: Hamsters
path: api-reference/core-api/core-api-quickstart.mdx
- section: "How-to Guides"
contents:
- page: How to deploy a smart contract
path: api-reference/core-api/core-api-quickstart.mdx
- page: How to launch an ERC-20 token
path: api-reference/core-api/core-api-quickstart.mdx
- section: API Reference
contents:
- section: Core API
contents:
- page: What is the Core API?
path: api-reference/core-api/core-api-quickstart.mdx
- api: Ethereum Methods
api-name: core-api
- api: Optimism Methods
api-name: core-api
Comment on lines +2474 to +2477
Copy link
Collaborator Author

@stanleyjones stanleyjones May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but includes all of the methods in the API spec, not just the ones that we tagged "Ethereum" or "Optimism".

- section: Trace API
contents:
- page: What is the Trace API?
path: api-reference/trace-api/trace-api-quickstart.mdx
- api: Trace API Methods
api-name: trace
- section: Debug API
contents:
- page: What is the Debug API?
path: api-reference/debug-api/debug-api-quickstart.mdx
- api: Debug API Methods
api-name: debug

analytics:
ga4:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"remark-preset-lint-recommended": "^7.0.1",
"typescript": "^5.8.3",
"typescript-eslint": "^8.31.0"
}
},
"packageManager": "[email protected]+sha1.64838798f519c18029c1e8a1310e16101fc2eda0"
}
17 changes: 17 additions & 0 deletions src/openrpc/alchemy/core-api/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
info:
title: Alchemy Core API JSON-RPC Specification
description: A specification of the standard JSON-RPC methods for Core API.
version: 0.0.0
servers:
[
{ "url": "https://eth-mainnet.g.alchemy.com/v2", "name": "Mainnet" },
{ "url": "https://eth-holesky.g.alchemy.com/v2", "name": "Holesky" },
{
"url": "https://opt-mainnet.g.alchemy.com/v2",
"name": "Optimism Mainnet",
},
{
"url": "https://opt-sepolia.g.alchemy.com/v2",
"name": "Optimism Sepolia",
},
]
19 changes: 19 additions & 0 deletions src/openrpc/alchemy/core-api/methods.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: eth_blockNumber
tags:
- name: "Ethereum"
description: "Ethereum Methods"
- name: "Optimism"
description: "Optimism Methods"
Comment on lines +2 to +6
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer to do it this way (although with $refs) to automatically nest by tag, similar to how it works for OpenAPI.

description: Returns the number of the most recent block.
params: []
result:
name: Block number
description: The block number of the most recently mined block as a hexadecimal string.
schema:
$ref: "#/components/schemas/uint"
examples:
- name: eth_blockNumber example
params: []
result:
name: Block number
value: "0x2377"
Loading