Skip to content

Commit 48f8b82

Browse files
committed
Clean up links and add tests/quickstart to docs
1 parent 5f630dd commit 48f8b82

File tree

5 files changed

+128
-7
lines changed

5 files changed

+128
-7
lines changed

README.md

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

1212
### Contributing
1313

14-
Please see the contributors guide in [`docs/contributors-guide.md`][contributors-guide]
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.
@@ -112,8 +112,8 @@ This repository is licensed under [CC0](LICENSE).
112112
[validator]: https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
113113
[graphql-schema]: http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
114114
[eip-1767]: https://eips.ethereum.org/EIPS/eip-1767
115-
[contributors-guide]: docs/contributors-guide.md
115+
[contributors-guide]: docs/reference/contributors-guide.md
116116
[json-schema]: https://json-schema.org
117117
[hive]: https://github.com/ethereum/hive
118118
[rpc-compat]: https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat
119-
[test-gen]: tests/README.md
119+
[test-gen]: docs/reference/tests.md

docs/config/gatsby-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ module.exports = {
1313
secondaryColor: '#f50057', //material-ui secondary color
1414
author: '',
1515
menuLinks: [
16-
{ name: 'Introduction', link: '/introduction' },
16+
{ name: 'Introduction', link: '/intro' },
1717
{
1818
name: 'API Documentation',
1919
link: '/api-documentation'
2020
},
21+
{ name: 'Quickstart', link: '/quickstart' },
2122
{ name: 'Contributors Guide', link: '/contributors-guide' },
23+
{ name: 'Testing', link: '/tests'},
2224
{ name: 'Ethsimulatev1 notes', link: '/ethsimulatev1-notes' },
2325
],
2426
footerLinks: [

docs/reference/quickstart.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Execution API Specification
2+
3+
## JSON-RPC
4+
5+
[View the spec][playground]
6+
7+
The Ethereum JSON-RPC is a standard collection of methods that all execution
8+
clients implement. It is the canonical interface between users and the network.
9+
This interface allows downstream tooling and infrastructure to treat different
10+
Ethereum clients as modules that can be swapped at will.
11+
12+
### Contributing
13+
14+
Please see the [contributors guide][contributors-guide]
15+
for general information about the process of standardizing new API methods and
16+
making changes to existing ones. Information on test generation can be found
17+
in [test-gen][test-gen]
18+
19+
The specification itself is written in [OpenRPC][openrpc]. Refer to the OpenRPC
20+
specification and the JSON schema [specification][json-schema] to get started.
21+
22+
### Building
23+
24+
The specification is split into multiple files to improve readability. The
25+
spec can be compiled into a single document as follows:
26+
27+
```console
28+
$ npm install
29+
$ npm run build
30+
Build successful.
31+
```
32+
33+
This will output the file `openrpc.json` in the root of the project. This file
34+
will have all schema `#ref`s resolved.
35+
36+
#### Testing
37+
38+
There are several mechanisms for testing specification contributions and client
39+
conformance.
40+
41+
First is the [OpenRPC validator][validator]. It performs some basic syntactic
42+
checks on the generated specification.
43+
44+
```console
45+
$ npm install
46+
$ npm run lint
47+
OpenRPC spec validated successfully.
48+
```
49+
50+
Next is `speccheck`. This tool validates the test cases in the `tests`
51+
directory against the specification.
52+
53+
```console
54+
$ go install github.com/lightclient/rpctestgen/cmd/speccheck@latest
55+
$ speccheck -v
56+
all passing.
57+
```
58+
59+
If you get an error that says: `speccheck: command not found`,
60+
make sure that the go binary is in your $PATH:
61+
62+
```console
63+
$ export PATH=$HOME/go/bin:$PATH
64+
```
65+
66+
The spell checker ensures the specification is free of spelling errors.
67+
68+
```console
69+
$ pip install pyspelling
70+
$ pyspelling -c spellcheck.yaml
71+
Spelling check passed :)
72+
```
73+
74+
pyspelling is a wrapper around either [Aspell](http://aspell.net/) or
75+
[Hunspell](https://hunspell.github.io/). You'll need to install
76+
one of those before running `pyspelling`.
77+
78+
Finally, the test cases in the `tests/` directory may be run against individual
79+
execution client using the [`hive`] simulator [`rpc-compat`][rpc-compat].
80+
Please see the documentation in the aforementioned repositories for more
81+
information.
82+
83+
## GraphQL
84+
85+
[View the spec][graphql-schema]
86+
87+
[EIP-1767][eip-1767] proposed a GraphQL schema for interacting with Ethereum clients. Since then Besu and Geth have implemented the interface. This repo contains a live specification to integrate changes to the protocol as well as other improvements into the GraphQL schema.
88+
89+
### Generation
90+
91+
The schema in this repo is generated by issuing a meta GraphQL query against a live node. This can be done as follows:
92+
93+
```console
94+
$ npm run graphql:schema
95+
```
96+
97+
### Testing
98+
99+
A script is included in the source code which reads and validates the given schema to be a valid one. It is recommended to perform this check after modifying the schema by:
100+
101+
```console
102+
$ npm run graphql:validate
103+
```
104+
105+
## License
106+
107+
This repository is licensed under [CC0](LICENSE).
108+
109+
110+
[playground]: https://ethereum.github.io/execution-apis/docs/reference/json-rpc-api
111+
[openrpc]: https://open-rpc.org
112+
[validator]: https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
113+
[graphql-schema]: http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
114+
[eip-1767]: https://eips.ethereum.org/EIPS/eip-1767
115+
[contributors-guide]: docs/reference/contributors-guide.md
116+
[json-schema]: https://json-schema.org
117+
[hive]: https://github.com/ethereum/hive
118+
[rpc-compat]: https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat
119+
[test-gen]: docs/reference/tests.md
File renamed without changes.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "npm run build:spec",
88
"build:spec": "node scripts/build.js",
99
"build:docs": "npm run generate-clients && npm run build:docs:gatsby",
10-
"build:docs:gatsby": "cd build/docs/gatsby && npm install && gatsby build --prefix-paths",
10+
"build:docs:gatsby": "cp README.md docs/reference/quickstart.md && cd build/docs/gatsby && npm install && gatsby build --prefix-paths",
1111
"lint": "node scripts/build.js && node scripts/validate.js && node scripts/graphql-validate.js",
1212
"clean": "rm -rf build && mkdir -p build",
1313
"generate-clients": "mkdir -p build && open-rpc-generator generate -c open-rpc-generator-config.json",
@@ -46,4 +46,4 @@
4646
"react": "^18.0.0",
4747
"react-dom": "^18.0.0"
4848
}
49-
}
49+
}

0 commit comments

Comments
 (0)