Skip to content

Commit

Permalink
doc: update reference to the generator code
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
  • Loading branch information
emmanuel-ferdman committed Sep 22, 2024
1 parent 0a6870f commit 633f6aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/contribute-to-core-lightning/code-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The manpages are generated from the JSON schemas using the [`fromschema`](https:

### `cln-rpc`

We use `msggen` to generate the Rust bindings crate [`cln-rpc`](https://github.com/ElementsProject/lightning/tree/master/cln-rpc). These bindings contain the stubs for the JSON-RPC methods, as well as types for the request and response structs. The [generator code](https://github.com/ElementsProject/lightning/blob/master/contrib/msggen/msggen/gen/rust.py) maps each abstract JSON-RPC type to a Rust type, minimizing size (e.g., binary data is hex-decoded).
We use `msggen` to generate the Rust bindings crate [`cln-rpc`](https://github.com/ElementsProject/lightning/tree/master/cln-rpc). These bindings contain the stubs for the JSON-RPC methods, as well as types for the request and response structs. The [generator code](https://github.com/ElementsProject/lightning/blob/master/contrib/msggen/msggen/gen/rpc/rust.py) maps each abstract JSON-RPC type to a Rust type, minimizing size (e.g., binary data is hex-decoded).

The calling pattern follows the `call(req_obj) -> resp_obj` format, and the individual arguments are not expanded. For more ergonomic handling of generic requests and responses we also define the `Request` and `Response` enumerations, so you can hand them to a generic function without having to resort to dynamic dispatch.

Expand Down

0 comments on commit 633f6aa

Please sign in to comment.