@@ -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
0 commit comments