Skip to content

Commit 730d259

Browse files
committed
Update readme
1 parent 8b05db3 commit 730d259

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ in [test-gen][test-gen]
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+
#### Compiling
2425
The specification is split into multiple files to improve readability. The
2526
spec can be compiled into a single document as follows:
2627

@@ -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
3954
conformance.
4055

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

@@ -47,13 +63,21 @@ $ 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

5983
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`,
6387
$ export PATH=$HOME/go/bin:$PATH
6488
```
6589

90+
#### Spelling
91+
6692
The 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
76102
one of those before running `pyspelling`.
77103

104+
#### Hive tests
78105
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].
80107
Please see the documentation in the aforementioned repositories for more
81108
information.
82109

0 commit comments

Comments
 (0)