Commit Graph

9 Commits

Author SHA1 Message Date
Christian Decker a8aa9bd5ae cln-rpc: Fixed two minor compiler warnings 2022-03-16 11:11:58 +10:30
Christian Decker 487b5e6169 msggen: Add meta file to keep the field numbers stable
We are inferring the field numbers on the fly, which isn't really
compatible with the way GRPC field numbers work, i.e., they must be
stable while the IDL file evolves. So far when a field was added in
the middle of a struct or removed all subsequent fields would get
renumbered, essentially breaking any client that was using the old
scheme.

We now add a meta file `.msggen.json` that keeps track of the numbers
assigned so far, so they can be reused, and new ones can be generated
not to conflict with existing ones. This file is intentionally kept
generic, so other generators can add more information that has to be
managed across runs.

Changelog-None
2022-03-16 11:11:58 +10:30
Christian Decker f5e1829117 cln-plugin: Implement logging facade adapter for cln plugins
We wrap emitted messages into a JSON-RPC notification envelope and
write them to stdout. We use an indirection over an mpsc channel in
order to avoid deadlocks if we emit logs while holding the writer lock
on stdout.
2022-03-10 10:21:41 +10:30
Christian Decker 6332578070 rust: Use $CARGO_OPTS when building the example plugin 2022-02-28 23:25:37 +00:00
Christian Decker 75f0b8e916 cln-grpc: Add `listpeers` RPC method
This is pretty much the hardest to map, but we map it correctly, with
the exception of the state_changes[] array we truncated out in the
last commit.
2022-02-28 23:25:37 +00:00
Christian Decker 24e44ecbb6 cln-grpc: Add glue to get all pieces to work together 2022-02-28 23:25:37 +00:00
Christian Decker 6d256fdbf9 cln-rpc: Add type for AmountOrAll and AmountOrAny 2022-02-11 16:02:25 +01:00
Christian Decker 787350eaa9 pytest: Test the rust bindings from cln-rpc 2022-02-11 16:02:25 +01:00
Christian Decker faa3835177 cln-rpc: Scaffolding for the cln-rpc crate
Changelog-Added: cln-rpc: A new Rust library called `cln-rpc` can be used to interact with the JSON-RPC
2022-02-11 16:02:25 +01:00