@@ -19,8 +19,9 @@ in [test-gen][test-gen]
19
19
The specification itself is written in [ OpenRPC] [ openrpc ] . Refer to the OpenRPC
20
20
specification and the JSON schema [ specification] [ json-schema ] to get started.
21
21
22
- ### Building
22
+ ### Updating the specs
23
23
24
+ #### Compiling
24
25
The specification is split into multiple files to improve readability. The
25
26
spec can be compiled into a single document as follows:
26
27
@@ -33,11 +34,26 @@ Build successful.
33
34
This will output the file ` openrpc.json ` in the root of the project. This file
34
35
will have all schema ` #ref ` s resolved.
35
36
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
37
52
38
53
There are several mechanisms for testing specification contributions and client
39
54
conformance.
40
55
56
+ #### Linting
41
57
First is the [ OpenRPC validator] [ validator ] . It performs some basic syntactic
42
58
checks on the generated specification.
43
59
@@ -47,13 +63,21 @@ $ npm run lint
47
63
OpenRPC spec validated successfully.
48
64
```
49
65
66
+ #### Spec tests
50
67
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
52
77
53
78
``` console
54
79
$ go install github.com/lightclient/rpctestgen/cmd/speccheck@latest
55
80
$ speccheck -v
56
- all passing.
57
81
```
58
82
59
83
If 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`,
63
87
$ export PATH=$HOME /go/bin:$PATH
64
88
```
65
89
90
+ #### Spelling
91
+
66
92
The spell checker ensures the specification is free of spelling errors.
67
93
68
94
``` console
@@ -75,8 +101,9 @@ pyspelling is a wrapper around either [Aspell](http://aspell.net/) or
75
101
[ Hunspell] ( https://hunspell.github.io/ ) . You'll need to install
76
102
one of those before running ` pyspelling ` .
77
103
104
+ #### Hive tests
78
105
Finally, 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 ] .
80
107
Please see the documentation in the aforementioned repositories for more
81
108
information.
82
109
@@ -104,16 +131,17 @@ $ npm run graphql:validate
104
131
105
132
## License
106
133
107
- This repository is licensed under [ CC0] ( LICENSE ) .
134
+ This repository is licensed under [ CC0] [ license ] .
108
135
109
136
110
137
[ playground ] : https://ethereum.github.io/execution-apis/api-documentation/
111
138
[ openrpc ] : https://open-rpc.org
112
139
[ validator ] : https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
113
140
[ graphql-schema ] : http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
114
141
[ eip-1767 ] : https://eips.ethereum.org/EIPS/eip-1767
115
- [ contributors-guide ] : docs/reference/ contributors-guide.md
142
+ [ contributors-guide ] : ../ contributors-guide
116
143
[ json-schema ] : https://json-schema.org
117
144
[ hive ] : https://github.com/ethereum/hive
118
145
[ 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