Skip to content

Commit 2656ffc

Browse files
authored
Merge branch 'main' into no-history-error-simple
2 parents 8686381 + 575f51b commit 2656ffc

File tree

140 files changed

+11729
-33838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+11729
-33838
lines changed

.github/workflows/deploy.yaml

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,34 @@
1-
name: Deploy specification
1+
name: Deploy to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
78

89
env:
9-
# this avoids node running out of memory while building
10-
NODE_OPTIONS: --max_old_space_size=20480
10+
GITHUB_REPOSITORY: ${{ github.repository }}
1111

1212
jobs:
13-
deploy-spec:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Use Node.js 15
18-
uses: actions/setup-node@v1
19-
with:
20-
node-version: '15'
21-
- run: npm ci
22-
- run: npm run build
23-
- name: setup git config
24-
run: |
25-
git config user.name "GitHub Actions Bot"
26-
git config user.email "<>"
27-
- name: Deploy assembled spec
28-
run: |
29-
git checkout -b assembled-spec
30-
git add -f openrpc.json
31-
git add -f refs-openrpc.json
32-
git commit -m "assemble openrpc.json"
33-
git push -fu origin assembled-spec
3413
deploy-gh-pages:
14+
permissions:
15+
pages: write
16+
id-token: write
17+
contents: write
18+
3519
runs-on: ubuntu-latest
3620
steps:
37-
- uses: actions/checkout@v2
38-
- name: Use Node.js 15
39-
uses: actions/setup-node@v1
21+
- uses: actions/checkout@v4
22+
- name: Use Node.js 22
23+
uses: actions/setup-node@v4
4024
with:
41-
node-version: '15'
25+
node-version: '22'
4226
- run: npm ci
43-
- run: npm run build
44-
- run: npm run generate-clients
45-
- run: 'sed -i -e "s|Prefix: \"\"|Prefix: \"/execution-apis\"|g" build/docs/gatsby/gatsby-config.js'
46-
- run: 'sed -i -e "s|/api|api|g" build/docs/gatsby/src/pages/index.tsx'
27+
- run: npm run build:spec
4728
- run: npm run build:docs
48-
- name: setup git config
49-
run: |
50-
git config user.name "GitHub Actions Bot"
51-
git config user.email "<>"
5229
- name: Deploy to GitHub Pages
53-
if: success()
54-
uses: crazy-max/ghaction-github-pages@v3
30+
uses: peaceiris/actions-gh-pages@v4
5531
with:
56-
target_branch: gh-pages
57-
build_dir: build/docs/gatsby/public
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: build/docs/gatsby/public
34+
commit_message: "Deploy to GitHub Pages"

.github/workflows/test-deploy.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
test-deploy:
11+
name: Test deployment
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [20, 22, 24]
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm install --frozen-lockfile
27+
- name: Test build website
28+
run: |
29+
npm run build:spec
30+
npm run build:docs

.github/workflows/test.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ jobs:
66
lint-and-check:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Use Node.js 15.x
11-
uses: actions/setup-node@v1
9+
- uses: actions/checkout@v4
10+
- name: Use Node.js 22
11+
uses: actions/setup-node@v4
1212
with:
13-
node-version: ^15.x
13+
node-version: 22
1414
- run: npm ci
15-
- run: npm run build
15+
- run: npm run build:spec
1616
- run: npm run lint
1717
- name: Set up Go 1.x
18-
uses: actions/setup-go@v2
18+
uses: actions/setup-go@v5
1919
with:
2020
go-version: ^1.18
2121
id: go

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ refs-openrpc.json
66
data.json
77
schema.json
88
*.dic
9+
.idea/

.nojekyll

Whitespace-only changes.

README.md

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ Ethereum clients as modules that can be swapped at will.
1111

1212
### Contributing
1313

14-
Please see the contributors guide in [`docs/making-changes.md`][making-changes]
14+
Please see the [contributors guide][contributors-guide]
1515
for general information about the process of standardizing new API methods and
1616
making changes to existing ones. Information on test generation can be found
17-
in [`tests/README.md`][test-gen]
17+
in [test-gen][test-gen]
1818

1919
The specification itself is written in [OpenRPC][openrpc]. Refer to the OpenRPC
2020
specification and the JSON schema [specification][json-schema] to get started.
2121

22-
### Building
22+
### Updating the specs
2323

24-
The specification is split into multiple files to improve readability. The
24+
#### Compiling
25+
The specification is split into multiple files to improve readability. The
2526
spec can be compiled into a single document as follows:
2627

2728
```console
@@ -33,11 +34,26 @@ Build successful.
3334
This will output the file `openrpc.json` in the root of the project. This file
3435
will have all schema `#ref`s resolved.
3536

36-
#### Testing
37+
#### Building the docs
38+
39+
Once you've updated something in the spec, you can use the docs generation tools
40+
to view the updated specs locally.
41+
42+
```console
43+
$ npm run build:docs
44+
$ npm run watch
45+
```
46+
47+
The `watch` command starts a local webserver serving the docs in-browser at
48+
`http://0.0.0.0:8000` and it rebuilds when you update something in the specs.
49+
Please reload the page to see your changes.
50+
51+
### Testing
3752

3853
There are several mechanisms for testing specification contributions and client
39-
conformance.
54+
conformance.
4055

56+
#### Linting
4157
First is the [OpenRPC validator][validator]. It performs some basic syntactic
4258
checks on the generated specification.
4359

@@ -47,15 +63,32 @@ $ npm run lint
4763
OpenRPC spec validated successfully.
4864
```
4965

66+
#### Spec tests
5067
Next is `speccheck`. This tool validates the test cases in the `tests`
51-
directory against the specification.
68+
directory against the specification. There are two npm scripts to simplify this.
69+
70+
```console
71+
$ npm run build:test
72+
$ npm run test
73+
all passing.
74+
```
75+
76+
or
5277

5378
```console
5479
$ go install github.com/lightclient/rpctestgen/cmd/speccheck@latest
5580
$ speccheck -v
56-
all passing.
5781
```
5882

83+
If you get an error that says: `speccheck: command not found`,
84+
make sure that the go binary is in your $PATH:
85+
86+
```console
87+
$ export PATH=$HOME/go/bin:$PATH
88+
```
89+
90+
#### Spelling
91+
5992
The spell checker ensures the specification is free of spelling errors.
6093

6194
```console
@@ -64,8 +97,13 @@ $ pyspelling -c spellcheck.yaml
6497
Spelling check passed :)
6598
```
6699

100+
pyspelling is a wrapper around either [Aspell](http://aspell.net/) or
101+
[Hunspell](https://hunspell.github.io/). You'll need to install
102+
one of those before running `pyspelling`.
103+
104+
#### Hive tests
67105
Finally, the test cases in the `tests/` directory may be run against individual
68-
execution client using the [`hive`] simulator [`rpc-compat`][rpc-compat].
106+
execution client using the [`hive`][hive] simulator [`rpc-compat`][rpc-compat].
69107
Please see the documentation in the aforementioned repositories for more
70108
information.
71109

@@ -101,8 +139,8 @@ This repository is licensed under [CC0](LICENSE).
101139
[validator]: https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
102140
[graphql-schema]: http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
103141
[eip-1767]: https://eips.ethereum.org/EIPS/eip-1767
104-
[making-changes]: docs/making-changes.md
105-
[json-schema]: https://json-schema.org
142+
[contributors-guide]: docs/reference/contributors-guide.md
143+
[json-schema]: https://json-schema.org
106144
[hive]: https://github.com/ethereum/hive
107145
[rpc-compat]: https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat
108-
[test-gen]: tests/README.md
146+
[test-gen]: docs/reference/tests.md

docs/config/gatsby-config.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
const remarkGfm = require('remark-gfm');
2+
3+
module.exports = {
4+
pathPrefix: "/execution-apis",
5+
siteMetadata: {
6+
title: 'Ethereum JSON-RPC Specification',
7+
description: 'A specification of the standard interface for Ethereum clients.',
8+
siteUrl: process.env.GITHUB_REPOSITORY
9+
? `https://${process.env.GITHUB_REPOSITORY.split('/')[0]}.github.io/execution-apis`
10+
: 'https://ethereum.github.io/execution-apis', // fallback for local development
11+
logoUrl: 'https://raw.githubusercontent.com/open-rpc/design/master/icons/open-rpc-logo-noText/open-rpc-logo-noText%20(PNG)/256x256.png',
12+
primaryColor: '#3f51b5', //material-ui primary color
13+
secondaryColor: '#f50057', //material-ui secondary color
14+
author: '',
15+
menuLinks: [
16+
{ name: 'Introduction', link: '/intro' },
17+
{
18+
name: 'API Documentation',
19+
link: '/api-documentation'
20+
},
21+
{ name: 'Quickstart', link: '/quickstart' },
22+
{ name: 'Contributors Guide', link: '/contributors-guide' },
23+
{ name: 'Testing', link: '/tests'},
24+
{ name: 'Ethsimulatev1 notes', link: '/ethsimulatev1-notes' },
25+
],
26+
footerLinks: [
27+
{
28+
name: 'OpenRPC',
29+
link: 'https://open-rpc.org'
30+
}
31+
]
32+
},
33+
plugins: [
34+
{
35+
resolve: 'gatsby-plugin-mdx',
36+
options: {
37+
extensions: ['.mdx', '.md'],
38+
gatsbyRemarkPlugins: [
39+
{
40+
resolve: 'gatsby-remark-autolink-headers',
41+
options: {
42+
icon: false,
43+
},
44+
},
45+
],
46+
mdxOptions: {
47+
remarkPlugins: [remarkGfm],
48+
},
49+
},
50+
},
51+
"gatsby-openrpc-theme",
52+
{
53+
resolve: 'gatsby-plugin-manifest',
54+
options: {
55+
name: 'pristine-site',
56+
short_name: 'pristine-site',
57+
start_url: '/execution-apis/',
58+
background_color: 'transparent',
59+
theme_color: '#3f51b5',
60+
display: 'minimal-ui',
61+
icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site.
62+
},
63+
},
64+
"gatsby-plugin-image",
65+
"gatsby-plugin-sharp",
66+
"gatsby-transformer-sharp",
67+
{
68+
resolve: "gatsby-source-filesystem",
69+
options: {
70+
name: "images",
71+
path: __dirname + '/src/images',
72+
},
73+
},
74+
{
75+
resolve: "gatsby-source-filesystem",
76+
options: {
77+
name: "docs",
78+
path: __dirname + '/../../../docs/reference',
79+
},
80+
},
81+
],
82+
}

docs/making-changes.md renamed to docs/reference/contributors-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ others don't.
115115

116116
[exec-apis]: https://github.com/ethereum/execution-apis
117117
[pm]: https://github.com/ethereum/pm
118-
[test-gen]: ../tests/README.md
118+
[test-gen]: https://github.com/ethereum/execution-apis/blob/main/docs/reference/tests.md

0 commit comments

Comments
 (0)