Commit Graph

28 Commits

Author SHA1 Message Date
joe.miyamoto 562974acdb Fix miner bug in rust client generator.
This commit fixes a bug in a function `gen_enum`, which
is not caught because so far we have no non-required field in enums
defined in json schema.
2022-04-21 16:43:50 +09:30
Christian Decker 9a8bc777e5 msggen: Add pay descriptions and maxfee 2022-04-08 11:30:10 +09:30
Rusty Russell 836c1b805b doc: update c-lightning to Core Lightning almost everywhere.
Mostly comments and docs: some places are actually paths, which
I have avoided changing.  We may migrate them slowly, particularly
when they're user-visible.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-07 06:53:26 +09:30
Christian Decker aae5e3d070 cln-grpc: Final generation of derived files
Didn't want to pollute each commit with the changes in the derived
files so here are all the changes in one commit :-)
2022-04-02 09:46:01 +10:30
Christian Decker 33960be040 cln-rpc: Test that we forward errors correctly
So far we were papering over the actual error with a generic string
that isn't very useful. Now we decode the error and forward it through
the grpc layer as well (though still as a string).
2022-04-02 09:46:01 +10:30
Christian Decker d0f6e8c8a6 cln-rpc: Add Sha256 and Secret types 2022-04-02 09:46:01 +10:30
Christian Decker ecda4f717f cln-rpc: Move tests into separate file
These json structs are gigantic, so let's externalize them a bit.
2022-04-02 09:46:01 +10:30
Christian Decker 1613c44b0a cln-rpc: Make Pubkey and ShortChannelId proper types 2022-04-02 09:46:01 +10:30
Christian Decker ef145c7900 msggen: Add RoutehintList as a primitive 2022-04-02 09:46:01 +10:30
Christian Decker ec5cd92580 msggen: Add model-side overrides
Sometimes we just want to paper over the schema directly. Mostly
useful to sidestep the `oneof` things that are required for
expressiveness.
2022-04-02 09:46:01 +10:30
Christian Decker bba68e2136 cln-grpc: Map AmountOrAll and AmountOrAny 2022-04-02 09:46:01 +10:30
Christian Decker 04e7e285d7 cln-rpc: Map PSBT and TX methods 2022-04-02 09:46:01 +10:30
Christian Decker 0354a7fdb1 cln-rpc: Add `OutputDesc` for `{addr: amt}` style arguments
This is likely inherited from bitcoind, and a bit awkward for us, so
we parse it into a classic struct, but serialize it back into the
bitcoind format when talking to the RPC.
2022-04-02 09:46:01 +10:30
Christian Decker eb2aa8c51c cln-rpc: Map feerates and backfill methods using it 2022-04-02 09:46:01 +10:30
Christian Decker 20704746bc grpc: Map `sendonion` and `createonion` 2022-04-02 09:46:01 +10:30
Christian Decker a7f3c54600 cln-rpc: Add invoice RPC methods 2022-04-02 09:46:01 +10:30
Christian Decker d90aafeed6 cln-grpc: Add the `connect` method 2022-04-02 09:46:01 +10:30
Christian Decker 6098386182 cln-grpc: Add the `connect` method 2022-03-30 12:15:55 +10:30
Vincenzo Palazzo 7e6893af9e rust: fixed compiler warning in the example
Changelog-None: rust: fixed compiler warning in the example

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-03-29 10:07:25 +10:30
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