@@ -19,8 +19,9 @@ in [test-gen][test-gen]
1919The specification itself is written in [ OpenRPC] [ openrpc ] . Refer to the OpenRPC
2020specification and the JSON schema [ specification] [ json-schema ] to get started.
2121
22- ### Building
22+ ### Updating the specs
2323
24+ #### Compiling
2425The specification is split into multiple files to improve readability. The
2526spec can be compiled into a single document as follows:
2627
@@ -33,11 +34,26 @@ Build successful.
3334This will output the file ` openrpc.json ` in the root of the project. This file
3435will 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
3853There are several mechanisms for testing specification contributions and client
3954conformance.
4055
56+ #### Linting
4157First is the [ OpenRPC validator] [ validator ] . It performs some basic syntactic
4258checks on the generated specification.
4359
@@ -47,13 +63,21 @@ $ npm run lint
4763OpenRPC spec validated successfully.
4864```
4965
66+ #### Spec tests
5067Next 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
5983If you get an error that says: ` speccheck: command not found ` ,
@@ -63,6 +87,8 @@ If you get an error that says: `speccheck: command not found`,
6387$ export PATH=$HOME /go/bin:$PATH
6488```
6589
90+ #### Spelling
91+
6692The spell checker ensures the specification is free of spelling errors.
6793
6894``` console
@@ -75,8 +101,9 @@ pyspelling is a wrapper around either [Aspell](http://aspell.net/) or
75101[ Hunspell] ( https://hunspell.github.io/ ) . You'll need to install
76102one of those before running ` pyspelling ` .
77103
104+ #### Hive tests
78105Finally, the test cases in the ` tests/ ` directory may be run against individual
79- execution client using the [ ` hive ` ] simulator [ ` rpc-compat ` ] [ rpc-compat ] .
106+ execution client using the [ ` hive ` ] [ hive ] simulator [ ` rpc-compat ` ] [ rpc-compat ] .
80107Please see the documentation in the aforementioned repositories for more
81108information.
82109
@@ -104,16 +131,17 @@ $ npm run graphql:validate
104131
105132## License
106133
107- This repository is licensed under [ CC0] ( LICENSE ) .
134+ This repository is licensed under [ CC0] [ license ] .
108135
109136
110137[ playground ] : https://ethereum.github.io/execution-apis/api-documentation/
111138[ openrpc ] : https://open-rpc.org
112139[ validator ] : https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
113140[ graphql-schema ] : http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
114141[ eip-1767 ] : https://eips.ethereum.org/EIPS/eip-1767
115- [ contributors-guide ] : docs/reference/ contributors-guide.md
142+ [ contributors-guide ] : ../ contributors-guide
116143[ json-schema ] : https://json-schema.org
117144[ hive ] : https://github.com/ethereum/hive
118145[ rpc-compat ] : https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat
119- [ test-gen ] : docs/reference/tests.md
146+ [ test-gen ] : ../tests
147+ [ license ] : https://github.com/ethereum/execution-apis/blob/main/LICENSE
0 commit comments